package com.seer.teach.mp.api;


import com.seer.teach.mp.api.resp.WxOAuth2AccessTokenDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = ApiConstants.SERVER_NAME, contextId = "wechatOfficialAccountApi", path = "/seer/mp")
public interface WechatOfficialAccountApi {

    /**
     * 获取用户用户信息和授权 Token
     *
     * @param code
     */
    @GetMapping("/internal/auth/code2session")
    WxOAuth2AccessTokenDTO getUserWxOAuth2AccessToken(@RequestParam("appId")String appId, @RequestParam("code") String code);

    /**
     * 初始化公众号账号缓存
     */
    @PostMapping("/internal/init-account")
    void initMpAccountCache();

    /**
     * 获取经销商申请状态
     * @param userId 用户Id
     *
     * return 0-待审核，1-审核通过，2-审核拒绝， null-表示未申请
     */
    @GetMapping("/internal/dealer/apply/status")
    Integer getDealerApplicationsApplyStatusByUserId(@RequestParam("userId")Integer userId);
}