Lemix dev server ExpressAPI Docs - lemix-project/lemix-dev-server GitHub Wiki

Express API Docs

Namespace

0x01.创建命名空间

  • 请求方式:POST
  • 接口地址:/lemix/nameSpace
  • 接口说明:通过本接口可以创建一个命名空间
  • 请求参数:
{
  "ns_name":"name_space", // 命名空间名称(必填且不为空)
  "ns_description":"name_space description" // 命名空间描述
}
  • 响应结果:
{
  "message":"创建成功"
}

0x02.查询命名空间列表

  • 请求方式:GET
  • 接口地址:/lemix/nameSpace
  • 接口说明:通过本接口可以查询所有命名空间信息
  • 请求参数:
{
  "current":1, // 当前页(可不传,默认为1)
  "size":10 // 每页显示数(可不传,默认为10)
}
  • 响应结果:
{
  "nameSpaceList":[
     {
       "ns_identifier":"ns_identifier", // 命名空间id
       "ns_name":"ns_name", // 命名空间名称
       "ns_description":"ns_description" // 命名空间描述
     }
     ...
  ],
  "common":{
    "size":10, // 每页显示数
    "current":1, // 当前页
    "count":2, // 总页数
    "total":20 // 数据总数
  }
}

0x03.查询命名空间明细

  • 请求方式:GET
  • 接口地址:/lemix/nameSpace/{ns_identifier}
  • 接口说明:通过本接口可以查询单条命名空间明细
  • 请求参数:ns_identifier直接拼接在url后面
  • 响应结果:
{
  "ns_identifier":"ns_identifier", // 命名空间id
  "ns_name":"ns_name", // 命名空间名称
  "ns_description":"ns_description" // 命名空间描述
}

0x04.修改命名空间

  • 请求方式:PUT
  • 接口地址:/lemix/nameSpace
  • 接口说明:通过本接口可以修改命名空间信息
  • 请求参数:
{
  "ns_identifier":"ns_identifier", // 命名空间id(必填)
  "ns_name":"ns_name", // 命名空间名称(必填且不为空)
  "ns_description":"ns_description" // 命名空间描述 
}
  • 响应结果:
{
  "message":"修改成功"
}

0x05.删除命名空间

  • 请求方式:DELETE
  • 接口地址:/lemix/nameSpace
  • 接口说明:通过本接口可以删除命名空间信息(支持删除多条)
  • 请求参数:
[
  {
    "ns_identifier":"ns_identifier" // 命名空间id
  }
  ...
]
  • 响应结果:
{
  "message":"删除成功"
}

Mix Module(App)

0x01.上传Mix Module图标

  • 请求方式:POST
  • 接口地址:/lemix/module/icon
  • 接口说明:通过本接口可以上传Mix Module图标(如不传,则应用系统默认图标)
  • 请求参数:图标文件(file类型)
  • 响应结果:
{
  "mm_identifier":"mm_identifier" // 上传成功返回临时mm_identifer作为创建Mix Module时的id,则实现module与图标关联
}

0x02.创建Mix Module

  • 请求方式:POST
  • 接口地址:/lemix/module
  • 接口说明:通过本接口可以在一个命名空间下创建一个Mix Module
  • 请求参数:
{
  "ns_identifier":"ns_identifier", // 指定的命名空间id(必填)
  "mm_identifier":"", // Mix Module id,取上传图标接口返回值时表示绑定对应图标,为空表示绑定系统默认图标
  "mm_name":"mm_name", // Mix Module名称(必填且不为空)
  "bundle_identifier":"bundle_identifier", // 插件id(必填切不为空)
  "mm_description":"mm_description" // Mix Module描述
}
  • 响应结果:
{
  "message":"创建成功"
}

0x03.查询指定命名空间下Mix Module列表

  • 请求方式:GET
  • 接口地址:/lemix/module
  • 接口说明:通过本接口可以查询指定命名空间下的所有Mix Module
  • 请求参数:
{
  "ns_identifier":"ns_identifier", // 指定的命名空间id
  "current":1, // 当前页(可不传,默认为1)
  "size":10 // 每页显示数(可不传,默认为10)
}
  • 响应结果:
{
  "moduleList":[
    {
      "ns_identifier":"", // 所属命名空间id
      "ns_name":"" // 所属命名空间名称
      "mm_identifier":"" // Mix Module id
      "mm_name":"" // Mix Module名称
      "bundle_identifier":"" // 插件id
      "mm_description":"" // Mix Module描述
      "create_time":"" // 创建时间
      "icon_path":"" // 图标路径
    }
  ],
  "common":{
    "size":10, // 每页显示数
    "current":1, // 当前页
    "count":2, // 总页数
    "total":20 // 数据总数
  }
}

0x04.查询Mix Module明细

  • 请求方式:GET
  • 接口地址:/lemix/module/{mm_identifier}
  • 接口说明:通过本接口可以查询指定Mix Module明细
  • 请求参数:mm_identifier直接拼接在url后面
  • 响应结果:
{
  "ns_identifier":"", // 所属命名空间id
  "ns_name":"" // 所属命名空间名称
  "mm_identifier":"" // Mix Module id
  "mm_name":"" // Mix Module名称
  "bundle_identifier":"" // 插件id
  "mm_description":"" // Mix Module描述
  "create_time":"" // 创建时间
  "icon_path":"" // 图标路径 
}

0x05.修改Mix Module信息

  • 请求方式:PUT
  • 接口地址:/lemix/module
  • 接口说明:通过本接口可以修改指定的Mix Module信息
  • 请求参数:
{
  "mm_identifier":"mm_identifier", // Mix Module 主键(id)
  "mm_name":"mm_name", // Mix Module 名称
  "mm_description":"mm_description", // Mix Module 描述
  "bundle_identifier":"bundle_identifier" // 插件id
}
  • 响应结果:
{
  "message":"修改成功"
}

