lxw
2022-05-16 7bf8e29a05ae358d01ba446aed5c94bc1cc025f6
yuml配置
4个文件已修改
1个文件已添加
173 ■■■■■ 已修改文件
src/main/java/com/whyc/config/StaticResourceConfig.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/YamlProperties.java 116 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/config/application.yml 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
target/classes/com/whyc/config/StaticResourceConfig.class 补丁 | 查看 | 原始文档 | blame | 历史
target/classes/config/application.yml 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/config/StaticResourceConfig.java
@@ -1,6 +1,7 @@
package com.whyc.config;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.whyc.pojo.YamlProperties;
import org.springframework.boot.system.ApplicationHome;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -65,7 +66,7 @@
        String baseDirPath;
        String baseDirPath2;
        if(true) {
        if(YamlProperties.runModel == 1) {
            //开发路径
            //baseDirPath = jarFile.getParentFile().toString()+File.separator;
            baseDirPath2 = jarFile.getParentFile().toString()+File.separator+"fg_photo"+File.separator;
src/main/java/com/whyc/pojo/YamlProperties.java
New file
@@ -0,0 +1,116 @@
package com.whyc.pojo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
/**
 * Yaml配置参数 实体类
 */
@Component
public class YamlProperties {
    /**
     * 系统类型
     * 1:普通,没有多重校验
     * 2:严格,有多重校验(登录,防重放,参数过滤)
     */
    public static Integer systemType;
    /**人脸识别对比阈值*/
    public static Float faceThreshold;
    /**告警短信开关*/
    public static String messageSwitch;
    public static String messageSecretId;
    public static String messageSecretKey;
    public static String messageRegion;
    public static String messageSdkAppId;
    public static String messageSignName;
    public static String messageTemplateId;
    public static String appId4Win;
    public static String sdkKey4Win;
    public static String appId4Linux;
    public static String sdkKey4Linux;
    /**告警工单开关*/
    public static String alarmTaskSwitch;
    /**系统运行模式*/
    public static Integer runModel;
    @Value("${system.type}")
    public void setSystemType(Integer systemType) {
        YamlProperties.systemType = systemType;
    }
    @Value("${custom.face.threshold}")
    private void setFaceThreshold(Float faceThreshold) {
        YamlProperties.faceThreshold = faceThreshold;
    }
    @Value("${custom.message.switch}")
    private void setMessageSwitch(String messageSwitch) {
        YamlProperties.messageSwitch = messageSwitch;
    }
    @Value("${custom.message.secret_id}")
    private void setMessageSecretId(String messageSecretId) {
        YamlProperties.messageSecretId = messageSecretId;
    }
    @Value("${custom.message.secret_key}")
    private void setMessageSecretKey(String messageSecretKey) {
        YamlProperties.messageSecretKey = messageSecretKey;
    }
    @Value("${custom.message.region}")
    private void setMessageRegion(String messageRegion) {
        YamlProperties.messageRegion = messageRegion;
    }
    @Value("${custom.message.smsSdkAppId}")
    private void setMessageSdkAppId(String messageSdkAppId) {
        YamlProperties.messageSdkAppId = messageSdkAppId;
    }
    @Value("${custom.message.signName}")
    private void setMessageSignName(String messageSignName) {
        YamlProperties.messageSignName = messageSignName;
    }
    @Value("${custom.message.templateId}")
    private void setMessageTemplateId(String messageTemplateId) {
        YamlProperties.messageTemplateId = messageTemplateId;
    }
    @Value("${custom.alarm.task.switch}")
    private void setAlarmTaskSwitch(String alarmTaskSwitch) {
        YamlProperties.alarmTaskSwitch = alarmTaskSwitch;
    }
    @Value("${custom.face.appId4Win}")
    private void setAppId4Win(String appId4Win) {
        YamlProperties.appId4Win = appId4Win;
    }
    @Value("${custom.face.sdkKey4Win}")
    private void setSdkKey4Win(String sdkKey4Win) {
        YamlProperties.sdkKey4Win = sdkKey4Win;
    }
    @Value("${custom.face.appId4Linux}")
    private void setAppId4Linux(String appId4Linux) {
        YamlProperties.appId4Linux = appId4Linux;
    }
    @Value("${custom.face.sdkKey4Linux}")
    private void setSdkKey4Linux(String sdkKey4Linux) {
        YamlProperties.sdkKey4Linux = sdkKey4Linux;
    }
    @Value("${configFile.type}")
    public void setRunModel(Integer runModel) {
        YamlProperties.runModel = runModel;
    }
}
src/main/resources/config/application.yml
@@ -1,3 +1,6 @@
#系统类型:1(普通,无限制),2(严格,多重限制)
system:
  type: 1
#服务端口号
server:
  port: 8092
@@ -6,3 +9,27 @@
knife:
  enable: true
custom:
  #人脸
  face:
    threshold: 0.8
    appId4Win: AafPX5afzycEnTqH3v79gY3VozNVTSNqT8kzSmP7b48q
    sdkKey4Win: GsYwWhxzuQEE1WE34J3Fo8d2QppjkqYGojyc4625JhKb
    appId4Linux: AafPX5afzycEnTqH3v79gY3VozNVTSNqT8kzSmP7b48q
    sdkKey4Linux: GsYwWhxzuQEE1WE34J3Fo8d2GiFdddqH81ghetQQTGmv
  #告警短信
  message:
    switch: OFF
    secret_id: AKIDaz80bw0oLbbLo0vay5vVoqb5IEtIQItD
    secret_key: 4sPeeNp0tWsVrxmLdfQu73i6D2btufAO
    region: ap-nanjing
    smsSdkAppId: 1400565791
    signName: 武汉源畅科技有限公司
    templateId: 1095970
  #告警工单
  alarm:
    task.switch: off
#Config文件读取 涉及License和FGCDFileDownload
configFile:
  type: 1 #1:本地测试;2:打包jar
target/classes/com/whyc/config/StaticResourceConfig.class
Binary files differ
target/classes/config/application.yml
@@ -1,3 +1,6 @@
#系统类型:1(普通,无限制),2(严格,多重限制)
system:
  type: 1
#服务端口号
server:
  port: 8092
@@ -6,3 +9,27 @@
knife:
  enable: true
custom:
  #人脸
  face:
    threshold: 0.8
    appId4Win: AafPX5afzycEnTqH3v79gY3VozNVTSNqT8kzSmP7b48q
    sdkKey4Win: GsYwWhxzuQEE1WE34J3Fo8d2QppjkqYGojyc4625JhKb
    appId4Linux: AafPX5afzycEnTqH3v79gY3VozNVTSNqT8kzSmP7b48q
    sdkKey4Linux: GsYwWhxzuQEE1WE34J3Fo8d2GiFdddqH81ghetQQTGmv
  #告警短信
  message:
    switch: OFF
    secret_id: AKIDaz80bw0oLbbLo0vay5vVoqb5IEtIQItD
    secret_key: 4sPeeNp0tWsVrxmLdfQu73i6D2btufAO
    region: ap-nanjing
    smsSdkAppId: 1400565791
    signName: 武汉源畅科技有限公司
    templateId: 1095970
  #告警工单
  alarm:
    task.switch: off
#Config文件读取 涉及License和FGCDFileDownload
configFile:
  type: 1 #1:本地测试;2:打包jar