【修改】组织和用户实体上加上schema需要的注解
This commit is contained in:
@@ -1,84 +0,0 @@
|
||||
//package com.jero.modules.iam;
|
||||
//
|
||||
//import com.bamboocloud.codec.BamboocloudFacade;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//
|
||||
//import javax.servlet.http.HttpServletRequest;
|
||||
//import java.io.BufferedReader;
|
||||
//import java.io.IOException;
|
||||
//import java.util.Iterator;
|
||||
//import java.util.Map;
|
||||
//import java.util.TreeMap;
|
||||
//@Slf4j
|
||||
//public class BamboocloudUtils {
|
||||
// public static void main(String[] args) {
|
||||
// String aes = BamboocloudFacade.encrypt("{\"uid\":\"104\",\"bimRequestId\":\"95d73fe7aa7a4930a3edea779708a46c\",\"resultCode\":\"0\",\"message\":\"success\"}", "123456", "AES");
|
||||
// System.out.println(aes);
|
||||
// String aes1 = getPlaintext("KJ3jbIflWkNiEq3oxE2d5oxtKRLO3CC7edGrq57RIB02RSRgPljiNcTfuWYLS3sc1tbZMLm5fWG2guLK100g9MkWH9NhlxorPSlcP8LaYuP5NeZ1wFP8iKqr5RredwXfDA3J1fjOCAJfzPvJ4HSb1w==", "123456", "AES");
|
||||
// System.out.println(aes1);
|
||||
// }
|
||||
// public static boolean checkUsernamePassword(String username, String password) {
|
||||
// log.info("username --->" + username + " password --- >" + password + " ----ok");
|
||||
// if("bbcadmin".equals(username)&&"P@ssw0rd".equals(password)) {
|
||||
// return true;
|
||||
// }
|
||||
// else {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public static String getPlaintext(String ciphertext, String key, String type) {
|
||||
// return BamboocloudFacade.decrypt(ciphertext, key, type);
|
||||
// }
|
||||
//
|
||||
// public static Boolean verify(Map<String, Object> reqmap, String type) {
|
||||
// Map<String, Object> verifymap = new TreeMap<String, Object>();
|
||||
// StringBuffer sb = new StringBuffer();
|
||||
// Iterator<String> it = reqmap.keySet().iterator();
|
||||
// while (it.hasNext()) {
|
||||
// String key = (String) it.next();
|
||||
// verifymap.put(key, reqmap.get(key));
|
||||
// }
|
||||
// Iterator<String> ittree = verifymap.keySet().iterator();
|
||||
// while (ittree.hasNext()) {
|
||||
// String key = (String) ittree.next();
|
||||
// if (!"signature".equals(key)) {
|
||||
// sb.append(key).append("=").append(verifymap.get(key)).append("&");
|
||||
// }
|
||||
// }
|
||||
// sb.deleteCharAt(sb.length() - 1);
|
||||
// System.out.println(reqmap.get("signature") + " now " + sb.toString());
|
||||
// return BamboocloudFacade.verify(reqmap.get("signature").toString(), sb.toString(), type);
|
||||
// }
|
||||
//
|
||||
// public static String getRequestBody(HttpServletRequest request) {
|
||||
// BufferedReader br = null;
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
// String str = "";
|
||||
// try {
|
||||
// br = request.getReader();
|
||||
// while ((str = br.readLine()) != null) {
|
||||
// sb.append(str);
|
||||
// }
|
||||
// br.close();
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// if (br != null) {
|
||||
// try {
|
||||
// br.close();
|
||||
// } catch (IOException eo) {
|
||||
// eo.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// } finally {
|
||||
// if (br != null) {
|
||||
// try {
|
||||
// br.close();
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return sb.toString();
|
||||
// }
|
||||
//}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,44 +0,0 @@
|
||||
package com.jero.modules.iam;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
public class SHA256Util {
|
||||
public static void main(String[] args) {
|
||||
String sha256StrJava = getSHA256StrJava("123456");
|
||||
System.out.println(sha256StrJava);
|
||||
}
|
||||
/**
|
||||
* 利用java原生的摘要实现SHA256加密密后的报文
|
||||
*/
|
||||
public static String getSHA256StrJava(String str) {
|
||||
MessageDigest messageDigest;
|
||||
String encodeStr = "";
|
||||
try {
|
||||
messageDigest = MessageDigest.getInstance("SHA-256");
|
||||
messageDigest.update(str.getBytes(StandardCharsets.UTF_8));
|
||||
encodeStr = byte2Hex(messageDigest.digest());
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return encodeStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将byte转为16进制
|
||||
*/
|
||||
private static String byte2Hex(byte[] bytes) {
|
||||
StringBuilder stringBuffer = new StringBuilder();
|
||||
String temp;
|
||||
for (byte aByte : bytes) {
|
||||
temp = Integer.toHexString(aByte & 0xFF);
|
||||
if (temp.length() == 1) {
|
||||
//1得到一位的进行补0操作
|
||||
stringBuffer.append("0");
|
||||
}
|
||||
stringBuffer.append(temp);
|
||||
}
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user