Merge branch 'master' into Bulbasaur

This commit is contained in:
lifenlong
2021-05-20 16:42:06 +08:00
23 changed files with 95 additions and 347 deletions

View File

@@ -1,5 +1,7 @@
package cn.lili.controller.setting;
import cn.lili.common.enums.ResultCode;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.utils.PageUtil;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.utils.StringUtils;
@@ -45,8 +47,11 @@ public class AppVersionManagerController {
@ApiOperation(value = "添加app版本信息", response = AppVersionDO.class)
@PostMapping
public ResultMessage<Boolean> add(@Valid AppVersionDO appVersionDO) {
return ResultUtil.data(this.appVersionService.save(appVersionDO));
public ResultMessage<Object> add(@Valid AppVersionDO appVersionDO) {
if(this.appVersionService.save(appVersionDO)){
return ResultUtil.success();
}
throw new ServiceException(ResultCode.ERROR);
}
@PutMapping(value = "/{id}")
@@ -55,10 +60,10 @@ public class AppVersionManagerController {
@ApiImplicitParam(name = "id", value = "主键", required = true, dataType = "String", paramType = "path")
})
public ResultMessage<Boolean> edit(@Valid AppVersionDO appVersionDO, @PathVariable String id) {
if (appVersionService.getById(id) != null) {
return ResultUtil.data(this.appVersionService.updateById(appVersionDO));
if(this.appVersionService.updateById(appVersionDO)){
return ResultUtil.success();
}
return ResultUtil.data(false);
throw new ServiceException(ResultCode.ERROR);
}
@DeleteMapping(value = "/{id}")
@@ -67,10 +72,10 @@ public class AppVersionManagerController {
@ApiImplicitParam(name = "id", value = "要删除的app版本主键", required = true, dataType = "String", paramType = "path")
})
public ResultMessage<Boolean> delete(@PathVariable String id) {
if (appVersionService.getById(id) != null) {
return ResultUtil.data(this.appVersionService.removeById(id));
if(this.appVersionService.removeById(id)){
return ResultUtil.success();
}
return ResultUtil.data(true);
throw new ServiceException(ResultCode.ERROR);
}
}

View File

@@ -66,4 +66,20 @@ public class AfterSaleManagerController {
return ResultUtil.data(afterSaleService.refund(afterSaleSn, remark));
}
@ApiOperation(value = "审核售后申请")
@ApiImplicitParams({
@ApiImplicitParam(name = "afterSaleSn", value = "售后sn", required = true, paramType = "path"),
@ApiImplicitParam(name = "serviceStatus", value = "PASS审核通过REFUSE审核未通过", required = true, paramType = "query"),
@ApiImplicitParam(name = "remark", value = "备注", paramType = "query"),
@ApiImplicitParam(name = "actualRefundPrice", value = "实际退款金额", paramType = "query")
})
@PutMapping(value = "/review/{afterSaleSn}")
public ResultMessage<AfterSale> review(@NotNull(message = "请选择售后单") @PathVariable String afterSaleSn,
@NotNull(message = "请审核") String serviceStatus,
String remark,
Double actualRefundPrice) {
return ResultUtil.data(afterSaleService.review(afterSaleSn, serviceStatus, remark,actualRefundPrice));
}
}