0x06.删除Mix Module

  • 请求方式:DELETE
  • 接口地址:/lemix/module
  • 接口说明:通过本接口可以删除Mix Module(支持删除多条)
  • 请求参数:
[
  {
    "mm_identifier":"mm_identifier" // Mix Module id
  }
  ...
]
  • 响应结果:
{
  "message":"删除成功"
}

Module Version

0x01.新增Mix Module版本信息

  • 请求方式:POST
  • 接口地址:/lemix/moduleVersion
  • 接口说明:通过本接口可以为Mix Module新增版本信息
  • 请求参数:
{
  "mm_identifier":"mm_identifier", // Mix Module id
  "config":{ // 配置信息
    "author":"author", // 作者
    "entrance":"entrance", // 项目入口
    "description":"description", // 版本描述
    "package_time":"package_time", // 打包时间(时间戳)
    "version":"version" // 版本号
  }
}
  • 响应结果:
{
  "message":"新增成功"
}

0x02.查询指定Mix Module的版本信息列表

  • 请求方式:GET
  • 接口地址:/lemix/moduleVersion
  • 接口说明:通过本接口可以查询指定Mix Module的版本信息列表
  • 请求参数:
{
  "mm_identifier":"mm_identifier", // Mix Module id
  "current":1, // 当前页(可不传,默认为1)
  "size":10 // 每页显示数(可不传,默认为10)
}
  • 响应结果:
{
  "ext_list":[
    {
      "pkid":"", // 版本id
      "identifier":"", // 插件id
      "name":"", // Mix Module名称
      "plugin_path":"", // 插件路径
      "icon_path":"", // 图标路径
      "package_time":"", // 打包时间(时间戳)
      "downloadUrl":"", // zip包下载地址
      "config":{ // 配置信息
        "identifier":"", // 插件id
        "name":"", // Mix Module(app)名称
        "author":"", // 作者
        "entrance":"", // 项目入口
        "description":"", // 版本描述
        "package_time":"", // 打包时间(时间戳)
        "version":"" // 版本号
      }
    }
    ...
  ],
  "common":{
    "size": 10, // 每页显示数
    "current": 1, // 当前页
    "count": 1, // 总页数
    "total": 1 // 数据总数
  }
}

0x03.查询Mix Module版本信息明细

  • 请求方式:GET
  • 接口地址:/lemix/moduleVersion/{pkid}
  • 接口说明:通过本接口可以查询Mix Module指定版本信息的明细
  • 请求参数:版本id直接拼接在url后面
  • 响应结果:
{
  "ext_list":[
    {
      "pkid":"", // 版本id
      "identifier":"", // 插件id
      "name":"", // Mix Module名称
      "plugin_path":"", // 插件路径
      "icon_path":"", // 图标路径
      "package_time":"", // 打包时间(时间戳)
      "downloadUrl":"", // zip包下载地址
      "config":{ // 配置信息
        "identifier":"", // 插件id
        "name":"", // Mix Module(app)名称
        "author":"", // 作者
        "entrance":"", // 项目入口
        "description":"", // 版本描述
        "package_time":"", // 打包时间(时间戳)
        "version":"" // 版本号
      }
    }
  ]
}

0x04.修改Mix Module版本信息

  • 请求方式:PUT
  • 接口地址:/lemix/moduleVersion
  • 接口说明:通过本接口可以修改Mix Module的版本信息
  • 请求参数:
{
  "pkid":"", // 版本id
  "author":"", // 作者
  "entrance":"", // 项目入口
  "description":"", // 版本描述
  "version":"" // 版本号
}

0x05.删除Mix Module版本信息

  • 请求方式:DELETE
  • 接口地址:/lemix/moduleVersion
  • 接口描述:通过本接口可以删除Mix Module版本信息(支持删除多条)
  • 请求参数:
[
  {
    "pkid":"" // 版本id
  }
  ...
]

响应结果:

{
  "message":"删除成功"
}

上传、下载

0x01.版本信息上传

  • 请求方式:PUT
  • 接口地址:/lemix/upload
  • 接口说明:通过本接口可以上传版本数据,包括插件zip,Mix Module图标,配置信息
  • 请求参数:
{
  "config":{
    "identifier":"", // 插件id
    "name":"", // Mix Module名称 
    "author":"", // 作者
    "entrance":"", // 项目入口
    "package_time":"", // 打包时间
    "description":"", // 版本描述
    "version":"" // 版本号
  },
  "icon":"", // file类型或者Buffer类型(不需要更新图标时可以不传)
  "package":"" // file类型或者Buffer类型
}
  • 响应结果:
{
  "pkid":"", // 版本id
  "icon_path":"" // 图标地址
}

0x02.获取图标

  • 请求方式:GET
  • 接口地址:/lemix/base/icon/{mm_identifier}
  • 接口说明:通过本接口可以获取到Mix Module图标
  • 请求参数:Mix Module id直接拼接在url后面
  • 响应结果:指定图标的数据(Buffer类型)

0x03.获取zip

  • 请求方式:GET
  • 接口地址:/lemix/base/package/{pkid}
  • 接口说明:通过本接口可以获取到Mix Module图标
  • 请求参数:版本id直接拼接在url后面
  • 响应结果:指定版本zip的数据(Buffer类型)

0x04.获取临时下载路径

  • 请求方式:GET
  • 接口地址:/lemix/getDownloadUrl
  • 接口说明:通过本接口可以获取下载zip包的路径
  • 请求参数:
{
  "pkid":"" // 版本id
}
  • 响应结果:下载路径(String)