| | |
| | | package com.zy.asrs.utils; |
| | | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.util.DigestUtils; |
| | | |
| | | import java.nio.charset.StandardCharsets; |
| | |
| | | |
| | | public class MesSyncUtil { |
| | | |
| | | @Value("${mes.appkey}") |
| | | private static String appkey; |
| | | |
| | | public static Map<String,Object> getRequestParamMap(){ |
| | | Date date = new Date(); |
| | | String ts = date.getTime() + ""; |
| | | String key = DigestUtils.md5DigestAsHex(("appkey" + ts).getBytes(StandardCharsets.UTF_8)); |
| | | String key = DigestUtils.md5DigestAsHex((appkey + ts).getBytes(StandardCharsets.UTF_8)); |
| | | Map<String,Object> requestParamMap = new HashMap<>(); |
| | | requestParamMap.put("ts",ts); |
| | | requestParamMap.put("key",key); |
| | | return requestParamMap; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | System.out.println(MesSyncUtil.getRequestParamMap()); |
| | | } |
| | | } |