fangyuan
2022-11-22 b1516fedd7deedb61641321158fce862f77b4b4d
ycl-platform/src/main/java/com/ycl/controller/NewsIpController.java
@@ -8,6 +8,8 @@
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;
@@ -22,6 +24,7 @@
 */
@RestController
@RequestMapping("newsIp")
@Api(tags = "ip管理")
public class NewsIpController extends ApiController {
    /**
     * 服务对象
@@ -37,6 +40,7 @@
     * @return 所有数据
     */
    @GetMapping
    @ApiOperation("查询所有")
    public R selectAll(Page<NewsIp> page, NewsIp newsIp) {
        return success(this.newsIpService.page(page, new QueryWrapper<>(newsIp)));
    }
@@ -48,6 +52,7 @@
     * @return 单条数据
     */
    @GetMapping("{id}")
    @ApiOperation("按id查询")
    public R selectOne(@PathVariable Serializable id) {
        return success(this.newsIpService.getById(id));
    }
@@ -59,6 +64,7 @@
     * @return 新增结果
     */
    @PostMapping
    @ApiOperation("新增")
    public R insert(@RequestBody NewsIp newsIp) {
        return success(this.newsIpService.save(newsIp));
    }
@@ -70,6 +76,7 @@
     * @return 修改结果
     */
    @PutMapping
    @ApiOperation("修改")
    public R update(@RequestBody NewsIp newsIp) {
        return success(this.newsIpService.updateById(newsIp));
    }
@@ -81,6 +88,7 @@
     * @return 删除结果
     */
    @DeleteMapping
    @ApiOperation("删除")
    public R delete(@RequestParam("idList") List<Long> idList) {
        return success(this.newsIpService.removeByIds(idList));
    }