Commit a603f9978632fd0a5806ac87389fe8dd254e23b9
1 parent
94760468
修复配置文件赋值失败
Showing
1 changed file
with
32 additions
and
65 deletions
src/main/java/com/genersoft/iot/vmp/conf/UserSetup.java
| 1 | 1 | package com.genersoft.iot.vmp.conf; |
| 2 | 2 | |
| 3 | -import org.springframework.beans.factory.annotation.Value; | |
| 4 | 3 | import org.springframework.boot.context.properties.ConfigurationProperties; |
| 5 | -import org.springframework.context.annotation.Configuration; | |
| 6 | 4 | import org.springframework.stereotype.Component; |
| 7 | 5 | |
| 8 | 6 | import java.util.ArrayList; |
| 9 | 7 | import java.util.List; |
| 10 | 8 | |
| 11 | -//@Configuration("userSetup") | |
| 12 | -//public class UserSetup { | |
| 13 | -// @Value("${userSettings.savePositionHistory:false}") | |
| 14 | -// boolean savePositionHistory; | |
| 15 | -// | |
| 16 | -// @Value("${userSettings.autoApplyPlay}") | |
| 17 | -// private boolean autoApplyPlay; | |
| 18 | -// | |
| 19 | -// @Value("${userSettings.seniorSdp:false}") | |
| 20 | -// private boolean seniorSdp; | |
| 21 | -// | |
| 22 | -// @Value("${userSettings.playTimeout:18000}") | |
| 23 | -// private long playTimeout; | |
| 24 | -// | |
| 25 | -// @Value("${userSettings.waitTrack:false}") | |
| 26 | -// private boolean waitTrack; | |
| 27 | -// | |
| 28 | -// @Value("${userSettings.interfaceAuthentication}") | |
| 29 | -// private boolean interfaceAuthentication; | |
| 30 | -// | |
| 31 | -// @Value("${userSettings.recordPushLive}") | |
| 32 | -// private boolean recordPushLive; | |
| 33 | -// | |
| 34 | -// @Value("${userSettings.interfaceAuthenticationExcludes:}") | |
| 35 | -// private String interfaceAuthenticationExcludes; | |
| 36 | -// | |
| 37 | -// public boolean getSavePositionHistory() { | |
| 38 | -// return savePositionHistory; | |
| 39 | -// } | |
| 40 | -// | |
| 41 | -// public boolean isSavePositionHistory() { | |
| 42 | -// return savePositionHistory; | |
| 43 | -// } | |
| 44 | -// | |
| 45 | -// public boolean isAutoApplyPlay() { | |
| 46 | -// return autoApplyPlay; | |
| 47 | -// } | |
| 48 | -// | |
| 49 | -// public boolean isSeniorSdp() { | |
| 50 | -// return seniorSdp; | |
| 51 | -// } | |
| 52 | -// | |
| 53 | -// public long getPlayTimeout() { | |
| 54 | -// return playTimeout; | |
| 55 | -// } | |
| 56 | -// | |
| 57 | -// public boolean isWaitTrack() { | |
| 58 | -// return waitTrack; | |
| 59 | -// } | |
| 60 | -// | |
| 61 | -// public boolean isInterfaceAuthentication() { | |
| 62 | -// return interfaceAuthentication; | |
| 63 | -// } | |
| 64 | -// | |
| 65 | -// public boolean isRecordPushLive() { | |
| 66 | -// return recordPushLive; | |
| 67 | -// } | |
| 68 | -// | |
| 69 | -// public String getInterfaceAuthenticationExcludes() { | |
| 70 | -// return interfaceAuthenticationExcludes; | |
| 71 | -// } | |
| 72 | -//} | |
| 73 | - | |
| 74 | 9 | |
| 75 | 10 | @Component |
| 76 | 11 | @ConfigurationProperties(prefix = "user-settings", ignoreInvalidFields = true) |
| ... | ... | @@ -127,4 +62,36 @@ public class UserSetup { |
| 127 | 62 | public List<String> getInterfaceAuthenticationExcludes() { |
| 128 | 63 | return interfaceAuthenticationExcludes; |
| 129 | 64 | } |
| 65 | + | |
| 66 | + public void setSavePositionHistory(Boolean savePositionHistory) { | |
| 67 | + this.savePositionHistory = savePositionHistory; | |
| 68 | + } | |
| 69 | + | |
| 70 | + public void setAutoApplyPlay(Boolean autoApplyPlay) { | |
| 71 | + this.autoApplyPlay = autoApplyPlay; | |
| 72 | + } | |
| 73 | + | |
| 74 | + public void setSeniorSdp(Boolean seniorSdp) { | |
| 75 | + this.seniorSdp = seniorSdp; | |
| 76 | + } | |
| 77 | + | |
| 78 | + public void setPlayTimeout(Long playTimeout) { | |
| 79 | + this.playTimeout = playTimeout; | |
| 80 | + } | |
| 81 | + | |
| 82 | + public void setWaitTrack(Boolean waitTrack) { | |
| 83 | + this.waitTrack = waitTrack; | |
| 84 | + } | |
| 85 | + | |
| 86 | + public void setInterfaceAuthentication(boolean interfaceAuthentication) { | |
| 87 | + this.interfaceAuthentication = interfaceAuthentication; | |
| 88 | + } | |
| 89 | + | |
| 90 | + public void setRecordPushLive(Boolean recordPushLive) { | |
| 91 | + this.recordPushLive = recordPushLive; | |
| 92 | + } | |
| 93 | + | |
| 94 | + public void setInterfaceAuthenticationExcludes(List<String> interfaceAuthenticationExcludes) { | |
| 95 | + this.interfaceAuthenticationExcludes = interfaceAuthenticationExcludes; | |
| 96 | + } | |
| 130 | 97 | } | ... | ... |