| | |
| | | import com.google.gson.Gson; |
| | | import com.open.common.util.OpenApiClient; |
| | | import com.open.common.util.SystemParameterNames; |
| | | import com.stylefeng.guns.modular.system.util.SpringContextsUtil; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | |
| | | @Slf4j |
| | | public class UserUtil { |
| | | |
| | | private static QianYunTongConfig qianYunTongConfig = SpringContextsUtil.getBean(QianYunTongConfig.class).getQianYunTongConfig(); |
| | | |
| | | /** |
| | | * 根据手机号码获取人员信息 |
| | |
| | | */ |
| | | public static List<QYTUserInfo> getUserInfoByPhone(String mobile, String enterNum) { |
| | | //请求路径 |
| | | String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/getUserInfoByPhone"; |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/getUserInfoByPhone"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = QianYunTongProperties.privateKeyPath; |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = QianYunTongProperties.appkey;//appkey |
| | | String appKey = qianYunTongConfig.getAppkey();//appkey |
| | | Map<String, String> headers = new HashMap<>(); |
| | | headers.put("Content-Type", "application/json"); |
| | | Map<String, Object> contentMap = new HashMap<String, Object>(); |
| | |
| | | String messageId = UUID.randomUUID().toString().replaceAll("-", ""); |
| | | contentMap.put(SystemParameterNames.getAppKey(), appKey); |
| | | contentMap.put(SystemParameterNames.getMessage_id(), messageId); |
| | | contentMap.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName); |
| | | contentMap.put(SystemParameterNames.getStatus(), QianYunTongProperties.status); |
| | | contentMap.put(SystemParameterNames.getUserName(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("mobile", mobile); |
| | | if (null != enterNum) { |
| | |
| | | */ |
| | | public static RegisterViaMobile registerViaMobile(RegisterViaMobileRequest request) { |
| | | //请求路径 |
| | | String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/m1_register_via_mobile"; |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/m1_register_via_mobile"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = QianYunTongProperties.privateKeyPath; |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = QianYunTongProperties.appkey;//appkey |
| | | String appKey = qianYunTongConfig.getAppkey();//appkey |
| | | Map<String, String> headers = new HashMap<>(); |
| | | headers.put("Content-Type", "application/json"); |
| | | Map<String, Object> contentMap = new HashMap<String, Object>(); |
| | |
| | | String messageId = UUID.randomUUID().toString().replaceAll("-", ""); |
| | | contentMap.put(SystemParameterNames.getAppKey(), appKey); |
| | | contentMap.put(SystemParameterNames.getMessage_id(), messageId); |
| | | contentMap.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName); |
| | | contentMap.put(SystemParameterNames.getStatus(), QianYunTongProperties.status); |
| | | contentMap.put(SystemParameterNames.getUserName(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | contentMap.put("content", new Gson().toJson(request)); |
| | | log.info("【根据手机号注册用户】请求地址:" + url); |
| | | log.info("【根据手机号注册用户】请求参数:" + JSON.toJSONString(contentMap)); |
| | |
| | | */ |
| | | public static Boolean modifyPwd(ModifyPwdRequest request) { |
| | | //请求路径 |
| | | String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/modifyPwd"; |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/modifyPwd"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = QianYunTongProperties.privateKeyPath; |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = QianYunTongProperties.appkey;//appkey |
| | | String appKey = qianYunTongConfig.getAppkey();//appkey |
| | | Map<String, String> headers = new HashMap<>(); |
| | | headers.put("Content-Type", "application/json"); |
| | | Map<String, Object> contentMap = new HashMap<String, Object>(); |
| | |
| | | String messageId = UUID.randomUUID().toString().replaceAll("-", ""); |
| | | contentMap.put(SystemParameterNames.getAppKey(), appKey); |
| | | contentMap.put(SystemParameterNames.getMessage_id(), messageId); |
| | | contentMap.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName); |
| | | contentMap.put(SystemParameterNames.getStatus(), QianYunTongProperties.status); |
| | | contentMap.put(SystemParameterNames.getUserName(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | contentMap.put("content", new Gson().toJson(request)); |
| | | log.info("【易信用户修改密码】请求地址:" + url); |
| | | log.info("【易信用户修改密码】请求参数:" + JSON.toJSONString(contentMap)); |
| | |
| | | */ |
| | | public static Boolean resetPwd(ResetPwdRequest request) { |
| | | //请求路径 |
| | | String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/resetPwd"; |
| | | String url = qianYunTongConfig.getApiUrl() + "/openapi/rest/1.0/resetPwd"; |
| | | //私钥文件 |
| | | String skprivateKeyFile = QianYunTongProperties.privateKeyPath; |
| | | String skprivateKeyFile = qianYunTongConfig.getPrivateKeyPath(); |
| | | //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 |
| | | String appKey = QianYunTongProperties.appkey;//appkey |
| | | String appKey = qianYunTongConfig.getAppkey();//appkey |
| | | Map<String, String> headers = new HashMap<>(); |
| | | headers.put("Content-Type", "application/json"); |
| | | Map<String, Object> contentMap = new HashMap<String, Object>(); |
| | |
| | | String messageId = UUID.randomUUID().toString().replaceAll("-", ""); |
| | | contentMap.put(SystemParameterNames.getAppKey(), appKey); |
| | | contentMap.put(SystemParameterNames.getMessage_id(), messageId); |
| | | contentMap.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName); |
| | | contentMap.put(SystemParameterNames.getStatus(), QianYunTongProperties.status); |
| | | contentMap.put(SystemParameterNames.getUserName(), qianYunTongConfig.getUserName()); |
| | | contentMap.put(SystemParameterNames.getStatus(), qianYunTongConfig.getStatus()); |
| | | contentMap.put("content", new Gson().toJson(request)); |
| | | log.info("【易信重置密码】请求地址:" + url); |
| | | log.info("【易信重置密码】请求参数:" + JSON.toJSONString(contentMap)); |