Browse Source

修改返回值

wang 1 month ago
parent
commit
0b400e9bcb
28 changed files with 229 additions and 229 deletions
  1. 14 14
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/AreaController.java
  2. 10 10
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/BrandController.java
  3. 20 20
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/CategoryController.java
  4. 12 12
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/DeliveryController.java
  5. 2 2
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/FeiEYunController.java
  6. 14 14
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/FileController.java
  7. 8 8
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/FreightFeeReductionController.java
  8. 10 10
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/HotSearchController.java
  9. 10 10
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/IndexImgController.java
  10. 9 9
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/KeywordController.java
  11. 10 10
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/NoticeController.java
  12. 6 6
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/OrderController.java
  13. 4 4
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/OrderRefundController.java
  14. 14 14
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ProductController.java
  15. 7 7
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/QnhController.java
  16. 14 14
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ScoreProductController.java
  17. 14 14
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ShopAuditingController.java
  18. 6 6
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ShopDetailController.java
  19. 2 2
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ShopWalletController.java
  20. 6 6
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ShopWithdrawCashController.java
  21. 2 2
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/SkuController.java
  22. 12 12
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/SpecController.java
  23. 14 14
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/StatisticsOrderController.java
  24. 2 2
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/UserAddrController.java
  25. 4 4
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/UserController.java
  26. 3 2
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/hb/GoodsController.java
  27. 0 1
      yami-shop-security/yami-shop-security-comment/src/main/java/com/yami/shop/security/comment/filter/YamiAuthenticationProcessingFilter.java
  28. 0 0
      yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/HBGoodsService.java

+ 14 - 14
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/AreaController.java

