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


import com.yuchen.saas.manage.user.api.entity.SaasUser;
import com.yuchen.saas.manage.user.api.vo.ChangePhoneVo;
import com.yuchen.saas.manage.user.api.vo.CountCompanyUserVo;
import com.yuchen.saas.manage.user.api.vo.sasscompany.CompanySettleParksVo;
import com.yuchen.saas.manage.user.api.vo.sasscompany.SaasCompanyAddUserVo;
import com.yuchen.saas.manage.user.api.vo.sassuser.*;
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 = SaasUserClientFallback.class
)
public interface ISaasUserClient {

    String API_PREFIX = "/sassUser/feign";
    String PAGE_USER = API_PREFIX + "/pageUser";
    String SAAS_USER_LOGIN_BY_WECHAT_AUTH = API_PREFIX + "/saasUserLoginByWechatAuth";
    String SAAS_USER_LOGIN_BY_SMS = API_PREFIX + "/saasUserLoginBySms";
    String GET_USER_CERTIFICATION_BY_PHONE = API_PREFIX + "/getUserCertificationByPhone";
    String GET_USER_CERTIFICATION_BY_USERID = API_PREFIX + "/getUserCertificationByUserId";
    String SAAS_USER_CERTIFICATION = API_PREFIX + "/sassUserCertification";
    String SAAS_USER_COMPANY_BY_USER = API_PREFIX + "/sassUserCompanyByUser";
    String SAAS_COMPANY_ADD_USER = API_PREFIX + "/saasCompanyAddUser";
    String USER_COMPANY_AUDIT = API_PREFIX + "/userCompanyAudit";
    String ENABLE_USER = API_PREFIX + "/enableUser";
    String DISABLE_USER = API_PREFIX + "/disableUser";
    String DELETE_USER = API_PREFIX + "/deleteUser";

    String GET_SMS_CODE = API_PREFIX + "/getSmsCode";

    String SAVE_SAAS_USER = API_PREFIX + "/saveSaasUser";

    String SHOW_PARKING_BILL = API_PREFIX + "/showParkingBill";

    String GET_USER_BY_OPENTID=API_PREFIX+"/getUserByOpenId";

    String CHANGE_PHONE=API_PREFIX+"/changePhone";

    String COUNT_BY_PARK_COMPANY=API_PREFIX+"/countByParkCompany";

    /**
     * 保存用户信息
     * @return
     */
    @PostMapping(SAVE_SAAS_USER)
    R saveSaasUser(@RequestBody SaasUserSaveVo saveVo);

    /**
     * 获取短信验证码
     * @return
     */
    @GetMapping(GET_SMS_CODE)
    R getSmsCode(@RequestParam String phone);

    /**
     * 获取个人用户信息
     * @return
     */
    @GetMapping(PAGE_USER)
    R pageUser(@RequestParam Integer current,@RequestParam Integer size);
    /**
     * 小程序微信授权登录
     * @param registerVo
     */
    @PostMapping(SAAS_USER_LOGIN_BY_WECHAT_AUTH)
    R saasUserLoginByWechatAuth(@RequestBody SaasUserLoginByWechatAuthVo registerVo);
    /**
     * 小程序短信验证码登录
     * @param registerVo
     */
    @PostMapping(SAAS_USER_LOGIN_BY_SMS)
    R saasUserLoginBySms(@RequestBody SaasUserLoginBySmsVo registerVo);
    /**
     * 根据手机号码获取用户认证信息
     * @param phone
     */
    @GetMapping(GET_USER_CERTIFICATION_BY_PHONE)
    GetUserCertificationVo getUserCertificationByPhone(@RequestParam String phone);
    /**
     * 根据手机号码获取用户认证信息
     */
    @GetMapping(GET_USER_CERTIFICATION_BY_USERID)
    GetUserCertificationVo getUserCertificationByUserId(@RequestParam Long userId);
    /**
     * 提交个人认证
     * @param certificationVo
     */
    @PostMapping(SAAS_USER_CERTIFICATION)
    R sassUserCertification(@RequestBody SaasUserCertificationVo certificationVo);
    /**
     * 用户主动进行员工登记
     * @param companyVo
     */
    @PostMapping(SAAS_USER_COMPANY_BY_USER)
    R sassUserCompanyByUser(@RequestBody SaasUserCompanyVo companyVo);
    /**
     * 管理员添加员工
     * @param companyVo
     */
    @PostMapping(SAAS_COMPANY_ADD_USER)
    R saasCompanyAddUser(@RequestBody SaasCompanyAddUserVo companyVo);
    /**
     * 员工登记
     * @param companyId
     * @param status
     * @param reason
     */
    @GetMapping(USER_COMPANY_AUDIT)
    R userCompanyAudit(@RequestParam Long companyId,@RequestParam Long userId,@RequestParam Integer status,@RequestParam(required = false) String reason);
    /**
     * 启用
     * @param userId
     */
    @GetMapping(ENABLE_USER)
    R enableUser(@RequestParam Long userId);
    /**
     * 禁用
     * @param userId
     */
    @GetMapping(DISABLE_USER)
    R disableUser(@RequestParam Long userId);
    /**
     * 删除
     * @param userId
     */
    @GetMapping(DELETE_USER)
    R deleteUser(@RequestParam Long userId);

    /**
     * 隐私设置
     * @param saasUserId
     */
    @GetMapping(SHOW_PARKING_BILL)
    R showParkingBill(@RequestParam Long saasUserId,@RequestParam Integer show);

    @GetMapping(GET_USER_BY_OPENTID)
    SaasUser getUserByOpenId(@RequestParam String openId);

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

    @PostMapping(COUNT_BY_PARK_COMPANY)
    R countByParkCompany(@RequestBody CountCompanyUserVo userVo);

}
