package com.yuchen.saas.manage.user.api.feign;


import com.yuchen.saas.manage.user.api.entity.SaasCompany;
import com.yuchen.saas.manage.user.api.vo.ChangePhoneVo;
import com.yuchen.saas.manage.user.api.vo.sasscompany.*;
import org.nest.springwrap.core.launch.app.AppNameConstant;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


@FeignClient(
        value = AppNameConstant.SAAS_USER
        ,
        fallback = SaasCompanyClientFallback.class
)
public interface ISaasCompanyClient {

    String API_PREFIX = "/sassCompany/feign";
    String PAGE_COMPANY_USER_BY_SAAS_COMPANY_ID = API_PREFIX + "/pageCompanyUserBySaasCompanyId";
    String PAGE_COMPANY_USER_BY_PHONE = API_PREFIX + "/pageCompanyUserByPhone";
    String GET_BY_PHONE = API_PREFIX + "/getByPhone";
    String GET_COMPANY_PARK_SETTLE_BY_PHONE = API_PREFIX + "/getCompanyParkSettleByPhone";
    String GET_COMPANY_PARK_SETTLE_BY_SAAS_COMPANY_ID = API_PREFIX + "/getCompanyParkSettleBySaasCompanyId";
    String COMPANY_PARK_SETTLE = API_PREFIX + "/companyParkSettle";
    String COMPANY_REGISTER_AUDIT = API_PREFIX + "/companyRegisterAudit";
    String COMPANY_CERTIFICATION = API_PREFIX + "/companyCertification";
    String GET_CERTIFICATION_BY_SAAS_COMPANY_ID = API_PREFIX + "/getCertificationBySaasCompanyId";
    String GET_CERTIFICATION_BY_SAAS_MANAGER_PHONE = API_PREFIX + "/getCertificationByManagerPhone";
    String GET_SAAS_COMPANY_BY_NAME=API_PREFIX+"/getSaasCompanyByName";

    String COMPANY_LOGIN_BY_SMS=API_PREFIX+"/companyLoginBySms";

    String COMPANY_LOGIN_BY_PWD=API_PREFIX+"/companyLoginByPwd";

    String COMPANY_REGISTER_AND_LOGIN=API_PREFIX+"/companyRegisterAndLogin";

    String GET_COMPANY_LOGIN_SMS=API_PREFIX+"/getCompanyLoginSms";

    String GET_COMPANY_REGISTER_SMS=API_PREFIX+"/getCompanyRegisterSms";

    String SAVE_SAAS_COMPANY=API_PREFIX+"/saveSaasCompany";

    String GET_COMPANY_SETTLE_PARKS=API_PREFIX+"/getCompanySettleParks";

    String CHANGE_PHONE=API_PREFIX+"/changePhone";

    String GET_COMPANY_LIST = API_PREFIX + "/getCompanyList";


    /**
     * 保存企业用户信息
     * @param saveVo
     */
    @PostMapping(SAVE_SAAS_COMPANY)
    R saveSaasCompany(@RequestBody SaasCompanySaveVo saveVo);
    /**
     * 企业用户登录短信验证码发送
     * @param companyName
     * @param phone
     * @return
     */
    @GetMapping(GET_COMPANY_LOGIN_SMS)
    R getCompanyLoginSms(@RequestParam String companyName,@RequestParam String phone);

    /**
     * 企业用户注册时短信验证码发送
     * @param companyName
     * @param phone
     * @return
     */
    @GetMapping(GET_COMPANY_REGISTER_SMS)
    R getCompanyRegisterSms(@RequestParam String companyName,@RequestParam String phone);

    /**
     * 企业用户注册
     * @return
     */
    @PostMapping(COMPANY_REGISTER_AND_LOGIN)
    R companyRegisterAndLogin(@RequestBody SaasCompanyRegisterVo pwdVo);
    /**
     * 企业用户密码登录
     * @return
     */
    @PostMapping(COMPANY_LOGIN_BY_PWD)
    R companyLoginByPwd(@RequestBody SaasCompanyLoginByPwdVo pwdVo);

    /**
     * 企业用户短信验证码登录
     * @return
     */
    @PostMapping(COMPANY_LOGIN_BY_SMS)
    R companyLoginBySms(@RequestBody SaasCompanyLoginBySmsVo smsVo);

