package com.sqx.modules.errand.controller;

import com.sqx.common.utils.Result;
import com.sqx.modules.errand.entity.ServiceType;
import com.sqx.modules.errand.service.ServiceTypeService;
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/servicetype")
@Api(value = "管理端-服务类型", tags = {"管理端-服务类型"})
public class AdminServiceTypeController {

    @Autowired
    private ServiceTypeService serviceTypeService;

    @ApiOperation("查")
    @GetMapping(value = "selectServiceTypeList")
    public Result selectServiceTypeList(){

        return serviceTypeService.selectServiceTypeList();
    }

    @ApiOperation("增")
    @PostMapping(value = "insertServiceType")
    public Result insertServiceType(@RequestBody ServiceType serviceType){

        return serviceTypeService.insertServiceType(serviceType);
    }

    @ApiOperation("改")
    @PostMapping(value = "updateServiceType")
    public Result updateServiceType(@RequestBody ServiceType serviceType){

        return serviceTypeService.updateServiceType(serviceType);
    }

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

        return serviceTypeService.deleteServiceType(id);
    }



}
