CustomerRpc.java 3.54 KB
package com.diligrp.etrade.rpc;


import cn.hutool.json.JSONObject;
import com.diligrp.etrade.rpc.dto.CerNumsDto;
import com.diligrp.etrade.rpc.dto.CustomerQueryInputDTO;
import com.diligrp.etrade.rpc.dto.response.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
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.RequestParam;

import java.util.List;

@FeignClient(
        name = "customer-service",
        url = "${CustomerRpc.url:}"
)
public interface CustomerRpc {

    /**
     * 查询客户基本信息
     *
     * @param id
     * @return
     */
    @PostMapping(value = "/api/customer/getById")
    JSONObject getById(@RequestParam("id") Long id);

    /**
     * 查询客户基本信息
     *
     * @param id
     * @return
     */
    @PostMapping(value = "/api/customer/getById")
    BaseOutput<Customer> getCustomerById(@RequestParam("id") Long id);

    /**
     * 创建默认客户和账号信息
     *
     * @param cellphone
     * @param name
     * @return
     */
    @RequestMapping("api/customer/createDefaultCustomerAndAccount")
    BaseOutput<Customer> createDefaultCustomerAndAccount(@RequestParam("cellphone") String cellphone, @RequestParam("name") String name);

    /**
     * 优惠券业务查询接口
     *
     * @param cerNumsDto
     * @return
     */
    @RequestMapping("api/customer/selectCustomerByCerNums")
    BaseOutput<List<Customer>> selectCustomerByCerNums(@RequestBody CerNumsDto cerNumsDto);

    /**
     * listCustomer
     *
     * @param customerQueryInputDTO customerQueryInputDTO
     * @return {@link BaseOutput}<{@link List}<{@link Customer}>>
     */
    @RequestMapping("api/customer/listBase")
    BaseOutput<List<Customer>> listCustomer(@RequestBody CustomerQueryInputDTO customerQueryInputDTO);

    /**
     * 获取用户审核信息
     * @param customerId
     * @param marketId
     * @return
     */
    @PostMapping({"/api/customerMarket/getByCustomerAndMarket"})
    BaseOutput<CustomerMarket> getByCustomerAndMarket(@RequestParam("customerId") Long customerId, @RequestParam("marketId") Long marketId);

    /**
     * 获取客户信息以及客户状态
     * @param id
     * @param marketId
     * @return
     */
    @PostMapping({"/api/customer/getSimple"})
    BaseOutput<CustomerSimpleExtendDto> getSimple(@RequestParam("id") Long id, @RequestParam("marketId") Long marketId);
    /**
     * 根据List<customerid,marketId>查询正常的客户信息
     * @param customerQueryInputs
     * @return
     */
    @RequestMapping("/api/customer/listSaleEasyByIdAndMarketIdSet")
    BaseOutput<List<CustomerAndMarket>> listSaleEasyByIdAndMarketIdSet(@RequestBody List<CustomerQueryInputDTO> customerQueryInputs);

    /**
     * 获取客户扩展信息(如果有需要额外返回值,请修改返回类型)
     * @param id
     * @return
     */
    @PostMapping(value = "/api/customer/getCustomerAndBaseExtensionById")
    BaseOutput<CustomerBaseExtensionInfo> getCustomerAndBaseExtensionById(@RequestParam("id") Long id);

    /**
     * 根据客户id批量查询客户
     *
     * @param customerQueryInputDTO customerQueryInputDTO
     * @return {@link BaseOutput}<{@link List}<{@link Customer}>>
     */
    @RequestMapping("/api/customer/listSimpleNormalPage")
    BaseOutput<List<Customer>> listSimpleNormalPage(@RequestBody CustomerQueryInputDTO customerQueryInputDTO);

}