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

import cn.com.ty.lift.system.settings.dao.entity.model.CompanyAttestationRequest;
import cn.com.ty.lift.system.settings.dao.entity.model.MaintenanceCompanyRequest;
import cn.com.ty.lift.system.settings.service.IMtCompanyAttestationService;
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;

/**
 * @author huangyuan
 * @date 2019-12-13
 * @description
 */
@RestController
@RequestMapping("/attestation")
public class CompanyAttestationController {

    @Resource
    private IMtCompanyAttestationService companyAttestationService;

    /**
     * @param
     * @return
     * @description 获取认证公司数据
     * @date 2020/5/25 2:28 下午
     */
    @RequestMapping("/applyCompanyList")
    public RestResponse applyCompanyList(@RequestBody MaintenanceCompanyRequest maintenanceCompanyRequest) {
        return companyAttestationService.applyCompanyList(maintenanceCompanyRequest);
    }

    /**
     * @param
     * @return
     * @description 获取申请列表
     * @date 2019-12-18 15:44
     */
    @RequestMapping("/list")
    public RestResponse list(@RequestBody CompanyAttestationRequest companyAttestationRequest) {
        return companyAttestationService.applyList(companyAttestationRequest);
    }

    /**
     * @param companyAttestationRequest 请求对象
     * @return
     * @description 申请认证
     * @date 2019-12-12 09:21
     */
    @PostMapping("/applyAudit")
    public RestResponse applyAudit(@RequestBody CompanyAttestationRequest companyAttestationRequest) {
        return companyAttestationService.applyAudit(companyAttestationRequest);
    }

    /**
     * @param
     * @return
     * @description 认证结果
     * @date 2020-01-07 20:44
     */
    @RequestMapping("/auditResult")
    public RestResponse auditResult(@RequestBody CompanyAttestationRequest companyAttestationRequest) {
        return companyAttestationService.getAuditResult(companyAttestationRequest);
    }

    /**
     * @param companyAttestationRequest id:认证信息id，mtCompanyId:企业id
     * @return
     * @description 认证通过
     * @date 2019-12-12 15:25
     */
    @PostMapping("/auditPass")
    public RestResponse auditPass(@RequestBody CompanyAttestationRequest companyAttestationRequest) {
        return companyAttestationService.auditPass(companyAttestationRequest);
    }

    /**
     * @param companyAttestationRequest id:认证信息id，mtCompanyId:企业id
     * @returnØ
     * @description 认证不通过
     * @date 2019-12-12 15:25
     */
    @PostMapping("/auditFail")
    public RestResponse auditFail(@RequestBody CompanyAttestationRequest companyAttestationRequest) {
        return companyAttestationService.auditFail(companyAttestationRequest);
    }
}
