package thyyxxk.webserver.service.externalhttp;

import com.alibaba.fastjson.JSONObject;
import com.dtflys.forest.annotation.Get;
import com.dtflys.forest.annotation.JSONBody;
import com.dtflys.forest.annotation.Post;
import com.dtflys.forest.annotation.Var;
import thyyxxk.webserver.entity.WeComTokens;

public interface CorpWxSrvc {

    @Get("https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=wwf0b23c8b36012b34&corpsecret={0}")
    JSONObject fetchAccessToken(String secret);

    @Post("http://172.16.32.160:8706/sendWxInfo/updateWeComTokens")
    String syncTokens(@JSONBody WeComTokens tokens);

    @Get("https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token={token}&userid={userid}")
    JSONObject getUserinfo(@Var("token") String token, @Var("userid") String userid);
}
