基于Atlas的APP更新服务器设计

表结构设计

  • apps: APP
  • app_versions: 版本
  • app_version_patchs: Update Patch
  • app_version_dexpatchs: Dex Patch
  • app_bundles: 远程Bundle

alter table `app_versions` add constraint `version_app_id_fk` foreign key(`app_id`) references `apps`(`id`)
alter table `app_versions` add constraint `version_tag_id_fk` foreign key(`tag_id`) references `app_tags`(`id`)

alter table `app_version_patchs` add constraint `patch_app_id_fk` foreign key(`app_id`) references `apps`(`id`)
alter table `app_version_patchs` add constraint `curr_version_id_fk` foreign key(`curr_version_id`) references `app_versions`(`id`)
alter table `app_version_patchs` add constraint `last_version_id_fk` foreign key(`last_version_id`) references `app_versions`(`id`)

alter table `app_version_dexpatchs` add constraint `dexpatch_app_id_fk` foreign key(`app_id`) references `apps`(`id`)
alter table `app_version_dexpatchs` add constraint `base_version_id_fk` foreign key(`base_version_id`) references `app_versions`(`id`)

alter table `app_bundles` add constraint `bundle_app_id_fk` foreign key(`app_id`) references `apps`(`id`)
alter table `app_bundles` add constraint `min_version_id_fk` foreign key(`min_version_id`) references `app_versions`(`id`)
alter table `app_bundles` add constraint `max_version_id_fk` foreign key(`max_version_id`) references `app_versions`(`id`)

请求在线更新包

URL:http://update.yezhou.cc/api/app_update
Method:POST
Request:{"application_id":"cn.appblog.example","version_code":1,"version_name":"1.0.0"}
Response:
{
    "code": 0,
    "msg": "Found a new patch to update",
    "data": {
        "id": 1,
        "file_name": "1.0.1@1.0.0.tpatch",
        "file_url": "http://update.yezhou.cc/upload/files/AppExample/1.0.1/1.0.1@1.0.0.zip",
        "update_info_name": "update-1.0.0.json",
        "update_info_url": "http://update.yezhou.cc/upload/files/AppExample/1.0.1/update-1.0.0.json",
        "update_desc": "更新支付",
        "update_time": "2018-09-19 10:00:00",
        "is_quiet": 1,
        "is_force": 1,
        "size": 2019,
        "md5": "52875c03b704eb7b81013a588a2fd8bd",
        "sha1": "3537b7154160345c747d921539124c1bfcfa9bcf",
        "update_type": "patch",
        "version_code": 1,
        "version_name": "1.0.1"
    }
}

请求DexPatch包

URL:http://update.yezhou.cc/api/app_patch
Method:POST
Request:{"application_id":"cn.appblog.example","version_code":1,"version_name":"1.0.0"}
Response:
{
    "code": 0,
    "msg": "Found a dex patch",
    "data": {
        "id": 1,
        "file_name": "1.0.0@1.0.0.tpatch",
        "file_url": "http://update.yezhou.cc/upload/files/AppExample/1.0.1/1.0.0@1.0.0-1.zip",
        "dexpatch_version": 1,
        "dexpatch_info_name": "dexpatch-1.0.0.json",
        "dexpatch_info_url": "http://update.yezhou.cc/upload/files/AppExample/1.0.1/dexpatch-1.0.0-1.json",
        "dexpatch_desc": "修正空指针异常",
        "dexpatch_time": "2018-09-20 10:00:00",
        "is_restart_app": 0,
        "size": 2019,
        "md5": "52875c03b704eb7b81013a588a2fd8bd",
        "sha1": "3537b7154160345c747d921539124c1bfcfa9bcf",
        "update_type": "dex_patch",
        "version_code": 1,
        "version_name": "1.0.1"
    }
}

请求远程插件包

URL:http://update.yezhou.cc/api/app_bundle
Method:POST
Request:{"application_id":"cn.appblog.example","version_code":1,"version_name":"1.0.1","bundle_name":"qrcode","bundle_group":"me.yezhou.lib.qrcode"}
Response:
{
    "code": 0,
    "msg": "Found a latest matched bundle",
    "data": {
        "bundle_name": "qrcode",
        "bundle_group": "me.yezhou.lib.qrcode",
        "bundle_version": "1.0.0",
        "bundle_desc": "二维码扫描插件",
        "bundle_time": "2018-09-19 12:00:00",
        "file_name": "libme_yezhou_lib_qrcode.so",
        "file_url": "http://update.yezhou.cc/files/AppExample/qrcode/libme_yezhou_lib_qrcode-1.0.0.zip",
        "size": 340153,
        "md5": "a17d6ca9717531b8d9c8c4584c461239",
        "sha1": "63a65d402de76ca7ec01c4b23c616e58fb4ca607"
    }
}

版权声明:
作者:Joe.Ye
链接:https://www.appblog.cn/index.php/2023/03/18/design-of-app-update-server-based-on-atlas/
来源:APP全栈技术分享
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
打赏
海报
基于Atlas的APP更新服务器设计
表结构设计 apps: APP app_versions: 版本 app_version_patchs: Update Patch app_version_dexpatchs: Dex Patch app_bundles: 远程Bundle alter table `ap……
<<上一篇
下一篇>>
文章目录
关闭
目 录