| | |
| | | * @return 所有数据
|
| | | */
|
| | | @GetMapping
|
| | | @ApiOperation(value = "查询所有数据")
|
| | | public R selectAll(Page<NewsAdmin> page, NewsAdmin newsAdmin) {
|
| | | return success(this.newsAdminService.page(page, new QueryWrapper<>(newsAdmin)));
|
| | | }
|
| | |
| | | * @return 单条数据
|
| | | */
|
| | | @GetMapping("{id}")
|
| | | @ApiOperation(value = "按id查询数据")
|
| | | public R selectOne(@PathVariable Serializable id) {
|
| | | return success(this.newsAdminService.getById(id));
|
| | | }
|
| | |
| | | * @return 新增结果
|
| | | */
|
| | | @PostMapping
|
| | | @ApiOperation(value = "新增数据")
|
| | | public R insert(@RequestBody NewsAdmin newsAdmin) {
|
| | | return success(this.newsAdminService.save(newsAdmin));
|
| | | }
|
| | |
| | | * @return 修改结果
|
| | | */
|
| | | @PutMapping
|
| | | @ApiOperation(value = "修改数据")
|
| | | public R update(@RequestBody NewsAdmin newsAdmin) {
|
| | | return success(this.newsAdminService.updateById(newsAdmin));
|
| | | }
|
| | |
| | | * @return 删除结果
|
| | | */
|
| | | @DeleteMapping
|
| | | @ApiOperation(value = "删除数据")
|
| | | public R delete(@RequestParam("idList") List<Long> idList) {
|
| | | return success(this.newsAdminService.removeByIds(idList));
|
| | | }
|