package com.trade.client.enterprise.customer.service;

import com.trade.common.core.domain.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @description: 调用B端接口
 * @Author: wanglang
 * @Date: 2024/6/3 20:13
 * @Version: 1.0
 */
@Component
@FeignClient(name = "trade-admin")
public interface CustomerUserRemoteService {

    /**
     * 分配客户
     * 
     * @param customerUserId
     * @param referralCode
     * @param identifierNo
     * @return
     */
    @PostMapping("/admin/api/customerAssign/save")
    ResponseResult<Boolean> customerAssign(@RequestParam(value = "customerUserId") Long customerUserId,
            @RequestParam(value = "referralCode") String referralCode,
            @RequestParam("identifierNo") String identifierNo);

    /**
     * 校验推荐码
     * 
     * @param referralCode 推荐码
     * @return true/false
     */
    @GetMapping("/admin/api/customerAssign/checkReferralCode")
    ResponseResult<Boolean> checkReferralCode(@RequestParam(value = "referralCode") String referralCode);

    /**
     * 获取推荐码
     * 
     * @param urlSuffix
     * @return 推荐码
     */
    @GetMapping("/admin/api/customerAssign/getReferralCode")
    ResponseResult<String> getReferralCode(@RequestParam(value = "urlSuffix") String urlSuffix);
}
