diff --git a/src/main/java/com/chint/interfaces/rest/ly/LYPostRequest.java b/src/main/java/com/chint/interfaces/rest/ly/LYPostRequest.java index 19150e05..e1982592 100644 --- a/src/main/java/com/chint/interfaces/rest/ly/LYPostRequest.java +++ b/src/main/java/com/chint/interfaces/rest/ly/LYPostRequest.java @@ -22,15 +22,16 @@ public class LYPostRequest { private String mySecret = L_Y_SECRET; - public T post(String url, LYBaseRequest jsonRequest, Class responseType) { + public T post(String url, LYBaseRequest jsonRequest, Class responseType) { String token = lyTokenRequest.loadToken(); jsonRequest.setRandom(UUID.randomUUID().toString()); jsonRequest.setTimestamp(String.valueOf(System.currentTimeMillis())); jsonRequest.setAccessToken(token); - String postDataMd5 = md5(postRequest.gson().toJson(jsonRequest)); + jsonRequest.setEncrypt(false); + String json = postRequest.gson().toJson(jsonRequest); + String postDataMd5 = md5(json); String finallySign = md5(postDataMd5 + mySecret); - jsonRequest.setSign(finallySign); - return postRequest.post(url, jsonRequest, responseType); + return postRequest.post(url + "?sign=" + finallySign, jsonRequest, responseType); } public static String md5(String input) { diff --git a/src/main/java/com/chint/interfaces/rest/ly/LYUserRequest.java b/src/main/java/com/chint/interfaces/rest/ly/LYUserRequest.java index 741913ea..575b60aa 100644 --- a/src/main/java/com/chint/interfaces/rest/ly/LYUserRequest.java +++ b/src/main/java/com/chint/interfaces/rest/ly/LYUserRequest.java @@ -34,7 +34,7 @@ public class LYUserRequest { EmployeeEntity employeeEntity = user2LYEmployee(currentUser); EmployeeRequest employeeData = new EmployeeRequest(); employeeData.setParam(employeeEntity); - UserResponse post = postRequest.post(userUrl, employeeData, UserResponse.class); + UserResponse post = postRequest.post(userUrl , employeeData, UserResponse.class); return post.isSuccess(); } diff --git a/src/main/java/com/chint/interfaces/rest/ly/dto/LYBaseRequest.java b/src/main/java/com/chint/interfaces/rest/ly/dto/LYBaseRequest.java index d0b0d3c2..42ccd876 100644 --- a/src/main/java/com/chint/interfaces/rest/ly/dto/LYBaseRequest.java +++ b/src/main/java/com/chint/interfaces/rest/ly/dto/LYBaseRequest.java @@ -8,4 +8,5 @@ public class LYBaseRequest { private String random; private String timestamp; private String sign; + private boolean isEncrypt; } diff --git a/src/main/java/com/chint/interfaces/rest/ly/dto/user/EmployeeEntity.java b/src/main/java/com/chint/interfaces/rest/ly/dto/user/EmployeeEntity.java index 7399dce9..495ec283 100644 --- a/src/main/java/com/chint/interfaces/rest/ly/dto/user/EmployeeEntity.java +++ b/src/main/java/com/chint/interfaces/rest/ly/dto/user/EmployeeEntity.java @@ -24,7 +24,7 @@ public class EmployeeEntity { private int workingState; private String birthday; private String credentialExpireDate; - private int credentialType; +// private int credentialType; private int addTravellerAllowed; private String employeeCode; private String costCenter; diff --git a/src/main/java/com/chint/interfaces/rest/ly/dto/user/EmployeeRequest.java b/src/main/java/com/chint/interfaces/rest/ly/dto/user/EmployeeRequest.java index a793f4c3..9977976c 100644 --- a/src/main/java/com/chint/interfaces/rest/ly/dto/user/EmployeeRequest.java +++ b/src/main/java/com/chint/interfaces/rest/ly/dto/user/EmployeeRequest.java @@ -7,7 +7,7 @@ import java.util.List; @Data public class EmployeeRequest extends LYBaseRequest { - private boolean isEncrypt; + private EmployeeEntity param; private List costCenterList;