增加了app 版本更新接口
This commit is contained in:
parent
985cbf84ac
commit
3eb03e3485
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (c) 2025. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||
*/
|
||||
|
||||
package com.suisung.mall.admin.controller.mobile;
|
||||
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.suisung.mall.admin.service.AdminAppMarketUpdateService;
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Api(tags = "安卓应用市场 APP 版本检查")
|
||||
@RestController
|
||||
@RequestMapping("/mobile/admin/app-market-update")
|
||||
public class AdminAppMarketUpdateController {
|
||||
|
||||
@Resource
|
||||
private AdminAppMarketUpdateService adminAppMarketUpdateService;
|
||||
|
||||
@ApiOperation(value = "检查并获取最新的App版本和下载地址", notes = "检查并获取最新的App版本和下载地址")
|
||||
@RequestMapping(value = "/check/version", method = RequestMethod.POST)
|
||||
public CommonResult checkAppVersion(@RequestBody JSONObject paramsJSON) {
|
||||
return adminAppMarketUpdateService.checkLatestVersion(paramsJSON.getInt("marketId"), paramsJSON.getStr("packageName"), paramsJSON.getInt("currVersionKey"));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.suisung.mall.admin.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.suisung.mall.common.modules.admin.AdminAppMarketUpdate;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 安卓应用市场 App 版本热更新表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Xinze
|
||||
* @since 2021-06-08
|
||||
*/
|
||||
|
||||
@Repository
|
||||
public interface AdminAppMarketUpdateMapper extends BaseMapper<AdminAppMarketUpdate> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright (c) 2025. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||
*/
|
||||
|
||||
package com.suisung.mall.admin.service;
|
||||
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
|
||||
public interface AdminAppMarketUpdateService {
|
||||
|
||||
/**
|
||||
* 检验并获取某个市场的最新 APP 版本
|
||||
*
|
||||
* @param marketId
|
||||
* @param packageName
|
||||
* @param currVersionKey 当前 App 内部版本
|
||||
* @return
|
||||
*/
|
||||
CommonResult checkLatestVersion(Integer marketId, String packageName, Integer currVersionKey);
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (c) 2025. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||
*/
|
||||
|
||||
package com.suisung.mall.admin.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.suisung.mall.admin.mapper.AdminAppMarketUpdateMapper;
|
||||
import com.suisung.mall.admin.service.AdminAppMarketUpdateService;
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
import com.suisung.mall.common.modules.admin.AdminAppMarketUpdate;
|
||||
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class AdminAppMarketUpdateServiceImpl extends BaseServiceImpl<AdminAppMarketUpdateMapper, AdminAppMarketUpdate> implements AdminAppMarketUpdateService {
|
||||
/**
|
||||
* 获取某个市场的最新 APP 版本
|
||||
*
|
||||
* @param marketId
|
||||
* @param packageName
|
||||
* @param currVersionKey 当前 App 内部版本
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public CommonResult checkLatestVersion(Integer marketId, String packageName, Integer currVersionKey) {
|
||||
if (ObjectUtil.isEmpty(marketId) || ObjectUtil.isEmpty(packageName)) {
|
||||
return CommonResult.failed("缺少必要参数");
|
||||
}
|
||||
|
||||
QueryWrapper<AdminAppMarketUpdate> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("market_id", marketId).eq("package_name", packageName)
|
||||
.orderByDesc("version_key").last("limit 1");
|
||||
|
||||
AdminAppMarketUpdate adminAppMarketUpdate = getOne(queryWrapper);
|
||||
if (adminAppMarketUpdate == null) {
|
||||
return CommonResult.failed("当前应用已是最新版本");
|
||||
}
|
||||
|
||||
|
||||
if (!ObjectUtil.isEmpty(currVersionKey) && adminAppMarketUpdate.getVersion_key() <= currVersionKey) {
|
||||
return CommonResult.failed("当前应用已是最新版本");
|
||||
}
|
||||
|
||||
return CommonResult.success(adminAppMarketUpdate);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.suisung.mall.admin.mapper.AdminAppMarketUpdateMapper">
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
*
|
||||
</sql>
|
||||
</mapper>
|
||||
@ -0,0 +1,79 @@
|
||||
package com.suisung.mall.common.modules.admin;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 安卓应用市场 App 版本热更新表
|
||||
*
|
||||
* @author Xinze
|
||||
* @since 2021-03-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("admin_app_market_update")
|
||||
@ApiModel(value = "AdminAppMarketUpdate对象", description = "安卓应用市场 App 版本热更新表")
|
||||
public class AdminAppMarketUpdate implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "自增ID")
|
||||
@TableId(value = "id", type = IdType.INPUT)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "各大安卓 APP 市场标识:1-小米;2-华为;3-腾讯应用市场;4-OPPO;5-VIVO;6-三星;用于区分不同的安卓应用市场")
|
||||
private Integer market_id;
|
||||
|
||||
@ApiModelProperty(value = "关联的安卓商城包名的唯一标识,用于确定具体的安卓应用")
|
||||
private String package_name;
|
||||
|
||||
@ApiModelProperty(value = "热更新包内部整数版本号,1-10000000")
|
||||
private Integer version_key;
|
||||
|
||||
@ApiModelProperty(value = "热更新包显示的版本号,用于标识不同的热更新版本,遵循一定命名规则,如 1.23.21")
|
||||
private String version_name;
|
||||
|
||||
@ApiModelProperty(value = "热更新包的下载链接,用户可通过此链接下载更新包完成应用更新")
|
||||
private String download_url;
|
||||
|
||||
@ApiModelProperty(value = "热更新的发布时间,记录更新包正式发布的时刻")
|
||||
private Date release_time;
|
||||
|
||||
@ApiModelProperty(value = "热更新的描述信息,向用户说明更新内容和修复的问题,帮助用户决定是否更新")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(value = "是否为强制更新,1-表示强制更新,2-表示非强制更新,用于控制更新的强制性")
|
||||
private Integer is_force_update;
|
||||
|
||||
@ApiModelProperty(value = "热更新包的大小,以字节为单位,方便用户了解更新所需流量")
|
||||
private Long package_size;
|
||||
|
||||
@ApiModelProperty(value = "热更新包的 MD5 校验值,用于验证下载的更新包是否完整,防止传输篡改")
|
||||
private String md5_checksum;
|
||||
|
||||
@ApiModelProperty(value = "状态,如 1-有效,2-无效;")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "创建用户")
|
||||
private String created_by;
|
||||
|
||||
@ApiModelProperty(value = "最后修改用户")
|
||||
private String updated_by;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date created_at;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updated_at;
|
||||
|
||||
}
|
||||
@ -120,4 +120,6 @@ public class ShopStoreBase implements Serializable {
|
||||
@ApiModelProperty(value = "关联拉卡拉的终端号码")
|
||||
private String lkl_term_no;
|
||||
|
||||
@ApiModelProperty(value = "微信小程序二维码图片路径")
|
||||
private String wx_qrcode;
|
||||
}
|
||||
|
||||
@ -2180,6 +2180,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
ShopStoreBase base = new ShopStoreBase();
|
||||
|
||||
if (user.isPlatform()) {
|
||||
// 平台方
|
||||
Integer store_id = getParameter("store_id", Integer.class);
|
||||
base.setStore_id(store_id);
|
||||
|
||||
@ -2285,7 +2286,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
userInfo.setUser_password(getParameter("user_password"));
|
||||
saveInfo(base, info, userInfo, null);
|
||||
} else if (user.isStore()) {
|
||||
|
||||
// 店铺
|
||||
Integer store_id = Convert.toInt(user.getStore_id());
|
||||
ShopStoreInfo info = new ShopStoreInfo();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user