commit
19b3225312
@ -496,6 +496,9 @@ public enum ResultCode {
|
||||
WECHAT_MP_MESSAGE_TMPL_ERROR(80306, "未能获取到微信模版消息id"),
|
||||
WECHAT_ERROR(80307, "微信接口异常"),
|
||||
APP_VERSION_EXIST(80307, "APP版本已存在"),
|
||||
APP_VERSION_PARAM_ERROR(80308, "添加APP版本参数异常"),
|
||||
// 未选择APP类型
|
||||
APP_VERSION_TYPE_ERROR(80308, "请选择有效的APP类型"),
|
||||
|
||||
/**
|
||||
* IM
|
||||
|
@ -2,6 +2,7 @@ package cn.lili.modules.system.serviceimpl;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.StringUtils;
|
||||
import cn.lili.modules.system.entity.dos.AppVersion;
|
||||
import cn.lili.modules.system.mapper.AppVersionMapper;
|
||||
import cn.lili.modules.system.service.AppVersionService;
|
||||
@ -26,9 +27,16 @@ public class AppVersionServiceImpl extends ServiceImpl<AppVersionMapper, AppVers
|
||||
|
||||
@Override
|
||||
public boolean checkAppVersion(AppVersion appVersion) {
|
||||
//检测版本是否存在
|
||||
if (null == appVersion) {
|
||||
throw new ServiceException(ResultCode.APP_VERSION_PARAM_ERROR);
|
||||
}
|
||||
if (StringUtils.isBlank(appVersion.getType())) {
|
||||
throw new ServiceException(ResultCode.APP_VERSION_TYPE_ERROR);
|
||||
}
|
||||
//检测版本是否存在(同类型APP下版本不允许重复)
|
||||
if (null != this.getOne(new LambdaQueryWrapper<AppVersion>()
|
||||
.eq(AppVersion::getVersion, appVersion.getVersion())
|
||||
.eq(AppVersion::getType, appVersion.getType())
|
||||
.ne(appVersion.getId() != null, AppVersion::getId, appVersion.getId()))) {
|
||||
throw new ServiceException(ResultCode.APP_VERSION_EXIST);
|
||||
}
|
||||
|
@ -63,7 +63,6 @@ public class AppVersionManagerController {
|
||||
@ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "String", paramType = "path")
|
||||
})
|
||||
public ResultMessage<Object> edit(@Valid AppVersion appVersion, @PathVariable String id) {
|
||||
|
||||
if(this.appVersionService.checkAppVersion(appVersion)){
|
||||
if(this.appVersionService.updateById(appVersion)){
|
||||
return ResultUtil.success();
|
||||
|
Loading…
x
Reference in New Issue
Block a user