Commit e1b1d995 by 111-PC\111

[+]代码整理

1 parent b2f9a67c
......@@ -43,19 +43,6 @@ public class GetTokenJob implements SimpleJob {
@Value("${tuya.secret}")
private String secret;
public ResponseBody sendRequestGetOA(String requesturl) {
ResponseBody responseBody = null;
Map<String, String> headerParams = HeaderParamUtils.buildHeaderParams(client_id, secret);
try {
JSONObject jsonObject = HttpUtil.sendGet(requesturl, null, headerParams);
responseBody = JSON.toJavaObject(jsonObject, ResponseBody.class);
} catch (IOException e) {
e.printStackTrace();
log.info("请求用户信息接口异常,异常信息{}", e);
}
return responseBody;
}
@Override
public void execute(ShardingContext shardingContext) {
AccessToken accessToken = accessTokenRedis.readCache(Constants.ACCESSTOKEN_REDISKEY);
......@@ -83,4 +70,17 @@ public class GetTokenJob implements SimpleJob {
}
}
}
public ResponseBody sendRequestGetOA(String requesturl) {
ResponseBody responseBody = null;
Map<String, String> headerParams = HeaderParamUtils.buildHeaderParams(client_id, secret);
try {
JSONObject jsonObject = HttpUtil.sendGet(requesturl, null, headerParams);
responseBody = JSON.toJavaObject(jsonObject, ResponseBody.class);
} catch (IOException e) {
e.printStackTrace();
log.info("请求用户信息接口异常,异常信息{}", e);
}
return responseBody;
}
}
......@@ -6,6 +6,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.stream.Collectors;
@RestController
public class TestController {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!