Ver Fonte

refactor: 响应增强器(GlobalResponseAdvice) + 61个控制器简化

docker há 2 meses atrás
pai
commit
4a66a5f8f2
52 ficheiros alterados com 708 adições e 754 exclusões
  1. 61 0
      backend/src/main/java/com/oms/common/GlobalResponseAdvice.java
  2. 17 25
      backend/src/main/java/com/oms/controller/AfterSaleController.java
  3. 16 13
      backend/src/main/java/com/oms/controller/AiChannelController.java
  4. 10 13
      backend/src/main/java/com/oms/controller/AutoReplyRuleController.java
  5. 17 23
      backend/src/main/java/com/oms/controller/ChannelController.java
  6. 20 24
      backend/src/main/java/com/oms/controller/ChannelMappingController.java
  7. 10 13
      backend/src/main/java/com/oms/controller/ChatMessageController.java
  8. 10 13
      backend/src/main/java/com/oms/controller/ChatSessionController.java
  9. 20 14
      backend/src/main/java/com/oms/controller/CouponController.java
  10. 2 3
      backend/src/main/java/com/oms/controller/DashboardController.java
  11. 13 17
      backend/src/main/java/com/oms/controller/FinancePaymentController.java
  12. 13 17
      backend/src/main/java/com/oms/controller/FinanceRefundController.java
  13. 17 23
      backend/src/main/java/com/oms/controller/InventoryController.java
  14. 9 12
      backend/src/main/java/com/oms/controller/InventoryLogController.java
  15. 10 13
      backend/src/main/java/com/oms/controller/InventoryTurnoverController.java
  16. 18 15
      backend/src/main/java/com/oms/controller/InvoiceController.java
  17. 17 14
      backend/src/main/java/com/oms/controller/IqcController.java
  18. 16 13
      backend/src/main/java/com/oms/controller/KnowledgeBaseController.java
  19. 10 13
      backend/src/main/java/com/oms/controller/KnowledgeCategoryController.java
  20. 10 13
      backend/src/main/java/com/oms/controller/LogisticsProviderController.java
  21. 9 12
      backend/src/main/java/com/oms/controller/OrderItemController.java
  22. 9 12
      backend/src/main/java/com/oms/controller/OrderOperationLogController.java
  23. 9 12
      backend/src/main/java/com/oms/controller/OrderStatusEventController.java
  24. 23 35
      backend/src/main/java/com/oms/controller/OrdersController.java
  25. 10 13
      backend/src/main/java/com/oms/controller/PriceWatchController.java
  26. 11 14
      backend/src/main/java/com/oms/controller/ProductCategoryController.java
  27. 15 20
      backend/src/main/java/com/oms/controller/ProductController.java
  28. 11 14
      backend/src/main/java/com/oms/controller/ProductSkuController.java
  29. 20 14
      backend/src/main/java/com/oms/controller/PromotionController.java
  30. 11 14
      backend/src/main/java/com/oms/controller/PurchaseArrivalController.java
  31. 9 12
      backend/src/main/java/com/oms/controller/PurchaseArrivalItemController.java
  32. 13 17
      backend/src/main/java/com/oms/controller/PurchaseOrderController.java
  33. 9 12
      backend/src/main/java/com/oms/controller/PurchaseOrderItemController.java
  34. 21 15
      backend/src/main/java/com/oms/controller/PurchaseRequestController.java
  35. 11 14
      backend/src/main/java/com/oms/controller/ReplenishmentPlanController.java
  36. 22 16
      backend/src/main/java/com/oms/controller/ReturnPackageController.java
  37. 10 13
      backend/src/main/java/com/oms/controller/ServicePerformanceController.java
  38. 15 21
      backend/src/main/java/com/oms/controller/ShippingOrderController.java
  39. 12 15
      backend/src/main/java/com/oms/controller/ShippingTemplateController.java
  40. 12 15
      backend/src/main/java/com/oms/controller/SupplierController.java
  41. 10 13
      backend/src/main/java/com/oms/controller/SupplierPerformanceController.java
  42. 15 19
      backend/src/main/java/com/oms/controller/SupplierSettlementController.java
  43. 8 12
      backend/src/main/java/com/oms/controller/SysApiKeyController.java
  44. 24 15
      backend/src/main/java/com/oms/controller/SysApprovalFlowController.java
  45. 10 13
      backend/src/main/java/com/oms/controller/SysDepartmentController.java
  46. 10 13
      backend/src/main/java/com/oms/controller/SysEmployeeController.java
  47. 10 13
      backend/src/main/java/com/oms/controller/SysMessageTemplateController.java
  48. 8 11
      backend/src/main/java/com/oms/controller/SysNotificationController.java
  49. 5 6
      backend/src/main/java/com/oms/controller/SysOperationLogController.java
  50. 8 12
      backend/src/main/java/com/oms/controller/SysRoleController.java
  51. 12 13
      backend/src/main/java/com/oms/controller/SysUserController.java
  52. 10 13
      backend/src/main/java/com/oms/controller/WarehouseController.java

+ 61 - 0
backend/src/main/java/com/oms/common/GlobalResponseAdvice.java

@@ -0,0 +1,61 @@
+package com.oms.common;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.core.MethodParameter;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.server.ServerHttpRequest;
+import org.springframework.http.server.ServerHttpResponse;
+import org.springframework.http.server.ServletServerHttpRequest;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
+
+import jakarta.servlet.http.HttpServletRequest;
+
+@Slf4j
+@RestControllerAdvice
+public class GlobalResponseAdvice implements ResponseBodyAdvice<Object> {
+
+    @Override
+    public boolean supports(MethodParameter returnType, Class<? extends HttpMessageConverter<?>> converterType) {
+        String className = returnType.getDeclaringClass().getName();
+        return className.startsWith("com.oms.controller");
+    }
+
+    @Override
+    public Object beforeBodyWrite(Object body, MethodParameter returnType, MediaType contentType,
+                                  Class<? extends HttpMessageConverter<?>> converterType,
+                                  ServerHttpRequest request, ServerHttpResponse response) {
+        if (body == null) {
+            return ApiResponse.success();
+        }
+        if (body instanceof ApiResponse) {
+            return body;
+        }
+        if (body instanceof ResponseEntity) {
+            ResponseEntity<?> re = (ResponseEntity<?>) body;
+            return ApiResponse.success(re.getBody());
+        }
+        return ApiResponse.success(body);
+    }
+
+    @ExceptionHandler(Exception.class)
+    public ApiResponse<Void> handleException(Exception e, HttpServletRequest request) {
+        log.error("接口 {} 异常: {}", request.getRequestURI(), e.getMessage(), e);
+        return ApiResponse.serverError("服务器内部错误: " + e.getMessage());
+    }
+
+    @ExceptionHandler(IllegalArgumentException.class)
+    public ApiResponse<Void> handleIllegalArgument(IllegalArgumentException e, HttpServletRequest request) {
+        return ApiResponse.badRequest(e.getMessage());
+    }
+
+    @ExceptionHandler(NullPointerException.class)
+    public ApiResponse<Void> handleNullPointer(NullPointerException e, HttpServletRequest request) {
+        log.error("接口 {} 空指针异常: {}", request.getRequestURI(), e.getMessage(), e);
+        return ApiResponse.serverError("数据不存在或未初始化");
+    }
+}

+ 17 - 25
backend/src/main/java/com/oms/controller/AfterSaleController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.AfterSaleDTO;
 import com.oms.entity.AfterSale;
 import com.oms.service.AfterSaleService;
