xin
2025-07-10 09ac251a089f5bb79d59a12bf2f932dda12c4ca2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package com.oying.modules.sh.rest;
 
import com.oying.annotation.Log;
import com.oying.modules.sh.domain.OrderProductSnapshot;
import com.oying.modules.sh.service.OrderProductSnapshotService;
import com.oying.utils.R;
import lombok.RequiredArgsConstructor;
 
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.*;
 
/**
 * @author lixin
 * @date 2025-06-11
 **/
@RestController
@RequiredArgsConstructor
@Api(tags = "SH:订单商品快照")
@RequestMapping("/api/orderProductSnapshot")
public class OrderProductSnapshotController {
 
    private final OrderProductSnapshotService orderProductSnapshotService;
 
    @GetMapping
    @ApiOperation("根据订单号查询订单商品快照")
    public ResponseEntity<Object> queryOrderProductSnapshot(@RequestParam String orderNum) {
        return new ResponseEntity<>(R.success(orderProductSnapshotService.queryOrderProductSnapshot(orderNum)), HttpStatus.OK);
    }
 
    @PutMapping
    @Log("修改订单商品快照")
    @ApiOperation("修改订单商品快照")
    @PreAuthorize("@el.check('orderProductSnapshot:edit')")
    public ResponseEntity<Object> updateOrderProductSnapshot(@Validated @RequestBody OrderProductSnapshot resources) {
        orderProductSnapshotService.update(resources);
        return new ResponseEntity<>(HttpStatus.NO_CONTENT);
    }
}