@@ -41,9 +41,9 @@ public class AreaController {
      */
     @GetMapping("/page")
     @PreAuthorize("@pms.hasPermission('admin:area:page')")
-    public ResponseEntity<IPage<Area>> page(Area area, PageParam<Area> page) {
+    public R<IPage<Area>> page(Area area, PageParam<Area> page) {
         IPage<Area> sysUserPage = areaService.page(page, new LambdaQueryWrapper<Area>());
-        return ResponseEntity.ok(sysUserPage);
+        return R.SUCCESS(sysUserPage);
     }
 
     /**
@@ -51,22 +51,22 @@ public class AreaController {
      */
     @GetMapping("/list")
     @PreAuthorize("@pms.hasPermission('admin:area:list')")
-    public ResponseEntity<List<Area>> list(Area area) {
+    public R<List<Area>> list(Area area) {
         List<Area> areas = areaService.list(new LambdaQueryWrapper<Area>()
                 .like(area.getAreaName() != null, Area::getAreaName, area.getAreaName())
                 .eq(Objects.nonNull(area.getParentId()), Area::getParentId, area.getAreaId())
                 .lt(!Objects.isNull(area.getMaxGrade()),Area::getLevel,area.getMaxGrade())
         );
-        return ResponseEntity.ok(areas);
+        return R.SUCCESS(areas);
     }
 
     /**
      * 通过父级id获取区域列表
      */
     @GetMapping("/listByPid")
-    public ResponseEntity<List<Area>> listByPid(Long pid) {
+    public R<List<Area>> listByPid(Long pid) {
         List<Area> list = areaService.listByPid(pid);
-        return ResponseEntity.ok(list);
+        return R.SUCCESS(list);
     }
 
     /**
@@ -74,9 +74,9 @@ public class AreaController {
      */
     @GetMapping("/info/{id}")
     @PreAuthorize("@pms.hasPermission('admin:area:info')")
-    public ResponseEntity<Area> info(@PathVariable("id") Long id) {
+    public R<Area> info(@PathVariable("id") Long id) {
         Area area = areaService.getById(id);
-        return ResponseEntity.ok(area);
+        return R.SUCCESS(area);
     }
 
     /**
@@ -84,7 +84,7 @@ public class AreaController {
      */
     @PostMapping
     @PreAuthorize("@pms.hasPermission('admin:area:save')")
-    public ResponseEntity<Void> save(@Valid @RequestBody Area area) {
+    public R<Void> save(@Valid @RequestBody Area area) {
         if(area.getCode() == null){
             Random random = new Random();
             int randomNumber = 10000 + random.nextInt(90000);
@@ -98,7 +98,7 @@ public class AreaController {
         }
         areaService.removeAreaListCache();
         areaService.save(area);
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
     /**
@@ -106,11 +106,11 @@ public class AreaController {
      */
     @PutMapping
     @PreAuthorize("@pms.hasPermission('admin:area:update')")
-    public ResponseEntity<Void> update(@Valid @RequestBody Area area) {
+    public R<Void> update(@Valid @RequestBody Area area) {
         areaService.updateById(area);
         areaService.removeAreaCacheByParentId(area.getParentId());
         areaService.removeAreaListCache();
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
     /**
@@ -118,7 +118,7 @@ public class AreaController {
      */
     @DeleteMapping("/{id}")
     @PreAuthorize("@pms.hasPermission('admin:area:delete')")
-    public ResponseEntity<Void> delete(@PathVariable Long id) {
+    public R<Void> delete(@PathVariable Long id) {
         if (areaService.count(new LambdaQueryWrapper<Area>().eq(Area::getParentId,id)) > 0) {
             throw new YamiShopBindException("请先删除子地区");
         }
@@ -127,7 +127,7 @@ public class AreaController {
         areaService.removeById(id);
         areaService.removeAreaCacheByParentId(area.getParentId());
         areaService.removeAreaListCache();
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
 }

+ 10 - 10
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/BrandController.java

@@ -43,29 +43,29 @@ public class BrandController {
      * 分页获取
      */
     @GetMapping("/page")
-    public ResponseEntity<IPage<Brand>> page(Brand brand,PageParam<Brand> page) {
+    public R<IPage<Brand>> page(Brand brand,PageParam<Brand> page) {
         IPage<Brand> brands = brandService.page(page, new LambdaQueryWrapper<Brand>()
                 .eq(Brand::getShopId,Constant.PLATFORM_SHOP_ID)
                 .eq(Objects.nonNull(brand.getStatus()),Brand::getStatus,brand.getStatus())
                 .like(StrUtil.isNotBlank(brand.getBrandName()), Brand::getBrandName, brand.getBrandName())
                 .orderByAsc(Brand::getFirstChar));
-        return ResponseEntity.ok(brands);
+        return R.SUCCESS(brands);
     }
 
     /**
      * 获取信息
      */
     @GetMapping("/info/{id}")
-    public ResponseEntity<Brand> info(@PathVariable("id") Long id) {
+    public R<Brand> info(@PathVariable("id") Long id) {
         Brand brand = brandService.getById(id);
-        return ResponseEntity.ok(brand);
+        return R.SUCCESS(brand);
     }
 
     /**
      * 保存
      */
     @PostMapping
-    public ResponseEntity<Void> save(@RequestBody @Valid Brand brand) {
+    public R<Void> save(@RequestBody @Valid Brand brand) {
         Brand dbBrand = brandService.getByBrandName(brand.getBrandName(),Constant.PLATFORM_SHOP_ID);
         if (dbBrand != null) {
             throw new YamiShopBindException("该品牌名称已存在");
@@ -75,30 +75,30 @@ public class BrandController {
         brand.setUpdateTime(date);
         brand.setShopId(Constant.PLATFORM_SHOP_ID);
         brandService.save(brand);
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
     /**
      * 修改
      */
     @PutMapping
-    public ResponseEntity<Void> update(@RequestBody @Valid Brand brand) {
+    public R<Void> update(@RequestBody @Valid Brand brand) {
         Brand dbBrand = brandService.getByBrandName(brand.getBrandName(),Constant.PLATFORM_SHOP_ID);
         if (dbBrand != null && !Objects.equals(dbBrand.getBrandId(), brand.getBrandId())) {
             throw new YamiShopBindException("该品牌名称已存在");
         }
         brand.setUpdateTime(new Date());
         brandService.updateById(brand);
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
     /**
      * 删除
      */
     @DeleteMapping("/{id}")
-    public ResponseEntity<Void> delete(@PathVariable Long id) {
+    public R<Void> delete(@PathVariable Long id) {
         brandService.deleteByBrand(id);
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
 }

+ 20 - 20
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/CategoryController.java

@@ -61,9 +61,9 @@ public class CategoryController {
 	 * 获取分类信息
 	 */
 	@GetMapping("/info/{categoryId}")
-	public ResponseEntity<Category> info(@PathVariable("categoryId") Long categoryId){
+	public R<Category> info(@PathVariable("categoryId") Long categoryId){
 		Category category = categoryService.getById(categoryId);
-		return ResponseEntity.ok(category);
+		return R.SUCCESS(category);
 	}
 
 	/**
@@ -72,12 +72,12 @@ public class CategoryController {
 	@SysLog("保存分类")
 	@PostMapping
 	@PreAuthorize("@pms.hasPermission('prod:category:save')")
-	public ResponseEntity<Void> save(@RequestBody Category category){
+	public R<Void> save(@RequestBody Category category){
 		category.setShopId(Constant.PLATFORM_SHOP_ID);
 		category.setRecTime(new Date());
 		category.setGrade(getGradeByParentId(category.getParentId()));
 		categoryService.saveCategroy(category);
-		return ResponseEntity.ok().build();
+		return R.SUCCESS();
 	}
 
 
@@ -87,18 +87,18 @@ public class CategoryController {
 	@SysLog("更新分类")
 	@PutMapping
 	@PreAuthorize("@pms.hasPermission('prod:category:update')")
-	public ResponseEntity<String> update(@RequestBody Category category){
+	public R<String> update(@RequestBody Category category){
 //		category.setShopId(Constant.PLATFORM_SHOP_ID);
 		Category categoryDB = categoryService.getById(category.getCategoryId());
 		if (Objects.equals(categoryDB.getParentId(), Constant.CATEGORY_ID) && !Objects.equals(category.getParentId(), Constant.CATEGORY_ID)){
-			return ResponseEntity.badRequest().body("一级分类不能改为二级分类");
+			return R.fail("一级分类不能改为二级分类");
 		}else if(Objects.equals(category.getParentId(), Constant.CATEGORY_ID) && !Objects.equals(categoryDB.getParentId(), Constant.CATEGORY_ID)){
-			return ResponseEntity.badRequest().body("二级分类不能改为一级分类");
+			return R.fail("二级分类不能改为一级分类");
 		}
 		category.setGrade(getGradeByParentId(category.getParentId()));
 		category.setOldCategoryName(categoryDB.getCategoryName());
 		categoryService.updateCategroy(category);
-		return ResponseEntity.ok().build();
+		return R.SUCCESS();
 	}
 
 	/**
@@ -107,24 +107,24 @@ public class CategoryController {
 	@SysLog("删除分类")
 	@DeleteMapping("/{categoryId}")
 	@PreAuthorize("@pms.hasPermission('prod:category:delete')")
-	public ResponseEntity<String> delete(@PathVariable("categoryId") Long categoryId){
+	public R<String> delete(@PathVariable("categoryId") Long categoryId){
 		if (categoryService.count(new LambdaQueryWrapper<Category>().eq(Category::getParentId,categoryId)) >0) {
-			return ResponseEntity.badRequest().body("请删除子分类,再删除该分类");
+			return R.fail("请删除子分类,再删除该分类");
 		}
 		int categoryProdCount = productService.count(new LambdaQueryWrapper<Product>().eq(Product::getCategoryId, categoryId).ne(Product::getStatus, -1));
 		if (categoryProdCount>0){
-			return ResponseEntity.badRequest().body("该分类下还有商品,请先删除该分类下的商品");
+			return R.fail("该分类下还有商品,请先删除该分类下的商品");
 		}
 		Category category = categoryService.getById(categoryId);
 		categoryService.deleteCategroy(category);
-		return ResponseEntity.ok().build();
+		return R.SUCCESS();
 	}
 
 	/**
 	 * 所有的
 	 */
 	@GetMapping("/listCategory")
-	public ResponseEntity<IPage<Category>> listCategory(@RequestParam Integer maxGrade,
+	public R<IPage<Category>> listCategory(@RequestParam Integer maxGrade,
 													   @RequestParam(value = "shopId", required = false) String shopId,
 													   @RequestParam(value = "categoryName", required = false) String categoryName,
 													   @RequestParam(value = "current", required = false, defaultValue = "1") Integer current,
@@ -148,13 +148,13 @@ public class CategoryController {
 //														.le(Category::getGrade, maxGrade)
 ////														.eq(Category::getShopId, Constant.PLATFORM_SHOP_ID)
 //														.orderByAsc(Category::getSeq)));
-		return ResponseEntity.ok(page);
+		return R.SUCCESS(page);
 	}
 
 	@PostMapping("/listCategoryNew")
 	@ApiOperation("分类查询")
-	public ResponseEntity<IPage<ListCategoryVO>> listCategoryNew(@RequestBody ListCategoryDTO listCategoryDTO){
-		return ResponseEntity.ok(categoryService.listCategory(listCategoryDTO));
+	public R<IPage<ListCategoryVO>> listCategoryNew(@RequestBody ListCategoryDTO listCategoryDTO){
+		return R.SUCCESS(categoryService.listCategory(listCategoryDTO));
 	}
 
 //	/**
@@ -183,9 +183,9 @@ public class CategoryController {
 	 * 平台的分类
 	 */
 	@GetMapping("/platformCategory")
-	public ResponseEntity<List<Category>> platformCategory(@RequestParam Integer maxGrade){
+	public R<List<Category>> platformCategory(@RequestParam Integer maxGrade){
 
-		return ResponseEntity.ok(categoryService.list(new LambdaQueryWrapper<Category>()
+		return R.SUCCESS(categoryService.list(new LambdaQueryWrapper<Category>()
 				.le(Category::getGrade, maxGrade)
 				.eq(Category::getShopId, Constant.PLATFORM_SHOP_ID)
 				.orderByAsc(Category::getSeq)));
@@ -193,10 +193,10 @@ public class CategoryController {
 
 	@ApiOperation("按名称模糊匹配店铺")
 	@GetMapping("/getShopByName")
-	public ResponseEntity<List<ShopDetail>> getShopByName(@RequestParam(value = "shopName", required = false) String shopName) {
+	public R<List<ShopDetail>> getShopByName(@RequestParam(value = "shopName", required = false) String shopName) {
 		List<ShopDetail> list = shopDetailService.list(new LambdaQueryWrapper<ShopDetail>()
 				.like(StringUtils.isNotEmpty(shopName), ShopDetail::getShopName, shopName));
-		return ResponseEntity.ok(list);
+		return R.SUCCESS(list);
 	}
 
 }

+ 12 - 12
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/DeliveryController.java

@@ -43,8 +43,8 @@ public class DeliveryController {
      * @return 分页数据
      */
     @GetMapping("/page" )
-    public ResponseEntity<IPage<Delivery>> getDeliveryPage(PageParam<Delivery> page, Delivery delivery) {
-        return ResponseEntity.ok(deliveryService.page(page, new LambdaQueryWrapper<Delivery>()));
+    public R<IPage<Delivery>> getDeliveryPage(PageParam<Delivery> page, Delivery delivery) {
+        return R.SUCCESS(deliveryService.page(page, new LambdaQueryWrapper<Delivery>()));
     }
 
 
@@ -54,8 +54,8 @@ public class DeliveryController {
      * @return 单个数据
      */
     @GetMapping("/info/{dvyId}" )
-    public ResponseEntity<Delivery> getById(@PathVariable("dvyId") Long dvyId) {
-        return ResponseEntity.ok(deliveryService.getById(dvyId));
+    public R<Delivery> getById(@PathVariable("dvyId") Long dvyId) {
+        return R.SUCCESS(deliveryService.getById(dvyId));
     }
 
     /**
@@ -66,10 +66,10 @@ public class DeliveryController {
     @SysLog("新增物流公司" )
     @PostMapping
     @PreAuthorize("@pms.hasPermission('platform:delivery:save')" )
-    public ResponseEntity<Boolean> save(@RequestBody @Valid Delivery delivery) {
+    public R<Boolean> save(@RequestBody @Valid Delivery delivery) {
         delivery.setRecTime(new Date());
         delivery.setModifyTime(new Date());
-        return ResponseEntity.ok(deliveryService.save(delivery));
+        return R.SUCCESS(deliveryService.save(delivery));
     }
 
     /**
@@ -80,8 +80,8 @@ public class DeliveryController {
     @SysLog("修改物流公司" )
     @PutMapping
     @PreAuthorize("@pms.hasPermission('platform:delivery:update')" )
-    public ResponseEntity<Boolean> updateById(@RequestBody @Valid Delivery delivery) {
-        return ResponseEntity.ok(deliveryService.updateById(delivery));
+    public R<Boolean> updateById(@RequestBody @Valid Delivery delivery) {
+        return R.SUCCESS(deliveryService.updateById(delivery));
     }
 
     /**
@@ -92,17 +92,17 @@ public class DeliveryController {
     @SysLog("删除物流公司" )
     @DeleteMapping("/{dvyId}" )
     @PreAuthorize("@pms.hasPermission('platform:delivery:delete')" )
-    public ResponseEntity<Boolean> removeById(@PathVariable Long dvyId) {
-        return ResponseEntity.ok(deliveryService.removeById(dvyId));
+    public R<Boolean> removeById(@PathVariable Long dvyId) {
+        return R.SUCCESS(deliveryService.removeById(dvyId));
     }
 
     /**
      * 分页获取
      */
     @GetMapping("/list")
-    public ResponseEntity<List<Delivery>> page(){
+    public R<List<Delivery>> page(){
 
         List<Delivery> list = deliveryService.list();
-        return ResponseEntity.ok(list);
+        return R.SUCCESS(list);
     }
 }

+ 2 - 2
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/FeiEYunController.java

@@ -17,7 +17,7 @@ public class FeiEYunController {
 
     @GetMapping("/addprinter")
     @ApiOperation("添加打印机")
-    public ResponseEntity<String> addprinter(@RequestParam @ApiParam("格式(多条逗号分隔):sn#key#remark#carnum") String snlist){
-        return ResponseEntity.ok(FeiEYunApi.addprinter(snlist));
+    public R<String> addprinter(@RequestParam @ApiParam("格式(多条逗号分隔):sn#key#remark#carnum") String snlist){
+        return R.SUCCESS(FeiEYunApi.addprinter(snlist));
     }
 }

+ 14 - 14
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/FileController.java

@@ -47,18 +47,18 @@ public class FileController {
 	private ShopConfig shopConfig;
 
 	@PostMapping("/upload/element")
-	public ResponseEntity<String> uploadElementFile(@RequestParam("file") MultipartFile file) throws IOException{
+	public R<String> uploadElementFile(@RequestParam("file") MultipartFile file) throws IOException{
 		if(file.isEmpty()){
-            return ResponseEntity.noContent().build();
+            return R.fail("文件不能为空");
         }
 		String fileName = attachFileService.uploadFile(file.getBytes(),file.getOriginalFilename());
-        return ResponseEntity.ok(fileName);
+        return R.SUCCESS(fileName);
 	}
 
 	@PostMapping("/upload/img")
-	public ResponseEntity<String> uploadImg(@RequestParam("file") MultipartFile file) throws IOException{
+	public R<String> uploadImg(@RequestParam("file") MultipartFile file) throws IOException{
 		if(file.isEmpty()){
-			return ResponseEntity.noContent().build();
+			return R.fail("文件不能为空");
 		}
 		AttachFile attachFile = new AttachFile();
 		attachFile.setFileType(FileUtil.extName(file.getOriginalFilename()));
@@ -67,20 +67,20 @@ public class FileController {
 		attachFile.setShopId(Constant.PLATFORM_SHOP_ID);
 		attachFile.setUploadTime(new Date());
 		String fileName = attachFileService.uploadImg(file.getBytes(),attachFile);
-		return ResponseEntity.ok(fileName);
+		return R.SUCCESS(fileName);
 	}
 
 	@PostMapping("/upload/tinymceEditor")
-	public ResponseEntity<String> uploadTinymceEditorImages(@RequestParam("editorFile") MultipartFile editorFile) throws IOException{
+	public R<String> uploadTinymceEditorImages(@RequestParam("editorFile") MultipartFile editorFile) throws IOException{
 		String fileName =  attachFileService.uploadFile(editorFile.getBytes(),editorFile.getOriginalFilename());
-        return ResponseEntity.ok(shopConfig.getDomain().getResourcesDomainName() + "/" + fileName);
+        return R.SUCCESS(shopConfig.getDomain().getResourcesDomainName() + "/" + fileName);
 	}
 
 	/**
 	 * 分页获取历史图片
 	 */
 	@GetMapping("/attachFilePage")
-	public ResponseEntity<IPage<AttachFile>> attachFilePage(PageParam<AttachFile> page, AttachFile attachFile) {
+	public R<IPage<AttachFile>> attachFilePage(PageParam<AttachFile> page, AttachFile attachFile) {
 		attachFile.setShopId(Constant.PLATFORM_SHOP_ID);
 		IPage<AttachFile> attachFilePage = attachFileService.getPage(page,attachFile);
 //		IPage<AttachFile> attachFilePage = attachFileService.page(page,new LambdaQueryWrapper<AttachFile>()
@@ -88,16 +88,16 @@ public class FileController {
 //				.eq(AttachFile::getType,1)
 //				.like(StrUtil.isNotBlank(attachFile.getFileName()),AttachFile::getFileName,attachFile.getFileName())
 //				.orderByDesc(AttachFile::getUploadTime));
-		return ResponseEntity.ok(attachFilePage);
+		return R.SUCCESS(attachFilePage);
 	}
 	/**
 	 * 删除图片
 	 */
 	@DeleteMapping("/deleteFile/{fileId}")
-	public ResponseEntity<Void> deleteFile(@PathVariable("fileId") Long fileId){
+	public R<Void> deleteFile(@PathVariable("fileId") Long fileId){
 		AttachFile attachFile = attachFileService.getById(fileId);
 		attachFileService.deleteFile(attachFile.getFilePath());
-		return ResponseEntity.ok().build();
+		return R.SUCCESS();
 	}
 
 
@@ -105,10 +105,10 @@ public class FileController {
 	 * 更改图片名称
 	 */
 	@PutMapping("/updateFileName")
-	public ResponseEntity<Boolean> updateFileName(@RequestBody  AttachFile attachFile) {
+	public R<Boolean> updateFileName(@RequestBody  AttachFile attachFile) {
 		if (Objects.isNull(attachFile.getFileName())){
 			throw new YamiShopBindException("图片名称不能为空");
 		}
-		return ResponseEntity.ok(attachFileService.updateFileName(attachFile));
+		return R.SUCCESS(attachFileService.updateFileName(attachFile));
 	}
 }

+ 8 - 8
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/FreightFeeReductionController.java

@@ -28,35 +28,35 @@ public class FreightFeeReductionController {
 
     @ApiOperation("添加/编辑")
     @PostMapping("/addOrUpdate")
-    public ResponseEntity<Void> addOrUpdate(@RequestBody FreightFeeReductionParam param) {
+    public R<Void> addOrUpdate(@RequestBody FreightFeeReductionParam param) {
         return freightFeeReductionService.addOrUpdate(param);
     }
 
     @ApiOperation("查看")
     @GetMapping("/get/{id}")
-    public ResponseEntity<FreightFeeReduction> get(@PathVariable("id") Integer id) {
+    public R<FreightFeeReduction> get(@PathVariable("id") Integer id) {
         return freightFeeReductionService.get(id);
     }
 
     @ApiOperation("列表")
     @GetMapping("/search")
-    public ResponseEntity<IPage<FreightFeeReduction>> search(PageParam<FreightFeeReduction> page) {
+    public R<IPage<FreightFeeReduction>> search(PageParam<FreightFeeReduction> page) {
         IPage<FreightFeeReduction> result = freightFeeReductionService.page(page, new LambdaQueryWrapper<FreightFeeReduction>()
                 .orderByAsc(FreightFeeReduction::getStatus)
                 .orderByDesc(FreightFeeReduction::getId));
-        return ResponseEntity.ok(result);
+        return R.SUCCESS(result);
     }
 
     @ApiOperation("删除")
     @GetMapping("/remove/{id}")
-    public ResponseEntity<Void> remove(@PathVariable("id") Integer id) {
+    public R<Void> remove(@PathVariable("id") Integer id) {
         freightFeeReductionService.removeById(id);
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
     @ApiOperation("获取减免")
     @GetMapping("/fee")
-    public ResponseEntity<BigDecimal> fee() {
+    public R<BigDecimal> fee() {
         BigDecimal fee = BigDecimal.ZERO;
         List<FreightFeeReduction> feeReductions = freightFeeReductionService.list(new LambdaQueryWrapper<FreightFeeReduction>()
                 .eq(FreightFeeReduction::getStatus, 1)
@@ -65,6 +65,6 @@ public class FreightFeeReductionController {
         if (CollectionUtil.isNotEmpty(feeReductions)) {
             fee = feeReductions.get(0).getMoney();
         }
-        return ResponseEntity.ok(fee);
+        return R.SUCCESS(fee);
     }
 }

+ 10 - 10
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/HotSearchController.java

@@ -43,14 +43,14 @@ public class HotSearchController {
 	 */
     @GetMapping("/page")
 	@PreAuthorize("@pms.hasPermission('platform:hotSearch:page')")
-	public ResponseEntity<IPage<HotSearch>> page(HotSearch hotSearch, PageParam<HotSearch> page){
+	public R<IPage<HotSearch>> page(HotSearch hotSearch, PageParam<HotSearch> page){
 		IPage<HotSearch> hotSearchs = hotSearchService.page(page,new LambdaQueryWrapper<HotSearch>()
 			.eq(HotSearch::getShopId, Constant.PLATFORM_SHOP_ID)
 			.like(StrUtil.isNotBlank(hotSearch.getContent()), HotSearch::getContent,hotSearch.getContent())
 				.like(StrUtil.isNotBlank(hotSearch.getTitle()), HotSearch::getTitle,hotSearch.getTitle())
 			.eq(hotSearch.getStatus()!=null, HotSearch::getStatus,hotSearch.getStatus())
 		);
-		return ResponseEntity.ok(hotSearchs);
+		return R.SUCCESS(hotSearchs);
 	}
 
     /**
@@ -58,9 +58,9 @@ public class HotSearchController {
 	 */
 	@GetMapping("/info/{id}")
 	@PreAuthorize("@pms.hasPermission('platform:hotSearch:info')")
-	public ResponseEntity<HotSearch> info(@PathVariable("id") Long id){
+	public R<HotSearch> info(@PathVariable("id") Long id){
 		HotSearch hotSearch = hotSearchService.getById(id);
-		return ResponseEntity.ok(hotSearch);
+		return R.SUCCESS(hotSearch);
 	}
 
 	/**
@@ -68,13 +68,13 @@ public class HotSearchController {
 	 */
 	@PostMapping
 	@PreAuthorize("@pms.hasPermission('platform:hotSearch:save')")
-	public ResponseEntity<Void> save(@RequestBody @Valid HotSearch hotSearch){
+	public R<Void> save(@RequestBody @Valid HotSearch hotSearch){
 		hotSearch.setRecDate(new Date());
 		hotSearch.setShopId(Constant.PLATFORM_SHOP_ID);
 		hotSearchService.save(hotSearch);
 		//清除缓存
 		hotSearchService.removeHotSearchDtoCacheByshopId(Constant.PLATFORM_SHOP_ID);
-		return ResponseEntity.ok().build();
+		return R.SUCCESS();
 	}
 
 	/**
@@ -82,11 +82,11 @@ public class HotSearchController {
 	 */
 	@PutMapping
 	@PreAuthorize("@pms.hasPermission('platform:hotSearch:update')")
-	public ResponseEntity<Void> update(@RequestBody @Valid HotSearch hotSearch){
+	public R<Void> update(@RequestBody @Valid HotSearch hotSearch){
 		hotSearchService.updateById(hotSearch);
 		//清除缓存
 		hotSearchService.removeHotSearchDtoCacheByshopId(Constant.PLATFORM_SHOP_ID);
-		return ResponseEntity.ok().build();
+		return R.SUCCESS();
 	}
 
 	/**
@@ -94,10 +94,10 @@ public class HotSearchController {
 	 */
 	@DeleteMapping
 	@PreAuthorize("@pms.hasPermission('platform:hotSearch:delete')")
-	public ResponseEntity<Void> delete(@RequestBody List<Long> ids){
+	public R<Void> delete(@RequestBody List<Long> ids){
 		hotSearchService.removeByIds(ids);
 		//清除缓存
 		hotSearchService.removeHotSearchDtoCacheByshopId(Constant.PLATFORM_SHOP_ID);
-		return ResponseEntity.ok().build();
+		return R.SUCCESS();
 	}
 }

+ 10 - 10
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/IndexImgController.java

@@ -51,7 +51,7 @@ public class IndexImgController {
      */
     @GetMapping("/page")
     @PreAuthorize("@pms.hasPermission('platform:indexImg:page')")
-    public ResponseEntity<IPage<IndexImg>> page(IndexImg indexImg, PageParam<IndexImg> page) {
+    public R<IPage<IndexImg>> page(IndexImg indexImg, PageParam<IndexImg> page) {
         IPage<IndexImg> indexImgIPage = indexImgService.page(page,
                 new LambdaQueryWrapper<IndexImg>()
                         .eq(indexImg.getStatus() != null, IndexImg::getStatus, indexImg.getStatus())
@@ -60,7 +60,7 @@ public class IndexImgController {
                         .orderByDesc(IndexImg::getStatus)
                         .orderByAsc(IndexImg::getImgType)
                         .orderByDesc(IndexImg::getSeq));
-        return ResponseEntity.ok(indexImgIPage);
+        return R.SUCCESS(indexImgIPage);
     }
 
     /**
@@ -68,7 +68,7 @@ public class IndexImgController {
      */
     @GetMapping("/info/{imgId}")
     @PreAuthorize("@pms.hasPermission('platform:indexImg:info')")
-    public ResponseEntity<IndexImg> info(@PathVariable("imgId") Long imgId) {
+    public R<IndexImg> info(@PathVariable("imgId") Long imgId) {
         Long shopId = Constant.PLATFORM_SHOP_ID;
         IndexImg indexImg = indexImgService.getOne(new LambdaQueryWrapper<IndexImg>().eq(IndexImg::getShopId, shopId).eq(IndexImg::getImgId, imgId));
         if (Objects.nonNull(indexImg.getRelation())) {
@@ -78,7 +78,7 @@ public class IndexImgController {
                 indexImg.setProdName(product.getProdName());
             }
         }
-        return ResponseEntity.ok(indexImg);
+        return R.SUCCESS(indexImg);
     }
 
     /**
@@ -86,13 +86,13 @@ public class IndexImgController {
      */
     @PostMapping
     @PreAuthorize("@pms.hasPermission('platform:indexImg:save')")
-    public ResponseEntity<Void> save(@RequestBody @Valid IndexImg indexImg) {
+    public R<Void> save(@RequestBody @Valid IndexImg indexImg) {
         Long shopId = Constant.PLATFORM_SHOP_ID;
         indexImg.setShopId(shopId);
         indexImg.setUploadTime(new Date());
         indexImgService.save(indexImg);
         indexImgService.removeIndexImgCacheByShopId(shopId);
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
     /**
@@ -100,11 +100,11 @@ public class IndexImgController {
      */
     @PutMapping
     @PreAuthorize("@pms.hasPermission('platform:indexImg:update')")
-    public ResponseEntity<Void> update(@RequestBody @Valid IndexImg indexImg) {
+    public R<Void> update(@RequestBody @Valid IndexImg indexImg) {
         indexImgService.saveOrUpdate(indexImg);
         // 移除缓存
         indexImgService.removeIndexImgCacheByShopId(Constant.PLATFORM_SHOP_ID);
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
     /**
@@ -112,11 +112,11 @@ public class IndexImgController {
      */
     @DeleteMapping
     @PreAuthorize("@pms.hasPermission('platform:indexImg:delete')")
-    public ResponseEntity<Void> delete(@RequestBody Long[] ids) {
+    public R<Void> delete(@RequestBody Long[] ids) {
         indexImgService.deleteIndexImgsByIds(ids, Constant.PLATFORM_SHOP_ID);
         // 移除缓存
         indexImgService.removeIndexImgCacheByShopId(Constant.PLATFORM_SHOP_ID);
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
 }

+ 9 - 9
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/KeywordController.java

@@ -28,41 +28,41 @@ public class KeywordController {
 
     @ApiOperation("添加编辑")
     @PostMapping("/addOrUpdate")
-    public ResponseEntity<Void> addOrUpdate(@RequestBody KeywordParam keywordParam) {
+    public R<Void> addOrUpdate(@RequestBody KeywordParam keywordParam) {
         return keywordService.addOrUpdate(keywordParam);
     }
 
     @ApiOperation("列表")
     @GetMapping("/search")
-    public ResponseEntity<IPage<Keyword>> search(String name, PageParam<Keyword> page) {
+    public R<IPage<Keyword>> search(String name, PageParam<Keyword> page) {
         IPage<Keyword> result = keywordService.page(page, new LambdaQueryWrapper<Keyword>()
                 .like(StringUtils.isNotEmpty(name), Keyword::getName, name)
                 .orderByDesc(Keyword::getId));
-        return ResponseEntity.ok(result);
+        return R.SUCCESS(result);
     }
 
     @ApiOperation("查看")
     @GetMapping("/get/{id}")
-    public ResponseEntity<Keyword> get(@PathVariable("id") Integer id) {
+    public R<Keyword> get(@PathVariable("id") Integer id) {
         Keyword keyword = keywordService.getById(id);
-        return ResponseEntity.ok(keyword);
+        return R.SUCCESS(keyword);
     }
 
     @ApiOperation("获取关键词类型下关键词")
     @GetMapping("/list")
-    public ResponseEntity<List<Keyword>> list(@RequestParam("type") Integer type) {
+    public R<List<Keyword>> list(@RequestParam("type") Integer type) {
         LocalDateTime now = LocalDateTime.now();
         List<Keyword> list = keywordService.list(new LambdaQueryWrapper<Keyword>()
                 .eq(Keyword::getType, type)
                 .ge(Keyword::getDeadTime, now));
-        return ResponseEntity.ok(list);
+        return R.SUCCESS(list);
     }
 
     @ApiOperation("获取关键词类型下关键词")
     @GetMapping("/remove/{id}")
-    public ResponseEntity<Void> remove(@PathVariable("id") Integer id) {
+    public R<Void> remove(@PathVariable("id") Integer id) {
         keywordService.removeById(id);
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
 }

+ 10 - 10
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/NoticeController.java

@@ -46,13 +46,13 @@ public class NoticeController {
      * @return 分页数据
      */
     @GetMapping("/page")
-    public ResponseEntity<IPage<Notice>> getNoticePage(PageParam<Notice> page, Notice notice) {
+    public R<IPage<Notice>> getNoticePage(PageParam<Notice> page, Notice notice) {
         IPage<Notice> noticeIPage = noticeService.page(page, new LambdaQueryWrapper<Notice>()
                 .eq(Notice::getShopId, Constant.PLATFORM_SHOP_ID)
                 .eq(notice.getStatus() != null, Notice::getStatus, notice.getStatus())
                 .eq(notice.getIsTop() != null, Notice::getIsTop, notice.getIsTop())
                 .like(notice.getTitle() != null, Notice::getTitle, notice.getTitle()).orderByDesc(Notice::getUpdateTime));
-        return ResponseEntity.ok(noticeIPage);
+        return R.SUCCESS(noticeIPage);
     }
 
 
@@ -63,8 +63,8 @@ public class NoticeController {
      * @return 单个数据
      */
     @GetMapping("/info/{id}")
-    public ResponseEntity<Notice> getById(@PathVariable("id") Long id) {
-        return ResponseEntity.ok(noticeService.getById(id));
+    public R<Notice> getById(@PathVariable("id") Long id) {
+        return R.SUCCESS(noticeService.getById(id));
     }
 
     /**
@@ -76,7 +76,7 @@ public class NoticeController {
     @SysLog("新增公告管理")
     @PostMapping
     @PreAuthorize("@pms.hasPermission('platform:notice:save')")
-    public ResponseEntity<Void> save(@RequestBody @Valid Notice notice) {
+    public R<Void> save(@RequestBody @Valid Notice notice) {
         notice.setShopId(Constant.PLATFORM_SHOP_ID);
         if (notice.getStatus() == 1) {
             notice.setPublishTime(new Date());
@@ -85,7 +85,7 @@ public class NoticeController {
         noticeService.save(notice);
         noticeService.removeTopNoticeListCacheByShopId(Constant.PLATFORM_SHOP_ID);
         noticeService.removeNoticeCacheById(notice.getId());
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
     /**
@@ -97,7 +97,7 @@ public class NoticeController {
     @SysLog("修改公告管理")
     @PutMapping
     @PreAuthorize("@pms.hasPermission('platform:notice:update')")
-    public ResponseEntity<Void> updateById(@RequestBody @Valid Notice notice) {
+    public R<Void> updateById(@RequestBody @Valid Notice notice) {
         Notice oldNotice = noticeService.getById(notice.getId());
         notice.setShopId(Constant.PLATFORM_SHOP_ID);
         if (oldNotice.getStatus() == 0 && notice.getStatus() == 1) {
@@ -107,7 +107,7 @@ public class NoticeController {
         noticeService.updateById(notice);
         noticeService.removeTopNoticeListCacheByShopId(Constant.PLATFORM_SHOP_ID);
         noticeService.removeNoticeCacheById(notice.getId());
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
     /**
@@ -119,11 +119,11 @@ public class NoticeController {
     @SysLog("删除公告管理")
     @DeleteMapping("/{id}")
     @PreAuthorize("@pms.hasPermission('platform:notice:delete')")
-    public ResponseEntity<Void> removeById(@PathVariable Long id) {
+    public R<Void> removeById(@PathVariable Long id) {
         noticeService.removeByIdAndShopId(id,Constant.PLATFORM_SHOP_ID);
         noticeService.removeTopNoticeListCacheByShopId(Constant.PLATFORM_SHOP_ID);
         noticeService.removeNoticeCacheById(id);
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
 }

+ 6 - 6
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/OrderController.java

@@ -55,9 +55,9 @@ public class OrderController {
      */
     @GetMapping("/page")
     @PreAuthorize("@pms.hasPermission('platform:order:page')")
-    public ResponseEntity<IPage<Order>> page(OrderParam orderParam, PageParam<Order> page) {
+    public R<IPage<Order>> page(OrderParam orderParam, PageParam<Order> page) {
         IPage<Order> orderIPage = orderService.pageOrdersDetialByOrderParam(page, orderParam);
-        return ResponseEntity.ok(orderIPage);
+        return R.SUCCESS(orderIPage);
     }
 
     /**
@@ -65,10 +65,10 @@ public class OrderController {
      */
     @GetMapping("/orderPayByShopId")
     @ApiOperation(value = "根据商家id获取支付信息")
-    public ResponseEntity<OrderPayParam> orderPayByShopId(@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")@RequestParam("startTime") Date startTime,
+    public R<OrderPayParam> orderPayByShopId(@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")@RequestParam("startTime") Date startTime,
                                                           @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")@RequestParam("endTime") Date endTime) {
         OrderPayParam actualTotal = orderService.getPayUserCountByshopId(null,startTime,endTime);
-        return ResponseEntity.ok(actualTotal);
+        return R.SUCCESS(actualTotal);
     }
 
 
@@ -77,7 +77,7 @@ public class OrderController {
      */
     @GetMapping("/orderInfo/{orderNumber}")
     @PreAuthorize("@pms.hasPermission('platform:order:info')")
-    public ResponseEntity<Order> info(@PathVariable("orderNumber") String orderNumber) {
+    public R<Order> info(@PathVariable("orderNumber") String orderNumber) {
 
         Order order = orderService.getOne(new LambdaUpdateWrapper<Order>().eq(Order::getOrderNumber, orderNumber));
         if (order == null) {
@@ -88,7 +88,7 @@ public class OrderController {
 
         List<OrderItem> orderItems = orderItemService.getOrderItemsByOrderNumber(orderNumber);
         order.setOrderItems(orderItems);
-        return ResponseEntity.ok(order);
+        return R.SUCCESS(order);
     }
 
 

+ 4 - 4
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/OrderRefundController.java

@@ -28,10 +28,10 @@ public class OrderRefundController {
      */
     @GetMapping("/page")
     @PreAuthorize("@pms.hasPermission('platform:orderRefund:page')")
-    public ResponseEntity<IPage<OrderRefundDto>> getOrderRefundPage(PageParam<OrderRefundDto> page, OrderRefundDto orderRefundDto,
+    public R<IPage<OrderRefundDto>> getOrderRefundPage(PageParam<OrderRefundDto> page, OrderRefundDto orderRefundDto,
                                                                     @RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime) {
         IPage<OrderRefundDto> page1 = orderRefundService.getPage(page, orderRefundDto, startTime, endTime);
-        return ResponseEntity.ok(orderRefundService.getPage(page, orderRefundDto, startTime, endTime));
+        return R.SUCCESS(orderRefundService.getPage(page, orderRefundDto, startTime, endTime));
     }
 
     /**
@@ -42,9 +42,9 @@ public class OrderRefundController {
      */
     @GetMapping("/info")
     @PreAuthorize("@pms.hasPermission('platform:orderRefund:info')")
-    public ResponseEntity<OrderRefund> info(@RequestParam("refundId") Long refundId, @RequestParam("shopId") Long shopId) {
+    public R<OrderRefund> info(@RequestParam("refundId") Long refundId, @RequestParam("shopId") Long shopId) {
         OrderRefund orderRefund = orderRefundService.getOrderRefundById(refundId, shopId);
-        return ResponseEntity.ok(orderRefund);
+        return R.SUCCESS(orderRefund);
     }
 
 }

+ 14 - 14
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ProductController.java

@@ -70,7 +70,7 @@ public class ProductController {
      */
     @GetMapping("/page")
     @PreAuthorize("@pms.hasPermission('prod:prod:page')")
-    public ResponseEntity<IPage<Product>> page(ProductParam product, PageParam<Product> page) {
+    public R<IPage<Product>> page(ProductParam product, PageParam<Product> page) {
        /* IPage<Product> products = productService.page(page,
                 new LambdaQueryWrapper<Product>()
                         .like(StrUtil.isNotBlank(product.getProdName()), Product::getProdName, product.getProdName())
@@ -79,7 +79,7 @@ public class ProductController {
                         .ne(Product::getStatus,-1));*/
        //TODO gai eq(Product::getProdType,ProdType.PROD_TYPE_NORMAL)
         IPage<Product> products = productService.getPageAngShopName(page,product);
-        return ResponseEntity.ok(products);
+        return R.SUCCESS(products);
     }
 
     /**
@@ -87,7 +87,7 @@ public class ProductController {
      */
     @GetMapping("/info/{prodId}")
     @PreAuthorize("@pms.hasPermission('prod:prod:info')")
-    public ResponseEntity<Product> info(@PathVariable("prodId") Long prodId) {
+    public R<Product> info(@PathVariable("prodId") Long prodId) {
         Product prod = productService.getProductByProdId(prodId);
         List<Sku> skuList = skuService.listByProdId(prodId);
         Brand brand = brandService.getById(prod.getBrandId());
@@ -95,7 +95,7 @@ public class ProductController {
             prod.setBrand(brand);
         }
         prod.setSkuList(skuList);
-        return ResponseEntity.ok(prod);
+        return R.SUCCESS(prod);
     }
 
     /**
@@ -103,7 +103,7 @@ public class ProductController {
      */
     @DeleteMapping("/{prodId}")
     @PreAuthorize("@pms.hasPermission('prod:prod:update')")
-    public ResponseEntity<Void> delete(@PathVariable("prodId") Long prodId) {
+    public R<Void> delete(@PathVariable("prodId") Long prodId) {
         Product dbProduct = productService.getProductByProdId(prodId);
         List<Sku> dbSkus = skuService.listByProdId(dbProduct.getProdId());
         // 删除商品
@@ -120,7 +120,7 @@ public class ProductController {
         }
         // 删除商品时,改变分销设置,团购订单处理。。。
         applicationContext.publishEvent(new ProdChangeEvent(dbProduct));
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
     /**
@@ -128,7 +128,7 @@ public class ProductController {
      */
     @PostMapping("/offline")
     @PreAuthorize("@pms.hasPermission('prod:prod:update')")
-    public ResponseEntity<Void> offline(@RequestBody OfflineHandleEvent offlineHandleEvent) {
+    public R<Void> offline(@RequestBody OfflineHandleEvent offlineHandleEvent) {
         Product dbProduct = productService.getProductByProdId(offlineHandleEvent.getHandleId());
         if (dbProduct == null) {
             throw new YamiShopBindException("未找到刚商品的信息");
@@ -144,29 +144,29 @@ public class ProductController {
         }
         // 移除缓存
         productService.removeProductCacheByProdId(dbProduct.getProdId());
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
     /**
      * 通过prodId获取最新下线商品的事件
      */
     @GetMapping("/getOfflineHandleEventByProdId/{prodId}")
-    public ResponseEntity<OfflineHandleEvent> getOfflineHandleEventByProdId(@PathVariable Long prodId) {
+    public R<OfflineHandleEvent> getOfflineHandleEventByProdId(@PathVariable Long prodId) {
         OfflineHandleEvent offlineHandleEvent = offlineHandleEventService.getProcessingEventByHandleTypeAndHandleId(OfflineHandleEventType.PROD.getValue(), prodId);
-        return ResponseEntity.ok(offlineHandleEvent);
+        return R.SUCCESS(offlineHandleEvent);
     }
 
     /**
      * 审核商品
      */
     @PostMapping("/prodAudit")
-    public ResponseEntity<Void> prodAudit(@RequestBody OfflineHandleEventAuditParam offlineHandleEventAuditParam) {
+    public R<Void> prodAudit(@RequestBody OfflineHandleEventAuditParam offlineHandleEventAuditParam) {
         Long userId = SecurityUtils.getSysUser().getUserId();
         productService.prodAudit(offlineHandleEventAuditParam, userId);
 
         // 移除缓存
         productService.removeProductCacheByProdId(offlineHandleEventAuditParam.getHandleId());
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
     /**
@@ -174,8 +174,8 @@ public class ProductController {
      * */
     @PostMapping("/listRelatedProducts")
     @ApiOperation("根据分类ID查询关联商品")
-    public ResponseEntity<IPage<Product>> listRelatedProducts(@RequestBody ListRelatedProductsDto listRelatedProductsDto){
-        return ResponseEntity.ok(productService.listRelatedProducts(listRelatedProductsDto));
+    public R<IPage<Product>> listRelatedProducts(@RequestBody ListRelatedProductsDto listRelatedProductsDto){
+        return R.SUCCESS(productService.listRelatedProducts(listRelatedProductsDto));
     }
 
 }

+ 7 - 7
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/QnhController.java

@@ -27,13 +27,13 @@ public class QnhController {
 
     @ApiOperation("查询所有门店")
     @PostMapping("/getStores")
-    public ResponseEntity<List<StoreListVo>> getStores(@RequestBody StoreDto dto) {
+    public R<List<StoreListVo>> getStores(@RequestBody StoreDto dto) {
         return qnhService.getStores(dto);
     }
 
     @ApiOperation("查询门店详情")
     @PostMapping("/queryStore")
-    public ResponseEntity<StoreDetailVo> queryStore(@RequestParam("regionCode") String regionCode,
+    public R<StoreDetailVo> queryStore(@RequestParam("regionCode") String regionCode,
                                                           @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
                                                           @RequestParam(value = "pageSize", defaultValue = "20") Integer pageSize) {
         return qnhService.queryStore(regionCode, pageNo, pageSize);
@@ -41,31 +41,31 @@ public class QnhController {
 
     @ApiOperation("查询门店商品列表")
     @PostMapping("/itemQuery")
-    public ResponseEntity<GoodsItemPageVo> itemQuery(@RequestBody ItemQueryDto dto) {
+    public R<GoodsItemPageVo> itemQuery(@RequestBody ItemQueryDto dto) {
         return qnhService.itemQuery(dto);
     }
 
     @ApiOperation("下单")
     @PostMapping("/addOrder")
-    public ResponseEntity<String> addOrder(@RequestBody OrderDto dto) {
+    public R<String> addOrder(@RequestBody OrderDto dto) {
         return qnhService.addOrder(dto);
     }
 
     @ApiOperation("syncShop")
     @GetMapping("/syncShop")
-    public ResponseEntity<Void> syncShop() {
+    public R<Void> syncShop() {
         return qnhService.syncShop(null);
     }
 
     @ApiOperation("syncGoods")
     @GetMapping("/syncGoods")
-    public ResponseEntity<Void> syncGoods() {
+    public R<Void> syncGoods() {
         return qnhService.syncGoods(null);
     }
 
     @ApiOperation("获取门店")
     @GetMapping("/getDetailShop")
-    public ResponseEntity<Map<String,String>> getDetailShop(@RequestParam(value = "name", required = false) String name) {
+    public R<Map<String,String>> getDetailShop(@RequestParam(value = "name", required = false) String name) {
         return qnhService.getDetailShop(name);
     }
 }

+ 14 - 14
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ScoreProductController.java

@@ -58,7 +58,7 @@ public class ScoreProductController {
      */
     @GetMapping("/page")
     @PreAuthorize("@pms.hasPermission('score:prod:page')")
-    public ResponseEntity<IPage<Product>> page(ProductParam product, PageParam<Product> page) {
+    public R<IPage<Product>> page(ProductParam product, PageParam<Product> page) {
             IPage<Product> products = productService.page(page,
                 new LambdaQueryWrapper<Product>()
                         .like(StrUtil.isNotBlank(product.getProdName()), Product::getProdName, product.getProdName())
@@ -67,7 +67,7 @@ public class ScoreProductController {
                         .eq(Product::getProdType, ProdType.PROD_TYPE_SCORE.value())
                         .ne(Product::getStatus,-1));
 //        System.out.println("---------"+ProdType.PROD_TYPE_SCORE);
-        return ResponseEntity.ok(products);
+        return R.SUCCESS(products);
     }
 
 
@@ -76,11 +76,11 @@ public class ScoreProductController {
      */
     @GetMapping("/info/{prodId}")
     @PreAuthorize("@pms.hasPermission('score:prod:info')")
-    public ResponseEntity<Product> info(@PathVariable("prodId") Long prodId) {
+    public R<Product> info(@PathVariable("prodId") Long prodId) {
         Product prod = productService.getProductByProdId(prodId);
         List<Sku> skuList = skuService.listByProdId(prodId);
         prod.setSkuList(skuList);
-        return ResponseEntity.ok(prod);
+        return R.SUCCESS(prod);
     }
 
     /**
@@ -88,7 +88,7 @@ public class ScoreProductController {
      */
     @DeleteMapping("/{prodId}")
     @PreAuthorize("@pms.hasPermission('score:prod:delete')")
-    public ResponseEntity<Void> delete(@PathVariable("prodId") Long prodId) {
+    public R<Void> delete(@PathVariable("prodId") Long prodId) {
         Product dbProduct = productService.getProductByProdId(prodId);
         List<Sku> dbSkus = skuService.listByProdId(dbProduct.getProdId());
         // 删除商品
@@ -104,7 +104,7 @@ public class ScoreProductController {
             basketService.removeShopCartItemsCacheByUserId(userId);
         }
 
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
 
@@ -113,9 +113,9 @@ public class ScoreProductController {
      * 通过prodId获取最新下线商品的事件
      */
     @GetMapping("/getOfflineHandleEventByProdId/{prodId}")
-    public ResponseEntity<OfflineHandleEvent> getOfflineHandleEventByProdId(@PathVariable Long prodId) {
+    public R<OfflineHandleEvent> getOfflineHandleEventByProdId(@PathVariable Long prodId) {
         OfflineHandleEvent offlineHandleEvent = offlineHandleEventService.getProcessingEventByHandleTypeAndHandleId(OfflineHandleEventType.PROD.getValue(), prodId);
-        return ResponseEntity.ok(offlineHandleEvent);
+        return R.SUCCESS(offlineHandleEvent);
     }
 
 
@@ -123,7 +123,7 @@ public class ScoreProductController {
      * 更新商品状态
      */
     @PutMapping("/prodStatus")
-    public ResponseEntity<Void> shopStatus(@RequestBody ProductParam productParam) {
+    public R<Void> shopStatus(@RequestBody ProductParam productParam) {
         Long prodId = productParam.getProdId();
         Integer prodStatus = productParam.getStatus();
         Product dbProduct = productService.getProductByProdId(prodId);
@@ -147,7 +147,7 @@ public class ScoreProductController {
         for (String userId : userIds) {
             basketService.removeShopCartItemsCacheByUserId(userId);
         }
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
     /**
@@ -155,7 +155,7 @@ public class ScoreProductController {
      */
     @PostMapping
     @PreAuthorize("@pms.hasPermission('score:prod:save')")
-    public ResponseEntity<String> save(@Valid @RequestBody ProductScoreParam productScoreParam) {
+    public R<String> save(@Valid @RequestBody ProductScoreParam productScoreParam) {
         checkParam(productScoreParam);
         Product product = mapperFacade.map(productScoreParam, Product.class);
         product.setStatus(1);
@@ -170,7 +170,7 @@ public class ScoreProductController {
         //积分商品类型
         product.setProdType(ProdType.PROD_TYPE_SCORE.value());
         productService.saveProduct(product);
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
     /**
@@ -178,7 +178,7 @@ public class ScoreProductController {
      */
     @PutMapping
     @PreAuthorize("@pms.hasPermission('score:prod:update')")
-    public ResponseEntity<String> update(@Valid @RequestBody ProductScoreParam productScoreParam) {
+    public R<String> update(@Valid @RequestBody ProductScoreParam productScoreParam) {
         checkParam(productScoreParam);
         Product product = mapperFacade.map(productScoreParam, Product.class);
         Product dbProduct = productService.getProductByProdId(productScoreParam.getProdId());
@@ -196,7 +196,7 @@ public class ScoreProductController {
         for (String userId : userIds) {
             basketService.removeShopCartItemsCacheByUserId(userId);
         }
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
 

+ 14 - 14
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ShopAuditingController.java

@@ -60,8 +60,8 @@ public class ShopAuditingController {
      */
     @GetMapping("/page")
     @PreAuthorize("@pms.hasPermission('shop:shopAuditing:page')")
-    public ResponseEntity<IPage<ShopAuditingInfoDto>> getShopAuditingPage(PageParam<ShopAuditingInfoDto> page, AuditingInfoParam auditingInfoParam) {
-        return ResponseEntity.ok(shopAuditingService.auditingInfoList(page, auditingInfoParam));
+    public R<IPage<ShopAuditingInfoDto>> getShopAuditingPage(PageParam<ShopAuditingInfoDto> page, AuditingInfoParam auditingInfoParam) {
+        return R.SUCCESS(shopAuditingService.auditingInfoList(page, auditingInfoParam));
     }
 
     /**
@@ -69,23 +69,23 @@ public class ShopAuditingController {
      */
     @GetMapping("/shopDetail/{shopId}")
     @PreAuthorize("@pms.hasPermission('shop:shopAuditing:info')")
-    public ResponseEntity<ShopDetail> auditingDetail(@PathVariable Long shopId) {
+    public R<ShopDetail> auditingDetail(@PathVariable Long shopId) {
         ShopDetail shopDetail = shopDetailService.getShopDetailByShopId(shopId);
-        return ResponseEntity.ok(shopDetail);
+        return R.SUCCESS(shopDetail);
     }
 
     /**
      * 根据审核id查询详情信息
      */
     @GetMapping("/{shopId}")
-    public ResponseEntity<ShopAuditing> getShopAuditing(@PathVariable Long shopId) {
+    public R<ShopAuditing> getShopAuditing(@PathVariable Long shopId) {
         ShopAuditing shopAuditing = shopAuditingService.getOne(new LambdaQueryWrapper<ShopAuditing>().eq(ShopAuditing::getShopId, shopId));
         if (Objects.isNull(shopAuditing)){
             shopAuditing = new ShopAuditing();
         }
         ShopDetail shopDetail = shopDetailService.getShopDetailByShopId(shopId);
         shopAuditing.setShopDetail(shopDetail);
-        return ResponseEntity.ok(shopAuditing);
+        return R.SUCCESS(shopAuditing);
     }
 
     /**
@@ -94,7 +94,7 @@ public class ShopAuditingController {
     @SysLog("审核商家信息")
     @PutMapping("/audit/{shopId}")
     @PreAuthorize("@pms.hasPermission('shop:shopAuditing:audit')")
-    public ResponseEntity<Void> audit(@PathVariable Long shopId, @Valid @RequestBody ShopAuditingParam shopAuditingParam) {
+    public R<Void> audit(@PathVariable Long shopId, @Valid @RequestBody ShopAuditingParam shopAuditingParam) {
 
         ShopAuditing shopAuditing = shopAuditingService.getOne(new LambdaQueryWrapper<ShopAuditing>().eq(ShopAuditing::getShopId, shopId));
         if (Objects.equals(shopAuditing.getStatus(), AuditStatus.SUCCESSAUDIT.value())) {
@@ -108,7 +108,7 @@ public class ShopAuditingController {
 
         shopDetailService.removeShopDetailCacheByShopId(shopId);
 
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
     /**
@@ -116,16 +116,16 @@ public class ShopAuditingController {
      */
     @PostMapping
 
-    public ResponseEntity<ShopDetail> insertDetail(@RequestBody ShopDetail shopDetail) {
+    public R<ShopDetail> insertDetail(@RequestBody ShopDetail shopDetail) {
         shopDetailService.insertDetail(shopDetail);
-        return ResponseEntity.ok(shopDetail);
+        return R.SUCCESS(shopDetail);
     }
 
     /**
      * 校验账号
      */
     @GetMapping("/checkMobile")
-    public ResponseEntity<Boolean> checkMobile(@RequestParam("mobile") String mobile,@RequestParam("shopId")Long shopId) {
+    public R<Boolean> checkMobile(@RequestParam("mobile") String mobile,@RequestParam("shopId")Long shopId) {
         Boolean isTrue = true;
         if (Objects.isNull(shopId)){
             shopId = 0L;
@@ -134,7 +134,7 @@ public class ShopAuditingController {
         if (count > 0){
             isTrue = false;
         }
-        return ResponseEntity.ok(isTrue);
+        return R.SUCCESS(isTrue);
     }
 
 
@@ -142,9 +142,9 @@ public class ShopAuditingController {
      * 重置密码或者修改账号
      */
     @PutMapping("/updatePasswordOrMobile")
-    public ResponseEntity<Boolean> updatePasswordOrMobile(@RequestBody ShopDetail shopDetail) {
+    public R<Boolean> updatePasswordOrMobile(@RequestBody ShopDetail shopDetail) {
         shopDetailService.updatePasswordOrMobile(shopDetail.getShopId(),shopDetail.getPassword(),shopDetail.getMobile());
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
 //    /**

+ 6 - 6
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ShopDetailController.java

@@ -60,9 +60,9 @@ public class ShopDetailController {
      */
     @GetMapping("/getOfflineHandleEventByShopId/{shopId}")
     @PreAuthorize("@pms.hasPermission('shop:shopAuditing:info')")
-    public ResponseEntity<OfflineHandleEvent> getOfflineHandleEventByShopId(@PathVariable("shopId") Long shopId) {
+    public R<OfflineHandleEvent> getOfflineHandleEventByShopId(@PathVariable("shopId") Long shopId) {
         OfflineHandleEvent offlineHandleEvent = offlineHandleEventService.getProcessingEventByHandleTypeAndHandleId(OfflineHandleEventType.SHOP.getValue(), shopId);
-        return ResponseEntity.ok(offlineHandleEvent);
+        return R.SUCCESS(offlineHandleEvent);
     }
 
     /**
@@ -70,7 +70,7 @@ public class ShopDetailController {
      */
     @PostMapping("/offline")
     @PreAuthorize("@pms.hasPermission('shop:shopAuditing:audit')")
-    public ResponseEntity<Void> offline(@RequestBody OfflineHandleEvent offlineHandleEvent) {
+    public R<Void> offline(@RequestBody OfflineHandleEvent offlineHandleEvent) {
         Long sysUserId = SecurityUtils.getSysUser().getUserId();
         ShopDetail shopDetail = shopDetailService.getShopDetailByShopId(offlineHandleEvent.getHandleId());
         if (shopDetail == null) {
@@ -102,7 +102,7 @@ public class ShopDetailController {
                 }
             }
         }
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
     /**
@@ -110,7 +110,7 @@ public class ShopDetailController {
      */
     @PostMapping("/auditShop")
     @PreAuthorize("@pms.hasPermission('shop:shopAuditing:audit')")
-    public ResponseEntity<Void> auditOfflineShop(@RequestBody OfflineHandleEventAuditParam offlineHandleEventAuditParam) {
+    public R<Void> auditOfflineShop(@RequestBody OfflineHandleEventAuditParam offlineHandleEventAuditParam) {
         Long sysUserId = SecurityUtils.getSysUser().getUserId();
         ShopDetail shopDetail = shopDetailService.getShopDetailByShopId(offlineHandleEventAuditParam.getHandleId());
         if (shopDetail == null) {
@@ -118,7 +118,7 @@ public class ShopDetailController {
         }
         shopDetailService.auditOfflineShop(offlineHandleEventAuditParam, sysUserId);
 
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
     private String generateKey(Map<String, String> values) {

+ 2 - 2
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ShopWalletController.java

@@ -44,7 +44,7 @@ public class ShopWalletController {
      * @return 分页数据
      */
     @GetMapping("/page" )
-    public ResponseEntity<IPage<ShopWallet>> getShopWalletPage(PageParam<ShopWallet> page, ShopWallet shopWallet) {
-        return ResponseEntity.ok(shopWalletService.pageShopWallet(page, shopWallet));
+    public R<IPage<ShopWallet>> getShopWalletPage(PageParam<ShopWallet> page, ShopWallet shopWallet) {
+        return R.SUCCESS(shopWalletService.pageShopWallet(page, shopWallet));
     }
 }

+ 6 - 6
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ShopWithdrawCashController.java

@@ -53,8 +53,8 @@ public class ShopWithdrawCashController {
      * @return 分页数据
      */
     @GetMapping("/page")
-    public ResponseEntity<IPage<ShopWithdrawCash>> getShopWithdrawCashPage(PageParam<ShopWithdrawCash> page, ShopWithdrawCash shopWithdrawCash) {
-        return ResponseEntity.ok(shopWithdrawCashService.pageShopWithdrawCash(page, shopWithdrawCash));
+    public R<IPage<ShopWithdrawCash>> getShopWithdrawCashPage(PageParam<ShopWithdrawCash> page, ShopWithdrawCash shopWithdrawCash) {
+        return R.SUCCESS(shopWithdrawCashService.pageShopWithdrawCash(page, shopWithdrawCash));
     }
 
 
@@ -65,8 +65,8 @@ public class ShopWithdrawCashController {
      * @return 单个数据
      */
     @GetMapping("/info/{cashId}")
-    public ResponseEntity<ShopWithdrawCash> getById(@PathVariable("cashId") Long cashId) {
-        return ResponseEntity.ok(shopWithdrawCashService.getById(cashId));
+    public R<ShopWithdrawCash> getById(@PathVariable("cashId") Long cashId) {
+        return R.SUCCESS(shopWithdrawCashService.getById(cashId));
     }
 
 
@@ -76,7 +76,7 @@ public class ShopWithdrawCashController {
     @SysLog("审核商家提现信息")
     @PutMapping("/audit")
     @PreAuthorize("@pms.hasPermission('shop:shopWithdrawCash:audit')")
-    public ResponseEntity<Void> audit(@RequestBody ShopWithdrawCash shopWithdrawCash) {
+    public R<Void> audit(@RequestBody ShopWithdrawCash shopWithdrawCash) {
         ShopWithdrawCash dbShopWithdrawCash = shopWithdrawCashService.getById(shopWithdrawCash.getCashId());
         if (dbShopWithdrawCash == null) {
             throw new YamiShopBindException("未找到申请信息");
@@ -95,6 +95,6 @@ public class ShopWithdrawCashController {
 
         shopWithdrawCashService.auditWithdrawCash(shopWithdrawCash.getCashId(), shopWithdrawCash, SecurityUtils.getSysUser().getUserId(), appConnect.getBizUserId());
         // 减少冻结金额
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 }

+ 2 - 2
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/SkuController.java

@@ -33,8 +33,8 @@ public class SkuController {
 
     @GetMapping("/getAllSkuList")
     @PreAuthorize("@pms.hasPermission('plateform:sku:list')")
-    public ResponseEntity<List<Sku>> getSkuListByProdId(Long prodId) {
+    public R<List<Sku>> getSkuListByProdId(Long prodId) {
         List<Sku> skus = skuService.listByProdId(prodId);
-        return ResponseEntity.ok(skus);
+        return R.SUCCESS(skus);
     }
 }

+ 12 - 12
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/SpecController.java

@@ -45,22 +45,22 @@ public class SpecController {
      * 获取所有的规格
      */
     @GetMapping("/list")
-    public ResponseEntity<List<ProdProp>> list() {
+    public R<List<ProdProp>> list() {
         List<ProdProp> list = prodPropService.list(new LambdaQueryWrapper<ProdProp>()
                 .eq(ProdProp::getRule, ProdPropRule.SPEC.value()).
                 eq(ProdProp::getShopId, Constant.PLATFORM_SHOP_ID));
-        return ResponseEntity.ok(list);
+        return R.SUCCESS(list);
     }
 
     /**
      * 分页获取
      */
     @GetMapping("/page")
-    public ResponseEntity<IPage<ProdProp>> page(ProdProp prodProp, PageParam<ProdProp> page) {
+    public R<IPage<ProdProp>> page(ProdProp prodProp, PageParam<ProdProp> page) {
         prodProp.setRule(ProdPropRule.SPEC.value());
         prodProp.setShopId( Constant.PLATFORM_SHOP_ID);
         IPage<ProdProp> list = prodPropService.pagePropAndValue(prodProp, page);
-        return ResponseEntity.ok(list);
+        return R.SUCCESS(list);
     }
 
 
@@ -69,39 +69,39 @@ public class SpecController {
      * 根据规格id获取规格值
      */
     @GetMapping("/listSpecValue/{specId}")
-    public ResponseEntity<List<ProdPropValue>> listSpecValue(@PathVariable("specId") Long specId) {
+    public R<List<ProdPropValue>> listSpecValue(@PathVariable("specId") Long specId) {
         List<ProdPropValue> list = prodPropValueService.list(new LambdaQueryWrapper<ProdPropValue>().eq(ProdPropValue::getPropId, specId));
-        return ResponseEntity.ok(list);
+        return R.SUCCESS(list);
     }
 
     /**
      * 保存
      */
     @PostMapping
-    public ResponseEntity<Void> save(@Valid @RequestBody ProdProp prodProp) {
+    public R<Void> save(@Valid @RequestBody ProdProp prodProp) {
         prodProp.setRule(ProdPropRule.SPEC.value());
         prodProp.setShopId(Constant.PLATFORM_SHOP_ID);
         prodPropService.saveProdPropAndValues(prodProp);
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
     /**
      * 修改
      */
     @PutMapping
-    public ResponseEntity<Void> update(@Valid @RequestBody ProdProp prodProp) {
+    public R<Void> update(@Valid @RequestBody ProdProp prodProp) {
         prodProp.setRule(ProdPropRule.SPEC.value());
         prodPropService.updateProdPropAndValues(prodProp);
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
     /**
      * 删除
      */
     @DeleteMapping("/{id}")
-    public ResponseEntity<Void> delete(@PathVariable Long id) {
+    public R<Void> delete(@PathVariable Long id) {
         prodPropService.deleteProdPropAndValues(id, ProdPropRule.SPEC.value(), Constant.PLATFORM_SHOP_ID);
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
 }

+ 14 - 14
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/StatisticsOrderController.java

@@ -34,57 +34,57 @@ public class StatisticsOrderController {
 
     @GetMapping("/orderPayByShopId")
     @ApiOperation(value = "通过时间获取支付信息")
-    public ResponseEntity<OrderPayParam> orderPayByShopId() {
+    public R<OrderPayParam> orderPayByShopId() {
         OrderPayParam actualTotal = orderService.getPayUserCountByshopId(null,DateUtil.beginOfDay(DateUtil.date()), DateUtil.endOfDay(DateUtil.date()));
-        return ResponseEntity.ok(actualTotal);
+        return R.SUCCESS(actualTotal);
     }
 
     @GetMapping("/getActualTotalByHour")
     @ApiOperation(value = "通过24小时分段获取支付金额")
-    public ResponseEntity<OrderPayParam> getActualTotalByHour() {
+    public R<OrderPayParam> getActualTotalByHour() {
         OrderPayParam payList = orderService.getActualTotalByHour(
                 null,DateUtil.beginOfDay(DateUtil.date()),DateUtil.endOfDay(DateUtil.date()));
-        return ResponseEntity.ok(payList);
+        return R.SUCCESS(payList);
     }
 
     @GetMapping("/getActualTotalByDay")
     @ApiOperation(value = "通过天数分段获取支付金额")
-    public ResponseEntity<List<OrderPayParam>> getActualTotalByDay() {
+    public R<List<OrderPayParam>> getActualTotalByDay() {
         List<OrderPayParam> payList = orderService.getActualTotalByDay(
                 null,DateUtil.endOfDay(DateUtil.lastMonth()),DateUtil.endOfDay(DateUtil.date()));
-        return ResponseEntity.ok(payList);
+        return R.SUCCESS(payList);
     }
 
     @GetMapping("/getOrderRefundByTime")
     @ApiOperation(value = "通过时间获取比率信息")
-    public ResponseEntity<StatisticsRefundParam> getOrderRefundByTime() {
+    public R<StatisticsRefundParam> getOrderRefundByTime() {
         StatisticsRefundParam refundParam = orderRefundService.getOrderRefundByShopId(
                 null,DateUtil.beginOfDay(DateUtil.date()), DateUtil.endOfDay(DateUtil.date()));
-        return ResponseEntity.ok(refundParam);
+        return R.SUCCESS(refundParam);
     }
 
     @GetMapping("/getOrderRefundDayByTime")
     @ApiOperation(value = "通过时间获取分段比率信息及退款金额信息")
-    public ResponseEntity<List<StatisticsRefundParam>> getOrderRefundById() {
+    public R<List<StatisticsRefundParam>> getOrderRefundById() {
         List<StatisticsRefundParam> refundList = orderRefundService.getOrderRefundByShopIdAndDay(
                 null,DateUtil.endOfDay(DateUtil.lastMonth()),DateUtil.endOfDay(DateUtil.date()));
-        return ResponseEntity.ok(refundList);
+        return R.SUCCESS(refundList);
     }
 
     @GetMapping("/getRefundRankingByProd")
     @ApiOperation(value = "根据商品名生成退款排行")
-    public ResponseEntity<List<StatisticsRefundParam>> getRefundRankingByProd() {
+    public R<List<StatisticsRefundParam>> getRefundRankingByProd() {
         List<StatisticsRefundParam> refundList = orderRefundService.getRefundRankingByProd(
                 null,DateUtil.endOfDay(DateUtil.lastMonth()),DateUtil.endOfDay(DateUtil.date()));
-        return ResponseEntity.ok(refundList);
+        return R.SUCCESS(refundList);
     }
 
   @GetMapping("/getRefundRankingByReason")
     @ApiOperation(value = "根据退款原因生成退款排行")
-    public ResponseEntity<List<StatisticsRefundParam>> getRefundRankingByReason() {
+    public R<List<StatisticsRefundParam>> getRefundRankingByReason() {
         List<StatisticsRefundParam> refundList = orderRefundService.getRefundRankingByReason(
                 null,DateUtil.endOfDay(DateUtil.lastMonth()),DateUtil.endOfDay(DateUtil.date()));
-        return ResponseEntity.ok(refundList);
+        return R.SUCCESS(refundList);
     }
 
 }

+ 2 - 2
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/UserAddrController.java

@@ -52,10 +52,10 @@ public class UserAddrController {
      */
     @GetMapping("/page")
     @PreAuthorize("@pms.hasPermission('plateform:user:page')")
-    public ResponseEntity<List<UserAddr>> page(UserAddr userAddr,PageParam<UserAddr> page) {
+    public R<List<UserAddr>> page(UserAddr userAddr,PageParam<UserAddr> page) {
         List<UserAddr> userAddrPage = userAddrService.list(new LambdaQueryWrapper<UserAddr>()
                 .eq(UserAddr::getUserId, userAddr.getUserId()));
-        return ResponseEntity.ok(userAddrPage);
+        return R.SUCCESS(userAddrPage);
     }
 
 }

+ 4 - 4
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/UserController.java

@@ -55,7 +55,7 @@ public class UserController {
      */
     @GetMapping("/page")
     @PreAuthorize("@pms.hasPermission('plateform:user:page')")
-    public ResponseEntity<IPage<User>> page(User user,PageParam<User> page) {
+    public R<IPage<User>> page(User user,PageParam<User> page) {
 //        IPage<User> userPage = userService.page(page, new LambdaQueryWrapper<User>()
 //                .like(StrUtil.isNotBlank(user.getNickName()), User::getNickName, user.getNickName())
 //                .eq(user.getStatus() != null, User::getStatus, user.getStatus())
@@ -65,7 +65,7 @@ public class UserController {
 //        for (User userResult : userPage.getRecords()) {
 //            userResult.setNickName(userResult.getNickName());
 //        }
-        return ResponseEntity.ok(userPage);
+        return R.SUCCESS(userPage);
     }
 
     /**
@@ -84,7 +84,7 @@ public class UserController {
      */
     @PutMapping
     @PreAuthorize("@pms.hasPermission('plateform:user:update')")
-    public ResponseEntity<Void> update(@RequestBody User user) {
+    public R<Void> update(@RequestBody User user) {
         user.setModifyTime(new Date());
         user.setNickName(user.getNickName());
         userService.updateById(user);
@@ -101,7 +101,7 @@ public class UserController {
                 RedisUtil.del(SecurityConstants.YAMI_OAUTH_PREFIX + "access:" + oAuth2AccessToken.getValue());
             }
         }
-        return ResponseEntity.ok().build();
+        return R.SUCCESS();
     }
 
 

+ 3 - 2
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/hb/GoodsController.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.yami.shop.bean.model.Product;
+import com.yami.shop.common.util.R;
 import com.yami.shop.common.util.hb.HBR;
 import com.yami.shop.service.hb.IGoodsService;
 import io.swagger.annotations.Api;
@@ -131,7 +132,7 @@ public class GoodsController {
  * @return 分页数据
  */
 @GetMapping("/selectPage")
-public ResponseEntity<IPage<Product>> selectGoodsPage(
+public R<IPage<Product>> selectGoodsPage(
         @RequestParam(defaultValue = "1") Integer pageNum,
         @RequestParam(defaultValue = "10") Integer pageSize,
         @RequestBody(required = false) Product product) {
@@ -146,7 +147,7 @@ public ResponseEntity<IPage<Product>> selectGoodsPage(
     // 调用Service层获取分页数据
     IPage<Product> page = goodsService.selectGoodsPage(pageNum, pageSize, product);
     // 返回统一格式的响应
-    return ResponseEntity.ok(page);
+    return R.SUCCESS(page);
 }
 
 

+ 0 - 1
yami-shop-security/yami-shop-security-comment/src/main/java/com/yami/shop/security/comment/filter/YamiAuthenticationProcessingFilter.java

@@ -1,6 +1,5 @@
 package com.yami.shop.security.comment.filter;
 
-import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.extra.servlet.ServletUtil;
 import com.yami.shop.common.util.HttpContextUtils;

+ 0 - 0
yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/GoodsService.java → yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/HBGoodsService.java