Browse Source

修改商家后台管理

liude 1 year ago
parent
commit
8bb9e1f5b0

+ 4 - 5
src/main/java/com/chelvc/cloud/admin/controller/CouponController.java

@@ -4,13 +4,12 @@ import com.chelvc.cloud.vehicle.api.dto.CouponDTO;
 import com.chelvc.cloud.vehicle.api.param.CouponModifyParam;
 import com.chelvc.cloud.vehicle.api.param.CouponPagingParam;
 import com.chelvc.cloud.vehicle.api.service.CouponService;
-import com.chelvc.framework.base.annotation.UnifiedResponseBody;
-import com.chelvc.framework.base.model.Pagination;
+import com.chelvc.framework.base.annotation.ResponseWrapping;
+import com.chelvc.framework.common.model.Pagination;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
-
 import javax.validation.Valid;
 import javax.validation.constraints.Min;
 
@@ -22,8 +21,8 @@ import javax.validation.constraints.Min;
  **/
 @Validated
 @RestController
-@UnifiedResponseBody
-//@PreAuthorize("isBusiness('COUPON')")
+@ResponseWrapping
+@PreAuthorize("isBusiness('EMPLOYEE')")
 public class CouponController {
     @DubboReference
     private CouponService couponService;

+ 4 - 4
src/main/java/com/chelvc/cloud/admin/controller/GoodsController.java

@@ -3,8 +3,8 @@ import com.chelvc.cloud.vehicle.api.dto.GoodsDTO;
 import com.chelvc.cloud.vehicle.api.param.GoodsModifyParam;
 import com.chelvc.cloud.vehicle.api.param.GoodsPagingParam;
 import com.chelvc.cloud.vehicle.api.service.GoodsService;
-import com.chelvc.framework.base.annotation.UnifiedResponseBody;
-import com.chelvc.framework.base.model.Pagination;
+import com.chelvc.framework.base.annotation.ResponseWrapping;
+import com.chelvc.framework.common.model.Pagination;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
@@ -21,8 +21,8 @@ import javax.validation.constraints.Min;
  **/
 @Validated
 @RestController
-@UnifiedResponseBody
-//@PreAuthorize("isBusiness('GOODS')")
+@ResponseWrapping
+@PreAuthorize("isBusiness('EMPLOYEE')")
 public class GoodsController {
     @DubboReference
     private GoodsService goodsService;

+ 0 - 2
src/main/java/com/chelvc/cloud/admin/controller/MenuController.java

@@ -64,8 +64,6 @@ public class MenuController {
      */
     @GetMapping("/menu/delete/{id}")
     public void deleteMenu(@PathVariable("id") @Min(value = 1, message = "菜单主键不能小于1") Long id) {
-        MenuDTO menu = this.menuService.getMenu(id);
-        ErrorUtils.requireResource(menu, "菜单不存在");
         this.menuService.deleteMenu(id);
     }