智慧校园
This commit is contained in:
parent
23f214d1d0
commit
cdf5e28051
|
@ -1,5 +1,5 @@
|
|||
# 使用官方Java运行环境作为基础镜像
|
||||
FROM openjdk:1.8-jre-slim
|
||||
FROM openjdk:8
|
||||
|
||||
# 指定维护者信息
|
||||
LABEL maintainer="zhangbo"
|
||||
|
@ -8,7 +8,7 @@ LABEL maintainer="zhangbo"
|
|||
VOLUME /tmp
|
||||
|
||||
# 将jar包添加到容器中并更名为app.jar
|
||||
ADD shapelight-admin/target/shapelight-admin.jar app.jar
|
||||
ADD target/shapelight-admin.jar app.jar
|
||||
|
||||
# 暴露容器内的端口给外部访问
|
||||
EXPOSE 8018
|
|
@ -244,12 +244,38 @@
|
|||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<!-- docker的maven插件官网:https://github.com/spotify/docker-maven-plugin -->
|
||||
<plugin>
|
||||
<groupId>com.spotify</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<version>1.2.2</version>
|
||||
<configuration>
|
||||
<!--配置最终生成的镜像名称-->
|
||||
<imageName>shapelight/admin</imageName>
|
||||
<baseImage>java:8-alpine</baseImage>
|
||||
<entryPoint>["java", "-jar", "/${project.build.finalName}.jar"]</entryPoint>
|
||||
<resources>
|
||||
<resource>
|
||||
<targetPath>/</targetPath>
|
||||
<directory>${project.build.directory}</directory>
|
||||
<include>${project.build.finalName}.jar</include>
|
||||
</resource>
|
||||
</resources>
|
||||
<!--配置 docker 的地址,当运行 docker build 命令时构建并上传镜像-->
|
||||
<dockerHost>http://192.168.10.62:2375</dockerHost>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!--<plugin>
|
||||
<groupId>com.spotify</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<version>0.4.14</version>
|
||||
<configuration>
|
||||
<imageName>shapelight/admin</imageName>
|
||||
<dockerDirectory>${project.basedir}</dockerDirectory>
|
||||
<dockerHost>http://192.168.10.62:2375</dockerHost>
|
||||
<resources>
|
||||
<resource>
|
||||
<targetPath>/</targetPath>
|
||||
|
@ -258,8 +284,49 @@
|
|||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
<!-- 运行命令 mvn clean package docker:build 打包并生成docker镜像 -->
|
||||
</plugin>
|
||||
<!– 运行命令 mvn clean package docker:build 打包并生成docker镜像 –>
|
||||
</plugin>-->
|
||||
<!--<plugin>
|
||||
<groupId>com.spotify</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<configuration>
|
||||
<!– 镜像名称 guoweixin/exam–>
|
||||
<imageName>${project.artifactId}</imageName>
|
||||
<!–指定标签–>
|
||||
<imageTags>
|
||||
<imageTag>latest</imageTag>
|
||||
</imageTags>
|
||||
<!– 基础镜像jdk 1.8–>
|
||||
<baseImage>java</baseImage>
|
||||
<!– 制作者提供本人信息 –>
|
||||
<maintainer>zdk=20477@sina.com</maintainer>
|
||||
<runs>
|
||||
<run>mkdir -p /opt/java/</run>
|
||||
</runs>
|
||||
<!–切换到/ROOT目录 –>
|
||||
<workdir>/ROOT</workdir>
|
||||
<cmd>["java", "-version"]</cmd>
|
||||
<entryPoint>["java", "-jar", "${project.build.finalName}.jar"]</entryPoint>
|
||||
<!– 指定 Dockerfile 路径
|
||||
<dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
|
||||
–>
|
||||
<!–指定远程 docker api地址–>
|
||||
<dockerHost>http://192.168.10.62:2375</dockerHost>
|
||||
<!– 这里是复制 jar 包到 docker 容器指定目录配置 –>
|
||||
<resources>
|
||||
<resource>
|
||||
<targetPath>/ROOT</targetPath>
|
||||
<!–用于指定需要复制的根目录,${project.build.directory}表示target目录–>
|
||||
<directory>${project.build.directory}</directory>
|
||||
<!–用于指定需要复制的文件。${project.build.finalName}.jar指的是打包后的jar
|
||||
包文件。–>
|
||||
<include>${project.build.finalName}.jar</include>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</plugin>-->
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
|
@ -29,8 +29,8 @@ public class AdminApplication {
|
|||
SpringApplication.run(AdminApplication.class, args);
|
||||
|
||||
//初始化掌静脉sdk
|
||||
//int initCode = PalmSDK.init();
|
||||
//log.debug("掌静脉sdk初始化。。。。。。。。。。:"+initCode);
|
||||
int initCode = PalmSDK.init();
|
||||
log.debug("掌静脉sdk初始化。。。。。。。。。。:"+initCode);
|
||||
// //mqtt服务启动
|
||||
// MqttClientUtil.createClient();
|
||||
//
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
package net.shapelight.modules.job.task;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.shapelight.modules.job.entity.KeysEntity;
|
||||
import net.shapelight.modules.tripartitePlatform.operatorPlatform.OpFeignClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Component("empowerTask")
|
||||
@Slf4j
|
||||
public class EmpowerTask implements ITask{
|
||||
@Autowired
|
||||
private OpFeignClient feignClient;
|
||||
|
||||
@Value("${global.qingju.accountNumber}")
|
||||
String accountNumber;
|
||||
@Value("${global.qingju.empowerKey}")
|
||||
String empowerKey;
|
||||
|
||||
// 定义Token续期的方法
|
||||
public void renewToken() {
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("accountNumber",accountNumber);
|
||||
params.put("empowerKey", empowerKey);
|
||||
JSONObject json = feignClient.empower(params);
|
||||
if(json.getString("shrgStatus").equals("S")) {
|
||||
KeysEntity.passKey = json.getString("passKey");
|
||||
KeysEntity.empowerText = json.getString("empowerText");
|
||||
log.debug("TokenResponse:{}", json.getString("passKey"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(String params) {
|
||||
renewToken();
|
||||
}
|
||||
}
|
|
@ -104,7 +104,7 @@ public class TenParentController {
|
|||
TenParent tenParent = tenParentService.getById(id);
|
||||
AppUserEntity userEntity = appUserService.getById(tenParent.getUserId());
|
||||
userEntity.setPassword(DigestUtils.sha256Hex(passWord));
|
||||
appUserService.save(userEntity);
|
||||
appUserService.updateById(userEntity);
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,14 +64,14 @@ spring:
|
|||
async:
|
||||
request-timeout: 60000 #60秒
|
||||
resources:
|
||||
static-locations: file:/home/huangyifang/project/cell #根目录
|
||||
static-locations: file:D:/project/cell/temp #根目录
|
||||
#file:
|
||||
#文件上传目录(注意Linux和Windows上的目录结构不同)
|
||||
#uploadPath: D:/project/cell/temp
|
||||
global:
|
||||
http_flag: http
|
||||
file_path:
|
||||
static-locations: /home/huangyifang/project/cell #根目录,必须是在static-locations下
|
||||
static-locations: D:/project/cell/temp #根目录,必须是在static-locations下
|
||||
temp_dir: temp
|
||||
images_dir: images
|
||||
apk_dir: apk
|
||||
|
|
Loading…
Reference in New Issue