From 3e5c32288447da14ad6032aeb5bf5f79fa9a0560 Mon Sep 17 00:00:00 2001
From: xin <1099200748@qq.com>
Date: Tue, 24 Jun 2025 11:40:03 +0800
Subject: [PATCH] 封装返回值

---
 oying-system/src/main/java/com/oying/modules/sh/rest/OrderReturnProductSnapshotController.java |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/oying-system/src/main/java/com/oying/modules/sh/rest/OrderReturnProductSnapshotController.java b/oying-system/src/main/java/com/oying/modules/sh/rest/OrderReturnProductSnapshotController.java
index c91d620..b54edc3 100644
--- a/oying-system/src/main/java/com/oying/modules/sh/rest/OrderReturnProductSnapshotController.java
+++ b/oying-system/src/main/java/com/oying/modules/sh/rest/OrderReturnProductSnapshotController.java
@@ -4,23 +4,27 @@
 import com.oying.modules.sh.domain.OrderReturnProductSnapshot;
 import com.oying.modules.sh.service.OrderReturnProductSnapshotService;
 import com.oying.modules.sh.domain.dto.OrderReturnProductSnapshotQueryCriteria;
+import com.oying.utils.R;
 import lombok.RequiredArgsConstructor;
+
 import java.util.List;
+
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import io.swagger.annotations.*;
+
 import java.io.IOException;
 import javax.servlet.http.HttpServletResponse;
+
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.oying.utils.PageResult;
 
 /**
-* @author lixin
-* @date 2025-06-11
-**/
+ * @author lixin
+ * @date 2025-06-11
+ **/
 @RestController
 @RequiredArgsConstructor
 @Api(tags = "SH:退款订单商品快照")
@@ -39,27 +43,27 @@
     @GetMapping
     @ApiOperation("查询退款订单商品快照")
     @PreAuthorize("@el.check('orderReturnProductSnapshot:list')")
-    public ResponseEntity<PageResult<OrderReturnProductSnapshot>> queryOrderReturnProductSnapshot(OrderReturnProductSnapshotQueryCriteria criteria){
+    public ResponseEntity<Object> queryOrderReturnProductSnapshot(OrderReturnProductSnapshotQueryCriteria criteria) {
         Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize());
-        return new ResponseEntity<>(orderReturnProductSnapshotService.queryAll(criteria,page),HttpStatus.OK);
+        return new ResponseEntity<>(R.success(orderReturnProductSnapshotService.queryAll(criteria, page)), HttpStatus.OK);
     }
 
     @PostMapping
     @Log("新增退款订单商品快照")
     @ApiOperation("新增退款订单商品快照")
     @PreAuthorize("@el.check('orderReturnProductSnapshot:add')")
-    public ResponseEntity<Object> createOrderReturnProductSnapshot(@Validated @RequestBody OrderReturnProductSnapshot resources){
+    public ResponseEntity<Object> createOrderReturnProductSnapshot(@Validated @RequestBody OrderReturnProductSnapshot resources) {
         orderReturnProductSnapshotService.create(resources);
-        return new ResponseEntity<>(HttpStatus.CREATED);
+        return new ResponseEntity<>(R.success(), HttpStatus.CREATED);
     }
 
     @PutMapping
     @Log("修改退款订单商品快照")
     @ApiOperation("修改退款订单商品快照")
     @PreAuthorize("@el.check('orderReturnProductSnapshot:edit')")
-    public ResponseEntity<Object> updateOrderReturnProductSnapshot(@Validated @RequestBody OrderReturnProductSnapshot resources){
+    public ResponseEntity<Object> updateOrderReturnProductSnapshot(@Validated @RequestBody OrderReturnProductSnapshot resources) {
         orderReturnProductSnapshotService.update(resources);
-        return new ResponseEntity<>(HttpStatus.NO_CONTENT);
+        return new ResponseEntity<>(R.success(), HttpStatus.NO_CONTENT);
     }
 
     @DeleteMapping
@@ -68,6 +72,6 @@
     @PreAuthorize("@el.check('orderReturnProductSnapshot:del')")
     public ResponseEntity<Object> deleteOrderReturnProductSnapshot(@ApiParam(value = "传ID数组[]") @RequestBody List<Long> ids) {
         orderReturnProductSnapshotService.deleteAll(ids);
-        return new ResponseEntity<>(HttpStatus.OK);
+        return new ResponseEntity<>(R.success(), HttpStatus.OK);
     }
 }

--
Gitblit v1.9.3