package com.sqx.modules.errand.controller;

import com.sqx.common.utils.Result;
import com.sqx.modules.errand.entity.ErrandIllegalType;
import com.sqx.modules.errand.service.ErrandIllegalTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/illegalType")
@Api(value = "管理端-跑腿投诉类型", tags = {"管理端-跑腿投诉类型"})
public class IllegalTypeController {

    @Autowired
    private ErrandIllegalTypeService errandIllegalTypeService;

    @ApiOperation("查（不分页）")
    @GetMapping(value = "selectIllegalTypeList")
    public Result selectIllegalTypeList(){

        return errandIllegalTypeService.selectIllegalTypeList();
    }

    @ApiOperation("查（不分页）")
    @GetMapping(value = "selectIllegalTypePage")
    public Result selectIllegalTypePage(Integer page, Integer limit){

        return errandIllegalTypeService.selectIllegalTypePage(page, limit);
    }

    @ApiOperation("增")
    @PostMapping(value = "insertIllegalType")
    public Result insertIllegalType(@RequestBody ErrandIllegalType errandIllegalType){

        return errandIllegalTypeService.insertIllegalType(errandIllegalType);
    }

    @ApiOperation("改")
    @PostMapping(value = "updateIllegalType")
    public Result updateIllegalType(@RequestBody ErrandIllegalType errandIllegalType){

        return errandIllegalTypeService.updateIllegalType(errandIllegalType);
    }

    @ApiOperation("删")
    @GetMapping(value = "deleteIllegalType")
    public Result deleteIllegalType(Long id){

        return errandIllegalTypeService.deleteIllegalType(id);
    }

}
