app自动更新

This commit is contained in:
hayu 2024-08-28 17:25:53 +08:00
parent 207624395a
commit 3c35b9b51c
6 changed files with 122 additions and 0 deletions

View File

@ -1,19 +1,24 @@
package com.bonus.aqgqj.app.controller;
import com.bonus.aqgqj.annotation.DecryptAndVerify;
import com.bonus.aqgqj.annotation.LogAnnotation;
import com.bonus.aqgqj.app.entity.AppVersion;
import com.bonus.aqgqj.app.entity.HomeAppVo;
import com.bonus.aqgqj.app.entity.dto.ParamsAppDto;
import com.bonus.aqgqj.app.service.HomeAppService;
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
import com.bonus.aqgqj.system.vo.EncryptedReq;
import com.bonus.aqgqj.utils.ServerResponse;
import io.swagger.annotations.Api;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
@ -62,4 +67,22 @@ public class HomeAppController {
public Map<String,Object> getCostRank(HomeAppVo vo) {
return service.getCostRank(vo);
}
/**
* 获取app版本信息
*
* @param
* @return AjaxResult对象
*/
@LogAnnotation(operModul = "获取app版本信息", operation = "获取app版本信息", operDesc = "业务级事件",operType="查询")
@PostMapping("getVersion")
public ServerResponse getVersion() {
try {
List<AppVersion> list = service.getVersion();
return ServerResponse.createSuccess(list);
} catch (Exception e) {
log.error(e.toString(),e);
}
return ServerResponse.createErroe("获取失败");
}
}

View File

@ -1,5 +1,6 @@
package com.bonus.aqgqj.app.dao;
import com.bonus.aqgqj.app.entity.AppVersion;
import com.bonus.aqgqj.app.entity.HomeAppVo;
import org.apache.ibatis.annotations.Mapper;
@ -45,4 +46,11 @@ public interface HomeAppDao {
* @return
*/
List<HomeAppVo> getCostRank(HomeAppVo vo);
/**
* 获取app版本信息
* @param
* @return List<AppVersion>
*/
List<AppVersion> getVersion();
}

View File

@ -0,0 +1,60 @@
package com.bonus.aqgqj.app.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @description app版本
* @author hay
* @date 2024/2/21 15:00
*/
@Data
public class AppVersion {
/**
* 版本号
*/
@ApiModelProperty(value = "version")
private int version;
/**
* 版本名称
*/
@ApiModelProperty(value = "versionName")
private String versionName;
/**
* apk名称
*/
@ApiModelProperty(value = "apkName")
private String apkName;
/**
* apk路径
*/
@ApiModelProperty(value = "apkPath")
private String apkPath;
/**
* 更新内容
*/
@ApiModelProperty(value = "updateContent")
private String updateContent;
/**
* 部署时间
*/
@ApiModelProperty(value = "deployTime")
private String deployTime;
/**
* 部署人员
*/
@ApiModelProperty(value = "deployUser")
private String deployUser;
/**
* 备注
*/
@ApiModelProperty(value = "remark")
private String remark;
}

View File

@ -1,7 +1,9 @@
package com.bonus.aqgqj.app.service;
import com.bonus.aqgqj.app.entity.AppVersion;
import com.bonus.aqgqj.app.entity.HomeAppVo;
import java.util.List;
import java.util.Map;
/**
@ -37,4 +39,10 @@ public interface HomeAppService {
* @return
*/
Map<String, Object> getCostRank(HomeAppVo vo);
/**
* 获取app版本信息
* @return
*/
List<AppVersion> getVersion();
}

View File

@ -1,6 +1,7 @@
package com.bonus.aqgqj.app.service.impl;
import com.bonus.aqgqj.app.dao.HomeAppDao;
import com.bonus.aqgqj.app.entity.AppVersion;
import com.bonus.aqgqj.app.entity.HomeAppVo;
import com.bonus.aqgqj.app.service.HomeAppService;
import com.bonus.aqgqj.basis.entity.vo.HomeVo;
@ -151,4 +152,12 @@ public class HomeAppServiceImpl implements HomeAppService {
}
return map;
}
/**
* 获取app版本信息
*/
@Override
public List<AppVersion> getVersion() {
return dao.getVersion();
}
}

View File

@ -88,4 +88,18 @@
cc.totalCost DESC
LIMIT 5
</select>
<select id="getVersion" resultType="com.bonus.aqgqj.app.entity.AppVersion">
SELECT version,
version_name as versionName,
apk_name AS apkName,
apk_path AS apkPath,
update_content AS updateContent,
deploy_time AS deployTime,
deploy_user AS deployUser,
remark
FROM app_version
WHERE is_active = '1'
ORDER BY version + 0 DESC LIMIT 1
</select>
</mapper>