错误消息机制问题重新处理
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.distribution;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
@@ -12,7 +13,6 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -48,7 +48,7 @@ public class DistributionManagerController {
|
||||
if (distributionService.retreat(id)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
} else {
|
||||
return ResultUtil.error(ResultCode.DISTRIBUTION_RETREAT_ERROR);
|
||||
throw new ServiceException(ResultCode.DISTRIBUTION_RETREAT_ERROR);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -62,7 +62,7 @@ public class DistributionManagerController {
|
||||
if (distributionService.resume(id)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
} else {
|
||||
return ResultUtil.error(ResultCode.DISTRIBUTION_RETREAT_ERROR);
|
||||
throw new ServiceException(ResultCode.DISTRIBUTION_RETREAT_ERROR);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -77,7 +77,7 @@ public class DistributionManagerController {
|
||||
if (distributionService.audit(id, status)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
} else {
|
||||
return ResultUtil.error(ResultCode.DISTRIBUTION_AUDIT_ERROR);
|
||||
throw new ServiceException(ResultCode.DISTRIBUTION_AUDIT_ERROR);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package cn.lili.controller.goods;
|
||||
|
||||
|
||||
import cn.lili.common.enums.MessageCode;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.goods.entity.dos.Brand;
|
||||
@@ -15,7 +15,6 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -67,7 +66,7 @@ public class BrandManagerController {
|
||||
if (brandService.addBrand(brand)) {
|
||||
return ResultUtil.data(brand);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.BRAND_SAVE_ERROR);
|
||||
throw new ServiceException(ResultCode.BRAND_SAVE_ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "更新数据")
|
||||
@@ -78,7 +77,7 @@ public class BrandManagerController {
|
||||
if (brandService.updateBrand(brand)) {
|
||||
return ResultUtil.data(brand);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.BRAND_UPDATE_ERROR);
|
||||
throw new ServiceException(ResultCode.BRAND_UPDATE_ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "后台禁用品牌")
|
||||
@@ -91,7 +90,7 @@ public class BrandManagerController {
|
||||
if (brandService.brandDisable(brandId, disable)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.BRAND_DISABLE_ERROR);
|
||||
throw new ServiceException(ResultCode.BRAND_DISABLE_ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量删除")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.goods;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.utils.StringUtils;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
@@ -12,7 +13,6 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -67,22 +67,22 @@ public class CategoryManagerController {
|
||||
category1.setName(category.getName());
|
||||
List<Category> list = categoryService.findByAllBySortOrder(category1);
|
||||
if (StringUtils.isNotEmpty(list)) {
|
||||
return ResultUtil.error(ResultCode.CATEGORY_NOT_EXIST);
|
||||
throw new ServiceException(ResultCode.CATEGORY_NOT_EXIST);
|
||||
}
|
||||
// 非顶级分类
|
||||
if (category.getParentId() != null && !category.getParentId().equals("0")) {
|
||||
Category parent = categoryService.getById(category.getParentId());
|
||||
if (parent == null) {
|
||||
return ResultUtil.error(ResultCode.CATEGORY_PARENT_NOT_EXIST);
|
||||
throw new ServiceException(ResultCode.CATEGORY_PARENT_NOT_EXIST);
|
||||
}
|
||||
if (category.getLevel() >= 4) {
|
||||
return ResultUtil.error(ResultCode.CATEGORY_BEYOND_THREE);
|
||||
throw new ServiceException(ResultCode.CATEGORY_BEYOND_THREE);
|
||||
}
|
||||
}
|
||||
if (categoryService.saveCategory(category)) {
|
||||
return ResultUtil.data(category);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.CATEGORY_SAVE_ERROR);
|
||||
throw new ServiceException(ResultCode.CATEGORY_SAVE_ERROR);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@@ -90,7 +90,7 @@ public class CategoryManagerController {
|
||||
public ResultMessage<Category> updateCategory(CategoryVO category) {
|
||||
Category catTemp = categoryService.getById(category.getId());
|
||||
if (catTemp == null) {
|
||||
return ResultUtil.error(ResultCode.CATEGORY_PARENT_NOT_EXIST);
|
||||
throw new ServiceException(ResultCode.CATEGORY_PARENT_NOT_EXIST);
|
||||
}
|
||||
//不能添加重复的分类名称
|
||||
Category category1 = new Category();
|
||||
@@ -98,7 +98,7 @@ public class CategoryManagerController {
|
||||
category1.setId(category.getId());
|
||||
List<Category> list = categoryService.findByAllBySortOrder(category1);
|
||||
if (StringUtils.isNotEmpty(list)) {
|
||||
return ResultUtil.error(ResultCode.CATEGORY_NAME_IS_EXIST);
|
||||
throw new ServiceException(ResultCode.CATEGORY_NAME_IS_EXIST);
|
||||
}
|
||||
|
||||
categoryService.updateCategory(category);
|
||||
@@ -113,13 +113,13 @@ public class CategoryManagerController {
|
||||
category.setParentId(id);
|
||||
List<Category> list = categoryService.findByAllBySortOrder(category);
|
||||
if (list != null && !list.isEmpty()) {
|
||||
return ResultUtil.error(ResultCode.CATEGORY_HAS_CHILDREN);
|
||||
throw new ServiceException(ResultCode.CATEGORY_HAS_CHILDREN);
|
||||
|
||||
}
|
||||
// 查询某商品分类的商品数量
|
||||
Integer count = goodsService.getGoodsCountByCategory(id);
|
||||
if (count > 0) {
|
||||
return ResultUtil.error(ResultCode.CATEGORY_HAS_GOODS);
|
||||
throw new ServiceException(ResultCode.CATEGORY_HAS_GOODS);
|
||||
}
|
||||
categoryService.delete(id);
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
@@ -134,7 +134,7 @@ public class CategoryManagerController {
|
||||
|
||||
Category category = categoryService.getById(id);
|
||||
if (category == null) {
|
||||
return ResultUtil.error(ResultCode.CATEGORY_NOT_EXIST);
|
||||
throw new ServiceException(ResultCode.CATEGORY_NOT_EXIST);
|
||||
}
|
||||
categoryService.updateCategoryStatus(id, enableOperations);
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.goods;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.goods.entity.dos.CategoryParameterGroup;
|
||||
@@ -12,7 +13,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -55,7 +55,7 @@ public class CategoryParameterGroupManagerController {
|
||||
if (categoryParameterGroupService.save(categoryParameterGroup)) {
|
||||
return ResultUtil.data(categoryParameterGroup);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.CATEGORY_PARAMETER_SAVE_ERROR);
|
||||
throw new ServiceException(ResultCode.CATEGORY_PARAMETER_SAVE_ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "更新数据")
|
||||
@@ -65,7 +65,7 @@ public class CategoryParameterGroupManagerController {
|
||||
if (categoryParameterGroupService.updateById(categoryParameterGroup)) {
|
||||
return ResultUtil.data(categoryParameterGroup);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.CATEGORY_PARAMETER_UPDATE_ERROR);
|
||||
throw new ServiceException(ResultCode.CATEGORY_PARAMETER_UPDATE_ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通过id删除参数组")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.goods;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.goods.entity.dos.Goods;
|
||||
@@ -71,7 +72,7 @@ public class GoodsManagerController {
|
||||
if (Boolean.TRUE.equals(goodsService.updateGoodsMarketAble(goodsIds, GoodsStatusEnum.DOWN, reason))) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.GOODS_UNDER_ERROR);
|
||||
throw new ServiceException(ResultCode.GOODS_UNDER_ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "管理员审核商品", notes = "管理员审核商品")
|
||||
@@ -85,7 +86,7 @@ public class GoodsManagerController {
|
||||
if (goodsService.auditGoods(goodsIds, GoodsAuthEnum.valueOf(isAuth))) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.GOODS_AUTH_ERROR);
|
||||
throw new ServiceException(ResultCode.GOODS_AUTH_ERROR);
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +99,7 @@ public class GoodsManagerController {
|
||||
if (goodsService.updateGoodsMarketAble(goodsId, GoodsStatusEnum.UPPER, "")) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.GOODS_UPPER_ERROR);
|
||||
throw new ServiceException(ResultCode.GOODS_UPPER_ERROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.goods;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.goods.entity.dos.Parameters;
|
||||
@@ -34,7 +35,7 @@ public class ParameterManagerController {
|
||||
if (parametersService.save(parameters)) {
|
||||
return ResultUtil.data(parameters);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.PARAMETER_SAVE_ERROR);
|
||||
throw new ServiceException(ResultCode.PARAMETER_SAVE_ERROR);
|
||||
|
||||
}
|
||||
|
||||
@@ -45,7 +46,7 @@ public class ParameterManagerController {
|
||||
if (parametersService.updateById(parameters)) {
|
||||
return ResultUtil.data(parameters);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.PARAMETER_UPDATE_ERROR);
|
||||
throw new ServiceException(ResultCode.PARAMETER_UPDATE_ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通过id删除参数")
|
||||
|
||||
@@ -2,6 +2,7 @@ package cn.lili.controller.goods;
|
||||
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
@@ -14,7 +15,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -68,7 +68,7 @@ public class SpecificationManagerController {
|
||||
if (specificationService.updateSpecification(parameters)) {
|
||||
return ResultUtil.data(parameters);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.SPEC_UPDATE_ERROR);
|
||||
throw new ServiceException(ResultCode.SPEC_UPDATE_ERROR);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@@ -80,7 +80,7 @@ public class SpecificationManagerController {
|
||||
if (specificationService.addSpecification(parameters) != null) {
|
||||
return ResultUtil.data(parameters);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.SPEC_SAVE_ERROR);
|
||||
throw new ServiceException(ResultCode.SPEC_SAVE_ERROR);
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "/{ids}")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.member;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
@@ -10,7 +11,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -42,7 +42,7 @@ public class MemberAddressManagerController {
|
||||
if (memberAddressService.removeMemberAddress(id)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改会员收件地址")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.member;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
@@ -13,7 +14,6 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -57,7 +57,7 @@ public class MemberEvaluationManagerController {
|
||||
if (memberEvaluationService.updateStatus(id, status)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除评论")
|
||||
@@ -67,7 +67,7 @@ public class MemberEvaluationManagerController {
|
||||
if (memberEvaluationService.delete(id)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.member;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
@@ -71,7 +72,7 @@ public class MemberManagerController {
|
||||
if (memberService.updateMemberStatus(memberIds, disabled)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.member;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.PageUtil;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
@@ -10,7 +11,6 @@ import cn.lili.modules.member.service.MemberNoticeLogService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -56,7 +56,7 @@ public class MemberNoticeLogManagerController {
|
||||
if (memberNoticeLogService.saveOrUpdate(memberNoticeLog)) {
|
||||
return ResultUtil.data(memberNoticeLog);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量删除")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.member;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.PageUtil;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
@@ -11,7 +12,6 @@ import cn.lili.modules.member.service.MemberNoticeSenterService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -61,7 +61,7 @@ public class MemberNoticeSenterManagerController {
|
||||
if (memberNoticeSenterService.customSave(memberNoticeSenter)) {
|
||||
return ResultUtil.data(memberNoticeSenter);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量删除")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.other;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.page.entity.dos.ArticleCategory;
|
||||
@@ -75,6 +76,6 @@ public class ArticleCategoryManagerController {
|
||||
if (articleCategoryService.deleteById(id)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.other;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.page.entity.dos.Article;
|
||||
@@ -79,7 +80,7 @@ public class ArticleManagerController {
|
||||
if(articleService.updateArticleStatus(id,status)){
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.other;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
@@ -40,7 +41,7 @@ public class CustomWordsManagerController {
|
||||
if (customWordsService.addCustomWords(customWords)) {
|
||||
return ResultUtil.data(customWords);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改自定义分词")
|
||||
@@ -49,7 +50,7 @@ public class CustomWordsManagerController {
|
||||
if (customWordsService.updateCustomWords(customWords)) {
|
||||
return ResultUtil.data(customWords);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除自定义分词")
|
||||
@@ -59,7 +60,7 @@ public class CustomWordsManagerController {
|
||||
if (customWordsService.deleteCustomWords(id)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分页获取自定义分词")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.other;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.PageUtil;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
@@ -52,7 +53,7 @@ public class SensitiveWordsManagerController {
|
||||
SensitiveWordsFilter.put(sensitiveWords.getSensitiveWord());
|
||||
return ResultUtil.data(sensitiveWords);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改敏感词")
|
||||
@@ -64,7 +65,7 @@ public class SensitiveWordsManagerController {
|
||||
SensitiveWordsFilter.put(sensitiveWords.getSensitiveWord());
|
||||
return ResultUtil.data(sensitiveWords);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量删除")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package cn.lili.controller.other;
|
||||
|
||||
import cn.lili.common.enums.MessageCode;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.PageUtil;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
@@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -47,7 +46,7 @@ public class SpecialManagerController {
|
||||
if (specialService.updateById(special)) {
|
||||
return ResultUtil.data(special);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除专题活动")
|
||||
@@ -57,8 +56,7 @@ public class SpecialManagerController {
|
||||
if(specialService.removeSpecial(id)){
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分页获取专题活动")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.other;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.PageUtil;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
@@ -58,7 +59,7 @@ public class VerificationSourceController {
|
||||
verificationSourceService.initCache();
|
||||
return ResultUtil.data(verificationSource);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
@@ -69,7 +70,7 @@ public class VerificationSourceController {
|
||||
verificationSourceService.initCache();
|
||||
return ResultUtil.data(verificationSource);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "/{ids}")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.passport;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.security.AuthUser;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.token.Token;
|
||||
@@ -74,7 +75,7 @@ public class AdminUserManagerController {
|
||||
adminUser.setPassword(null);
|
||||
return ResultUtil.data(adminUser);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.USER_NOT_LOGIN);
|
||||
throw new ServiceException(ResultCode.USER_NOT_LOGIN);
|
||||
}
|
||||
|
||||
@PutMapping(value = "/edit")
|
||||
@@ -88,11 +89,11 @@ public class AdminUserManagerController {
|
||||
adminUserDB.setAvatar(adminUser.getAvatar());
|
||||
adminUserDB.setNickName(adminUser.getNickName());
|
||||
if (!adminUserService.updateById(adminUserDB)) {
|
||||
return ResultUtil.error(ResultCode.USER_EDIT_ERROR);
|
||||
throw new ServiceException(ResultCode.USER_EDIT_ERROR);
|
||||
}
|
||||
return ResultUtil.success(ResultCode.USER_EDIT_SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.USER_NOT_LOGIN);
|
||||
throw new ServiceException(ResultCode.USER_NOT_LOGIN);
|
||||
}
|
||||
|
||||
@PutMapping(value = "/admin/edit")
|
||||
@@ -100,7 +101,7 @@ public class AdminUserManagerController {
|
||||
public ResultMessage<Object> edit(AdminUser adminUser,
|
||||
@RequestParam(required = false) List<String> roles) {
|
||||
if (!adminUserService.updateAdminUser(adminUser, roles)) {
|
||||
return ResultUtil.error(ResultCode.USER_EDIT_ERROR);
|
||||
throw new ServiceException(ResultCode.USER_EDIT_ERROR);
|
||||
}
|
||||
return ResultUtil.success(ResultCode.USER_EDIT_SUCCESS);
|
||||
}
|
||||
@@ -143,7 +144,7 @@ public class AdminUserManagerController {
|
||||
@RequestParam(required = false) List<String> roles) {
|
||||
try {
|
||||
if (roles != null && roles.size() >= 10) {
|
||||
return ResultUtil.error(ResultCode.PERMISSION_BEYOND_TEN);
|
||||
throw new ServiceException(ResultCode.PERMISSION_BEYOND_TEN);
|
||||
}
|
||||
adminUserService.saveAdminUser(adminUser, roles);
|
||||
} catch (Exception e) {
|
||||
@@ -157,7 +158,7 @@ public class AdminUserManagerController {
|
||||
public ResultMessage<Object> disable(@ApiParam("用户唯一id标识") @PathVariable String userId, Boolean status) {
|
||||
AdminUser user = adminUserService.getById(userId);
|
||||
if (user == null) {
|
||||
return ResultUtil.error(ResultCode.USER_NOT_EXIST);
|
||||
throw new ServiceException(ResultCode.USER_NOT_EXIST);
|
||||
}
|
||||
user.setStatus(status);
|
||||
adminUserService.updateById(user);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.permission;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.PageUtil;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
@@ -10,7 +11,6 @@ import cn.lili.modules.permission.entity.vo.DepartmentVO;
|
||||
import cn.lili.modules.permission.service.DepartmentService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -51,7 +51,7 @@ public class DepartmentManagerController {
|
||||
if (departmentService.save(department)) {
|
||||
return ResultUtil.data(department);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
@@ -60,7 +60,7 @@ public class DepartmentManagerController {
|
||||
if (departmentService.updateById(department)) {
|
||||
return ResultUtil.data(department);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "/{ids}")
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package cn.lili.controller.permission;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.permission.entity.dos.DepartmentRole;
|
||||
import cn.lili.modules.permission.service.DepartmentRoleService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -40,7 +40,7 @@ public class DepartmentRoleManagerController {
|
||||
departmentRoleService.updateByDepartmentId(departmentId, departmentRole);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class CouponManagerController {
|
||||
if (couponService.add(couponVO) != null) {
|
||||
return ResultUtil.data(couponVO);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改优惠券")
|
||||
@@ -74,7 +74,7 @@ public class CouponManagerController {
|
||||
if (couponService.updateCoupon(couponVO) != null) {
|
||||
return ResultUtil.data(coupon);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改优惠券状态")
|
||||
@@ -84,7 +84,7 @@ public class CouponManagerController {
|
||||
if (couponService.updateCouponStatus(Arrays.asList(split), PromotionStatusEnum.valueOf(promotionStatus))) {
|
||||
return ResultUtil.success(ResultCode.COUPON_EDIT_STATUS_SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.COUPON_EDIT_STATUS_ERROR);
|
||||
throw new ServiceException(ResultCode.COUPON_EDIT_STATUS_ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量删除")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.promotion;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
@@ -15,7 +16,6 @@ import cn.lili.modules.promotion.service.PromotionGoodsService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -66,7 +66,7 @@ public class PintuanManagerController {
|
||||
if (pintuanService.openPintuan(pintuanId, new Date(startTime), new Date(endTime))) {
|
||||
return ResultUtil.success(ResultCode.PINTUAN_MANUAL_OPEN_SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.PINTUAN_MANUAL_OPEN_ERROR);
|
||||
throw new ServiceException(ResultCode.PINTUAN_MANUAL_OPEN_ERROR);
|
||||
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class PintuanManagerController {
|
||||
if (pintuanService.closePintuan(pintuanId)) {
|
||||
return ResultUtil.success(ResultCode.PINTUAN_MANUAL_CLOSE_SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.PINTUAN_MANUAL_CLOSE_ERROR);
|
||||
throw new ServiceException(ResultCode.PINTUAN_MANUAL_CLOSE_ERROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.promotion;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
@@ -32,7 +33,7 @@ public class PointsGoodsCategoryManagerController {
|
||||
if (pointsGoodsCategoryService.addCategory(pointsGoodsCategory)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@@ -41,7 +42,7 @@ public class PointsGoodsCategoryManagerController {
|
||||
if (pointsGoodsCategoryService.updateCategory(pointsGoodsCategory)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
@@ -50,7 +51,7 @@ public class PointsGoodsCategoryManagerController {
|
||||
if (pointsGoodsCategoryService.deleteCategory(id)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.promotion;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.security.AuthUser;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
@@ -12,7 +13,6 @@ import cn.lili.modules.promotion.service.PointsGoodsService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -46,7 +46,7 @@ public class PointsGoodsManagerController {
|
||||
if (pointsGoodsService.addPointsGoods(collect)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@PutMapping(consumes = "application/json", produces = "application/json")
|
||||
@@ -58,7 +58,7 @@ public class PointsGoodsManagerController {
|
||||
if (pointsGoodsService.updatePointsGoods(pointsGoods)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@PutMapping("/{ids}")
|
||||
@@ -67,7 +67,7 @@ public class PointsGoodsManagerController {
|
||||
if (pointsGoodsService.updatePointsGoodsPromotionStatus(Arrays.asList(ids.split(",")), promotionStatus)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{ids}")
|
||||
@@ -76,7 +76,7 @@ public class PointsGoodsManagerController {
|
||||
if (pointsGoodsService.deletePointsGoods(Arrays.asList(ids.split(",")))) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.promotion;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.security.AuthUser;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
@@ -44,7 +45,7 @@ public class SeckillManagerController {
|
||||
if (seckillService.saveSeckill(seckillVO)) {
|
||||
return ResultUtil.data(seckillVO);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@@ -56,7 +57,7 @@ public class SeckillManagerController {
|
||||
if (seckillService.modifySeckill(seckillVO)) {
|
||||
return ResultUtil.data(seckillVO);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/{id}")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.purchase;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.purchase.entity.dos.PurchaseOrder;
|
||||
@@ -64,7 +65,7 @@ public class PurchaseManagerController {
|
||||
if (purchaseOrderService.close(id)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "报价列表")
|
||||
|
||||
@@ -2,6 +2,7 @@ package cn.lili.controller.setting;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.enums.SwitchEnum;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.BeanUtil;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
@@ -15,7 +16,6 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.EnumUtils;
|
||||
import org.elasticsearch.ResourceNotFoundException;
|
||||
@@ -99,7 +99,7 @@ public class NoticeMessageManagerController {
|
||||
if (result) {
|
||||
return ResultUtil.data(noticeMessage);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
throw new ResourceNotFoundException(ResultCode.NOTICE_NOT_EXIST.message());
|
||||
}
|
||||
@@ -125,7 +125,7 @@ public class NoticeMessageManagerController {
|
||||
return ResultUtil.data(messageTemplate);
|
||||
}
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
throw new ResourceNotFoundException(ResultCode.NOTICE_NOT_EXIST.message());
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.setting;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.base.service.RegionService;
|
||||
@@ -8,7 +9,6 @@ import cn.lili.modules.system.entity.dos.Region;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -59,7 +59,7 @@ public class RegionManagerController {
|
||||
if (regionService.updateById(region)) {
|
||||
return ResultUtil.data(region);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ public class RegionManagerController {
|
||||
if (regionService.save(region)) {
|
||||
return ResultUtil.data(region);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "{ids}")
|
||||
|
||||
@@ -1,6 +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.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
@@ -54,7 +55,7 @@ public class ServiceNoticeManagerController {
|
||||
if (serviceNoticeService.saveOrUpdate(serviceNotice)) {
|
||||
return ResultUtil.data(serviceNotice);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "更新服务订阅消息")
|
||||
@@ -63,7 +64,7 @@ public class ServiceNoticeManagerController {
|
||||
if (serviceNoticeService.saveOrUpdate(serviceNotice)) {
|
||||
return ResultUtil.data(serviceNotice);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除服务订阅消息")
|
||||
|
||||
@@ -2,6 +2,7 @@ package cn.lili.controller.setting;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.base.aspect.DemoSite;
|
||||
@@ -98,7 +99,7 @@ public class SettingManagerController {
|
||||
return createSetting(key);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +188,7 @@ public class SettingManagerController {
|
||||
ResultUtil.data(new WechatPaymentSetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), WechatPaymentSetting.class));
|
||||
default:
|
||||
return ResultUtil.error(ResultCode.SETTING_NOT_TO_SET);
|
||||
throw new ServiceException(ResultCode.SETTING_NOT_TO_SET);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +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.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
@@ -59,7 +60,7 @@ public class WechatMPMessageManagerController {
|
||||
if (wechatMPMessageService.save(wechatMPMessage)) {
|
||||
return new ResultUtil<WechatMPMessage>().setData(wechatMPMessage);
|
||||
}
|
||||
return new ResultUtil<WechatMPMessage>().setErrorMsg(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
@@ -68,7 +69,7 @@ public class WechatMPMessageManagerController {
|
||||
if (wechatMPMessageService.updateById(wechatMPMessage)) {
|
||||
return new ResultUtil<WechatMPMessage>().setData(wechatMPMessage);
|
||||
}
|
||||
return new ResultUtil<WechatMPMessage>().setErrorMsg(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "/{ids}")
|
||||
|
||||
@@ -1,6 +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.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
@@ -10,7 +11,6 @@ import cn.lili.modules.message.service.WechatMessageService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -60,7 +60,7 @@ public class WechatMessageManageController {
|
||||
if (wechatMessageService.save(wechatMessage)) {
|
||||
return ResultUtil.data(wechatMessage);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
@@ -69,7 +69,7 @@ public class WechatMessageManageController {
|
||||
if (wechatMessageService.updateById(wechatMessage)) {
|
||||
return ResultUtil.data(wechatMessage);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "/{ids}")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.store;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
@@ -14,7 +15,6 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -63,7 +63,7 @@ public class BillManagerController {
|
||||
if (billService.complete(id)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.store;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
@@ -98,7 +99,7 @@ public class StoreManagerController {
|
||||
if (storeService.disable(id)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "开启店铺")
|
||||
@@ -108,7 +109,7 @@ public class StoreManagerController {
|
||||
if (storeService.enable(id)) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询一级分类列表")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.lili.controller.trade;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.security.AuthUser;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.utils.ResultUtil;
|
||||
@@ -20,7 +21,6 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -66,7 +66,7 @@ public class OrderComplaintManagerController {
|
||||
if (orderComplaintService.updateOrderComplain(orderComplainVO)) {
|
||||
return ResultUtil.data(orderComplainVO);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "添加交易投诉对话")
|
||||
@@ -81,7 +81,7 @@ public class OrderComplaintManagerController {
|
||||
if (orderComplaintCommunicationService.addCommunication(communicationVO)) {
|
||||
return ResultUtil.data(communicationVO);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改状态")
|
||||
@@ -90,7 +90,7 @@ public class OrderComplaintManagerController {
|
||||
if (orderComplaintService.updateOrderComplainByStatus(orderComplainVO) != null) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
|
||||
@@ -111,6 +111,6 @@ public class OrderComplaintManagerController {
|
||||
if (orderComplaintService.updateOrderComplainByStatus(orderComplaintOperationParams) != null) {
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
return ResultUtil.error(ResultCode.ERROR);
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user