package com.xhpc.common.api;

import com.xhpc.common.api.factory.UserTypeFallbackFactory;
import com.xhpc.common.core.constant.ServiceNameConstants;
import com.xhpc.common.core.domain.R;
import org.apache.ibatis.annotations.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.Map;

/**
 * @author yuyang
 * @date 2021/12/29 10:23
 */
@FeignClient(contextId ="userTypeService",value = ServiceNameConstants.XHPC_USER, fallbackFactory = UserTypeFallbackFactory.class)
public interface UserTypeService {

    /**
     * 根据手机号（账号），用户id和类型 获取用户信息
     *
     * @param
     * @return
     */
    @GetMapping("/common/getUser")
    R<Map<String, Object>> getUser(@RequestParam(value = "phone") String phone, @RequestParam(value = "userId") Long userId, @RequestParam(value = "userType") Integer userType, @RequestParam(value = "serialNumber") String serialNumber, @RequestParam(value = "tenantId") String tenantId);



    /**
     * 根据用户类型，用户id，充值退款记录，增加流水
     * @param money          充值退款金额
     * @param userId          充值退款用户
     * @param userType        用户类型
     * @param tenantId        租户id
     * @param type            充值渠道（1微信 2支付宝  3平台)
     * @param status           1 充值 2退款
     * @param remark          备注
     * @return
     */
    @GetMapping("/common/insertUserBalance")
    R insertUserBalance(@RequestParam(value = "money")BigDecimal money, @RequestParam(value = "userId")Long userId, @RequestParam(value = "userType")Integer userType, @RequestParam(value = "tenantId")String tenantId, @RequestParam(value = "type")Integer type, @RequestParam(value = "status")Integer status, @RequestParam(value = "remark")String remark,@RequestParam(value = "moneyOrderId")Long moneyOrderId);


    /**
     * 获取该机构的折扣比例
     */
    @GetMapping("/common/getMechanismDiscount")
    R getMechanismDiscount(@RequestParam(value = "userId")Long userId, @RequestParam(value = "userType")Integer userType, @RequestParam(value = "tenantId")String tenantId,@RequestParam(value = "chargingStationId")Long chargingStationId);



    /**
     * 获取车队信息
     */
    @GetMapping("/motorcade/getOrderMotorcade")
    R getOrderMotorcade(@RequestParam(value = "mark")String mark);


}
