修改--在进行实名认证时获取实名认证token
This commit is contained in:
parent
04f1699a04
commit
5660e0e178
@ -9,14 +9,14 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
@RestController
|
||||
//@RestController
|
||||
class GetToken {
|
||||
|
||||
static final OkHttpClient HTTP_CLIENT = new OkHttpClient().newBuilder().build();
|
||||
|
||||
static String access_token = "24.d6e37cf9b67921a112de974d2a4930c8.2592000.1743216019.282335-115883169";
|
||||
|
||||
@Scheduled(cron = "0 0 * */1 * *")
|
||||
// @Scheduled(cron = "0 0 0 */1 * *")
|
||||
public static String getToken() throws IOException{
|
||||
|
||||
MediaType mediaType = MediaType.parse("application/json");
|
||||
@ -32,10 +32,10 @@ class GetToken {
|
||||
BaiduToken baiduToken = GsonUtils.fromJson(response.body().string(), BaiduToken.class);
|
||||
//// System.out.println(response.body().string());
|
||||
access_token = baiduToken.getAccess_token();
|
||||
System.out.println("获取token定时任务触发");
|
||||
// System.out.println("获取token, token: "+ access_token);
|
||||
|
||||
// return baiduToken.getAccess_token();
|
||||
return "";
|
||||
return access_token;
|
||||
}
|
||||
|
||||
public static void main(String []args) throws IOException{
|
||||
|
||||
@ -47,7 +47,7 @@ public class OcrIdCardBAI {
|
||||
|
||||
// 注意这里仅为了简化编码每一次请求都去获取access_token,线上环境access_token有过期时间, 客户端可自行缓存,过期后重新获取。
|
||||
// 使用之前要通过GetToken方法获取token, token默认30天有效, 30天内token不变, 即使再次请求也不变。
|
||||
// String accessToken = "24.d6e37cf9b67921a112de974d2a4930c8.2592000.1743216019.282335-115883169";
|
||||
// String accessToken = "24.504de3f2380f51403a05d2b9d6b07314.2592000.1743907560.282335-115883169";
|
||||
String accessToken = GetToken.getToken();
|
||||
|
||||
String result = HttpUtil.post(url, accessToken, param);
|
||||
|
||||
@ -12,6 +12,8 @@ public class AppUserInfoVo {
|
||||
private Long sendRockets;
|
||||
/** 被关注数(欢迎度) */
|
||||
private Long followers;
|
||||
/** 关注他人数*/
|
||||
private Long followings;
|
||||
/** 7天在线时长(通过在线时长表来计算) */
|
||||
private Long sOnlineTime;
|
||||
/** 7天MR在线时长(通过在线时长表来计算) */
|
||||
@ -85,6 +87,14 @@ public class AppUserInfoVo {
|
||||
this.followers = followers;
|
||||
}
|
||||
|
||||
public Long getFollowings() {
|
||||
return followings;
|
||||
}
|
||||
|
||||
public void setFollowings(Long followings) {
|
||||
this.followings = followings;
|
||||
}
|
||||
|
||||
public Long getsOnlineTime() {
|
||||
return sOnlineTime;
|
||||
}
|
||||
|
||||
@ -44,6 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="status" column="status" />
|
||||
|
||||
<result property="followers" column="followers" />
|
||||
<result property="followings" column="followings" />
|
||||
<result property="sOnlineTime" column="s_online_time" />
|
||||
<result property="sMrTime" column="s_mr_time" />
|
||||
<result property="sConsumption" column="s_consumption" />
|
||||
@ -116,7 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select user_id, authentication_status, real_name, id_card, sex, signature, avatar, card_front, card_back, email, receive_rockets, send_rockets, shares, followers, s_online_time, s_mr_time, s_consumption, th_consumption, phonenumber, t_mr_time, t_online_time, t_consumption, update_time, date_of_birth, back_ground, calculation_time, id_type from user_info
|
||||
</select>
|
||||
<select id="getAllAppUserInfo" resultMap="AppUserInfoVoResult" parameterType="SysUser">
|
||||
select s.user_id, s.nick_name, s.status, s.create_time, u.receive_rockets, u.send_rockets, u.followers, u.s_online_time, u.s_mr_time, u.s_consumption, u.th_consumption, u.phonenumber, u.t_mr_time, u.t_online_time, u.t_consumption
|
||||
select s.user_id, s.nick_name, s.status, s.create_time, u.receive_rockets, u.send_rockets, u.followers, u.followings, u.s_online_time, u.s_mr_time, u.s_consumption, u.th_consumption, u.phonenumber, u.t_mr_time, u.t_online_time, u.t_consumption
|
||||
from sys_user s
|
||||
left join user_info u
|
||||
on s.user_id = u.user_id
|
||||
|
||||
Loading…
Reference in New Issue
Block a user