|
@@ -9,6 +9,7 @@ import org.jeecg.modules.iotedgeConfig.service.IIotedgeConfigService;
|
|
|
import org.jeecg.modules.iotedgeConfig.util.ConfigInfo;
|
|
|
import org.jeecg.modules.util.MyResponseErrorHandler;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.http.*;
|
|
|
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -19,6 +20,7 @@ import java.io.File;
|
|
|
import java.nio.file.Files;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Base64;
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
@@ -38,6 +40,24 @@ public class RestClientService {
|
|
|
@SuppressWarnings("all")
|
|
|
private IIotedgeConfigService configService;
|
|
|
|
|
|
+ @Value("${iotedge.ip}")
|
|
|
+ private String iotIp;
|
|
|
+ @Value("${iotedge.port}")
|
|
|
+ private String iotPort;
|
|
|
+
|
|
|
+ @Value("${sso.ip}")
|
|
|
+ private String ssoIp;
|
|
|
+ @Value("${sso.port}")
|
|
|
+ private String ssoPort;
|
|
|
+ @Value("${sso.username}")
|
|
|
+ private String ssoUsername;
|
|
|
+ @Value("${sso.password}")
|
|
|
+ private String ssoPassword;
|
|
|
+
|
|
|
+ @Value("${notification.ip}")
|
|
|
+ private String notificationIp;
|
|
|
+ @Value("${notification.port}")
|
|
|
+ private String notificationPort;
|
|
|
|
|
|
/**
|
|
|
* author: dzc
|
|
@@ -46,13 +66,13 @@ public class RestClientService {
|
|
|
* date: 2024/5/22
|
|
|
*/
|
|
|
public String getAccessToken() {
|
|
|
- //String url = "http://127.0.0.1:8082/v1/auth";
|
|
|
- String url = configService.getConfigValue(ConfigInfo.GETTOKEN);
|
|
|
- String username = configService.getConfigValue(ConfigInfo.USERNAME);
|
|
|
- String password = configService.getConfigValue(ConfigInfo.PASSWORD);
|
|
|
+ String url = "http://"+iotIp+":"+iotPort+"/v1/auth";
|
|
|
+ //String url = configService.getConfigValue(ConfigInfo.GETTOKEN);
|
|
|
+ //String username = configService.getConfigValue(ConfigInfo.USERNAME);
|
|
|
+ //String password = configService.getConfigValue(ConfigInfo.PASSWORD);
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("username",username);
|
|
|
- jsonObject.put("password",password);
|
|
|
+ jsonObject.put("username","admin");
|
|
|
+ jsonObject.put("password","admin");
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|
|
|
headers.setContentType(type);
|
|
@@ -62,6 +82,31 @@ public class RestClientService {
|
|
|
return accessToken;
|
|
|
}
|
|
|
|
|
|
+ public String getAccessTokenSSO() {
|
|
|
+ String url = "http://"+iotIp+":"+iotPort+"/v1/sso/auth";
|
|
|
+ //String url = configService.getConfigValue(ConfigInfo.GETTOKEN);
|
|
|
+ //String username = configService.getConfigValue(ConfigInfo.USERNAME);
|
|
|
+ //String password = configService.getConfigValue(ConfigInfo.PASSWORD);
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ jsonObject.put("username",ssoUsername);
|
|
|
+ jsonObject.put("password",ssoPassword);
|
|
|
+ HttpHeaders headers = new HttpHeaders();
|
|
|
+ MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|
|
|
+ headers.setContentType(type);
|
|
|
+ HttpEntity<String> httpEntity = new HttpEntity<String>(jsonObject.toString(), headers);
|
|
|
+ ResponseEntity<JSONObject> response = restTemplate.postForEntity(url, httpEntity, JSONObject.class);
|
|
|
+ HttpHeaders headers1 = response.getHeaders();
|
|
|
+ List<String> list = headers1.get(HttpHeaders.SET_COOKIE);
|
|
|
+ // 提取 EIToken 的值并赋给变量
|
|
|
+ String eitoken = list.stream()
|
|
|
+ .filter(s -> s.startsWith("EIToken="))
|
|
|
+ .map(s -> s.substring("EIToken=".length()).split(";")[0].trim())
|
|
|
+ .findFirst()
|
|
|
+ .orElse("Token not found");
|
|
|
+ return eitoken;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* author: dzc
|
|
|
* version: 1.0
|
|
@@ -71,8 +116,8 @@ public class RestClientService {
|
|
|
|
|
|
public JSONObject getGroupDevicesInfo(String groupId,String elToken){
|
|
|
//String url = "http://127.0.0.1:8082/v1/devices?deviceType=&groupID="+groupId+"&projectID=all&productID=all";
|
|
|
- String url = configService.getConfigValue(ConfigInfo.IOTEDGE_GETINFOBYGROUPID)+groupId+"&projectID=all&productID=all";
|
|
|
- //String accessToken = getAccessToken();
|
|
|
+ //String url = configService.getConfigValue(ConfigInfo.IOTEDGE_GETINFOBYGROUPID)+groupId+"&projectID=all&productID=all";
|
|
|
+ String url = "http://"+iotIp+":"+iotPort+"/v1/devices?deviceType=&groupID="+groupId+"&projectID=all&productID=all";
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|
|
|
headers.setContentType(type);
|
|
@@ -90,8 +135,8 @@ public class RestClientService {
|
|
|
*/
|
|
|
public JSONObject getAllDevicesInfo(String elToken){
|
|
|
//String url = "http://127.0.0.1:8082/v1/devices?deviceType=&groupID="+groupId+"&projectID=all&productID=all";
|
|
|
- String url = configService.getConfigValue(ConfigInfo.GETALLDEVICESINFO);
|
|
|
- //String accessToken = getAccessToken();
|
|
|
+ //String url = configService.getConfigValue(ConfigInfo.GETALLDEVICESINFO);
|
|
|
+ String url = "http://"+iotIp+":"+iotPort+"/v1/devices?deviceType=&projectID=all&productID=all";
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|
|
|
headers.setContentType(type);
|
|
@@ -110,7 +155,8 @@ public class RestClientService {
|
|
|
*/
|
|
|
public JSONObject getAllDevicesInfoById(String deviceId,String elToken){
|
|
|
//String url = "http://127.0.0.1:8082/v1/devices/"+deviceId+"/deviceshadow";
|
|
|
- String url = configService.getConfigValue(ConfigInfo.GETALLDEVICESINFOBYID)+"/"+deviceId+"/deviceshadow";
|
|
|
+ //String url = configService.getConfigValue(ConfigInfo.GETALLDEVICESINFOBYID)+"/"+deviceId+"/deviceshadow";
|
|
|
+ String url = "http://"+iotIp+":"+iotPort+"/v1/devices/"+deviceId+"/deviceshadow";
|
|
|
//String accessToken = getAccessToken();
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|
|
@@ -129,13 +175,15 @@ public class RestClientService {
|
|
|
* date: 2024/5/29
|
|
|
*/
|
|
|
public JSONObject getAllEmailGroupInfo(){
|
|
|
+ String token = getAccessTokenSSO();
|
|
|
//String url = "http://127.0.0.1:3005/api/v1.5/Groups?count=1000&index=1&desc=false";
|
|
|
- String url = configService.getConfigValue(ConfigInfo.GETGROUPINFO);
|
|
|
- String accessToken = getAccessToken();
|
|
|
+ //String url = configService.getConfigValue(ConfigInfo.GETGROUPINFO);
|
|
|
+ String url = "http://"+notificationIp+":"+notificationPort+"/api/v1.5/Groups?count=1000&index=1&desc=false";
|
|
|
+ //String accessToken = getAccessToken();
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|
|
|
headers.setContentType(type);
|
|
|
- headers.add("Authorization", "Bearer " + accessToken);
|
|
|
+ headers.add("Authorization", "Bearer " + token);
|
|
|
HttpEntity<String> httpEntity = new HttpEntity<String>(null, headers);
|
|
|
ResponseEntity<JSONObject> response = restTemplate.exchange(url, HttpMethod.GET,httpEntity, JSONObject.class);
|
|
|
return response.getBody();
|
|
@@ -159,12 +207,14 @@ public class RestClientService {
|
|
|
ArrayList<JSONObject> list = new ArrayList<>();
|
|
|
ArrayList<JSONObject> requestList = new ArrayList<>();
|
|
|
//String url = "http://127.0.0.1:3005/api/v1.5/Groups/send";
|
|
|
- String url = configService.getConfigValue(ConfigInfo.SENDEMAil);
|
|
|
- String accessToken = getAccessToken();
|
|
|
+ //String url = configService.getConfigValue(ConfigInfo.SENDEMAil);
|
|
|
+ String url = "http://"+notificationIp+":"+notificationPort+"/api/v1.5/Groups/send";
|
|
|
+ //String accessToken = getAccessToken();
|
|
|
+ String token = getAccessTokenSSO();
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|
|
|
headers.setContentType(type);
|
|
|
- headers.add("Authorization", "Bearer " + accessToken);
|
|
|
+ headers.add("Authorization", "Bearer " + token);
|
|
|
// 文本内容参数
|
|
|
JSONObject jsonObject1 = new JSONObject();
|
|
|
jsonObject1.put("params","接口测试"); // Notification中模板中的参数 也可以没有,根据具体情况决定
|
|
@@ -209,7 +259,8 @@ public class RestClientService {
|
|
|
*/
|
|
|
public JSONObject addGroup(String groupName,String elToken){
|
|
|
//String url = "http://127.0.0.1:8082/v1/groups";
|
|
|
- String url = configService.getConfigValue(ConfigInfo.IOTEDGE_ADDGROUP);
|
|
|
+ //String url = configService.getConfigValue(ConfigInfo.IOTEDGE_ADDGROUP);
|
|
|
+ String url = "http://"+iotIp+":"+iotPort+"/v1/groups";
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("groupName",groupName);
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
@@ -230,7 +281,8 @@ public class RestClientService {
|
|
|
*/
|
|
|
public JSONObject deleteGroup(String groupId,String elToken){
|
|
|
//String url = "http://127.0.0.1:8082/v1/groups"+"/"+groupId;
|
|
|
- String url = configService.getConfigValue(ConfigInfo.IOTEDGE_DELETEGROUP)+"/"+groupId;
|
|
|
+ //String url = configService.getConfigValue(ConfigInfo.IOTEDGE_DELETEGROUP)+"/"+groupId;
|
|
|
+ String url = "http://"+iotIp+":"+iotPort+"/v1/groups"+"/"+groupId;
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|
|
|
headers.setContentType(type);
|
|
@@ -250,12 +302,14 @@ public class RestClientService {
|
|
|
*/
|
|
|
public String getSSOToken(){
|
|
|
//String url = "http://127.0.0.1:8188/v4.0/auth/native";
|
|
|
- String url = configService.getConfigValue(ConfigInfo.SSO_LOGIN_URL);
|
|
|
- String username = configService.getConfigValue(ConfigInfo.SSO_SYS_USERNAME);
|
|
|
- String password = configService.getConfigValue(ConfigInfo.SSO_SYS_PASSWORD);
|
|
|
+ //String url = configService.getConfigValue(ConfigInfo.SSO_LOGIN_URL);
|
|
|
+ //String username = configService.getConfigValue(ConfigInfo.SSO_SYS_USERNAME);
|
|
|
+ //String password = configService.getConfigValue(ConfigInfo.SSO_SYS_PASSWORD);
|
|
|
+
|
|
|
+ String url = "http://"+ssoIp+":"+ssoPort+"/v4.0/auth/native";
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("username",username);
|
|
|
- jsonObject.put("password",password);
|
|
|
+ jsonObject.put("username",ssoUsername);
|
|
|
+ jsonObject.put("password",ssoPassword);
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|
|
|
headers.setContentType(type);
|
|
@@ -275,7 +329,8 @@ public class RestClientService {
|
|
|
public JSONObject getClientInfo(){
|
|
|
String token = getSSOToken();
|
|
|
//String url = "http://127.0.0.1:8188/v4.0/clients?page=1&maxResults=10&appName=iothub";
|
|
|
- String url = configService.getConfigValue(ConfigInfo.SSO_GetClientInfo);
|
|
|
+ //String url = configService.getConfigValue(ConfigInfo.SSO_GetClientInfo);
|
|
|
+ String url = "http://"+ssoIp+":"+ssoPort+"/v4.0/clients?page=1&maxResults=10&appName=iothub";
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|
|
|
headers.setContentType(type);
|
|
@@ -298,7 +353,8 @@ public class RestClientService {
|
|
|
String clientId = (String) resources.get(0).get("clientId");
|
|
|
String clientSecret = (String) resources.get(0).get("clientSecret");
|
|
|
//String url = "http://127.0.0.1:8188/v4.0/oauth/token?grant_type=client_credentials&client_id="+clientId+"&client_secret="+clientSecret+"&duration=eternal";
|
|
|
- String url = configService.getConfigValue(ConfigInfo.SSO_GetClientToken)+"?grant_type=client_credentials&client_id="+clientId+"&client_secret="+clientSecret+"&duration=eternal";
|
|
|
+ //String url = configService.getConfigValue(ConfigInfo.SSO_GetClientToken)+"?grant_type=client_credentials&client_id="+clientId+"&client_secret="+clientSecret+"&duration=eternal";
|
|
|
+ String url = "http://"+ssoIp+":"+ssoPort+"/v4.0/oauth/token?grant_type=client_credentials&client_id="+clientId+"&client_secret="+clientSecret+"&duration=eternal";
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|
|
|
//headers.setContentType(type);
|
|
@@ -323,7 +379,8 @@ public class RestClientService {
|
|
|
clientToken = getClientToken();
|
|
|
}
|
|
|
//String url = "http://127.0.0.1:8082/v1/org"+"/"+groupId;
|
|
|
- String url = configService.getConfigValue(ConfigInfo.IOTEDGE_UPDATEGROUP)+"/"+groupId;
|
|
|
+ //String url = configService.getConfigValue(ConfigInfo.IOTEDGE_UPDATEGROUP)+"/"+groupId;
|
|
|
+ String url = "http://"+iotIp+":"+iotPort+"/v1/org/"+groupId;
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("orgName",groupName);
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
@@ -347,14 +404,14 @@ public class RestClientService {
|
|
|
* des: 获取所有的 Group
|
|
|
* date: 2024/8/5
|
|
|
*/
|
|
|
- public JSONObject getAllGroup(){
|
|
|
+ public JSONObject getAllGroup(String elToken){
|
|
|
//String url = "http://127.0.0.1:8082/v1/groups";
|
|
|
- String url = configService.getConfigValue(ConfigInfo.IOTEDGE_GETALLGROUP);
|
|
|
- String accessToken = getAccessToken();
|
|
|
+ //String url = configService.getConfigValue(ConfigInfo.IOTEDGE_GETALLGROUP);
|
|
|
+ String url = "http://"+iotIp+":"+iotPort+"/v1/groups";
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|
|
|
headers.setContentType(type);
|
|
|
- headers.add("Authorization", "Bearer " + accessToken);
|
|
|
+ headers.add("Authorization", "Bearer " + elToken);
|
|
|
HttpEntity<String> httpEntity = new HttpEntity<String>(null, headers);
|
|
|
ResponseEntity<JSONObject> response = restTemplate.exchange(url, HttpMethod.GET,httpEntity, JSONObject.class);
|
|
|
return response.getBody();
|
|
@@ -370,7 +427,8 @@ public class RestClientService {
|
|
|
ArrayList<String> scopList = new ArrayList<>();
|
|
|
scopList.add("Admin");
|
|
|
String ssoToken = getSSOToken();
|
|
|
- String url = configService.getConfigValue(ConfigInfo.SSO_CREATECLIENT);
|
|
|
+ //String url = configService.getConfigValue(ConfigInfo.SSO_CREATECLIENT);
|
|
|
+ String url = "http://"+ssoIp+":"+ssoPort+"/v4.0/clients";
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
//if (ObjectUtil.isNotNull(System.getenv("appName"))){
|
|
|
// jsonObject.put("appName",System.getenv("appName"));
|
|
@@ -405,7 +463,8 @@ public class RestClientService {
|
|
|
String clientId = (String) clientInfo.get("clientId");
|
|
|
String clientSecret = (String) clientInfo.get("clientSecret");
|
|
|
//String url = "http://127.0.0.1:8188/v4.0/oauth/token?grant_type=client_credentials&client_id="+clientId+"&client_secret="+clientSecret+"&duration=eternal";
|
|
|
- String url = configService.getConfigValue(ConfigInfo.SSO_GetClientToken)+"?grant_type=client_credentials&client_id="+clientId+"&client_secret="+clientSecret+"&duration=eternal";
|
|
|
+ //String url = configService.getConfigValue(ConfigInfo.SSO_GetClientToken)+"?grant_type=client_credentials&client_id="+clientId+"&client_secret="+clientSecret+"&duration=eternal";
|
|
|
+ String url = "http://"+ssoIp+":"+ssoPort+"/v4.0/oauth/token?grant_type=client_credentials&client_id="+clientId+"&client_secret="+clientSecret+"&duration=eternal";
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|
|
|
//headers.setContentType(type);
|
|
@@ -442,7 +501,8 @@ public class RestClientService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- String url = configService.getConfigValue(ConfigInfo.SSO_ADDUSER)+"/"+userName+"/scopes";
|
|
|
+ //String url = configService.getConfigValue(ConfigInfo.SSO_ADDUSER)+"/"+userName+"/scopes";
|
|
|
+ String url = "http://"+ssoIp+":"+ssoPort+"/v4.0/users/"+userName+"/scopes";
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("clientId",clientId);
|
|
@@ -485,7 +545,8 @@ public class RestClientService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- String url = configService.getConfigValue(ConfigInfo.SSO_ADDUSER)+"/"+userName+"/scopes";
|
|
|
+ //String url = configService.getConfigValue(ConfigInfo.SSO_ADDUSER)+"/"+userName+"/scopes";
|
|
|
+ String url = "http://"+ssoIp+":"+ssoPort+"/v4.0/users/"+userName+"/scopes";
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("clientId",clientId);
|
|
@@ -521,7 +582,8 @@ public class RestClientService {
|
|
|
*/
|
|
|
public JSONObject invitationSSOUserInIoTEdge(String userName,String elToken){
|
|
|
//String url = "http://127.0.0.1:8082/v1/users/username"+"/"+userName;
|
|
|
- String url = configService.getConfigValue(ConfigInfo.IOTEDGE_ADDUSER)+"/"+userName;
|
|
|
+ //String url = configService.getConfigValue(ConfigInfo.IOTEDGE_ADDUSER)+"/"+userName;
|
|
|
+ String url = "http://"+iotIp+":"+iotPort+"/v1/users/username/"+userName;
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("groupId","");
|
|
|
jsonObject.put("role","");
|
|
@@ -542,7 +604,8 @@ public class RestClientService {
|
|
|
*/
|
|
|
public JSONObject setUserRole(String userId,String groupId,String rloe,String elToken){
|
|
|
//String url = "http://127.0.0.1:8082/v1/users"+"/"+userId+"/rolebinding";
|
|
|
- String url = configService.getConfigValue(ConfigInfo.IOTEDGE_SETUSERROLE)+"/"+userId+"/rolebinding";
|
|
|
+ //String url = configService.getConfigValue(ConfigInfo.IOTEDGE_SETUSERROLE)+"/"+userId+"/rolebinding";
|
|
|
+ String url = "http://"+iotIp+":"+iotPort+"/v1/users/"+userId+"/rolebinding";
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("groupId",groupId);
|
|
|
jsonObject.put("role",rloe);
|
|
@@ -563,7 +626,8 @@ public class RestClientService {
|
|
|
*/
|
|
|
public JSONObject deleteUserRole(String userId,String groupId,String rloe,String elToken){
|
|
|
//String url = "http://127.0.0.1:8082/v1/users"+"/"+userId+"/rolebinding";
|
|
|
- String url = configService.getConfigValue(ConfigInfo.IOTEDGE_SETUSERROLE)+"/"+userId+"/rolebinding";
|
|
|
+ //String url = configService.getConfigValue(ConfigInfo.IOTEDGE_SETUSERROLE)+"/"+userId+"/rolebinding";
|
|
|
+ String url = "http://"+iotIp+":"+iotPort+"/v1/users/"+userId+"/rolebinding";
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("groupId",groupId);
|
|
|
jsonObject.put("role",rloe);
|
|
@@ -585,7 +649,8 @@ public class RestClientService {
|
|
|
* date: 2024/8/29
|
|
|
*/
|
|
|
public JSONObject ifUserInSSO(String userName){
|
|
|
- String url = configService.getConfigValue(ConfigInfo.SSO_IFUSERINSSO)+"/"+userName;
|
|
|
+ //String url = configService.getConfigValue(ConfigInfo.SSO_IFUSERINSSO)+"/"+userName;
|
|
|
+ String url = "http://"+ssoIp+":"+ssoPort+"/v4.0/validators/users/"+userName;
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|
|
|
//headers.setContentType(type);
|
|
@@ -606,7 +671,7 @@ public class RestClientService {
|
|
|
*/
|
|
|
public JSONObject deleteSSOUser(String userName){
|
|
|
String ssoToken = getSSOToken();
|
|
|
- String url = "http://127.0.0.1:8188/v4.0/users"+"/"+userName;
|
|
|
+ String url = "http://"+ssoIp+":"+ssoPort+"/v4.0/users"+"/"+userName;
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|
|
|
headers.setContentType(type);
|
|
@@ -624,7 +689,7 @@ public class RestClientService {
|
|
|
* date: 2024/8/7
|
|
|
*/
|
|
|
public JSONObject deleteIoTEdgeUser(String userId,String elToken){
|
|
|
- String url = "http://127.0.0.1:8082/v1/user"+"/"+userId;
|
|
|
+ String url = "http://"+iotIp+":"+iotPort+"/v1/user"+"/"+userId;
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|
|
|
headers.setContentType(type);
|