package com.oying.modules.message.rest;
|
|
import com.oying.annotation.Log;
|
import com.oying.modules.message.domain.MessageOrderSeller;
|
import com.oying.modules.message.service.MessageOrderSellerService;
|
import com.oying.modules.message.domain.dto.MessageOrderSellerQueryCriteria;
|
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 李萌
|
* @date 2025-05-20
|
**/
|
@RestController
|
@RequiredArgsConstructor
|
@Api(tags = "卖家端订单消息通知")
|
@RequestMapping("/api/messageOrderSeller")
|
public class MessageOrderSellerController {
|
|
private final MessageOrderSellerService messageOrderSellerService;
|
|
@ApiOperation("导出数据")
|
@GetMapping(value = "/download")
|
@PreAuthorize("@el.check('messageOrderSeller:list')")
|
public void exportMessageOrderSeller(HttpServletResponse response, MessageOrderSellerQueryCriteria criteria) throws IOException {
|
messageOrderSellerService.download(messageOrderSellerService.queryAll(criteria), response);
|
}
|
|
@GetMapping
|
@ApiOperation("查询卖家端订单消息通知")
|
@PreAuthorize("@el.check('messageOrderSeller:list')")
|
public ResponseEntity<PageResult<MessageOrderSeller>> queryMessageOrderSeller(MessageOrderSellerQueryCriteria criteria){
|
Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize());
|
return new ResponseEntity<>(messageOrderSellerService.queryAll(criteria,page),HttpStatus.OK);
|
}
|
|
@PostMapping
|
@Log("新增卖家端订单消息通知")
|
@ApiOperation("新增卖家端订单消息通知")
|
@PreAuthorize("@el.check('messageOrderSeller:add')")
|
public ResponseEntity<Object> createMessageOrderSeller(@Validated @RequestBody MessageOrderSeller resources){
|
messageOrderSellerService.create(resources);
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
}
|
|
@PutMapping
|
@Log("修改卖家端订单消息通知")
|
@ApiOperation("修改卖家端订单消息通知")
|
@PreAuthorize("@el.check('messageOrderSeller:edit')")
|
public ResponseEntity<Object> updateMessageOrderSeller(@Validated @RequestBody MessageOrderSeller resources){
|
messageOrderSellerService.update(resources);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
}
|
|
@DeleteMapping
|
@Log("删除卖家端订单消息通知")
|
@ApiOperation("删除卖家端订单消息通知")
|
@PreAuthorize("@el.check('messageOrderSeller:del')")
|
public ResponseEntity<Object> deleteMessageOrderSeller(@ApiParam(value = "传ID数组[]") @RequestBody List<Integer> ids) {
|
messageOrderSellerService.deleteAll(ids);
|
return new ResponseEntity<>(HttpStatus.OK);
|
}
|
}
|