    /**
     * 根据企业id获取员工信息
     * @param saasCompanyId
     * @return
     */
    @GetMapping(PAGE_COMPANY_USER_BY_SAAS_COMPANY_ID)
    R pageCompanyUserBySaasCompanyId(@RequestParam Long saasCompanyId,@RequestParam Integer status,@RequestParam Integer current,@RequestParam Integer size);
    /**
     * 根据管理员手机获取员工信息
     * @param phone
     * @return
     */
    @GetMapping(PAGE_COMPANY_USER_BY_PHONE)
    R pageCompanyUserByPhone(@RequestParam String phone,@RequestParam(required = false)Integer status,@RequestParam Integer current,@RequestParam Integer size);
    /**
     * 小程序添加企业
     * @param companyVo
     */
//    @PostMapping(ADD_COMPANY)
//    R addCompany(@RequestBody AddCompanyVo companyVo);
    /**
     * 通过管理员电话获取企业信息
     * @return
     */
    @GetMapping(GET_BY_PHONE)
    SaasCompany getByPhone(@RequestParam String phone);
    /**
     * 通过管理员电话判断企业是否认证过
     * @return
     */
    @GetMapping(GET_COMPANY_PARK_SETTLE_BY_PHONE)
    GetCompanyParkSettleVo getCompanyParkSettleByPhone(@RequestParam String phone, @RequestParam Long parkId);
    @GetMapping(GET_COMPANY_PARK_SETTLE_BY_SAAS_COMPANY_ID)
    GetCompanyParkSettleVo getCompanyParkSettleBySaasCompanyId(@RequestParam Long saasCompanyId, @RequestParam Long parkId);
    //企业登记
    @PostMapping(COMPANY_PARK_SETTLE)
    R companyParkSettle(@RequestBody CompanyParkSettleVo registerVo);
    /**
     * 企业登记审核
     * @param companyId
     * @param status
     * @param reason
     */
//    @GetMapping(COMPANY_REGISTER_AUDIT)
//    R companyRegisterAudit(@RequestParam Long companyId,@RequestParam Integer status,@RequestParam String reason);

    /**
     * 校验服务登记信息
     * @param phone
     * @param parkId
     * @return
     */
//    @GetMapping(CHECK_COMPANY_SERVE_BY_MANAGER_PHONE)
//    CheckCompanyServeVo checkCompanyServeByManagerPhone(@RequestParam String phone,@RequestParam Long parkId);
    //服务登记
//    @PostMapping(SERVE_REGISTER)
//    R serveRegister(@RequestBody ServeRegisterVo registerVo);
    /**
     * 服务登记审核
     */
//    @PostMapping(COMPANY_SERVE_AUDIT)
//    R companyServeAudit(@RequestParam Long companyId,@RequestParam Integer status,@RequestParam String reason);

    //企业认证
    @PostMapping(COMPANY_CERTIFICATION)
    R companyCertification(@RequestBody SaasCompanyCertificationVo certificationVo);

    /**
     * 通过企业用户id获取企业认证信息
     * @return
     */
    @GetMapping(GET_CERTIFICATION_BY_SAAS_COMPANY_ID)
    GetCompanyCertificationVo getCertificationBySaasCompanyId(@RequestParam Long saasCompanyId);

    /**
     * 通过绑定电话获取企业认证信息
     * @return
     */
    @GetMapping(GET_CERTIFICATION_BY_SAAS_MANAGER_PHONE)
    GetCompanyCertificationVo getCertificationByManagerPhone(@RequestParam String phone);

    @GetMapping(GET_SAAS_COMPANY_BY_NAME)
    SaasCompany getSaasCompanyByName(@RequestParam String companyName);

    @GetMapping(GET_COMPANY_SETTLE_PARKS)
    List<CompanySettleParksVo> getCompanySettleParks(@RequestParam Long saasCompanyId);

    @PostMapping(CHANGE_PHONE)
    R changePhone(@RequestBody ChangePhoneVo changePhoneVo);

    @GetMapping(GET_COMPANY_LIST)
    R<List<SaasCompanyListVO>> getCompanyList(String companyName);

}
