首页>代码>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);
    }

}
最近下载更多
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日
微信网友_6927932988952576  LV12 2024年3月30日
eagerwujin  LV4 2024年3月2日
最近浏览更多
luhong  LV1 3月31日
叉烧君  LV3 3月20日
102404426  LV8 3月3日
qpzmla 2024年12月13日
暂无贡献等级
zolscy  LV24 2024年11月26日
citybird  LV4 2024年11月18日
微信网友_6779541724286976 2024年11月15日
暂无贡献等级
withyouatdusk  LV2 2024年10月20日
Peny_ZH  LV5 2024年9月21日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友