package com.oying.modules.message.rest;
|
|
import com.oying.annotation.Log;
|
import com.oying.modules.message.domain.MessageSystemAdvertise;
|
import com.oying.modules.message.service.MessageSystemAdvertiseService;
|
import com.oying.modules.message.domain.dto.MessageSystemAdvertiseQueryCriteria;
|
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 leomon
|
* @date 2025-06-05
|
**/
|
@RestController
|
@RequiredArgsConstructor
|
@Api(tags = "广告")
|
@RequestMapping("/api/messageSystemAdvertise")
|
public class MessageSystemAdvertiseController {
|
|
private final MessageSystemAdvertiseService messageSystemAdvertiseService;
|
|
|
@GetMapping
|
@ApiOperation("页查询广告")
|
@PreAuthorize("@el.check('messageSystemAdvertise:list')")
|
public R<PageResult<MessageSystemAdvertise>> queryMessageSystemAdvertise(MessageSystemAdvertiseQueryCriteria criteria){
|
Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize());
|
// return new ResponseEntity<>(messageSystemAdvertiseService.queryAll(criteria,page),HttpStatus.OK);
|
return R.success(messageSystemAdvertiseService.queryAll(criteria,page));
|
|
}
|
//条查询广告
|
@GetMapping("/{id}")
|
@ApiOperation("条查询广告")
|
public R<MessageSystemAdvertise> getMessageSystemAdvertise(@PathVariable Integer id){
|
MessageSystemAdvertise messageSystemAdvertise = messageSystemAdvertiseService.getById(id);
|
// return new ResponseEntity<>(messageSystemAdvertise,HttpStatus.OK);
|
return R.success(messageSystemAdvertise);
|
}
|
|
// @PostMapping
|
// @Log("新增广告")
|
// @ApiOperation("新增广告")
|
// @PreAuthorize("@el.check('messageSystemAdvertise:add')")
|
// public ResponseEntity<Object> createMessageSystemAdvertise(@Validated @RequestBody MessageSystemAdvertise resources){
|
// messageSystemAdvertiseService.create(resources);
|
// return new ResponseEntity<>(HttpStatus.CREATED);
|
// }
|
|
// @PutMapping
|
// @Log("修改广告")
|
// @ApiOperation("修改广告")
|
// @PreAuthorize("@el.check('messageSystemAdvertise:edit')")
|
// public ResponseEntity<Object> updateMessageSystemAdvertise(@Validated @RequestBody MessageSystemAdvertise resources){
|
// messageSystemAdvertiseService.update(resources);
|
// return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
// }
|
|
// @DeleteMapping
|
// @Log("删除广告")
|
// @ApiOperation("删除广告")
|
// @PreAuthorize("@el.check('messageSystemAdvertise:del')")
|
// public ResponseEntity<Object> deleteMessageSystemAdvertise(@ApiParam(value = "传ID数组[]") @RequestBody List<Long> ids) {
|
// messageSystemAdvertiseService.deleteAll(ids);
|
// return new ResponseEntity<>(HttpStatus.OK);
|
// }
|
}
|