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

import com.yuchen.saas.manage.user.api.entity.SaasWechatSubscribeData;
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.validation.annotation.Validated;
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;

/**
 * @author zhouhanwei
 * @create 2024/1/2 16:18
 */
@FeignClient(
        value = AppNameConstant.SAAS_USER,
        fallbackFactory = SaasWechatSubscribeDataClientFallback.class
)
public interface ISaasWechatSubscribeDataClient {

    @PostMapping("/saasWechatSubscribeData/saveSubscribeData")
    R saveSubscribeData(@Validated @RequestBody SaasWechatSubscribeData subscribeData);

    @PostMapping("/saasWechatSubscribeData/updateUnSubscribeData")
    R updateUnSubscribeData(@Validated @RequestBody SaasWechatSubscribeData subscribeData);

    @GetMapping("/saasWechatSubscribeData/getWechatSubscribeDataByOpenId")
    R<SaasWechatSubscribeData> getWechatSubscribeDataByOpenId(@RequestParam String openId);

    @GetMapping("/saasWechatSubscribeData/getSubscribeDataByUnionIdAndAppId")
    R<SaasWechatSubscribeData> getSubscribeDataByUnionIdAndAppId(@RequestParam String unionId, @RequestParam String appId);
}
