From cd07eb23600d62680cafeae7ee2515e859d234fb Mon Sep 17 00:00:00 2001 From: 2821744554@qq.com <2821744554@qq.com> Date: Thu, 27 Aug 2020 14:12:13 +0800 Subject: [PATCH] 增加网关负载 --- cloud/dahua/src/main/java/com/example/dahua/mqtt/MqttManager.java | 2 +- cloud/dahua/src/test/java/com/example/dahua/DahuaApplicationTests.java | 20 +++++++++++++++----- cloud/haikangface/.gitignore | 6 ++++-- cloud/haikangface/.mvn/wrapper/MavenWrapperDownloader.java | 60 ++++++++++++++++++++++++++++++++---------------------------- cloud/haikangface/.mvn/wrapper/maven-wrapper.jar | Bin 48337 -> 0 bytes cloud/haikangface/.mvn/wrapper/maven-wrapper.properties | 3 ++- cloud/haikangface/src/main/java/com/sincere/haikangface/CMSServer.java | 48 +++++++++++++++++++++++++++++++++++------------- cloud/haikangface/src/main/java/com/sincere/haikangface/async/SendUserAsync.java | 2 +- cloud/haikangface/src/main/java/com/sincere/haikangface/bean/face/WeekDay.java | 1 + cloud/haikangface/src/main/java/com/sincere/haikangface/control/FileControl.java | 2 +- cloud/haikangface/src/main/java/com/sincere/haikangface/control/UserControl.java | 6 +++--- cloud/haikangface/src/main/java/com/sincere/haikangface/dao/UserDao.java | 4 ++-- cloud/haikangface/src/main/java/com/sincere/haikangface/mqtt/MqtUtils.java | 4 ++-- cloud/haikangface/src/main/java/com/sincere/haikangface/utils/CompressPic.java | 2 +- cloud/haikangface/src/main/java/com/sincere/haikangface/utils/HttpUtil.java | 2 +- cloud/haikangface/src/main/resources/application.yaml | 8 ++++---- cloud/pom.xml | 2 +- 17 files changed, 106 insertions(+), 66 deletions(-) diff --git a/cloud/dahua/src/main/java/com/example/dahua/mqtt/MqttManager.java b/cloud/dahua/src/main/java/com/example/dahua/mqtt/MqttManager.java index 2d2a878..704a6da 100644 --- a/cloud/dahua/src/main/java/com/example/dahua/mqtt/MqttManager.java +++ b/cloud/dahua/src/main/java/com/example/dahua/mqtt/MqttManager.java @@ -96,7 +96,7 @@ public class MqttManager { public void sendMq(String deviceId, String cmd) { String recvClientId = groupId + "@@@" + deviceId; final String p2pSendTopic = topic + "/p2p/" + recvClientId; - String content = "{\"cmd\":\"" + cmd + "\",\"clientId\":\"" + deviceId + "\",\"data\": \"http://update.myjxt.com/CloundWindowYueQing.apk\"}"; + String content = "{\"cmd\":\"" + cmd + "\",\"clientId\":\"" + deviceId + "\",\"data\": \"http://update.myjxt.com/CloundWindow.apk\"}"; MqttMessage message = new MqttMessage(content.getBytes()); message.setQos(qosLevel); System.out.println("发送内容:" + p2pSendTopic); diff --git a/cloud/dahua/src/test/java/com/example/dahua/DahuaApplicationTests.java b/cloud/dahua/src/test/java/com/example/dahua/DahuaApplicationTests.java index b9d1d3d..2eed71d 100644 --- a/cloud/dahua/src/test/java/com/example/dahua/DahuaApplicationTests.java +++ b/cloud/dahua/src/test/java/com/example/dahua/DahuaApplicationTests.java @@ -478,13 +478,23 @@ public class DahuaApplicationTests { @Test public void test1() { - List list = userDao.getStudentUserIdsWith(); +// List list = userDao.getStudentUserIdsWith(); +// +// for (int i = 0; i < list.size(); i++) { +// StudentBean studentBean = list.get(i); +// } +// +// System.out.println("list:" + list.toString()); + + List attendanceBeanList = userDao.getAttendanceBeans("479","4"); + + for (int i = 0; i < attendanceBeanList.size(); i++) { + AttendanceBean attendanceBean = attendanceBeanList.get(i); + - for (int i = 0; i < list.size(); i++) { - StudentBean studentBean = list.get(i); } - System.out.println("list:" + list.toString()); + } @@ -496,7 +506,7 @@ public class DahuaApplicationTests { mqttManager.init(); - List stringList = userDao.getAllDecWithSch(13); + List stringList = userDao.getAllDecWithSch(479); System.out.println("stringList:" + stringList.size()); for (int i = 0; i < stringList.size(); i++) { String devId = stringList.get(i); diff --git a/cloud/haikangface/.gitignore b/cloud/haikangface/.gitignore index a2a3040..549e00a 100644 --- a/cloud/haikangface/.gitignore +++ b/cloud/haikangface/.gitignore @@ -1,8 +1,8 @@ HELP.md target/ !.mvn/wrapper/maven-wrapper.jar -!**/src/main/** -!**/src/test/** +!**/src/main/**/target/ +!**/src/test/**/target/ ### STS ### .apt_generated @@ -26,6 +26,8 @@ target/ /nbdist/ /.nb-gradle/ build/ +!**/src/main/**/build/ +!**/src/test/**/build/ ### VS Code ### .vscode/ diff --git a/cloud/haikangface/.mvn/wrapper/MavenWrapperDownloader.java b/cloud/haikangface/.mvn/wrapper/MavenWrapperDownloader.java index 7f91a56..a45eb6b 100644 --- a/cloud/haikangface/.mvn/wrapper/MavenWrapperDownloader.java +++ b/cloud/haikangface/.mvn/wrapper/MavenWrapperDownloader.java @@ -1,38 +1,32 @@ /* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at + * Copyright 2007-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ - https://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.net.URL; -import java.nio.channels.Channels; -import java.nio.channels.ReadableByteChannel; +import java.net.*; +import java.io.*; +import java.nio.channels.*; import java.util.Properties; public class MavenWrapperDownloader { + private static final String WRAPPER_VERSION = "0.5.6"; /** * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. */ - private static final String DEFAULT_DOWNLOAD_URL = - "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"; + private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; /** * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to @@ -80,13 +74,13 @@ public class MavenWrapperDownloader { } } } - System.out.println("- Downloading from: : " + url); + System.out.println("- Downloading from: " + url); File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); if (!outputFile.getParentFile().exists()) { if (!outputFile.getParentFile().mkdirs()) { System.out.println( - "- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); } } System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); @@ -102,6 +96,16 @@ public class MavenWrapperDownloader { } private static void downloadFileFromURL(String urlString, File destination) throws Exception { + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + String username = System.getenv("MVNW_USERNAME"); + char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } URL website = new URL(urlString); ReadableByteChannel rbc; rbc = Channels.newChannel(website.openStream()); diff --git a/cloud/haikangface/.mvn/wrapper/maven-wrapper.jar b/cloud/haikangface/.mvn/wrapper/maven-wrapper.jar index 01e6799..2cc7d4a 100644 Binary files a/cloud/haikangface/.mvn/wrapper/maven-wrapper.jar and b/cloud/haikangface/.mvn/wrapper/maven-wrapper.jar differ diff --git a/cloud/haikangface/.mvn/wrapper/maven-wrapper.properties b/cloud/haikangface/.mvn/wrapper/maven-wrapper.properties index cd0d451..642d572 100644 --- a/cloud/haikangface/.mvn/wrapper/maven-wrapper.properties +++ b/cloud/haikangface/.mvn/wrapper/maven-wrapper.properties @@ -1 +1,2 @@ -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar diff --git a/cloud/haikangface/src/main/java/com/sincere/haikangface/CMSServer.java b/cloud/haikangface/src/main/java/com/sincere/haikangface/CMSServer.java index 1db8626..70f91a3 100644 --- a/cloud/haikangface/src/main/java/com/sincere/haikangface/CMSServer.java +++ b/cloud/haikangface/src/main/java/com/sincere/haikangface/CMSServer.java @@ -10,10 +10,12 @@ import com.sincere.haikangface.haikanglibs.HCEHomeAlarm; import com.sincere.haikangface.haikanglibs.HCEHomeCMS; import com.sincere.haikangface.haikanglibs.HCEHomeSS; import com.sincere.haikangface.mqtt.MqtUtils; +import com.sincere.haikangface.mqtt.MqttManager; import com.sincere.haikangface.utils.*; import com.sincere.haikangface.xiananDao.SendRecordDao; import com.sun.jna.NativeLong; import com.sun.jna.Pointer; +import lombok.extern.slf4j.Slf4j; import org.apache.http.util.TextUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -36,6 +38,7 @@ import java.util.Map; import java.util.regex.Pattern; @Component +@Slf4j public class CMSServer implements ApplicationRunner { @Autowired @@ -50,9 +53,9 @@ public class CMSServer implements ApplicationRunner { //114.55.30.100 //120.26.116.253 - private String ip_cloud = "120.26.116.253"; - // private String ip_cloud = "172.16.2.56"; -// private String ip_cloud = "114.55.30.100"; +// private String ip_cloud = "120.26.116.253"; + private String ip_cloud = "172.16.2.53"; + // private String ip_cloud = "114.55.30.100"; private String ip; { @@ -126,7 +129,7 @@ public class CMSServer implements ApplicationRunner { public class FRegisterCallBack implements HCEHomeCMS.DEVICE_REGISTER_CB { public boolean invoke(NativeLong lUserID, int dwDataType, Pointer pOutBuffer, int dwOutLen, HCEHomeCMS.NET_EHOME_SERVER_INFO pInBuffer, int dwInLen, Pointer pUser) { String deviceId = ""; -// System.out.println("dwDataType:" + dwDataType); + System.out.println("dwDataType:" + dwDataType); if (dwDataType == 0) { HCEHomeCMS.NET_EHOME_DEV_REG_INFO strDevRegInfo = new HCEHomeCMS.NET_EHOME_DEV_REG_INFO(); strDevRegInfo.write(); @@ -169,10 +172,12 @@ public class CMSServer implements ApplicationRunner { // byte[] byIP = ip.getBytes(); byte[] byIP = ip_cloud.getBytes(); System.arraycopy(byIP, 0, pInBuffer.struUDPAlarmSever.szIP, 0, byIP.length); + // TODO: 2020/8/27 人脸机类型为0 pInBuffer.dwAlarmServerType = 0; //报警服务器类型:0- 只支持UDP协议上报,1- 支持UDP、TCP两种协议上报 pInBuffer.struTCPAlarmSever.wPort = 7661; pInBuffer.struUDPAlarmSever.wPort = 7662; + // TODO: 2020/8/27 人脸存储类型为3 pInBuffer.dwPicServerType = 3; System.arraycopy(byIP, 0, pInBuffer.struPictureSever.szIP, 0, byIP.length); pInBuffer.struPictureSever.wPort = 8081; @@ -296,6 +301,7 @@ public class CMSServer implements ApplicationRunner { pFileName = pFileName.split("T")[0] + ".jpg"; isZhuaPai = true; } + String strFilePath = strPath + pFileName; FileUtils.getInstance().writeLogs("文件名:" + pFileName, FileUtils.fileName); //保存抓拍到的人脸图片,比对通过后的图片资源 @@ -365,9 +371,11 @@ public class CMSServer implements ApplicationRunner { } net_ehome_alarm_listen_param.struAddress.szIP = ip.getBytes(); + // TODO: 2020/8/27 人脸端口号为7662 net_ehome_alarm_listen_param.struAddress.wPort = 7662; net_ehome_alarm_listen_param.fnMsgCb = cbEHomeMsgCallBack; net_ehome_alarm_listen_param.pUserData = null; + // TODO: 2020/8/27 人脸类型为1 net_ehome_alarm_listen_param.byProtocolType = 1; //协议类型:0- TCP,1- UDP net_ehome_alarm_listen_param.byUseCmsPort = 0; //是否复用CMS端口:0- 不复用,非0- 复用 //如果复用cms端口,协议类型字段无效,此时AMS的本地监听信息struAddress填本地回环地址, @@ -378,18 +386,18 @@ public class CMSServer implements ApplicationRunner { System.out.println("NET_EALARM_StartListen失败, error code:" + hCEhomeCMS.NET_ECMS_GetLastError()); return; } else { - /*复用CMS端口接收设备上传报警信息的时候需要调用以下接口配置 - HCEHomeCMS.NET_EHOME_AMS_ADDRESS struAMSAddr= new HCEHomeCMS.NET_EHOME_AMS_ADDRESS(); + /*复用CMS端口接收设备上传报警信息的时候需要调用以下接口配置*/ + /*HCEHomeCMS.NET_EHOME_AMS_ADDRESS struAMSAddr= new HCEHomeCMS.NET_EHOME_AMS_ADDRESS(); struAMSAddr.dwSize = struAMSAddr.size(); struAMSAddr.byEnable = 1;//是否启用:0-关闭CMS接收报警功能,1-开启CMS接收报警功能 - String strAmsAddr = "10.17.36.25"; + String strAmsAddr = ip_cloud; System.arraycopy(strAmsAddr.getBytes(), 0, struAMSAddr.struAddress.szIP, 0, strAmsAddr.length()); struAMSAddr.struAddress.wPort = 7662; //和报警服务器监听端口需要一致 struAMSAddr.write(); if(!hCEhomeCMS.NET_ECMS_SetSDKLocalCfg(1, struAMSAddr.getPointer())) { - JOptionPane.showMessageDialog(null, "NET_ECMS_SetSDKLocalCfg failed, error code:" + hCEhomeCMS.NET_ECMS_GetLastError()); + System.out.println("NET_ECMS_SetSDKLocalCfg failed, error code:" + hCEhomeCMS.NET_ECMS_GetLastError()); }*/ System.out.println("启动报警监听成功"); } @@ -412,7 +420,7 @@ public class CMSServer implements ApplicationRunner { strXMLData.read(); String strXML = new String(strXMLData.byValue); -// System.out.println(strXML); + System.out.println(strXML); if (null == alarmUtils) { alarmUtils = new AlarmUtils(deviceDao); @@ -496,6 +504,10 @@ public class CMSServer implements ApplicationRunner { FileUtils.getInstance().writeLogs("card:" + card, FileUtils.faceSuccess); } + if (deviceID.startsWith("qj")) {//枪击 用来抓拍人脸考勤用 + initQJ(deviceID, cardNo, studentBean == null); + } + } } catch (Exception e) { @@ -503,8 +515,18 @@ public class CMSServer implements ApplicationRunner { } } - public void isTeacher(String cardNo, String deviceID) { + /** + * @param deviceID + * @param cardNo + * @param isTeacher true:教师 false:学生 + */ + private void initQJ(String deviceID, String cardNo, boolean isTeacher) { + +// MqtUtils.getInstance().sendMsg(); + + } + public void isTeacher(String cardNo, String deviceID) { List devLists = userDao.getDeviceRoomRelation(deviceID); @@ -512,14 +534,14 @@ public class CMSServer implements ApplicationRunner { StudentBean teacher = userDao.getTeacherWithCard(cardNo); if (null != teacher) { - String url = String.format("http://60.190.202.57:1000/api/RollCall/AddRollCallPersonnelRecord?userId=%s&deviceId=%s", teacher.getUser_id(), deviceID); + String url = String.format("http://campus.myjxt.com/api/RollCall/AddRollCallPersonnelRecord?userId=%s&deviceId=%s", teacher.getUser_id(), deviceID); RestTemplate restTemplate = new RestTemplate(); - String res = restTemplate.getForObject(url, String.class); + JSONObject jsonObject = JSON.parseObject(res); - System.out.println("result:" + res + "------url:" + url); + System.out.println("result:" + res + "------url:" + jsonObject.getBoolean("data")); } } diff --git a/cloud/haikangface/src/main/java/com/sincere/haikangface/async/SendUserAsync.java b/cloud/haikangface/src/main/java/com/sincere/haikangface/async/SendUserAsync.java index adaadcd..907f0e2 100644 --- a/cloud/haikangface/src/main/java/com/sincere/haikangface/async/SendUserAsync.java +++ b/cloud/haikangface/src/main/java/com/sincere/haikangface/async/SendUserAsync.java @@ -204,7 +204,7 @@ public class SendUserAsync { String weekPlanTime = HKXmlUtils.getInstance().SetCardWeekPlanTime(stringBuffer.toString(), "" + week); String serCardRightCfg = HKXmlUtils.getInstance().SetCardRightCfg(cardNum); // log.error("serCardRightCfg:{}", serCardRightCfg); - FileUtils.getInstance().writeLogs(weekPlanTime,"设置卡权限周计划时间.txt"); + FileUtils.getInstance().writeLogs(weekPlanTime, "设置卡权限周计划时间.txt"); cmsServer.SetCardWeekPlan(deviceId, cardNum, userType, weekPlanTime, "设置卡权限周计划时间"); cmsServer.SetCardWeekPlan(deviceId, cardNum, userType, serCardRightCfg, "设置卡权限"); diff --git a/cloud/haikangface/src/main/java/com/sincere/haikangface/bean/face/WeekDay.java b/cloud/haikangface/src/main/java/com/sincere/haikangface/bean/face/WeekDay.java index 3fff656..ec5cc5b 100644 --- a/cloud/haikangface/src/main/java/com/sincere/haikangface/bean/face/WeekDay.java +++ b/cloud/haikangface/src/main/java/com/sincere/haikangface/bean/face/WeekDay.java @@ -19,6 +19,7 @@ public class WeekDay implements Serializable { private String userIds; private List deviceIds; + public List getDeviceIds() { return deviceIds; } diff --git a/cloud/haikangface/src/main/java/com/sincere/haikangface/control/FileControl.java b/cloud/haikangface/src/main/java/com/sincere/haikangface/control/FileControl.java index 9fdb8c6..9127325 100644 --- a/cloud/haikangface/src/main/java/com/sincere/haikangface/control/FileControl.java +++ b/cloud/haikangface/src/main/java/com/sincere/haikangface/control/FileControl.java @@ -54,7 +54,7 @@ public class FileControl { public boolean sendPermiss(@RequestBody PermissionBean permissionBean) { log.error("permissionBean:{}", JSON.toJSONString(permissionBean)); if (!StringUtils.isEmpty(permissionBean)) { - return sendUserAsync.sendPermiss(permissionBean,1); + return sendUserAsync.sendPermiss(permissionBean, 1); } return false; } diff --git a/cloud/haikangface/src/main/java/com/sincere/haikangface/control/UserControl.java b/cloud/haikangface/src/main/java/com/sincere/haikangface/control/UserControl.java index dca6bbe..701385e 100644 --- a/cloud/haikangface/src/main/java/com/sincere/haikangface/control/UserControl.java +++ b/cloud/haikangface/src/main/java/com/sincere/haikangface/control/UserControl.java @@ -78,7 +78,7 @@ public class UserControl { @ApiOperation("下发指定教师用户权限给设备") public boolean sendUsersAndPermiss(@RequestBody UserAndPermission userAndPermission) { log.error("sendUsersAndPermiss:{}", JSON.toJSONString(userAndPermission)); - FileUtils.getInstance().writeLogs(JSON.toJSONString(userAndPermission),"下发指定教师用户权限给设备.txt"); + FileUtils.getInstance().writeLogs(JSON.toJSONString(userAndPermission), "下发指定教师用户权限给设备.txt"); PermissionBean permissionBean = new PermissionBean(); permissionBean.setSchoolId(userAndPermission.getSchoolId()); permissionBean.setUserType(String.valueOf(userAndPermission.getUserType())); @@ -91,8 +91,8 @@ public class UserControl { @ApiOperation("测试教师点名") public void isTeacher(@RequestParam("deviceId") String deviceId, @RequestParam("cardNo") String cardNo) { try { - cmsServer.isTeacher(cardNo,deviceId); - }catch (Exception e){ + cmsServer.isTeacher(cardNo, deviceId); + } catch (Exception e) { e.printStackTrace(); } } diff --git a/cloud/haikangface/src/main/java/com/sincere/haikangface/dao/UserDao.java b/cloud/haikangface/src/main/java/com/sincere/haikangface/dao/UserDao.java index 03d0ea9..73b3d16 100644 --- a/cloud/haikangface/src/main/java/com/sincere/haikangface/dao/UserDao.java +++ b/cloud/haikangface/src/main/java/com/sincere/haikangface/dao/UserDao.java @@ -240,10 +240,10 @@ public interface UserDao { TeacherBean getTeacherWithUserId(@Param("userId") String userId); - List getStudentWiSidAndSex(@Param("schoolId")String schoolId , @Param("sexs")List sexs); + List getStudentWiSidAndSex(@Param("schoolId") String schoolId, @Param("sexs") List sexs); - List getDeviceRoomRelation(@Param("clint_id")String clint_id); + List getDeviceRoomRelation(@Param("clint_id") String clint_id); } diff --git a/cloud/haikangface/src/main/java/com/sincere/haikangface/mqtt/MqtUtils.java b/cloud/haikangface/src/main/java/com/sincere/haikangface/mqtt/MqtUtils.java index f30b52b..ce71d16 100644 --- a/cloud/haikangface/src/main/java/com/sincere/haikangface/mqtt/MqtUtils.java +++ b/cloud/haikangface/src/main/java/com/sincere/haikangface/mqtt/MqtUtils.java @@ -20,9 +20,9 @@ public class MqtUtils { mqttManager.init(); } - public void sendMsg(String msg) { + public void sendMsg(String deviceId, int cmd, String msg) { - mqttManager.sendMq("123456789", 51, msg); + mqttManager.sendMq(deviceId, cmd, msg); } diff --git a/cloud/haikangface/src/main/java/com/sincere/haikangface/utils/CompressPic.java b/cloud/haikangface/src/main/java/com/sincere/haikangface/utils/CompressPic.java index 61f09c2..da2450e 100644 --- a/cloud/haikangface/src/main/java/com/sincere/haikangface/utils/CompressPic.java +++ b/cloud/haikangface/src/main/java/com/sincere/haikangface/utils/CompressPic.java @@ -55,7 +55,7 @@ public class CompressPic { File targetFile = new File(targetPath); if (!targetFile.exists()) targetFile.createNewFile(); - if (width>height){ + if (width > height) { int width1 = width; width = height; height = width1; diff --git a/cloud/haikangface/src/main/java/com/sincere/haikangface/utils/HttpUtil.java b/cloud/haikangface/src/main/java/com/sincere/haikangface/utils/HttpUtil.java index c8360f6..6fef96f 100644 --- a/cloud/haikangface/src/main/java/com/sincere/haikangface/utils/HttpUtil.java +++ b/cloud/haikangface/src/main/java/com/sincere/haikangface/utils/HttpUtil.java @@ -182,7 +182,7 @@ public class HttpUtil { HttpEntity httpEntity = new HttpEntity<>(permissionBean, headers); - System.out.println("PermissionBean:"+JSON.toJSONString(permissionBean)); + System.out.println("PermissionBean:" + JSON.toJSONString(permissionBean)); ResponseEntity responseEntity = restTemplate.postForEntity(url, httpEntity, String.class); diff --git a/cloud/haikangface/src/main/resources/application.yaml b/cloud/haikangface/src/main/resources/application.yaml index 59c6710..14d4e04 100644 --- a/cloud/haikangface/src/main/resources/application.yaml +++ b/cloud/haikangface/src/main/resources/application.yaml @@ -10,10 +10,10 @@ spring: password: RQminVCJota3H1u8bBYH jdbc-url: jdbc:sqlserver://116.62.155.137:33419;database=SmartCampus driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver -# username: SZJXTUSER -# password: xst200919 -# jdbc-url: jdbc:sqlserver://60.190.202.57:14333;database=SmartCampusSZ -# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver + # username: SZJXTUSER + # password: xst200919 + # jdbc-url: jdbc:sqlserver://60.190.202.57:14333;database=SmartCampusSZ + # driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver xiaoan: jdbc-url: jdbc:sqlserver://116.62.241.27:33419;database=xiaoanhxy username: szjxtuser diff --git a/cloud/pom.xml b/cloud/pom.xml index c05689d..496db1e 100644 --- a/cloud/pom.xml +++ b/cloud/pom.xml @@ -33,7 +33,7 @@ haikang - + haikangface -- libgit2 0.21.0