package shop.alien.gateway.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "alien-second", url = "${feign.alienSecond.url}")
public interface SecondServiceFeign {
    
    /**
     * 记录风控数据
     *
     * @param userId     用户ID
     * @param ruleType   规则类型 1:洗钱嫌疑 2:账号异常 3:交易欺诈 4:异常发布
     * @param ruleName   规则名称
     * @param businessId 业务ID
     * @param detailInfo 详细信息（JSON格式）
     */
    @PostMapping("/riskControl/record")
    void recordRiskControlData(@RequestParam("userId") Integer userId,
                               @RequestParam("ruleType") Integer ruleType,
                               @RequestParam("ruleName") String ruleName,
                               @RequestParam("businessId") String businessId,
                               @RequestParam("detailInfo") String detailInfo);

    /**
     * 用户积分数据
     *
     * @param userId     用户ID
     * @param initialPoints   用户积分
     */
    @PostMapping("/userPoints/create")
    void createPointsRecord(@RequestParam("userId") Integer userId,
                            @RequestParam("initialPoints") Integer initialPoints,
                            @RequestParam("pointsType") Integer pointsType);
}