新增版本升级功能
Showing
3 changed files
with
38 additions
and
0 deletions
| ... | @@ -7,6 +7,7 @@ import com.lego.common.core.domain.R; | ... | @@ -7,6 +7,7 @@ import com.lego.common.core.domain.R; |
| 7 | import com.lego.common.core.page.TableDataInfo; | 7 | import com.lego.common.core.page.TableDataInfo; |
| 8 | import com.lego.common.utils.EncryptUtils; | 8 | import com.lego.common.utils.EncryptUtils; |
| 9 | import com.lego.common.utils.MessageUtils; | 9 | import com.lego.common.utils.MessageUtils; |
| 10 | import com.lego.common.utils.StringUtils; | ||
| 10 | import com.lego.core.domain.bo.UpgradeBo; | 11 | import com.lego.core.domain.bo.UpgradeBo; |
| 11 | import com.lego.core.domain.bo.UpgradeQueryBo; | 12 | import com.lego.core.domain.bo.UpgradeQueryBo; |
| 12 | import com.lego.core.domain.vo.ResourceVo; | 13 | import com.lego.core.domain.vo.ResourceVo; |
| ... | @@ -36,6 +37,14 @@ public class UpgradeController extends BaseController { | ... | @@ -36,6 +37,14 @@ public class UpgradeController extends BaseController { |
| 36 | * @param query | 37 | * @param query |
| 37 | * @return | 38 | * @return |
| 38 | */ | 39 | */ |
| 40 | @GetMapping("latest") | ||
| 41 | public UpgradeVo latest(@RequestBody UpgradeQueryBo query, HttpServletRequest request) { | ||
| 42 | String language = request.getHeader("content-language"); | ||
| 43 | if(StringUtils.isBlank(language)) | ||
| 44 | language = "zh_CN"; | ||
| 45 | return service.latest(query,language); | ||
| 46 | } | ||
| 47 | |||
| 39 | @PostMapping("listPage") | 48 | @PostMapping("listPage") |
| 40 | public TableDataInfo<UpgradeVo> list(@RequestBody UpgradeQueryBo query, HttpServletRequest request) { | 49 | public TableDataInfo<UpgradeVo> list(@RequestBody UpgradeQueryBo query, HttpServletRequest request) { |
| 41 | String language = request.getHeader("content-language"); | 50 | String language = request.getHeader("content-language"); | ... | ... |
| ... | @@ -29,6 +29,8 @@ public interface IUpgradeService { | ... | @@ -29,6 +29,8 @@ public interface IUpgradeService { |
| 29 | */ | 29 | */ |
| 30 | TableDataInfo<UpgradeVo> list(UpgradeQueryBo query,String language); | 30 | TableDataInfo<UpgradeVo> list(UpgradeQueryBo query,String language); |
| 31 | 31 | ||
| 32 | UpgradeVo latest(UpgradeQueryBo query,String language); | ||
| 33 | |||
| 32 | /** | 34 | /** |
| 33 | * 新增 | 35 | * 新增 |
| 34 | * | 36 | * | ... | ... |
| ... | @@ -99,6 +99,33 @@ public class UpgradeServiceImpl implements IUpgradeService { | ... | @@ -99,6 +99,33 @@ public class UpgradeServiceImpl implements IUpgradeService { |
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | /** | 101 | /** |
| 102 | * 查询列表 | ||
| 103 | * | ||
| 104 | * @param query | ||
| 105 | * @return | ||
| 106 | */ | ||
| 107 | @Override | ||
| 108 | public UpgradeVo latest(UpgradeQueryBo query, String language) { | ||
| 109 | Page<UpgradeVo> page = baseMapper.selectVoPage(query.build(), | ||
| 110 | Wrappers.<Upgrade>lambdaQuery() | ||
| 111 | .eq(StrUtil.isNotBlank(query.getFileType()), Upgrade::getFileType, query.getFileType()) | ||
| 112 | .eq(StrUtil.isNotBlank(query.getPlatformType()), Upgrade::getPlatformType, query.getPlatformType()) | ||
| 113 | .eq(Upgrade::getLanguage, language)); | ||
| 114 | List<UpgradeVo> list = page.getRecords(); | ||
| 115 | for (UpgradeVo vo : list) { | ||
| 116 | if(vo.getStatus().equals(StatusEnums.PUBLISHED.status)) { | ||
| 117 | vo.setAppSecret(EncryptUtils.decryptByAes(vo.getAppSecret())); | ||
| 118 | if (StrUtil.isNotBlank(vo.getFileOssId())) { | ||
| 119 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getFileOssId())); | ||
| 120 | vo.setOssUrl(oss.getUrl()); | ||
| 121 | } | ||
| 122 | return vo; | ||
| 123 | } | ||
| 124 | } | ||
| 125 | return null; | ||
| 126 | } | ||
| 127 | |||
| 128 | /** | ||
| 102 | * 新增 | 129 | * 新增 |
| 103 | * | 130 | * |
| 104 | * @param upgradeBo | 131 | * @param upgradeBo | ... | ... |
-
Please register or sign in to post a comment