|
|
@@ -1,53 +1,27 @@
|
|
|
package easydo.technology.controller;
|
|
|
|
|
|
-import java.io.BufferedReader;
|
|
|
-import java.io.IOException;
|
|
|
-import java.io.InputStream;
|
|
|
-import java.io.InputStreamReader;
|
|
|
-import java.net.Authenticator;
|
|
|
-import java.net.HttpURLConnection;
|
|
|
-import java.net.MalformedURLException;
|
|
|
-import java.net.PasswordAuthentication;
|
|
|
-import java.net.URL;
|
|
|
-import java.sql.Connection;
|
|
|
-import java.text.MessageFormat;
|
|
|
-import java.time.LocalDateTime;
|
|
|
import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
import java.util.Map;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.sql.DataSource;
|
|
|
|
|
|
-import org.apache.http.HttpHost;
|
|
|
-import org.apache.http.auth.AuthScope;
|
|
|
-import org.apache.http.auth.UsernamePasswordCredentials;
|
|
|
-import org.apache.http.client.CredentialsProvider;
|
|
|
-import org.apache.http.impl.client.BasicCredentialsProvider;
|
|
|
-
|
|
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
-
|
|
|
import easydo.technology.components.JdbcClient;
|
|
|
-import easydo.technology.exception.BizException;
|
|
|
-import easydo.technology.model.GldProject;
|
|
|
-import easydo.technology.model.ProjectInfo;
|
|
|
import easydo.technology.service.GLDMasterService;
|
|
|
-import easydo.technology.system.domain.SysDept;
|
|
|
import easydo.technology.util.HttpClientUtil;
|
|
|
-import easydo.technology.utils.LocalDateUtil;
|
|
|
import easydo.technology.utils.RedisUtils;
|
|
|
import easydo.technology.utils.StringUtil;
|
|
|
+import lombok.extern.java.Log;
|
|
|
|
|
|
+@Log
|
|
|
@RestController
|
|
|
@RequestMapping("/test")
|
|
|
public class TestController {
|
|
|
@@ -72,7 +46,7 @@ public class TestController {
|
|
|
* String tenantId = "5600001";
|
|
|
*
|
|
|
* JSONObject object = HttpClientUtil.sendGLDGET_getTenantId(url, token);
|
|
|
- * System.out.println(object.toJSONString());
|
|
|
+ * log.info(object.toJSONString());
|
|
|
* //{"access_token":"cn-b3c73fac-2629-4337-94fb-e79c289d1979","scope":
|
|
|
* "paas-clouddoc,paas-gdoc_tenant,paas-new-storage-service_admin,paas-organization_admin,paas-gws_tenant,paas-organization_tenant,paas-comment-service_tenant,paas-databag_tenant,paas-new-storage-service_tenant,paas-databag_admin,paas_databag_tenant,paas-raw-storage-service_tenant"
|
|
|
* ,"token_type":"bearer","exp":1723342092,"expires_in":74670}
|
|
|
@@ -89,7 +63,7 @@ public class TestController {
|
|
|
// header.put("x-tenant-id", "5600003");
|
|
|
|
|
|
// JSONArray resObject = HttpClientUtil.sendGETWithHeader_Arr(url, header);
|
|
|
- // System.out.println(resObject.toJSONString());
|
|
|
+ // log.info(resObject.toJSONString());
|
|
|
// }
|
|
|
|
|
|
/*
|
|
|
@@ -97,7 +71,7 @@ public class TestController {
|
|
|
* // String url =
|
|
|
* "http://218.201.101.181:8180/seeyon/thirdpartyController.do?ticket=-5127817351537210703";
|
|
|
* // String username = HttpClientUtil.sendOaGET_USERNAME(url);
|
|
|
- * // System.out.println(username);
|
|
|
+ * // log.info(username);
|
|
|
*
|
|
|
* String url = "http://218.201.101.181:8180/seeyon/rest/token";
|
|
|
* JSONObject object = new JSONObject();
|
|
|
@@ -105,7 +79,7 @@ public class TestController {
|
|
|
* object.put("password", "2679fc6b-df18-4563-9b8e-773b59bdcb62");
|
|
|
* JSONObject resObject = HttpClientUtil.sendPOST(url, object.toJSONString());
|
|
|
* String accessToken = resObject.getString("id");
|
|
|
- * System.out.println(accessToken);
|
|
|
+ * log.info(accessToken);
|
|
|
*
|
|
|
* String getUserInfoUrl =
|
|
|
* "http://218.201.101.181:8180/seeyon/rest/orgMember?loginName=guanglianda";
|
|
|
@@ -114,14 +88,14 @@ public class TestController {
|
|
|
* // header.put("Authorization", "Bearer " + accessToken);
|
|
|
* JSONObject resObj = HttpClientUtil.sendGETWithHeader_Obj(getUserInfoUrl,
|
|
|
* header);
|
|
|
- * System.out.println(resObj);
|
|
|
+ * log.info(resObj);
|
|
|
* }
|
|
|
*/
|
|
|
|
|
|
@RequestMapping(value = "/getPage")
|
|
|
public Object getPage() throws Exception {
|
|
|
redisUtils.set("test", "123456", 600);
|
|
|
- System.out.println(redisUtils.get("test"));
|
|
|
+ log.info(redisUtils.get("test"));
|
|
|
return "success";
|
|
|
}
|
|
|
|
|
|
@@ -151,7 +125,7 @@ public class TestController {
|
|
|
// object.put("userName", "zcxt");
|
|
|
// object.put("password", "2679fc6b-df18-4563-9b8e-773b59bdcb62");
|
|
|
// JSONObject resObject = HttpClientUtil.sendPOST(url, object.toJSONString());
|
|
|
- // System.out.println("查询OAtoken的res======>" + resObject.toJSONString());
|
|
|
+ // log.info("查询OAtoken的res======>" + resObject.toJSONString());
|
|
|
// String token = resObject.getString("id");
|
|
|
|
|
|
// Map<String, String> header = new HashMap<>();
|
|
|
@@ -180,7 +154,7 @@ public class TestController {
|
|
|
|
|
|
// JSONObject resObj = HttpClientUtil.sendPOSTWithHeader(sendTodoUrl,
|
|
|
// object.toJSONString(), header);
|
|
|
- // System.out.println("生成OA待办req======>" + object.toJSONString() + ",res======>"
|
|
|
+ // log.info("生成OA待办req======>" + object.toJSONString() + ",res======>"
|
|
|
// + resObj.toJSONString());
|
|
|
|
|
|
// String updateTodoUrl = "http://218.201.101.181:8180" +
|
|
|
@@ -193,7 +167,7 @@ public class TestController {
|
|
|
// JSONObject resObj =
|
|
|
// HttpClientUtil.sendPOSTWithHeader(updateTodoUrl,object.toJSONString(),
|
|
|
// header);
|
|
|
- // System.out.println("更新OA待办req======>" + object.toJSONString() + ",res======>"
|
|
|
+ // log.info("更新OA待办req======>" + object.toJSONString() + ",res======>"
|
|
|
// + resObj.toJSONString());
|
|
|
|
|
|
// String sendMessageUrl = "http://218.201.101.181:8180" +
|
|
|
@@ -210,7 +184,7 @@ public class TestController {
|
|
|
|
|
|
// JSONObject resObj = HttpClientUtil.sendPOSTWithHeader(sendMessageUrl,
|
|
|
// object.toJSONString(), header);
|
|
|
- // System.out.println("推送OA消息req======>" + object.toJSONString() + ",res======>"
|
|
|
+ // log.info("推送OA消息req======>" + object.toJSONString() + ",res======>"
|
|
|
// + resObj.toJSONString());
|
|
|
// }
|
|
|
|