@@ -17,72 +16,65 @@ public class AfterSaleController {
     private final AfterSaleService afterSaleService;
 
     @GetMapping
-    public ApiResponse<List<AfterSale>> getAfterSales(
+    public List<AfterSale> getAfterSales(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(afterSaleService.getPage(page, size).getRecords());
+        return afterSaleService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<AfterSale>> getAll() {
-        return ApiResponse.success(afterSaleService.getAll());
+    public List<AfterSale> getAll() {
+        return afterSaleService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<AfterSaleDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(afterSaleService.getDtoById(id));
+    public AfterSaleDTO getById(@PathVariable Long id) {
+        return afterSaleService.getDtoById(id);
     }
 
     @GetMapping("/after-sale-no/{afterSaleNo}")
-    public ApiResponse<AfterSale> getByAfterSaleNo(@PathVariable String afterSaleNo) {
-        return ApiResponse.success(afterSaleService.getByAfterSaleNo(afterSaleNo));
+    public AfterSale getByAfterSaleNo(@PathVariable String afterSaleNo) {
+        return afterSaleService.getByAfterSaleNo(afterSaleNo);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody AfterSale afterSale) {
-        return ApiResponse.success(afterSaleService.save(afterSale));
+    public Long create(@RequestBody AfterSale afterSale) {
+        return afterSaleService.save(afterSale);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody AfterSale afterSale) {
+    public void update(@PathVariable Long id, @RequestBody AfterSale afterSale) {
         afterSale.setId(id);
         afterSaleService.update(afterSale);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         afterSaleService.delete(id);
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/approve")
-    public ApiResponse<Void> approve(@PathVariable Long id, @RequestParam(required = false) String remark) {
+    public void approve(@PathVariable Long id, @RequestParam(required = false) String remark) {
         afterSaleService.approve(id, remark, "SYSTEM");
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/reject")
-    public ApiResponse<Void> reject(@PathVariable Long id, @RequestParam String reason) {
+    public void reject(@PathVariable Long id, @RequestParam String reason) {
         afterSaleService.reject(id, reason, "SYSTEM");
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/process-refund")
-    public ApiResponse<Void> processRefund(@PathVariable Long id) {
+    public void processRefund(@PathVariable Long id) {
         afterSaleService.processRefund(id, "SYSTEM");
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/submit-return-tracking")
-    public ApiResponse<Void> submitReturnTracking(@PathVariable Long id, @RequestParam String carrier, @RequestParam String trackingNo) {
+    public void submitReturnTracking(@PathVariable Long id, @RequestParam String carrier, @RequestParam String trackingNo) {
         afterSaleService.submitReturnTracking(id, carrier, trackingNo, "SYSTEM");
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/confirm-receipt")
-    public ApiResponse<Void> confirmReceipt(@PathVariable Long id) {
+    public void confirmReceipt(@PathVariable Long id) {
         afterSaleService.confirmReceipt(id, "SYSTEM");
-        return ApiResponse.success(null);
     }
 }

+ 16 - 13
backend/src/main/java/com/oms/controller/AiChannelController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.AiChannelDTO;
 import com.oms.entity.AiChannel;
 import com.oms.service.AiChannelService;
@@ -16,36 +15,40 @@ public class AiChannelController {
     private final AiChannelService aiChannelService;
 
     @GetMapping
-    public ApiResponse<List<AiChannel>> getAiChannels(
+    public List<AiChannel> getAiChannels(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(aiChannelService.getPage(page, size).getRecords());
+        return aiChannelService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<AiChannel>> getAll() {
-        return ApiResponse.success(aiChannelService.getAll());
+    public List<AiChannel> getAll() {
+        return aiChannelService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<AiChannelDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(aiChannelService.getDtoById(id));
+    public AiChannelDTO getById(@PathVariable Long id) {
+        return aiChannelService.getDtoById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody AiChannel aiChannel) {
-        return ApiResponse.success(aiChannelService.save(aiChannel));
+    public Long create(@RequestBody AiChannel aiChannel) {
+        return aiChannelService.save(aiChannel);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody AiChannel aiChannel) {
+    public void update(@PathVariable Long id, @RequestBody AiChannel aiChannel) {
         aiChannel.setId(id);
         aiChannelService.update(aiChannel);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) { aiChannelService.delete(id); return ApiResponse.success(null); }
+    public void delete(@PathVariable Long id) {
+        aiChannelService.delete(id);
+    }
+
     @PostMapping("/{id}/toggle-enabled")
-    public ApiResponse<Void> toggleEnabled(@PathVariable Long id, @RequestParam boolean enabled) { aiChannelService.toggleEnabled(id, enabled); return ApiResponse.success(null); }
+    public void toggleEnabled(@PathVariable Long id, @RequestParam boolean enabled) {
+        aiChannelService.toggleEnabled(id, enabled);
+    }
 }

+ 10 - 13
backend/src/main/java/com/oms/controller/AutoReplyRuleController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.AutoReplyRuleDTO;
 import com.oms.entity.AutoReplyRule;
 import com.oms.service.AutoReplyRuleService;
@@ -16,37 +15,35 @@ public class AutoReplyRuleController {
     private final AutoReplyRuleService autoReplyRuleService;
 
     @GetMapping
-    public ApiResponse<List<AutoReplyRule>> getAutoReplyRules(
+    public List<AutoReplyRule> getAutoReplyRules(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(autoReplyRuleService.getPage(page, size).getRecords());
+        return autoReplyRuleService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<AutoReplyRule>> getAll() {
-        return ApiResponse.success(autoReplyRuleService.getAll());
+    public List<AutoReplyRule> getAll() {
+        return autoReplyRuleService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<AutoReplyRuleDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(autoReplyRuleService.getDtoById(id));
+    public AutoReplyRuleDTO getById(@PathVariable Long id) {
+        return autoReplyRuleService.getDtoById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody AutoReplyRule autoReplyRule) {
-        return ApiResponse.success(autoReplyRuleService.save(autoReplyRule));
+    public Long create(@RequestBody AutoReplyRule autoReplyRule) {
+        return autoReplyRuleService.save(autoReplyRule);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody AutoReplyRule autoReplyRule) {
+    public void update(@PathVariable Long id, @RequestBody AutoReplyRule autoReplyRule) {
         autoReplyRule.setId(id);
         autoReplyRuleService.update(autoReplyRule);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         autoReplyRuleService.delete(id);
-        return ApiResponse.success(null);
     }
 }

+ 17 - 23
backend/src/main/java/com/oms/controller/ChannelController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.ChannelDTO;
 import com.oms.entity.Channel;
 import com.oms.service.ChannelService;
@@ -17,65 +16,60 @@ public class ChannelController {
     private final ChannelService channelService;
 
     @GetMapping
-    public ApiResponse<List<Channel>> getChannels(
+    public List<Channel> getChannels(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(channelService.getPage(page, size).getRecords());
+        return channelService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<Channel>> getAll() {
-        return ApiResponse.success(channelService.getAll());
+    public List<Channel> getAll() {
+        return channelService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<ChannelDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(channelService.getDtoById(id));
+    public ChannelDTO getById(@PathVariable Long id) {
+        return channelService.getDtoById(id);
     }
 
     @GetMapping("/code/{channelCode}")
-    public ApiResponse<Channel> getByChannelCode(@PathVariable String channelCode) {
-        return ApiResponse.success(channelService.getByChannelCode(channelCode));
+    public Channel getByChannelCode(@PathVariable String channelCode) {
+        return channelService.getByChannelCode(channelCode);
     }
 
     @GetMapping("/token-status/{tokenStatus}")
-    public ApiResponse<List<Channel>> getByTokenStatus(@PathVariable String tokenStatus) {
-        return ApiResponse.success(channelService.getByTokenStatus(tokenStatus));
+    public List<Channel> getByTokenStatus(@PathVariable String tokenStatus) {
+        return channelService.getByTokenStatus(tokenStatus);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody Channel channel) {
-        return ApiResponse.success(channelService.save(channel));
+    public Long create(@RequestBody Channel channel) {
+        return channelService.save(channel);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody Channel channel) {
+    public void update(@PathVariable Long id, @RequestBody Channel channel) {
         channel.setId(id);
         channelService.update(channel);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         channelService.delete(id);
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/test-connection")
-    public ApiResponse<Void> testConnection(@PathVariable Long id) {
+    public void testConnection(@PathVariable Long id) {
         channelService.testConnection(id);
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/toggle-sync")
-    public ApiResponse<Void> toggleSync(@PathVariable Long id, @RequestParam boolean enabled) {
+    public void toggleSync(@PathVariable Long id, @RequestParam boolean enabled) {
         channelService.toggleSync(id, enabled);
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/reauthorize")
-    public ApiResponse<Void> reauthorize(@PathVariable Long id) {
+    public void reauthorize(@PathVariable Long id) {
         channelService.reauthorize(id);
-        return ApiResponse.success(null);
     }
 }

+ 20 - 24
backend/src/main/java/com/oms/controller/ChannelMappingController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.entity.ChannelMapping;
 import com.oms.service.ChannelMappingService;
 import lombok.RequiredArgsConstructor;
@@ -16,63 +15,60 @@ public class ChannelMappingController {
     private final ChannelMappingService channelMappingService;
 
     @GetMapping
-    public ApiResponse<List<ChannelMapping>> getMappings(
+    public List<ChannelMapping> getMappings(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(channelMappingService.getMappings(page, size).getRecords());
+        return channelMappingService.getMappings(page, size).getRecords();
     }
 
     @GetMapping("/product/{productId}")
-    public ApiResponse<List<ChannelMapping>> getByProductId(@PathVariable Long productId) {
-        return ApiResponse.success(channelMappingService.getByProductId(productId));
+    public List<ChannelMapping> getByProductId(@PathVariable Long productId) {
+        return channelMappingService.getByProductId(productId);
     }
 
     @GetMapping("/sku/{skuId}")
-    public ApiResponse<List<ChannelMapping>> getBySkuId(@PathVariable Long skuId) {
-        return ApiResponse.success(channelMappingService.getBySkuId(skuId));
+    public List<ChannelMapping> getBySkuId(@PathVariable Long skuId) {
+        return channelMappingService.getBySkuId(skuId);
     }
 
     @GetMapping("/channel/{channelId}")
-    public ApiResponse<List<ChannelMapping>> getByChannelId(@PathVariable Long channelId) {
-        return ApiResponse.success(channelMappingService.getByChannelId(channelId));
+    public List<ChannelMapping> getByChannelId(@PathVariable Long channelId) {
+        return channelMappingService.getByChannelId(channelId);
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<ChannelMapping> getById(@PathVariable Long id) {
-        return ApiResponse.success(channelMappingService.getById(id));
+    public ChannelMapping getById(@PathVariable Long id) {
+        return channelMappingService.getById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody ChannelMapping mapping) {
-        return ApiResponse.success(channelMappingService.save(mapping));
+    public Long create(@RequestBody ChannelMapping mapping) {
+        return channelMappingService.save(mapping);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody ChannelMapping mapping) {
+    public void update(@PathVariable Long id, @RequestBody ChannelMapping mapping) {
         mapping.setId(id);
         channelMappingService.update(mapping);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         channelMappingService.delete(id);
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/validate")
-    public ApiResponse<String> validate(@PathVariable Long id) {
-        return ApiResponse.success(channelMappingService.validate(id));
+    public String validate(@PathVariable Long id) {
+        return channelMappingService.validate(id);
     }
 
     @PostMapping("/{id}/publish")
-    public ApiResponse<Void> publish(@PathVariable Long id) {
+    public void publish(@PathVariable Long id) {
         channelMappingService.publish(id);
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/auto-map")
-    public ApiResponse<java.util.List<Long>> autoMap(@RequestParam Long productId, @RequestParam Long channelId) {
-        return ApiResponse.success(channelMappingService.autoMap(productId, channelId));
+    public List<Long> autoMap(@RequestParam Long productId, @RequestParam Long channelId) {
+        return channelMappingService.autoMap(productId, channelId);
     }
-}
+}

+ 10 - 13
backend/src/main/java/com/oms/controller/ChatMessageController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.ChatMessageDTO;
 import com.oms.entity.ChatMessage;
 import com.oms.service.ChatMessageService;
@@ -16,37 +15,35 @@ public class ChatMessageController {
     private final ChatMessageService chatMessageService;
 
     @GetMapping
-    public ApiResponse<List<ChatMessage>> getChatMessages(
+    public List<ChatMessage> getChatMessages(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(chatMessageService.getPage(page, size).getRecords());
+        return chatMessageService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<ChatMessage>> getAll() {
-        return ApiResponse.success(chatMessageService.getAll());
+    public List<ChatMessage> getAll() {
+        return chatMessageService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<ChatMessageDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(chatMessageService.getDtoById(id));
+    public ChatMessageDTO getById(@PathVariable Long id) {
+        return chatMessageService.getDtoById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody ChatMessage chatMessage) {
-        return ApiResponse.success(chatMessageService.save(chatMessage));
+    public Long create(@RequestBody ChatMessage chatMessage) {
+        return chatMessageService.save(chatMessage);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody ChatMessage chatMessage) {
+    public void update(@PathVariable Long id, @RequestBody ChatMessage chatMessage) {
         chatMessage.setId(id);
         chatMessageService.update(chatMessage);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         chatMessageService.delete(id);
-        return ApiResponse.success(null);
     }
 }

+ 10 - 13
backend/src/main/java/com/oms/controller/ChatSessionController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.ChatSessionDTO;
 import com.oms.entity.ChatSession;
 import com.oms.service.ChatSessionService;
@@ -16,37 +15,35 @@ public class ChatSessionController {
     private final ChatSessionService chatSessionService;
 
     @GetMapping
-    public ApiResponse<List<ChatSession>> getChatSessions(
+    public List<ChatSession> getChatSessions(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(chatSessionService.getPage(page, size).getRecords());
+        return chatSessionService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<ChatSession>> getAll() {
-        return ApiResponse.success(chatSessionService.getAll());
+    public List<ChatSession> getAll() {
+        return chatSessionService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<ChatSessionDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(chatSessionService.getDtoById(id));
+    public ChatSessionDTO getById(@PathVariable Long id) {
+        return chatSessionService.getDtoById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody ChatSession chatSession) {
-        return ApiResponse.success(chatSessionService.save(chatSession));
+    public Long create(@RequestBody ChatSession chatSession) {
+        return chatSessionService.save(chatSession);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody ChatSession chatSession) {
+    public void update(@PathVariable Long id, @RequestBody ChatSession chatSession) {
         chatSession.setId(id);
         chatSessionService.update(chatSession);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         chatSessionService.delete(id);
-        return ApiResponse.success(null);
     }
 }

+ 20 - 14
backend/src/main/java/com/oms/controller/CouponController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.CouponDTO;
 import com.oms.entity.Coupon;
 import com.oms.service.CouponService;
@@ -16,38 +15,45 @@ public class CouponController {
     private final CouponService couponService;
 
     @GetMapping
-    public ApiResponse<List<Coupon>> getCoupons(
+    public List<Coupon> getCoupons(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(couponService.getPage(page, size).getRecords());
+        return couponService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<Coupon>> getAll() {
-        return ApiResponse.success(couponService.getAll());
+    public List<Coupon> getAll() {
+        return couponService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<CouponDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(couponService.getDtoById(id));
+    public CouponDTO getById(@PathVariable Long id) {
+        return couponService.getDtoById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody Coupon coupon) {
-        return ApiResponse.success(couponService.save(coupon));
+    public Long create(@RequestBody Coupon coupon) {
+        return couponService.save(coupon);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody Coupon coupon) {
+    public void update(@PathVariable Long id, @RequestBody Coupon coupon) {
         coupon.setId(id);
         couponService.update(coupon);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) { couponService.delete(id); return ApiResponse.success(null); }
+    public void delete(@PathVariable Long id) {
+        couponService.delete(id);
+    }
+
     @PostMapping("/{id}/issue")
-    public ApiResponse<Void> issue(@PathVariable Long id, @RequestParam int qty) { couponService.issue(id, qty); return ApiResponse.success(null); }
+    public void issue(@PathVariable Long id, @RequestParam int qty) {
+        couponService.issue(id, qty);
+    }
+
     @PostMapping("/{id}/use")
-    public ApiResponse<Void> use(@PathVariable Long id) { couponService.use(id); return ApiResponse.success(null); }
+    public void use(@PathVariable Long id) {
+        couponService.use(id);
+    }
 }

+ 2 - 3
backend/src/main/java/com/oms/controller/DashboardController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.service.DashboardService;
 import lombok.RequiredArgsConstructor;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -16,7 +15,7 @@ public class DashboardController {
     private final DashboardService dashboardService;
 
     @GetMapping("/overview")
-    public ApiResponse<Map<String, Object>> getOverview() {
-        return ApiResponse.success(dashboardService.getOverview());
+    public Map<String, Object> getOverview() {
+        return dashboardService.getOverview();
     }
 }

+ 13 - 17
backend/src/main/java/com/oms/controller/FinancePaymentController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.FinancePaymentDTO;
 import com.oms.entity.FinancePayment;
 import com.oms.service.FinancePaymentService;
@@ -17,48 +16,45 @@ public class FinancePaymentController {
     private final FinancePaymentService financePaymentService;
 
     @GetMapping
-    public ApiResponse<List<FinancePayment>> getPayments(
+    public List<FinancePayment> getPayments(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(financePaymentService.getPage(page, size).getRecords());
+        return financePaymentService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<FinancePayment>> getAll() {
-        return ApiResponse.success(financePaymentService.getAll());
+    public List<FinancePayment> getAll() {
+        return financePaymentService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<FinancePaymentDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(financePaymentService.getDtoById(id));
+    public FinancePaymentDTO getById(@PathVariable Long id) {
+        return financePaymentService.getDtoById(id);
     }
 
     @GetMapping("/payment-no/{paymentNo}")
-    public ApiResponse<FinancePayment> getByPaymentNo(@PathVariable String paymentNo) {
-        return ApiResponse.success(financePaymentService.getByPaymentNo(paymentNo));
+    public FinancePayment getByPaymentNo(@PathVariable String paymentNo) {
+        return financePaymentService.getByPaymentNo(paymentNo);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody FinancePayment payment) {
-        return ApiResponse.success(financePaymentService.save(payment));
+    public Long create(@RequestBody FinancePayment payment) {
+        return financePaymentService.save(payment);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody FinancePayment payment) {
+    public void update(@PathVariable Long id, @RequestBody FinancePayment payment) {
         payment.setId(id);
         financePaymentService.update(payment);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         financePaymentService.delete(id);
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/reconcile")
-    public ApiResponse<Void> reconcile(@PathVariable Long id) {
+    public void reconcile(@PathVariable Long id) {
         financePaymentService.reconcile(id);
-        return ApiResponse.success(null);
     }
 }

+ 13 - 17
backend/src/main/java/com/oms/controller/FinanceRefundController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.FinanceRefundDTO;
 import com.oms.entity.FinanceRefund;
 import com.oms.service.FinanceRefundService;
@@ -17,48 +16,45 @@ public class FinanceRefundController {
     private final FinanceRefundService financeRefundService;
 
     @GetMapping
-    public ApiResponse<List<FinanceRefund>> getRefunds(
+    public List<FinanceRefund> getRefunds(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(financeRefundService.getPage(page, size).getRecords());
+        return financeRefundService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<FinanceRefund>> getAll() {
-        return ApiResponse.success(financeRefundService.getAll());
+    public List<FinanceRefund> getAll() {
+        return financeRefundService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<FinanceRefundDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(financeRefundService.getDtoById(id));
+    public FinanceRefundDTO getById(@PathVariable Long id) {
+        return financeRefundService.getDtoById(id);
     }
 
     @GetMapping("/refund-no/{refundNo}")
-    public ApiResponse<FinanceRefund> getByRefundNo(@PathVariable String refundNo) {
-        return ApiResponse.success(financeRefundService.getByRefundNo(refundNo));
+    public FinanceRefund getByRefundNo(@PathVariable String refundNo) {
+        return financeRefundService.getByRefundNo(refundNo);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody FinanceRefund refund) {
-        return ApiResponse.success(financeRefundService.save(refund));
+    public Long create(@RequestBody FinanceRefund refund) {
+        return financeRefundService.save(refund);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody FinanceRefund refund) {
+    public void update(@PathVariable Long id, @RequestBody FinanceRefund refund) {
         refund.setId(id);
         financeRefundService.update(refund);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         financeRefundService.delete(id);
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/process-refund")
-    public ApiResponse<Void> processRefund(@PathVariable Long id) {
+    public void processRefund(@PathVariable Long id) {
         financeRefundService.processRefund(id);
-        return ApiResponse.success(null);
     }
 }

+ 17 - 23
backend/src/main/java/com/oms/controller/InventoryController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.InventoryDTO;
 import com.oms.entity.Inventory;
 import com.oms.service.InventoryService;
@@ -17,66 +16,63 @@ public class InventoryController {
     private final InventoryService inventoryService;
 
     @GetMapping
-    public ApiResponse<List<Inventory>> getInventories(
+    public List<Inventory> getInventories(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(inventoryService.getPage(page, size).getRecords());
+        return inventoryService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<Inventory>> getAll() {
-        return ApiResponse.success(inventoryService.getAll());
+    public List<Inventory> getAll() {
+        return inventoryService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<InventoryDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(inventoryService.getDtoById(id));
+    public InventoryDTO getById(@PathVariable Long id) {
+        return inventoryService.getDtoById(id);
     }
 
     @GetMapping("/sku/{skuId}")
-    public ApiResponse<List<Inventory>> getBySkuId(@PathVariable Long skuId) {
-        return ApiResponse.success(inventoryService.getBySkuId(skuId));
+    public List<Inventory> getBySkuId(@PathVariable Long skuId) {
+        return inventoryService.getBySkuId(skuId);
     }
 
     @GetMapping("/sku/{skuId}/warehouse/{warehouseId}")
-    public ApiResponse<Inventory> getBySkuIdAndWarehouseId(
+    public Inventory getBySkuIdAndWarehouseId(
             @PathVariable Long skuId,
             @PathVariable Long warehouseId) {
-        return ApiResponse.success(inventoryService.getBySkuIdAndWarehouseId(skuId, warehouseId));
+        return inventoryService.getBySkuIdAndWarehouseId(skuId, warehouseId);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody Inventory inventory) {
-        return ApiResponse.success(inventoryService.save(inventory));
+    public Long create(@RequestBody Inventory inventory) {
+        return inventoryService.save(inventory);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody Inventory inventory) {
+    public void update(@PathVariable Long id, @RequestBody Inventory inventory) {
         inventory.setId(id);
         inventoryService.update(inventory);
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/lock")
-    public ApiResponse<Void> lockInventory(
+    public void lockInventory(
             @PathVariable Long id,
             @RequestParam int qty,
             @RequestParam String operator) {
         inventoryService.lockInventory(id, qty, operator);
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/unlock")
-    public ApiResponse<Void> unlockInventory(
+    public void unlockInventory(
             @PathVariable Long id,
             @RequestParam int qty,
             @RequestParam String operator) {
         inventoryService.unlockInventory(id, qty, operator);
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/increment")
-    public ApiResponse<Void> incrementInventory(
+    public void incrementInventory(
             @PathVariable Long id,
             @RequestParam int qty,
             @RequestParam String changeType,
@@ -84,12 +80,10 @@ public class InventoryController {
             @RequestParam(required = false) Long orderId,
             @RequestParam(required = false) String orderNo) {
         inventoryService.incrementInventory(id, qty, changeType, operator, orderId, orderNo);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         inventoryService.delete(id);
-        return ApiResponse.success(null);
     }
 }

+ 9 - 12
backend/src/main/java/com/oms/controller/InventoryLogController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.entity.InventoryLog;
 import com.oms.service.InventoryLogService;
 import lombok.RequiredArgsConstructor;
@@ -16,30 +15,28 @@ public class InventoryLogController {
     private final InventoryLogService inventoryLogService;
 
     @GetMapping("/{inventoryId}/logs")
-    public ApiResponse<List<InventoryLog>> getByInventoryId(@PathVariable Long inventoryId) {
-        return ApiResponse.success(inventoryLogService.getAll());
+    public List<InventoryLog> getByInventoryId(@PathVariable Long inventoryId) {
+        return inventoryLogService.getAll();
     }
 
     @GetMapping("/log/{id}")
-    public ApiResponse<InventoryLog> getById(@PathVariable Long id) {
-        return ApiResponse.success(inventoryLogService.getById(id));
+    public InventoryLog getById(@PathVariable Long id) {
+        return inventoryLogService.getById(id);
     }
 
     @PostMapping("/log")
-    public ApiResponse<Long> create(@RequestBody InventoryLog inventoryLog) {
-        return ApiResponse.success(inventoryLogService.save(inventoryLog));
+    public Long create(@RequestBody InventoryLog inventoryLog) {
+        return inventoryLogService.save(inventoryLog);
     }
 
     @PutMapping("/log/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody InventoryLog inventoryLog) {
+    public void update(@PathVariable Long id, @RequestBody InventoryLog inventoryLog) {
         inventoryLog.setId(id);
         inventoryLogService.update(inventoryLog);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/log/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         inventoryLogService.delete(id);
-        return ApiResponse.success(null);
     }
-}
+}

+ 10 - 13
backend/src/main/java/com/oms/controller/InventoryTurnoverController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.InventoryTurnoverDTO;
 import com.oms.entity.InventoryTurnover;
 import com.oms.service.InventoryTurnoverService;
@@ -16,37 +15,35 @@ public class InventoryTurnoverController {
     private final InventoryTurnoverService inventoryTurnoverService;
 
     @GetMapping
-    public ApiResponse<List<InventoryTurnover>> getInventoryTurnovers(
+    public List<InventoryTurnover> getInventoryTurnovers(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(inventoryTurnoverService.getPage(page, size).getRecords());
+        return inventoryTurnoverService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<InventoryTurnover>> getAll() {
-        return ApiResponse.success(inventoryTurnoverService.getAll());
+    public List<InventoryTurnover> getAll() {
+        return inventoryTurnoverService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<InventoryTurnoverDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(inventoryTurnoverService.getDtoById(id));
+    public InventoryTurnoverDTO getById(@PathVariable Long id) {
+        return inventoryTurnoverService.getDtoById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody InventoryTurnover inventoryTurnover) {
-        return ApiResponse.success(inventoryTurnoverService.save(inventoryTurnover));
+    public Long create(@RequestBody InventoryTurnover inventoryTurnover) {
+        return inventoryTurnoverService.save(inventoryTurnover);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody InventoryTurnover inventoryTurnover) {
+    public void update(@PathVariable Long id, @RequestBody InventoryTurnover inventoryTurnover) {
         inventoryTurnover.setId(id);
         inventoryTurnoverService.update(inventoryTurnover);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         inventoryTurnoverService.delete(id);
-        return ApiResponse.success(null);
     }
 }

+ 18 - 15
backend/src/main/java/com/oms/controller/InvoiceController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.InvoiceDTO;
 import com.oms.entity.Invoice;
 import com.oms.service.InvoiceService;
@@ -17,41 +16,45 @@ public class InvoiceController {
     private final InvoiceService invoiceService;
 
     @GetMapping
-    public ApiResponse<List<Invoice>> getInvoices(
+    public List<Invoice> getInvoices(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(invoiceService.getPage(page, size).getRecords());
+        return invoiceService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<Invoice>> getAll() {
-        return ApiResponse.success(invoiceService.getAll());
+    public List<Invoice> getAll() {
+        return invoiceService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<InvoiceDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(invoiceService.getDtoById(id));
+    public InvoiceDTO getById(@PathVariable Long id) {
+        return invoiceService.getDtoById(id);
     }
 
     @GetMapping("/invoice-no/{invoiceNo}")
-    public ApiResponse<Invoice> getByInvoiceNo(@PathVariable String invoiceNo) {
-        return ApiResponse.success(invoiceService.getByInvoiceNo(invoiceNo));
+    public Invoice getByInvoiceNo(@PathVariable String invoiceNo) {
+        return invoiceService.getByInvoiceNo(invoiceNo);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody Invoice invoice) {
-        return ApiResponse.success(invoiceService.save(invoice));
+    public Long create(@RequestBody Invoice invoice) {
+        return invoiceService.save(invoice);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody Invoice invoice) {
+    public void update(@PathVariable Long id, @RequestBody Invoice invoice) {
         invoice.setId(id);
         invoiceService.update(invoice);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) { invoiceService.delete(id); return ApiResponse.success(null); }
+    public void delete(@PathVariable Long id) {
+        invoiceService.delete(id);
+    }
+
     @PostMapping("/{id}/issue")
-    public ApiResponse<Void> issue(@PathVariable Long id) { invoiceService.issue(id); return ApiResponse.success(null); }
+    public void issue(@PathVariable Long id) {
+        invoiceService.issue(id);
+    }
 }

+ 17 - 14
backend/src/main/java/com/oms/controller/IqcController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.IqcDTO;
 import com.oms.entity.Iqc;
 import com.oms.service.IqcService;
@@ -15,34 +14,38 @@ public class IqcController {
     private final IqcService iqcService;
 
     @GetMapping("/{arrivalId}/iqc")
-    public ApiResponse<IqcDTO> getByArrivalId(@PathVariable Long arrivalId) {
-        return ApiResponse.success(iqcService.getDtoById(arrivalId));
+    public IqcDTO getByArrivalId(@PathVariable Long arrivalId) {
+        return iqcService.getDtoById(arrivalId);
     }
 
     @GetMapping("/iqc/{id}")
-    public ApiResponse<IqcDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(iqcService.getDtoById(id));
+    public IqcDTO getById(@PathVariable Long id) {
+        return iqcService.getDtoById(id);
     }
 
     @GetMapping("/iqc/no/{iqcNo}")
-    public ApiResponse<Iqc> getByIqcNo(@PathVariable String iqcNo) {
-        return ApiResponse.success(iqcService.getByIqcNo(iqcNo));
+    public Iqc getByIqcNo(@PathVariable String iqcNo) {
+        return iqcService.getByIqcNo(iqcNo);
     }
 
     @PostMapping("/iqc")
-    public ApiResponse<Long> create(@RequestBody Iqc iqc) {
-        return ApiResponse.success(iqcService.save(iqc));
+    public Long create(@RequestBody Iqc iqc) {
+        return iqcService.save(iqc);
     }
 
     @PutMapping("/iqc/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody Iqc iqc) {
+    public void update(@PathVariable Long id, @RequestBody Iqc iqc) {
         iqc.setId(id);
         iqcService.update(iqc);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/iqc/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) { iqcService.delete(id); return ApiResponse.success(null); }
+    public void delete(@PathVariable Long id) {
+        iqcService.delete(id);
+    }
+
     @PostMapping("/iqc/{id}/inspect")
-    public ApiResponse<Void> inspect(@PathVariable Long id, @RequestParam String result, @RequestParam String inspector) { iqcService.inspect(id, result, inspector); return ApiResponse.success(null); }
-}
+    public void inspect(@PathVariable Long id, @RequestParam String result, @RequestParam String inspector) {
+        iqcService.inspect(id, result, inspector);
+    }
+}

+ 16 - 13
backend/src/main/java/com/oms/controller/KnowledgeBaseController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.KnowledgeBaseDTO;
 import com.oms.entity.KnowledgeBase;
 import com.oms.service.KnowledgeBaseService;
@@ -16,36 +15,40 @@ public class KnowledgeBaseController {
     private final KnowledgeBaseService knowledgeBaseService;
 
     @GetMapping
-    public ApiResponse<List<KnowledgeBase>> getKnowledgeBases(
+    public List<KnowledgeBase> getKnowledgeBases(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(knowledgeBaseService.getPage(page, size).getRecords());
+        return knowledgeBaseService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<KnowledgeBase>> getAll() {
-        return ApiResponse.success(knowledgeBaseService.getAll());
+    public List<KnowledgeBase> getAll() {
+        return knowledgeBaseService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<KnowledgeBaseDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(knowledgeBaseService.getDtoById(id));
+    public KnowledgeBaseDTO getById(@PathVariable Long id) {
+        return knowledgeBaseService.getDtoById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody KnowledgeBase knowledgeBase) {
-        return ApiResponse.success(knowledgeBaseService.save(knowledgeBase));
+    public Long create(@RequestBody KnowledgeBase knowledgeBase) {
+        return knowledgeBaseService.save(knowledgeBase);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody KnowledgeBase knowledgeBase) {
+    public void update(@PathVariable Long id, @RequestBody KnowledgeBase knowledgeBase) {
         knowledgeBase.setId(id);
         knowledgeBaseService.update(knowledgeBase);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) { knowledgeBaseService.delete(id); return ApiResponse.success(null); }
+    public void delete(@PathVariable Long id) {
+        knowledgeBaseService.delete(id);
+    }
+
     @PostMapping("/{id}/toggle-enabled")
-    public ApiResponse<Void> toggleEnabled(@PathVariable Long id, @RequestParam boolean enabled) { knowledgeBaseService.toggleEnabled(id, enabled); return ApiResponse.success(null); }
+    public void toggleEnabled(@PathVariable Long id, @RequestParam boolean enabled) {
+        knowledgeBaseService.toggleEnabled(id, enabled);
+    }
 }

+ 10 - 13
backend/src/main/java/com/oms/controller/KnowledgeCategoryController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.KnowledgeCategoryDTO;
 import com.oms.entity.KnowledgeCategory;
 import com.oms.service.KnowledgeCategoryService;
@@ -16,37 +15,35 @@ public class KnowledgeCategoryController {
     private final KnowledgeCategoryService knowledgeCategoryService;
 
     @GetMapping
-    public ApiResponse<List<KnowledgeCategory>> getKnowledgeCategories(
+    public List<KnowledgeCategory> getKnowledgeCategories(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(knowledgeCategoryService.getPage(page, size).getRecords());
+        return knowledgeCategoryService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<KnowledgeCategory>> getAll() {
-        return ApiResponse.success(knowledgeCategoryService.getAll());
+    public List<KnowledgeCategory> getAll() {
+        return knowledgeCategoryService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<KnowledgeCategoryDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(knowledgeCategoryService.getDtoById(id));
+    public KnowledgeCategoryDTO getById(@PathVariable Long id) {
+        return knowledgeCategoryService.getDtoById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody KnowledgeCategory knowledgeCategory) {
-        return ApiResponse.success(knowledgeCategoryService.save(knowledgeCategory));
+    public Long create(@RequestBody KnowledgeCategory knowledgeCategory) {
+        return knowledgeCategoryService.save(knowledgeCategory);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody KnowledgeCategory knowledgeCategory) {
+    public void update(@PathVariable Long id, @RequestBody KnowledgeCategory knowledgeCategory) {
         knowledgeCategory.setId(id);
         knowledgeCategoryService.update(knowledgeCategory);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         knowledgeCategoryService.delete(id);
-        return ApiResponse.success(null);
     }
 }

+ 10 - 13
backend/src/main/java/com/oms/controller/LogisticsProviderController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.LogisticsProviderDTO;
 import com.oms.entity.LogisticsProvider;
 import com.oms.service.LogisticsProviderService;
@@ -17,37 +16,35 @@ public class LogisticsProviderController {
     private final LogisticsProviderService logisticsProviderService;
 
     @GetMapping
-    public ApiResponse<List<LogisticsProvider>> getProviders(
+    public List<LogisticsProvider> getProviders(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(logisticsProviderService.getPage(page, size).getRecords());
+        return logisticsProviderService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<LogisticsProvider>> getAll() {
-        return ApiResponse.success(logisticsProviderService.getAll());
+    public List<LogisticsProvider> getAll() {
+        return logisticsProviderService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<LogisticsProviderDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(logisticsProviderService.getDtoById(id));
+    public LogisticsProviderDTO getById(@PathVariable Long id) {
+        return logisticsProviderService.getDtoById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody LogisticsProvider provider) {
-        return ApiResponse.success(logisticsProviderService.save(provider));
+    public Long create(@RequestBody LogisticsProvider provider) {
+        return logisticsProviderService.save(provider);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody LogisticsProvider provider) {
+    public void update(@PathVariable Long id, @RequestBody LogisticsProvider provider) {
         provider.setId(id);
         logisticsProviderService.update(provider);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         logisticsProviderService.delete(id);
-        return ApiResponse.success(null);
     }
 }

+ 9 - 12
backend/src/main/java/com/oms/controller/OrderItemController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.OrderItemDTO;
 import com.oms.entity.OrderItem;
 import com.oms.service.OrderItemService;
@@ -17,30 +16,28 @@ public class OrderItemController {
     private final OrderItemService orderItemService;
 
     @GetMapping("/{orderId}/items")
-    public ApiResponse<List<OrderItem>> getByOrderId(@PathVariable Long orderId) {
-        return ApiResponse.success(orderItemService.getByOrderId(orderId));
+    public List<OrderItem> getByOrderId(@PathVariable Long orderId) {
+        return orderItemService.getByOrderId(orderId);
     }
 
     @GetMapping("/item/{id}")
-    public ApiResponse<OrderItemDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(orderItemService.getDtoById(id));
+    public OrderItemDTO getById(@PathVariable Long id) {
+        return orderItemService.getDtoById(id);
     }
 
     @PostMapping("/item")
-    public ApiResponse<Long> create(@RequestBody OrderItem orderItem) {
-        return ApiResponse.success(orderItemService.save(orderItem));
+    public Long create(@RequestBody OrderItem orderItem) {
+        return orderItemService.save(orderItem);
     }
 
     @PutMapping("/item/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody OrderItem orderItem) {
+    public void update(@PathVariable Long id, @RequestBody OrderItem orderItem) {
         orderItem.setId(id);
         orderItemService.update(orderItem);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/item/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         orderItemService.delete(id);
-        return ApiResponse.success(null);
     }
-}
+}

+ 9 - 12
backend/src/main/java/com/oms/controller/OrderOperationLogController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.OrderOperationLogDTO;
 import com.oms.entity.OrderOperationLog;
 import com.oms.service.OrderOperationLogService;
@@ -17,30 +16,28 @@ public class OrderOperationLogController {
     private final OrderOperationLogService orderOperationLogService;
 
     @GetMapping("/{orderId}/operation-logs")
-    public ApiResponse<List<OrderOperationLog>> getByOrderId(@PathVariable Long orderId) {
-        return ApiResponse.success(orderOperationLogService.getByOrderId(orderId));
+    public List<OrderOperationLog> getByOrderId(@PathVariable Long orderId) {
+        return orderOperationLogService.getByOrderId(orderId);
     }
 
     @GetMapping("/operation-log/{id}")
-    public ApiResponse<OrderOperationLogDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(orderOperationLogService.getDtoById(id));
+    public OrderOperationLogDTO getById(@PathVariable Long id) {
+        return orderOperationLogService.getDtoById(id);
     }
 
     @PostMapping("/operation-log")
-    public ApiResponse<Long> create(@RequestBody OrderOperationLog orderOperationLog) {
-        return ApiResponse.success(orderOperationLogService.save(orderOperationLog));
+    public Long create(@RequestBody OrderOperationLog orderOperationLog) {
+        return orderOperationLogService.save(orderOperationLog);
     }
 
     @PutMapping("/operation-log/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody OrderOperationLog orderOperationLog) {
+    public void update(@PathVariable Long id, @RequestBody OrderOperationLog orderOperationLog) {
         orderOperationLog.setId(id);
         orderOperationLogService.update(orderOperationLog);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/operation-log/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         orderOperationLogService.delete(id);
-        return ApiResponse.success(null);
     }
-}
+}

+ 9 - 12
backend/src/main/java/com/oms/controller/OrderStatusEventController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.OrderStatusEventDTO;
 import com.oms.entity.OrderStatusEvent;
 import com.oms.service.OrderStatusEventService;
@@ -17,30 +16,28 @@ public class OrderStatusEventController {
     private final OrderStatusEventService orderStatusEventService;
 
     @GetMapping("/{orderId}/status-events")
-    public ApiResponse<List<OrderStatusEvent>> getByOrderId(@PathVariable Long orderId) {
-        return ApiResponse.success(orderStatusEventService.getByOrderId(orderId));
+    public List<OrderStatusEvent> getByOrderId(@PathVariable Long orderId) {
+        return orderStatusEventService.getByOrderId(orderId);
     }
 
     @GetMapping("/status-event/{id}")
-    public ApiResponse<OrderStatusEventDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(orderStatusEventService.getDtoById(id));
+    public OrderStatusEventDTO getById(@PathVariable Long id) {
+        return orderStatusEventService.getDtoById(id);
     }
 
     @PostMapping("/status-event")
-    public ApiResponse<Long> create(@RequestBody OrderStatusEvent orderStatusEvent) {
-        return ApiResponse.success(orderStatusEventService.save(orderStatusEvent));
+    public Long create(@RequestBody OrderStatusEvent orderStatusEvent) {
+        return orderStatusEventService.save(orderStatusEvent);
     }
 
     @PutMapping("/status-event/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody OrderStatusEvent orderStatusEvent) {
+    public void update(@PathVariable Long id, @RequestBody OrderStatusEvent orderStatusEvent) {
         orderStatusEvent.setId(id);
         orderStatusEventService.update(orderStatusEvent);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/status-event/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         orderStatusEventService.delete(id);
-        return ApiResponse.success(null);
     }
-}
+}

+ 23 - 35
backend/src/main/java/com/oms/controller/OrdersController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.OrdersDTO;
 import com.oms.entity.Orders;
 import com.oms.service.OrdersService;
@@ -17,101 +16,90 @@ public class OrdersController {
     private final OrdersService ordersService;
 
     @GetMapping
-    public ApiResponse<List<Orders>> getOrders(
+    public List<Orders> getOrders(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(ordersService.getPage(page, size).getRecords());
+        return ordersService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<Orders>> getAll() {
-        return ApiResponse.success(ordersService.getAll());
+    public List<Orders> getAll() {
+        return ordersService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<OrdersDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(ordersService.getDtoById(id));
+    public OrdersDTO getById(@PathVariable Long id) {
+        return ordersService.getDtoById(id);
     }
 
     @GetMapping("/order-no/{orderNo}")
-    public ApiResponse<Orders> getByOrderNo(@PathVariable String orderNo) {
-        return ApiResponse.success(ordersService.getByOrderNo(orderNo));
+    public Orders getByOrderNo(@PathVariable String orderNo) {
+        return ordersService.getByOrderNo(orderNo);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody Orders order) {
-        return ApiResponse.success(ordersService.save(order));
+    public Long create(@RequestBody Orders order) {
+        return ordersService.save(order);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody Orders order) {
+    public void update(@PathVariable Long id, @RequestBody Orders order) {
         order.setId(id);
         ordersService.update(order);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         ordersService.delete(id);
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/confirm-payment")
-    public ApiResponse<Void> confirmPayment(@PathVariable Long id) {
+    public void confirmPayment(@PathVariable Long id) {
         ordersService.confirmPayment(id, "SYSTEM");
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/allocate")
-    public ApiResponse<Void> allocateOrder(@PathVariable Long id) {
+    public void allocateOrder(@PathVariable Long id) {
         ordersService.allocateOrder(id, "SYSTEM");
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/cancel")
-    public ApiResponse<Void> cancelOrder(@PathVariable Long id, @RequestParam String reason) {
+    public void cancelOrder(@PathVariable Long id, @RequestParam String reason) {
         ordersService.cancelOrder(id, reason, "SYSTEM");
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/confirm-shipped")
-    public ApiResponse<Void> confirmShipped(@PathVariable Long id) {
+    public void confirmShipped(@PathVariable Long id) {
         ordersService.confirmShipped(id, "SYSTEM");
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/confirm-delivered")
-    public ApiResponse<Void> confirmDelivered(@PathVariable Long id) {
+    public void confirmDelivered(@PathVariable Long id) {
         ordersService.confirmDelivered(id, "SYSTEM");
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/complete")
-    public ApiResponse<Void> completeOrder(@PathVariable Long id) {
+    public void completeOrder(@PathVariable Long id) {
         ordersService.completeOrder(id, "SYSTEM");
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/split")
-    public ApiResponse<Long> splitOrder(@PathVariable Long id, @RequestBody java.util.List<java.util.Map<String, Object>> splits) {
-        return ApiResponse.success(ordersService.splitOrder(id, splits, "SYSTEM"));
+    public Long splitOrder(@PathVariable Long id, @RequestBody List<java.util.Map<String, Object>> splits) {
+        return ordersService.splitOrder(id, splits, "SYSTEM");
     }
 
     @PostMapping("/{sourceId}/merge/{targetId}")
-    public ApiResponse<Void> mergeOrders(@PathVariable Long sourceId, @PathVariable Long targetId) {
+    public void mergeOrders(@PathVariable Long sourceId, @PathVariable Long targetId) {
         ordersService.mergeOrders(sourceId, targetId, "SYSTEM");
-        return ApiResponse.success(null);
     }
 
     @PutMapping("/{id}/handler")
-    public ApiResponse<Void> assignHandler(@PathVariable Long id, @RequestParam Long handlerId, @RequestParam String handlerName) {
+    public void assignHandler(@PathVariable Long id, @RequestParam Long handlerId, @RequestParam String handlerName) {
         ordersService.assignHandler(id, handlerId, handlerName);
-        return ApiResponse.success(null);
     }
 
     @PutMapping("/{id}/warehouse")
-    public ApiResponse<Void> assignWarehouse(@PathVariable Long id, @RequestParam Long warehouseId) {
+    public void assignWarehouse(@PathVariable Long id, @RequestParam Long warehouseId) {
         ordersService.assignWarehouse(id, warehouseId);
-        return ApiResponse.success(null);
     }
 }

+ 10 - 13
backend/src/main/java/com/oms/controller/PriceWatchController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.PriceWatchDTO;
 import com.oms.entity.PriceWatch;
 import com.oms.service.PriceWatchService;
@@ -16,37 +15,35 @@ public class PriceWatchController {
     private final PriceWatchService priceWatchService;
 
     @GetMapping
-    public ApiResponse<List<PriceWatch>> getPriceWatches(
+    public List<PriceWatch> getPriceWatches(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(priceWatchService.getPage(page, size).getRecords());
+        return priceWatchService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<PriceWatch>> getAll() {
-        return ApiResponse.success(priceWatchService.getAll());
+    public List<PriceWatch> getAll() {
+        return priceWatchService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<PriceWatchDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(priceWatchService.getDtoById(id));
+    public PriceWatchDTO getById(@PathVariable Long id) {
+        return priceWatchService.getDtoById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody PriceWatch priceWatch) {
-        return ApiResponse.success(priceWatchService.save(priceWatch));
+    public Long create(@RequestBody PriceWatch priceWatch) {
+        return priceWatchService.save(priceWatch);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody PriceWatch priceWatch) {
+    public void update(@PathVariable Long id, @RequestBody PriceWatch priceWatch) {
         priceWatch.setId(id);
         priceWatchService.update(priceWatch);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         priceWatchService.delete(id);
-        return ApiResponse.success(null);
     }
 }

+ 11 - 14
backend/src/main/java/com/oms/controller/ProductCategoryController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.entity.ProductCategory;
 import com.oms.service.ProductCategoryService;
 import lombok.RequiredArgsConstructor;
@@ -16,37 +15,35 @@ public class ProductCategoryController {
     private final ProductCategoryService productCategoryService;
 
     @GetMapping
-    public ApiResponse<List<ProductCategory>> getCategories(
+    public List<ProductCategory> getCategories(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(productCategoryService.getCategories(page, size).getRecords());
+        return productCategoryService.getCategories(page, size).getRecords();
     }
 
     @GetMapping("/tree")
-    public ApiResponse<List<ProductCategory>> getCategoryTree() {
-        return ApiResponse.success(productCategoryService.getTree());
+    public List<ProductCategory> getCategoryTree() {
+        return productCategoryService.getTree();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<ProductCategory> getById(@PathVariable Long id) {
-        return ApiResponse.success(productCategoryService.getById(id));
+    public ProductCategory getById(@PathVariable Long id) {
+        return productCategoryService.getById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody ProductCategory category) {
-        return ApiResponse.success(productCategoryService.save(category));
+    public Long create(@RequestBody ProductCategory category) {
+        return productCategoryService.save(category);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody ProductCategory category) {
+    public void update(@PathVariable Long id, @RequestBody ProductCategory category) {
         category.setId(id);
         productCategoryService.update(category);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         productCategoryService.delete(id);
-        return ApiResponse.success(null);
     }
-}
+}

+ 15 - 20
backend/src/main/java/com/oms/controller/ProductController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.entity.Product;
 import com.oms.service.ProductService;
 import lombok.RequiredArgsConstructor;
@@ -16,54 +15,50 @@ public class ProductController {
     private final ProductService productService;
 
     @GetMapping
-    public ApiResponse<List<Product>> getProducts(
+    public List<Product> getProducts(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(productService.getProducts(page, size).getRecords());
+        return productService.getProducts(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<Product>> getAll() {
-        return ApiResponse.success(productService.getAll());
+    public List<Product> getAll() {
+        return productService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<Product> getById(@PathVariable Long id) {
-        return ApiResponse.success(productService.getById(id));
+    public Product getById(@PathVariable Long id) {
+        return productService.getById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody Product product) {
-        return ApiResponse.success(productService.save(product));
+    public Long create(@RequestBody Product product) {
+        return productService.save(product);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody Product product) {
+    public void update(@PathVariable Long id, @RequestBody Product product) {
         product.setId(id);
         productService.update(product);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         productService.delete(id);
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/publish")
-    public ApiResponse<Void> publish(@PathVariable Long id) {
+    public void publish(@PathVariable Long id) {
         productService.publish(id);
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/unpublish")
-    public ApiResponse<Void> unpublish(@PathVariable Long id) {
+    public void unpublish(@PathVariable Long id) {
         productService.unpublish(id);
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/copy")
-    public ApiResponse<Long> copy(@PathVariable Long id) {
-        return ApiResponse.success(productService.copy(id));
+    public Long copy(@PathVariable Long id) {
+        return productService.copy(id);
     }
-}
+}

+ 11 - 14
backend/src/main/java/com/oms/controller/ProductSkuController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.entity.ProductSku;
 import com.oms.service.ProductSkuService;
 import lombok.RequiredArgsConstructor;
@@ -16,37 +15,35 @@ public class ProductSkuController {
     private final ProductSkuService productSkuService;
 
     @GetMapping
-    public ApiResponse<List<ProductSku>> getSkus(
+    public List<ProductSku> getSkus(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(productSkuService.getSkus(page, size).getRecords());
+        return productSkuService.getSkus(page, size).getRecords();
     }
 
     @GetMapping("/product/{productId}")
-    public ApiResponse<List<ProductSku>> getByProductId(@PathVariable Long productId) {
-        return ApiResponse.success(productSkuService.getByProductId(productId));
+    public List<ProductSku> getByProductId(@PathVariable Long productId) {
+        return productSkuService.getByProductId(productId);
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<ProductSku> getById(@PathVariable Long id) {
-        return ApiResponse.success(productSkuService.getById(id));
+    public ProductSku getById(@PathVariable Long id) {
+        return productSkuService.getById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody ProductSku sku) {
-        return ApiResponse.success(productSkuService.save(sku));
+    public Long create(@RequestBody ProductSku sku) {
+        return productSkuService.save(sku);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody ProductSku sku) {
+    public void update(@PathVariable Long id, @RequestBody ProductSku sku) {
         sku.setId(id);
         productSkuService.update(sku);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         productSkuService.delete(id);
-        return ApiResponse.success(null);
     }
-}
+}

+ 20 - 14
backend/src/main/java/com/oms/controller/PromotionController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.PromotionDTO;
 import com.oms.entity.Promotion;
 import com.oms.service.PromotionService;
@@ -16,38 +15,45 @@ public class PromotionController {
     private final PromotionService promotionService;
 
     @GetMapping
-    public ApiResponse<List<Promotion>> getPromotions(
+    public List<Promotion> getPromotions(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(promotionService.getPage(page, size).getRecords());
+        return promotionService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<Promotion>> getAll() {
-        return ApiResponse.success(promotionService.getAll());
+    public List<Promotion> getAll() {
+        return promotionService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<PromotionDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(promotionService.getDtoById(id));
+    public PromotionDTO getById(@PathVariable Long id) {
+        return promotionService.getDtoById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody Promotion promotion) {
-        return ApiResponse.success(promotionService.save(promotion));
+    public Long create(@RequestBody Promotion promotion) {
+        return promotionService.save(promotion);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody Promotion promotion) {
+    public void update(@PathVariable Long id, @RequestBody Promotion promotion) {
         promotion.setId(id);
         promotionService.update(promotion);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) { promotionService.delete(id); return ApiResponse.success(null); }
+    public void delete(@PathVariable Long id) {
+        promotionService.delete(id);
+    }
+
     @PostMapping("/{id}/activate")
-    public ApiResponse<Void> activate(@PathVariable Long id) { promotionService.activate(id); return ApiResponse.success(null); }
+    public void activate(@PathVariable Long id) {
+        promotionService.activate(id);
+    }
+
     @PostMapping("/{id}/deactivate")
-    public ApiResponse<Void> deactivate(@PathVariable Long id) { promotionService.deactivate(id); return ApiResponse.success(null); }
+    public void deactivate(@PathVariable Long id) {
+        promotionService.deactivate(id);
+    }
 }

+ 11 - 14
backend/src/main/java/com/oms/controller/PurchaseArrivalController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.PurchaseArrivalDTO;
 import com.oms.entity.PurchaseArrival;
 import com.oms.service.PurchaseArrivalService;
@@ -17,35 +16,33 @@ public class PurchaseArrivalController {
     private final PurchaseArrivalService purchaseArrivalService;
 
     @GetMapping("/{purchaseOrderId}/arrivals")
-    public ApiResponse<List<PurchaseArrival>> getByPurchaseOrderId(@PathVariable Long purchaseOrderId) {
-        return ApiResponse.success(purchaseArrivalService.getAll());
+    public List<PurchaseArrival> getByPurchaseOrderId(@PathVariable Long purchaseOrderId) {
+        return purchaseArrivalService.getAll();
     }
 
     @GetMapping("/arrival/{id}")
-    public ApiResponse<PurchaseArrivalDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(purchaseArrivalService.getDtoById(id));
+    public PurchaseArrivalDTO getById(@PathVariable Long id) {
+        return purchaseArrivalService.getDtoById(id);
     }
 
     @GetMapping("/arrival/no/{arrivalNo}")
-    public ApiResponse<PurchaseArrival> getByArrivalNo(@PathVariable String arrivalNo) {
-        return ApiResponse.success(purchaseArrivalService.getByArrivalNo(arrivalNo));
+    public PurchaseArrival getByArrivalNo(@PathVariable String arrivalNo) {
+        return purchaseArrivalService.getByArrivalNo(arrivalNo);
     }
 
     @PostMapping("/arrival")
-    public ApiResponse<Long> create(@RequestBody PurchaseArrival purchaseArrival) {
-        return ApiResponse.success(purchaseArrivalService.save(purchaseArrival));
+    public Long create(@RequestBody PurchaseArrival purchaseArrival) {
+        return purchaseArrivalService.save(purchaseArrival);
     }
 
     @PutMapping("/arrival/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody PurchaseArrival purchaseArrival) {
+    public void update(@PathVariable Long id, @RequestBody PurchaseArrival purchaseArrival) {
         purchaseArrival.setId(id);
         purchaseArrivalService.update(purchaseArrival);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/arrival/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         purchaseArrivalService.delete(id);
-        return ApiResponse.success(null);
     }
-}
+}

+ 9 - 12
backend/src/main/java/com/oms/controller/PurchaseArrivalItemController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.PurchaseArrivalItemDTO;
 import com.oms.entity.PurchaseArrivalItem;
 import com.oms.service.PurchaseArrivalItemService;
@@ -17,30 +16,28 @@ public class PurchaseArrivalItemController {
     private final PurchaseArrivalItemService purchaseArrivalItemService;
 
     @GetMapping("/{arrivalId}/items")
-    public ApiResponse<List<PurchaseArrivalItem>> getByArrivalId(@PathVariable Long arrivalId) {
-        return ApiResponse.success(purchaseArrivalItemService.getByArrivalId(arrivalId));
+    public List<PurchaseArrivalItem> getByArrivalId(@PathVariable Long arrivalId) {
+        return purchaseArrivalItemService.getByArrivalId(arrivalId);
     }
 
     @GetMapping("/arrival-item/{id}")
-    public ApiResponse<PurchaseArrivalItemDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(purchaseArrivalItemService.getDtoById(id));
+    public PurchaseArrivalItemDTO getById(@PathVariable Long id) {
+        return purchaseArrivalItemService.getDtoById(id);
     }
 
     @PostMapping("/arrival-item")
-    public ApiResponse<Long> create(@RequestBody PurchaseArrivalItem purchaseArrivalItem) {
-        return ApiResponse.success(purchaseArrivalItemService.save(purchaseArrivalItem));
+    public Long create(@RequestBody PurchaseArrivalItem purchaseArrivalItem) {
+        return purchaseArrivalItemService.save(purchaseArrivalItem);
     }
 
     @PutMapping("/arrival-item/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody PurchaseArrivalItem purchaseArrivalItem) {
+    public void update(@PathVariable Long id, @RequestBody PurchaseArrivalItem purchaseArrivalItem) {
         purchaseArrivalItem.setId(id);
         purchaseArrivalItemService.update(purchaseArrivalItem);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/arrival-item/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         purchaseArrivalItemService.delete(id);
-        return ApiResponse.success(null);
     }
-}
+}

+ 13 - 17
backend/src/main/java/com/oms/controller/PurchaseOrderController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.PurchaseOrderDTO;
 import com.oms.entity.PurchaseOrder;
 import com.oms.service.PurchaseOrderService;
@@ -17,48 +16,45 @@ public class PurchaseOrderController {
     private final PurchaseOrderService purchaseOrderService;
 
     @GetMapping
-    public ApiResponse<List<PurchaseOrder>> getOrders(
+    public List<PurchaseOrder> getOrders(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(purchaseOrderService.getPage(page, size).getRecords());
+        return purchaseOrderService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<PurchaseOrder>> getAll() {
-        return ApiResponse.success(purchaseOrderService.getAll());
+    public List<PurchaseOrder> getAll() {
+        return purchaseOrderService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<PurchaseOrderDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(purchaseOrderService.getDtoById(id));
+    public PurchaseOrderDTO getById(@PathVariable Long id) {
+        return purchaseOrderService.getDtoById(id);
     }
 
     @GetMapping("/po-no/{poNo}")
-    public ApiResponse<PurchaseOrder> getByPoNo(@PathVariable String poNo) {
-        return ApiResponse.success(purchaseOrderService.getByPoNo(poNo));
+    public PurchaseOrder getByPoNo(@PathVariable String poNo) {
+        return purchaseOrderService.getByPoNo(poNo);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody PurchaseOrder purchaseOrder) {
-        return ApiResponse.success(purchaseOrderService.save(purchaseOrder));
+    public Long create(@RequestBody PurchaseOrder purchaseOrder) {
+        return purchaseOrderService.save(purchaseOrder);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody PurchaseOrder purchaseOrder) {
+    public void update(@PathVariable Long id, @RequestBody PurchaseOrder purchaseOrder) {
         purchaseOrder.setId(id);
         purchaseOrderService.update(purchaseOrder);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         purchaseOrderService.delete(id);
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/submit")
-    public ApiResponse<Void> submit(@PathVariable Long id) {
+    public void submit(@PathVariable Long id) {
         purchaseOrderService.submit(id);
-        return ApiResponse.success(null);
     }
 }

+ 9 - 12
backend/src/main/java/com/oms/controller/PurchaseOrderItemController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.PurchaseOrderItemDTO;
 import com.oms.entity.PurchaseOrderItem;
 import com.oms.service.PurchaseOrderItemService;
@@ -17,30 +16,28 @@ public class PurchaseOrderItemController {
     private final PurchaseOrderItemService purchaseOrderItemService;
 
     @GetMapping("/{purchaseOrderId}/items")
-    public ApiResponse<List<PurchaseOrderItem>> getByPurchaseOrderId(@PathVariable Long purchaseOrderId) {
-        return ApiResponse.success(purchaseOrderItemService.getByPurchaseOrderId(purchaseOrderId));
+    public List<PurchaseOrderItem> getByPurchaseOrderId(@PathVariable Long purchaseOrderId) {
+        return purchaseOrderItemService.getByPurchaseOrderId(purchaseOrderId);
     }
 
     @GetMapping("/item/{id}")
-    public ApiResponse<PurchaseOrderItemDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(purchaseOrderItemService.getDtoById(id));
+    public PurchaseOrderItemDTO getById(@PathVariable Long id) {
+        return purchaseOrderItemService.getDtoById(id);
     }
 
     @PostMapping("/item")
-    public ApiResponse<Long> create(@RequestBody PurchaseOrderItem purchaseOrderItem) {
-        return ApiResponse.success(purchaseOrderItemService.save(purchaseOrderItem));
+    public Long create(@RequestBody PurchaseOrderItem purchaseOrderItem) {
+        return purchaseOrderItemService.save(purchaseOrderItem);
     }
 
     @PutMapping("/item/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody PurchaseOrderItem purchaseOrderItem) {
+    public void update(@PathVariable Long id, @RequestBody PurchaseOrderItem purchaseOrderItem) {
         purchaseOrderItem.setId(id);
         purchaseOrderItemService.update(purchaseOrderItem);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/item/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         purchaseOrderItemService.delete(id);
-        return ApiResponse.success(null);
     }
-}
+}

+ 21 - 15
backend/src/main/java/com/oms/controller/PurchaseRequestController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.PurchaseRequestDTO;
 import com.oms.entity.PurchaseRequest;
 import com.oms.service.PurchaseRequestService;
@@ -17,36 +16,43 @@ public class PurchaseRequestController {
     private final PurchaseRequestService purchaseRequestService;
 
     @GetMapping
-    public ApiResponse<List<PurchaseRequest>> getAll() {
-        return ApiResponse.success(purchaseRequestService.getAll());
+    public List<PurchaseRequest> getAll() {
+        return purchaseRequestService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<PurchaseRequestDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(purchaseRequestService.getDtoById(id));
+    public PurchaseRequestDTO getById(@PathVariable Long id) {
+        return purchaseRequestService.getDtoById(id);
     }
 
     @GetMapping("/request-no/{requestNo}")
-    public ApiResponse<PurchaseRequest> getByRequestNo(@PathVariable String requestNo) {
-        return ApiResponse.success(purchaseRequestService.getByRequestNo(requestNo));
+    public PurchaseRequest getByRequestNo(@PathVariable String requestNo) {
+        return purchaseRequestService.getByRequestNo(requestNo);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody PurchaseRequest purchaseRequest) {
-        return ApiResponse.success(purchaseRequestService.save(purchaseRequest));
+    public Long create(@RequestBody PurchaseRequest purchaseRequest) {
+        return purchaseRequestService.save(purchaseRequest);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody PurchaseRequest purchaseRequest) {
+    public void update(@PathVariable Long id, @RequestBody PurchaseRequest purchaseRequest) {
         purchaseRequest.setId(id);
         purchaseRequestService.update(purchaseRequest);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) { purchaseRequestService.delete(id); return ApiResponse.success(null); }
+    public void delete(@PathVariable Long id) {
+        purchaseRequestService.delete(id);
+    }
+
     @PostMapping("/{id}/approve")
-    public ApiResponse<Void> approve(@PathVariable Long id) { purchaseRequestService.approve(id); return ApiResponse.success(null); }
+    public void approve(@PathVariable Long id) {
+        purchaseRequestService.approve(id);
+    }
+
     @PostMapping("/{id}/reject")
-    public ApiResponse<Void> reject(@PathVariable Long id, @RequestParam String reason) { purchaseRequestService.reject(id, reason); return ApiResponse.success(null); }
-}
+    public void reject(@PathVariable Long id, @RequestParam String reason) {
+        purchaseRequestService.reject(id, reason);
+    }
+}

+ 11 - 14
backend/src/main/java/com/oms/controller/ReplenishmentPlanController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.ReplenishmentPlanDTO;
 import com.oms.entity.ReplenishmentPlan;
 import com.oms.service.ReplenishmentPlanService;
@@ -17,35 +16,33 @@ public class ReplenishmentPlanController {
     private final ReplenishmentPlanService replenishmentPlanService;
 
     @GetMapping
-    public ApiResponse<List<ReplenishmentPlan>> getAll() {
-        return ApiResponse.success(replenishmentPlanService.getAll());
+    public List<ReplenishmentPlan> getAll() {
+        return replenishmentPlanService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<ReplenishmentPlanDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(replenishmentPlanService.getDtoById(id));
+    public ReplenishmentPlanDTO getById(@PathVariable Long id) {
+        return replenishmentPlanService.getDtoById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody ReplenishmentPlan replenishmentPlan) {
-        return ApiResponse.success(replenishmentPlanService.save(replenishmentPlan));
+    public Long create(@RequestBody ReplenishmentPlan replenishmentPlan) {
+        return replenishmentPlanService.save(replenishmentPlan);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody ReplenishmentPlan replenishmentPlan) {
+    public void update(@PathVariable Long id, @RequestBody ReplenishmentPlan replenishmentPlan) {
         replenishmentPlan.setId(id);
         replenishmentPlanService.update(replenishmentPlan);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         replenishmentPlanService.delete(id);
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/generate-suggestions")
-    public ApiResponse<Integer> generateSuggestions() {
-        return ApiResponse.success(replenishmentPlanService.generateSuggestions());
+    public Integer generateSuggestions() {
+        return replenishmentPlanService.generateSuggestions();
     }
-}
+}

+ 22 - 16
backend/src/main/java/com/oms/controller/ReturnPackageController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.ReturnPackageDTO;
 import com.oms.entity.ReturnPackage;
 import com.oms.service.ReturnPackageService;
@@ -17,43 +16,50 @@ public class ReturnPackageController {
     private final ReturnPackageService returnPackageService;
 
     @GetMapping
-    public ApiResponse<List<ReturnPackage>> getReturns(
+    public List<ReturnPackage> getReturns(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(returnPackageService.getPage(page, size).getRecords());
+        return returnPackageService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<ReturnPackage>> getAll() {
-        return ApiResponse.success(returnPackageService.getAll());
+    public List<ReturnPackage> getAll() {
+        return returnPackageService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<ReturnPackageDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(returnPackageService.getDtoById(id));
+    public ReturnPackageDTO getById(@PathVariable Long id) {
+        return returnPackageService.getDtoById(id);
     }
 
     @GetMapping("/return-no/{returnNo}")
-    public ApiResponse<ReturnPackage> getByReturnNo(@PathVariable String returnNo) {
-        return ApiResponse.success(returnPackageService.getByReturnNo(returnNo));
+    public ReturnPackage getByReturnNo(@PathVariable String returnNo) {
+        return returnPackageService.getByReturnNo(returnNo);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody ReturnPackage returnPackage) {
-        return ApiResponse.success(returnPackageService.save(returnPackage));
+    public Long create(@RequestBody ReturnPackage returnPackage) {
+        return returnPackageService.save(returnPackage);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody ReturnPackage returnPackage) {
+    public void update(@PathVariable Long id, @RequestBody ReturnPackage returnPackage) {
         returnPackage.setId(id);
         returnPackageService.update(returnPackage);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) { returnPackageService.delete(id); return ApiResponse.success(null); }
+    public void delete(@PathVariable Long id) {
+        returnPackageService.delete(id);
+    }
+
     @PostMapping("/{id}/receive")
-    public ApiResponse<Void> receive(@PathVariable Long id) { returnPackageService.receive(id); return ApiResponse.success(null); }
+    public void receive(@PathVariable Long id) {
+        returnPackageService.receive(id);
+    }
+
     @PostMapping("/{id}/confirm-inspection")
-    public ApiResponse<Void> confirmInspection(@PathVariable Long id, @RequestParam String result) { returnPackageService.confirmInspection(id, result); return ApiResponse.success(null); }
+    public void confirmInspection(@PathVariable Long id, @RequestParam String result) {
+        returnPackageService.confirmInspection(id, result);
+    }
 }

+ 10 - 13
backend/src/main/java/com/oms/controller/ServicePerformanceController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.ServicePerformanceDTO;
 import com.oms.entity.ServicePerformance;
 import com.oms.service.ServicePerformanceService;
@@ -16,37 +15,35 @@ public class ServicePerformanceController {
     private final ServicePerformanceService servicePerformanceService;
 
     @GetMapping
-    public ApiResponse<List<ServicePerformance>> getServicePerformances(
+    public List<ServicePerformance> getServicePerformances(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(servicePerformanceService.getPage(page, size).getRecords());
+        return servicePerformanceService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<ServicePerformance>> getAll() {
-        return ApiResponse.success(servicePerformanceService.getAll());
+    public List<ServicePerformance> getAll() {
+        return servicePerformanceService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<ServicePerformanceDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(servicePerformanceService.getDtoById(id));
+    public ServicePerformanceDTO getById(@PathVariable Long id) {
+        return servicePerformanceService.getDtoById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody ServicePerformance servicePerformance) {
-        return ApiResponse.success(servicePerformanceService.save(servicePerformance));
+    public Long create(@RequestBody ServicePerformance servicePerformance) {
+        return servicePerformanceService.save(servicePerformance);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody ServicePerformance servicePerformance) {
+    public void update(@PathVariable Long id, @RequestBody ServicePerformance servicePerformance) {
         servicePerformance.setId(id);
         servicePerformanceService.update(servicePerformance);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         servicePerformanceService.delete(id);
-        return ApiResponse.success(null);
     }
 }

+ 15 - 21
backend/src/main/java/com/oms/controller/ShippingOrderController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.ShippingOrderDTO;
 import com.oms.entity.ShippingOrder;
 import com.oms.service.ShippingOrderService;
@@ -17,60 +16,55 @@ public class ShippingOrderController {
     private final ShippingOrderService shippingOrderService;
 
     @GetMapping
-    public ApiResponse<List<ShippingOrder>> getShippingOrders(
+    public List<ShippingOrder> getShippingOrders(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(shippingOrderService.getPage(page, size).getRecords());
+        return shippingOrderService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<ShippingOrder>> getAll() {
-        return ApiResponse.success(shippingOrderService.getAll());
+    public List<ShippingOrder> getAll() {
+        return shippingOrderService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<ShippingOrderDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(shippingOrderService.getDtoById(id));
+    public ShippingOrderDTO getById(@PathVariable Long id) {
+        return shippingOrderService.getDtoById(id);
     }
 
     @GetMapping("/shipment-no/{shipmentNo}")
-    public ApiResponse<ShippingOrder> getByShipmentNo(@PathVariable String shipmentNo) {
-        return ApiResponse.success(shippingOrderService.getByShipmentNo(shipmentNo));
+    public ShippingOrder getByShipmentNo(@PathVariable String shipmentNo) {
+        return shippingOrderService.getByShipmentNo(shipmentNo);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody ShippingOrder shippingOrder) {
-        return ApiResponse.success(shippingOrderService.save(shippingOrder));
+    public Long create(@RequestBody ShippingOrder shippingOrder) {
+        return shippingOrderService.save(shippingOrder);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody ShippingOrder shippingOrder) {
+    public void update(@PathVariable Long id, @RequestBody ShippingOrder shippingOrder) {
         shippingOrder.setId(id);
         shippingOrderService.update(shippingOrder);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         shippingOrderService.delete(id);
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/submit-tracking")
-    public ApiResponse<Void> submitTracking(@PathVariable Long id, @RequestParam String carrier, @RequestParam String trackingNo) {
+    public void submitTracking(@PathVariable Long id, @RequestParam String carrier, @RequestParam String trackingNo) {
         shippingOrderService.submitTracking(id, carrier, trackingNo, "SYSTEM");
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/confirm-shipped")
-    public ApiResponse<Void> confirmShipped(@PathVariable Long id) {
+    public void confirmShipped(@PathVariable Long id) {
         shippingOrderService.confirmShipped(id, "SYSTEM");
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/retry-return")
-    public ApiResponse<Void> retryReturn(@PathVariable Long id) {
+    public void retryReturn(@PathVariable Long id) {
         shippingOrderService.retryReturn(id);
-        return ApiResponse.success(null);
     }
 }

+ 12 - 15
backend/src/main/java/com/oms/controller/ShippingTemplateController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.ShippingTemplateDTO;
 import com.oms.entity.ShippingTemplate;
 import com.oms.service.ShippingTemplateService;
@@ -17,42 +16,40 @@ public class ShippingTemplateController {
     private final ShippingTemplateService shippingTemplateService;
 
     @GetMapping
-    public ApiResponse<List<ShippingTemplate>> getTemplates(
+    public List<ShippingTemplate> getTemplates(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(shippingTemplateService.getPage(page, size).getRecords());
+        return shippingTemplateService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<ShippingTemplate>> getAll() {
-        return ApiResponse.success(shippingTemplateService.getAll());
+    public List<ShippingTemplate> getAll() {
+        return shippingTemplateService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<ShippingTemplateDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(shippingTemplateService.getDtoById(id));
+    public ShippingTemplateDTO getById(@PathVariable Long id) {
+        return shippingTemplateService.getDtoById(id);
     }
 
     @GetMapping("/carrier/{carrierId}")
-    public ApiResponse<ShippingTemplate> getByCarrierId(@PathVariable Long carrierId) {
-        return ApiResponse.success(shippingTemplateService.getByCarrierId(carrierId));
+    public ShippingTemplate getByCarrierId(@PathVariable Long carrierId) {
+        return shippingTemplateService.getByCarrierId(carrierId);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody ShippingTemplate template) {
-        return ApiResponse.success(shippingTemplateService.save(template));
+    public Long create(@RequestBody ShippingTemplate template) {
+        return shippingTemplateService.save(template);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody ShippingTemplate template) {
+    public void update(@PathVariable Long id, @RequestBody ShippingTemplate template) {
         template.setId(id);
         shippingTemplateService.update(template);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         shippingTemplateService.delete(id);
-        return ApiResponse.success(null);
     }
 }

+ 12 - 15
backend/src/main/java/com/oms/controller/SupplierController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.SupplierDTO;
 import com.oms.entity.Supplier;
 import com.oms.service.SupplierService;
@@ -17,42 +16,40 @@ public class SupplierController {
     private final SupplierService supplierService;
 
     @GetMapping
-    public ApiResponse<List<Supplier>> getSuppliers(
+    public List<Supplier> getSuppliers(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(supplierService.getPage(page, size).getRecords());
+        return supplierService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<Supplier>> getAll() {
-        return ApiResponse.success(supplierService.getAll());
+    public List<Supplier> getAll() {
+        return supplierService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<SupplierDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(supplierService.getDtoById(id));
+    public SupplierDTO getById(@PathVariable Long id) {
+        return supplierService.getDtoById(id);
     }
 
     @GetMapping("/name/{name}")
-    public ApiResponse<Supplier> getByName(@PathVariable String name) {
-        return ApiResponse.success(supplierService.getByName(name));
+    public Supplier getByName(@PathVariable String name) {
+        return supplierService.getByName(name);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody Supplier supplier) {
-        return ApiResponse.success(supplierService.save(supplier));
+    public Long create(@RequestBody Supplier supplier) {
+        return supplierService.save(supplier);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody Supplier supplier) {
+    public void update(@PathVariable Long id, @RequestBody Supplier supplier) {
         supplier.setId(id);
         supplierService.update(supplier);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         supplierService.delete(id);
-        return ApiResponse.success(null);
     }
 }

+ 10 - 13
backend/src/main/java/com/oms/controller/SupplierPerformanceController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.SupplierPerformanceDTO;
 import com.oms.entity.SupplierPerformance;
 import com.oms.service.SupplierPerformanceService;
@@ -16,37 +15,35 @@ public class SupplierPerformanceController {
     private final SupplierPerformanceService supplierPerformanceService;
 
     @GetMapping
-    public ApiResponse<List<SupplierPerformance>> getSupplierPerformances(
+    public List<SupplierPerformance> getSupplierPerformances(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(supplierPerformanceService.getPage(page, size).getRecords());
+        return supplierPerformanceService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<SupplierPerformance>> getAll() {
-        return ApiResponse.success(supplierPerformanceService.getAll());
+    public List<SupplierPerformance> getAll() {
+        return supplierPerformanceService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<SupplierPerformanceDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(supplierPerformanceService.getDtoById(id));
+    public SupplierPerformanceDTO getById(@PathVariable Long id) {
+        return supplierPerformanceService.getDtoById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody SupplierPerformance supplierPerformance) {
-        return ApiResponse.success(supplierPerformanceService.save(supplierPerformance));
+    public Long create(@RequestBody SupplierPerformance supplierPerformance) {
+        return supplierPerformanceService.save(supplierPerformance);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody SupplierPerformance supplierPerformance) {
+    public void update(@PathVariable Long id, @RequestBody SupplierPerformance supplierPerformance) {
         supplierPerformance.setId(id);
         supplierPerformanceService.update(supplierPerformance);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         supplierPerformanceService.delete(id);
-        return ApiResponse.success(null);
     }
 }

+ 15 - 19
backend/src/main/java/com/oms/controller/SupplierSettlementController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.SupplierSettlementDTO;
 import com.oms.entity.SupplierSettlement;
 import com.oms.service.SupplierSettlementService;
@@ -17,53 +16,50 @@ public class SupplierSettlementController {
     private final SupplierSettlementService supplierSettlementService;
 
     @GetMapping
-    public ApiResponse<List<SupplierSettlement>> getSettlements(
+    public List<SupplierSettlement> getSettlements(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(supplierSettlementService.getPage(page, size).getRecords());
+        return supplierSettlementService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<SupplierSettlement>> getAll() {
-        return ApiResponse.success(supplierSettlementService.getAll());
+    public List<SupplierSettlement> getAll() {
+        return supplierSettlementService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<SupplierSettlementDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(supplierSettlementService.getDtoById(id));
+    public SupplierSettlementDTO getById(@PathVariable Long id) {
+        return supplierSettlementService.getDtoById(id);
     }
 
     @GetMapping("/settlement-no/{settlementNo}")
-    public ApiResponse<SupplierSettlement> getBySettlementNo(@PathVariable String settlementNo) {
-        return ApiResponse.success(supplierSettlementService.getBySettlementNo(settlementNo));
+    public SupplierSettlement getBySettlementNo(@PathVariable String settlementNo) {
+        return supplierSettlementService.getBySettlementNo(settlementNo);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody SupplierSettlement settlement) {
-        return ApiResponse.success(supplierSettlementService.save(settlement));
+    public Long create(@RequestBody SupplierSettlement settlement) {
+        return supplierSettlementService.save(settlement);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody SupplierSettlement settlement) {
+    public void update(@PathVariable Long id, @RequestBody SupplierSettlement settlement) {
         settlement.setId(id);
         supplierSettlementService.update(settlement);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         supplierSettlementService.delete(id);
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/{id}/settle")
-    public ApiResponse<Void> settle(@PathVariable Long id) {
+    public void settle(@PathVariable Long id) {
         supplierSettlementService.settle(id);
-        return ApiResponse.success(null);
     }
 
     @PostMapping("/generate")
-    public ApiResponse<Long> generateSettlement(@RequestParam Long supplierId, @RequestParam String period) {
-        return ApiResponse.success(supplierSettlementService.generateSettlement(supplierId, period));
+    public Long generateSettlement(@RequestParam Long supplierId, @RequestParam String period) {
+        return supplierSettlementService.generateSettlement(supplierId, period);
     }
 }

+ 8 - 12
backend/src/main/java/com/oms/controller/SysApiKeyController.java

@@ -1,7 +1,6 @@
 package com.oms.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.oms.common.ApiResponse;
 import com.oms.entity.SysApiKey;
 import com.oms.service.SysApiKeyService;
 import lombok.RequiredArgsConstructor;
@@ -15,32 +14,29 @@ public class SysApiKeyController {
     private final SysApiKeyService sysApiKeyService;
 
     @GetMapping
-    public ApiResponse<IPage<SysApiKey>> list(@RequestParam(defaultValue = "1") long page,
-                                               @RequestParam(defaultValue = "10") long size) {
-        return ApiResponse.success(sysApiKeyService.getApiKeys(page, size));
+    public IPage<SysApiKey> list(@RequestParam(defaultValue = "1") long page,
+                                 @RequestParam(defaultValue = "10") long size) {
+        return sysApiKeyService.getApiKeys(page, size);
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<SysApiKey> getById(@PathVariable Long id) {
-        return ApiResponse.success(sysApiKeyService.getById(id));
+    public SysApiKey getById(@PathVariable Long id) {
+        return sysApiKeyService.getById(id);
     }
 
     @PostMapping
-    public ApiResponse<Void> save(@RequestBody SysApiKey apiKey) {
+    public void save(@RequestBody SysApiKey apiKey) {
         sysApiKeyService.save(apiKey);
-        return ApiResponse.success(null);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody SysApiKey apiKey) {
+    public void update(@PathVariable Long id, @RequestBody SysApiKey apiKey) {
         apiKey.setId(id);
         sysApiKeyService.update(apiKey);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         sysApiKeyService.delete(id);
-        return ApiResponse.success(null);
     }
 }

+ 24 - 15
backend/src/main/java/com/oms/controller/SysApprovalFlowController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.SysApprovalFlowDTO;
 import com.oms.entity.SysApprovalFlow;
 import com.oms.service.SysApprovalFlowService;
@@ -16,40 +15,50 @@ public class SysApprovalFlowController {
     private final SysApprovalFlowService sysApprovalFlowService;
 
     @GetMapping
-    public ApiResponse<List<SysApprovalFlow>> getSysApprovalFlows(
+    public List<SysApprovalFlow> getSysApprovalFlows(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(sysApprovalFlowService.getPage(page, size).getRecords());
+        return sysApprovalFlowService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<SysApprovalFlow>> getAll() {
-        return ApiResponse.success(sysApprovalFlowService.getAll());
+    public List<SysApprovalFlow> getAll() {
+        return sysApprovalFlowService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<SysApprovalFlowDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(sysApprovalFlowService.getDtoById(id));
+    public SysApprovalFlowDTO getById(@PathVariable Long id) {
+        return sysApprovalFlowService.getDtoById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody SysApprovalFlow sysApprovalFlow) {
-        return ApiResponse.success(sysApprovalFlowService.save(sysApprovalFlow));
+    public Long create(@RequestBody SysApprovalFlow sysApprovalFlow) {
+        return sysApprovalFlowService.save(sysApprovalFlow);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody SysApprovalFlow sysApprovalFlow) {
+    public void update(@PathVariable Long id, @RequestBody SysApprovalFlow sysApprovalFlow) {
         sysApprovalFlow.setId(id);
         sysApprovalFlowService.update(sysApprovalFlow);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) { sysApprovalFlowService.delete(id); return ApiResponse.success(null); }
+    public void delete(@PathVariable Long id) {
+        sysApprovalFlowService.delete(id);
+    }
+
     @PostMapping("/{id}/submit")
-    public ApiResponse<Void> submit(@PathVariable Long id) { sysApprovalFlowService.submit(id); return ApiResponse.success(null); }
+    public void submit(@PathVariable Long id) {
+        sysApprovalFlowService.submit(id);
+    }
+
     @PostMapping("/{id}/approve")
-    public ApiResponse<Void> approve(@PathVariable Long id) { sysApprovalFlowService.approve(id); return ApiResponse.success(null); }
+    public void approve(@PathVariable Long id) {
+        sysApprovalFlowService.approve(id);
+    }
+
     @PostMapping("/{id}/reject")
-    public ApiResponse<Void> reject(@PathVariable Long id) { sysApprovalFlowService.reject(id); return ApiResponse.success(null); }
+    public void reject(@PathVariable Long id) {
+        sysApprovalFlowService.reject(id);
+    }
 }

+ 10 - 13
backend/src/main/java/com/oms/controller/SysDepartmentController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.entity.SysDepartment;
 import com.oms.service.SysDepartmentService;
 import lombok.RequiredArgsConstructor;
@@ -16,37 +15,35 @@ public class SysDepartmentController {
     private final SysDepartmentService sysDepartmentService;
 
     @GetMapping
-    public ApiResponse<List<SysDepartment>> getDepartments(
+    public List<SysDepartment> getDepartments(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(sysDepartmentService.getDepartments(page, size).getRecords());
+        return sysDepartmentService.getDepartments(page, size).getRecords();
     }
 
     @GetMapping("/tree")
-    public ApiResponse<List<SysDepartment>> getDepartmentTree() {
-        return ApiResponse.success(sysDepartmentService.getTree());
+    public List<SysDepartment> getDepartmentTree() {
+        return sysDepartmentService.getTree();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<SysDepartment> getById(@PathVariable Long id) {
-        return ApiResponse.success(sysDepartmentService.getById(id));
+    public SysDepartment getById(@PathVariable Long id) {
+        return sysDepartmentService.getById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody SysDepartment department) {
-        return ApiResponse.success(sysDepartmentService.save(department));
+    public Long create(@RequestBody SysDepartment department) {
+        return sysDepartmentService.save(department);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody SysDepartment department) {
+    public void update(@PathVariable Long id, @RequestBody SysDepartment department) {
         department.setId(id);
         sysDepartmentService.update(department);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         sysDepartmentService.delete(id);
-        return ApiResponse.success(null);
     }
 }

+ 10 - 13
backend/src/main/java/com/oms/controller/SysEmployeeController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.entity.SysEmployee;
 import com.oms.service.SysEmployeeService;
 import lombok.RequiredArgsConstructor;
@@ -16,37 +15,35 @@ public class SysEmployeeController {
     private final SysEmployeeService sysEmployeeService;
 
     @GetMapping
-    public ApiResponse<List<SysEmployee>> getEmployees(
+    public List<SysEmployee> getEmployees(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(sysEmployeeService.getEmployees(page, size).getRecords());
+        return sysEmployeeService.getEmployees(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<SysEmployee>> getAll() {
-        return ApiResponse.success(sysEmployeeService.getAll());
+    public List<SysEmployee> getAll() {
+        return sysEmployeeService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<SysEmployee> getById(@PathVariable Long id) {
-        return ApiResponse.success(sysEmployeeService.getById(id));
+    public SysEmployee getById(@PathVariable Long id) {
+        return sysEmployeeService.getById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody SysEmployee employee) {
-        return ApiResponse.success(sysEmployeeService.save(employee));
+    public Long create(@RequestBody SysEmployee employee) {
+        return sysEmployeeService.save(employee);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody SysEmployee employee) {
+    public void update(@PathVariable Long id, @RequestBody SysEmployee employee) {
         employee.setId(id);
         sysEmployeeService.update(employee);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         sysEmployeeService.delete(id);
-        return ApiResponse.success(null);
     }
 }

+ 10 - 13
backend/src/main/java/com/oms/controller/SysMessageTemplateController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.SysMessageTemplateDTO;
 import com.oms.entity.SysMessageTemplate;
 import com.oms.service.SysMessageTemplateService;
@@ -16,37 +15,35 @@ public class SysMessageTemplateController {
     private final SysMessageTemplateService sysMessageTemplateService;
 
     @GetMapping
-    public ApiResponse<List<SysMessageTemplate>> getSysMessageTemplates(
+    public List<SysMessageTemplate> getSysMessageTemplates(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(sysMessageTemplateService.getPage(page, size).getRecords());
+        return sysMessageTemplateService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<SysMessageTemplate>> getAll() {
-        return ApiResponse.success(sysMessageTemplateService.getAll());
+    public List<SysMessageTemplate> getAll() {
+        return sysMessageTemplateService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<SysMessageTemplateDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(sysMessageTemplateService.getDtoById(id));
+    public SysMessageTemplateDTO getById(@PathVariable Long id) {
+        return sysMessageTemplateService.getDtoById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody SysMessageTemplate sysMessageTemplate) {
-        return ApiResponse.success(sysMessageTemplateService.save(sysMessageTemplate));
+    public Long create(@RequestBody SysMessageTemplate sysMessageTemplate) {
+        return sysMessageTemplateService.save(sysMessageTemplate);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody SysMessageTemplate sysMessageTemplate) {
+    public void update(@PathVariable Long id, @RequestBody SysMessageTemplate sysMessageTemplate) {
         sysMessageTemplate.setId(id);
         sysMessageTemplateService.update(sysMessageTemplate);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         sysMessageTemplateService.delete(id);
-        return ApiResponse.success(null);
     }
 }

+ 8 - 11
backend/src/main/java/com/oms/controller/SysNotificationController.java

@@ -1,7 +1,6 @@
 package com.oms.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.oms.common.ApiResponse;
 import com.oms.entity.SysNotification;
 import com.oms.service.SysNotificationService;
 import lombok.RequiredArgsConstructor;
@@ -15,26 +14,24 @@ public class SysNotificationController {
     private final SysNotificationService sysNotificationService;
 
     @GetMapping
-    public ApiResponse<IPage<SysNotification>> list(@RequestParam(defaultValue = "1") long page,
-                                                    @RequestParam(defaultValue = "10") long size,
-                                                    @RequestParam String userId) {
-        return ApiResponse.success(sysNotificationService.getNotifications(page, size, userId));
+    public IPage<SysNotification> list(@RequestParam(defaultValue = "1") long page,
+                                      @RequestParam(defaultValue = "10") long size,
+                                      @RequestParam String userId) {
+        return sysNotificationService.getNotifications(page, size, userId);
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<SysNotification> getById(@PathVariable Long id) {
-        return ApiResponse.success(sysNotificationService.getById(id));
+    public SysNotification getById(@PathVariable Long id) {
+        return sysNotificationService.getById(id);
     }
 
     @PutMapping("/{id}/read")
-    public ApiResponse<Void> markAsRead(@PathVariable Long id) {
+    public void markAsRead(@PathVariable Long id) {
         sysNotificationService.markAsRead(id);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         sysNotificationService.delete(id);
-        return ApiResponse.success(null);
     }
 }

+ 5 - 6
backend/src/main/java/com/oms/controller/SysOperationLogController.java

@@ -1,7 +1,6 @@
 package com.oms.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.oms.common.ApiResponse;
 import com.oms.entity.SysOperationLog;
 import com.oms.service.SysOperationLogService;
 import lombok.RequiredArgsConstructor;
@@ -15,13 +14,13 @@ public class SysOperationLogController {
     private final SysOperationLogService sysOperationLogService;
 
     @GetMapping
-    public ApiResponse<IPage<SysOperationLog>> list(@RequestParam(defaultValue = "1") long page,
-                                                      @RequestParam(defaultValue = "10") long size) {
-        return ApiResponse.success(sysOperationLogService.getLogs(page, size));
+    public IPage<SysOperationLog> list(@RequestParam(defaultValue = "1") long page,
+                                       @RequestParam(defaultValue = "10") long size) {
+        return sysOperationLogService.getLogs(page, size);
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<SysOperationLog> getById(@PathVariable Long id) {
-        return ApiResponse.success(sysOperationLogService.getById(id));
+    public SysOperationLog getById(@PathVariable Long id) {
+        return sysOperationLogService.getById(id);
     }
 }

+ 8 - 12
backend/src/main/java/com/oms/controller/SysRoleController.java

@@ -1,7 +1,6 @@
 package com.oms.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.oms.common.ApiResponse;
 import com.oms.entity.SysRole;
 import com.oms.service.SysRoleService;
 import lombok.RequiredArgsConstructor;
@@ -15,32 +14,29 @@ public class SysRoleController {
     private final SysRoleService sysRoleService;
 
     @GetMapping
-    public ApiResponse<IPage<SysRole>> list(@RequestParam(defaultValue = "1") long page,
-                                             @RequestParam(defaultValue = "10") long size) {
-        return ApiResponse.success(sysRoleService.getRoles(page, size));
+    public IPage<SysRole> list(@RequestParam(defaultValue = "1") long page,
+                               @RequestParam(defaultValue = "10") long size) {
+        return sysRoleService.getRoles(page, size);
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<SysRole> getById(@PathVariable Long id) {
-        return ApiResponse.success(sysRoleService.getById(id));
+    public SysRole getById(@PathVariable Long id) {
+        return sysRoleService.getById(id);
     }
 
     @PostMapping
-    public ApiResponse<Void> save(@RequestBody SysRole role) {
+    public void save(@RequestBody SysRole role) {
         sysRoleService.save(role);
-        return ApiResponse.success(null);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody SysRole role) {
+    public void update(@PathVariable Long id, @RequestBody SysRole role) {
         role.setId(id);
         sysRoleService.update(role);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         sysRoleService.delete(id);
-        return ApiResponse.success(null);
     }
 }

+ 12 - 13
backend/src/main/java/com/oms/controller/SysUserController.java

@@ -1,12 +1,13 @@
 package com.oms.controller;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.oms.common.ApiResponse;
 import com.oms.entity.SysUser;
 import com.oms.service.SysUserService;
 import lombok.RequiredArgsConstructor;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
+
 @RestController
 @RequestMapping("/system/users")
 @RequiredArgsConstructor
@@ -15,37 +16,35 @@ public class SysUserController {
     private final SysUserService sysUserService;
 
     @GetMapping
-    public ApiResponse<Page<SysUser>> getUsers(
+    public Page<SysUser> getUsers(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(sysUserService.getUsers(page, size));
+        return sysUserService.getUsers(page, size);
     }
 
     @GetMapping("/all")
-    public ApiResponse<java.util.List<SysUser>> getAll() {
-        return ApiResponse.success(sysUserService.getAll());
+    public List<SysUser> getAll() {
+        return sysUserService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<SysUser> getById(@PathVariable Long id) {
-        return ApiResponse.success(sysUserService.getById(id));
+    public SysUser getById(@PathVariable Long id) {
+        return sysUserService.getById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody SysUser user) {
-        return ApiResponse.success(sysUserService.save(user));
+    public Long create(@RequestBody SysUser user) {
+        return sysUserService.save(user);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody SysUser user) {
+    public void update(@PathVariable Long id, @RequestBody SysUser user) {
         user.setId(id);
         sysUserService.update(user);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         sysUserService.delete(id);
-        return ApiResponse.success(null);
     }
 }

+ 10 - 13
backend/src/main/java/com/oms/controller/WarehouseController.java

@@ -1,6 +1,5 @@
 package com.oms.controller;
 
-import com.oms.common.ApiResponse;
 import com.oms.dto.WarehouseDTO;
 import com.oms.entity.Warehouse;
 import com.oms.service.WarehouseService;
@@ -17,37 +16,35 @@ public class WarehouseController {
     private final WarehouseService warehouseService;
 
     @GetMapping
-    public ApiResponse<List<Warehouse>> getWarehouses(
+    public List<Warehouse> getWarehouses(
             @RequestParam(defaultValue = "1") int page,
             @RequestParam(defaultValue = "20") int size) {
-        return ApiResponse.success(warehouseService.getPage(page, size).getRecords());
+        return warehouseService.getPage(page, size).getRecords();
     }
 
     @GetMapping("/all")
-    public ApiResponse<List<Warehouse>> getAll() {
-        return ApiResponse.success(warehouseService.getAll());
+    public List<Warehouse> getAll() {
+        return warehouseService.getAll();
     }
 
     @GetMapping("/{id}")
-    public ApiResponse<WarehouseDTO> getById(@PathVariable Long id) {
-        return ApiResponse.success(warehouseService.getDtoById(id));
+    public WarehouseDTO getById(@PathVariable Long id) {
+        return warehouseService.getDtoById(id);
     }
 
     @PostMapping
-    public ApiResponse<Long> create(@RequestBody Warehouse warehouse) {
-        return ApiResponse.success(warehouseService.save(warehouse));
+    public Long create(@RequestBody Warehouse warehouse) {
+        return warehouseService.save(warehouse);
     }
 
     @PutMapping("/{id}")
-    public ApiResponse<Void> update(@PathVariable Long id, @RequestBody Warehouse warehouse) {
+    public void update(@PathVariable Long id, @RequestBody Warehouse warehouse) {
         warehouse.setId(id);
         warehouseService.update(warehouse);
-        return ApiResponse.success(null);
     }
 
     @DeleteMapping("/{id}")
-    public ApiResponse<Void> delete(@PathVariable Long id) {
+    public void delete(@PathVariable Long id) {
         warehouseService.delete(id);
-        return ApiResponse.success(null);
     }
 }