package cn.com.ty.lift.ud.maintenanceCompany.controller;

import cn.com.ty.lift.ud.common.BaseController;
import cn.com.ty.lift.ud.maintenanceCompany.controller.query.MaintenanceCompanyQuery;
import cn.com.ty.lift.ud.maintenanceCompany.mapper.entity.MaintenanceCompanyEntity;
import cn.com.ty.lift.ud.maintenanceCompany.service.IMaintenanceCompanyService;
import cn.com.xwy.boot.web.dto.RestResponse;
import com.baomidou.mybatisplus.extension.service.IService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 维保公司API
 * 
 * @author Xson
 * @date 2020-05-19
 */
@Api(tags = "维保公司API - 小陶")
@RestController
@RequestMapping("/api/maintenanceCompanys")
public class MaintenanceCompanyController extends BaseController<MaintenanceCompanyEntity, MaintenanceCompanyQuery> {

    private final Logger log = LoggerFactory.getLogger(MaintenanceCompanyController.class);
    
    private @Autowired IMaintenanceCompanyService maintenanceCompanyService;

    @Override
    protected IService<MaintenanceCompanyEntity> getService() {
        return maintenanceCompanyService;
    }

    @PostMapping("/query-company-list")
    @ApiOperation(value = "查询所有公司名称和ID")
    public RestResponse getAllCompany(@RequestBody MaintenanceCompanyQuery query) {
        return maintenanceCompanyService.getAllCompany(query);
    }
}