| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
| | | import com.ycl.entity.NewsIp;
|
| | | import com.ycl.service.NewsIpService;
|
| | | import io.swagger.annotations.Api;
|
| | | import io.swagger.annotations.ApiOperation;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
| | | */
|
| | | @RestController
|
| | | @RequestMapping("newsIp")
|
| | | @Api(tags = "ip管理")
|
| | | public class NewsIpController extends ApiController {
|
| | | /**
|
| | | * 服务对象
|
| | |
| | | * @return 所有数据
|
| | | */
|
| | | @GetMapping
|
| | | @ApiOperation("查询所有")
|
| | | public R selectAll(Page<NewsIp> page, NewsIp newsIp) {
|
| | | return success(this.newsIpService.page(page, new QueryWrapper<>(newsIp)));
|
| | | }
|
| | |
| | | * @return 单条数据
|
| | | */
|
| | | @GetMapping("{id}")
|
| | | @ApiOperation("按id查询")
|
| | | public R selectOne(@PathVariable Serializable id) {
|
| | | return success(this.newsIpService.getById(id));
|
| | | }
|
| | |
| | | * @return 新增结果
|
| | | */
|
| | | @PostMapping
|
| | | @ApiOperation("新增")
|
| | | public R insert(@RequestBody NewsIp newsIp) {
|
| | | return success(this.newsIpService.save(newsIp));
|
| | | }
|
| | |
| | | * @return 修改结果
|
| | | */
|
| | | @PutMapping
|
| | | @ApiOperation("修改")
|
| | | public R update(@RequestBody NewsIp newsIp) {
|
| | | return success(this.newsIpService.updateById(newsIp));
|
| | | }
|
| | |
| | | * @return 删除结果
|
| | | */
|
| | | @DeleteMapping
|
| | | @ApiOperation("删除")
|
| | | public R delete(@RequestParam("idList") List<Long> idList) {
|
| | | return success(this.newsIpService.removeByIds(idList));
|
| | | }
|