首页>代码>spring boot+layui开发极简物业后台管理系统>/springboot-pms/src/main/java/com/simon/springbootpms/controller/ComplaintTypeController.java
package com.simon.springbootpms.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.simon.springbootpms.model.ComplaintType;
import com.simon.springbootpms.service.IComplaintTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Simon
 */
@Api(tags = {""})
@RestController
@RequestMapping("/complainttype")
public class ComplaintTypeController {

    private Logger log = LoggerFactory.getLogger(getClass());

    @Resource
    private IComplaintTypeService complaintTypeService;


    @RequestMapping("/queryAll")
    public List<ComplaintType> queryAll() {
        return complaintTypeService.queryType();
    }

    @ApiOperation(value = "新增")
    @PostMapping()
    public int add(@RequestBody ComplaintType complaintType) {
        return complaintTypeService.add(complaintType);
    }

    @ApiOperation(value = "删除")
    @DeleteMapping("{id}")
    public int delete(@PathVariable("id") Long id) {
        return complaintTypeService.delete(id);
    }

    @ApiOperation(value = "更新")
    @PutMapping()
    public int update(@RequestBody ComplaintType complaintType) {
        return complaintTypeService.updateData(complaintType);
    }

    @ApiOperation(value = "查询分页数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page", value = "页码"),
            @ApiImplicitParam(name = "pageCount", value = "每页条数")
    })
    @GetMapping()
    public IPage<ComplaintType> findListByPage(@RequestParam Integer page,
                                               @RequestParam Integer pageCount) {
        return complaintTypeService.findListByPage(page, pageCount);
    }

    @ApiOperation(value = "id查询")
    @GetMapping("{id}")
    public ComplaintType findById(@PathVariable Long id) {
        return complaintTypeService.findById(id);
    }

}
最近下载更多
C544350851  LV26 昨天
yifeng868  LV9 6月11日
102404426  LV8 3月3日
zolscy  LV24 2024年11月27日
计科一班  LV7 2024年6月19日
TY0165  LV20 2024年6月16日
1941549176  LV4 2024年5月10日
ma406805131  LV19 2024年5月7日
YhXyHx523  LV6 2024年4月13日
wanglinddad  LV55 2024年3月31日
最近浏览更多
C544350851  LV26 昨天
yifeng868  LV9 6月10日
KAIzx11  LV8 5月5日
luhong  LV4 3月31日
叉烧君  LV3 3月20日
102404426  LV8 3月3日
qpzmla 2024年12月13日
暂无贡献等级
zolscy  LV24 2024年11月26日
citybird  LV4 2024年11月18日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友