package cn.com.ty.lift.system.settings.controller;


import cn.com.ty.lift.system.settings.dao.entity.model.MaintenanceCompanyRequest;
import cn.com.ty.lift.system.settings.service.IMaintenanceCompanyService;
import cn.com.xwy.boot.web.dto.RestResponse;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.IOException;

/**
 * <p>
 * 维保公司 前端控制器
 * </p>
 *
 * @author huangy
 * @since 2019-12-09
 */
@RestController
@RequestMapping("/mtcompany")
public class MaintenanceCompanyController {

    @Resource
    private IMaintenanceCompanyService maintenanceCompanyService;

    /**
     * @param maintenanceCompanyRequest 请求类
     * @return
     * @description 获取公司列表
     * @date 2019-12-11 11:01
     */
    @RequestMapping("/list")
    public RestResponse list(@RequestBody MaintenanceCompanyRequest maintenanceCompanyRequest) {
        return maintenanceCompanyService.list(maintenanceCompanyRequest);
    }

    /**
     * @param
     * @return
     * @description 认证企业统计
     * @date 2020/2/14 2:45 下午
     */
    @RequestMapping("/confirmCompanyList")
    public RestResponse confirmCompanyList(@RequestBody MaintenanceCompanyRequest maintenanceCompanyRequest) {
        return maintenanceCompanyService.getConfirmCompanyList(maintenanceCompanyRequest);
    }

    /**
     * @param maintenanceCompanyRequest
     * @return
     * @description 获取用户所在的团队信息
     * @date 2019-12-23 13:02
     */
    @RequestMapping("/ownList")
    public RestResponse ownList(@RequestBody MaintenanceCompanyRequest maintenanceCompanyRequest) {
        return maintenanceCompanyService.ownList(maintenanceCompanyRequest);
    }

    /**
     * @param maintenanceCompanyRequest 请求对象
     * @return
     * @description 创建团队
     * @date 2019-12-11 14:04
     */
    @PostMapping("/createTeam")
    public RestResponse createTeam(@RequestBody MaintenanceCompanyRequest maintenanceCompanyRequest) throws IOException {
        return maintenanceCompanyService.createTeam(maintenanceCompanyRequest);
    }

    /**
     * @param maintenanceCompanyRequest 维保公司请求
     * @return
     * @description 更新公司信息
     * @date 2019-12-13 11:38
     */
    @PostMapping("/updateCompany")
    public RestResponse updateMaintenanceCompany(@RequestBody MaintenanceCompanyRequest maintenanceCompanyRequest) {
        return maintenanceCompanyService.updateMaintenanceCompany(maintenanceCompanyRequest);
    }

    /**
     * @param
     * @return
     * @description 获取团队详情
     * @date 2020/5/3 11:49 上午
     */
    @RequestMapping("/teamInfo")
    public RestResponse teamInfo(@RequestBody MaintenanceCompanyRequest maintenanceCompanyRequest) {
        return maintenanceCompanyService.teamInfo(maintenanceCompanyRequest);
    }

}
