package com.oying.modules.sh.rest;
|
|
import com.oying.annotation.Log;
|
import com.oying.modules.sh.domain.OrderAddressSnapshot;
|
import com.oying.modules.sh.service.OrderAddressSnapshotService;
|
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/orderAddressSnapshot")
|
public class OrderAddressSnapshotController {
|
|
private final OrderAddressSnapshotService orderAddressSnapshotService;
|
|
@GetMapping
|
@ApiOperation("根据订单号查询订单地址快照")
|
public ResponseEntity<Object> queryByOrderNum(@RequestParam String orderNum) {
|
return new ResponseEntity<>(R.success(orderAddressSnapshotService.queryByOrderNum(orderNum)), HttpStatus.OK);
|
}
|
|
@PutMapping
|
@Log("修改订单地址快照")
|
@ApiOperation("修改订单地址快照")
|
@PreAuthorize("@el.check('orderAddressSnapshot:edit')")
|
public ResponseEntity<Object> updateOrderAddressSnapshot(@Validated @RequestBody OrderAddressSnapshot resources) {
|
orderAddressSnapshotService.update(resources);
|
return new ResponseEntity<>(R.success(), HttpStatus.NO_CONTENT);
|
}
|
}
|