zhangyeguang
3 months ago
37 changed files with 386 additions and 90 deletions
@ -0,0 +1,25 @@ |
|||||
|
package com.jiagutech.ams.utils; |
||||
|
|
||||
|
import cn.dev33.satoken.stp.StpUtil; |
||||
|
import com.fasterxml.jackson.core.JsonProcessingException; |
||||
|
import com.fasterxml.jackson.databind.ObjectMapper; |
||||
|
import com.jiagutech.ams.constant.UserConstants; |
||||
|
import com.jiagutech.ams.model.LoginUser; |
||||
|
|
||||
|
public class LoginUtil { |
||||
|
|
||||
|
|
||||
|
public static LoginUser getLoginUser() { |
||||
|
String userStr = (String) StpUtil.getSession().get(UserConstants.SYS_SESSION); |
||||
|
|
||||
|
ObjectMapper mapper = new ObjectMapper(); |
||||
|
|
||||
|
try { |
||||
|
return mapper.readValue(userStr, LoginUser.class); |
||||
|
} catch (JsonProcessingException e) { |
||||
|
throw new RuntimeException(e); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,14 @@ |
|||||
|
#!/bin/bash |
||||
|
echo "服务开始打包" |
||||
|
export JAVA_HOME=~/Library/Java/JavaVirtualMachines/corretto-17.0.11/Contents/Home |
||||
|
|
||||
|
mvn -P prod clean package -Dmaven.test.skip=true |
||||
|
|
||||
|
echo "服务打包完成" |
||||
|
|
||||
|
echo "开始上传jar" |
||||
|
scp ./web/target/*.jar jg-node1:/usr/local/ams-social/ |
||||
|
echo "上传完成" |
||||
|
echo "开始启动服务" |
||||
|
ssh jg-node1 "cd /usr/local/ams-social && docker-compose up -d --build " |
||||
|
echo "部署完成" |
@ -0,0 +1,17 @@ |
|||||
|
package com.jiagutech.ams.model; |
||||
|
|
||||
|
import com.jiagutech.ams.model.dto.DeviceDTO; |
||||
|
import com.jiagutech.ams.model.response.DeviceInfo; |
||||
|
import org.mapstruct.Mapper; |
||||
|
import org.mapstruct.Mapping; |
||||
|
import org.mapstruct.factory.Mappers; |
||||
|
|
||||
|
@Mapper |
||||
|
public interface DeviceMapping { |
||||
|
|
||||
|
DeviceMapping INSTANCE = Mappers.getMapper(DeviceMapping.class); |
||||
|
|
||||
|
@Mapping(source = "id", target = "deviceId") |
||||
|
DeviceInfo convertDeviceInfo(DeviceDTO device); |
||||
|
|
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
|
||||
|
spring: |
||||
|
datasource: |
||||
|
# url: jdbc:mysql://192.168.10.111:23306/ams_social?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true |
||||
|
# username: root |
||||
|
# password: 123456 |
||||
|
url: jdbc:mysql://192.168.1.200:3306/ams_social?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true |
||||
|
username: root |
||||
|
password: Jiagu*2058 |
||||
|
|
||||
|
data: |
||||
|
redis: |
||||
|
host: 192.168.1.13 |
||||
|
port: 6379 |
||||
|
database: 11 |
||||
|
password: Test123 |
||||
|
rabbitmq: |
||||
|
host: 192.168.1.195 |
||||
|
port: 5672 |
||||
|
username: jiagu |
||||
|
password: jiagu2058 |
||||
|
|
||||
|
|
||||
|
|
||||
|
center-track: |
||||
|
client: |
||||
|
url: http://192.168.0.17:11003/iot/farm/track |
||||
|
|
Loading…
Reference in new issue