64850858
3 years ago
11 changed files with 2472 additions and 16569 deletions
@ -1,60 +1,130 @@ |
|||||
package com.genersoft.iot.vmp.conf; |
package com.genersoft.iot.vmp.conf; |
||||
|
|
||||
import org.springframework.beans.factory.annotation.Value; |
import org.springframework.beans.factory.annotation.Value; |
||||
|
import org.springframework.boot.context.properties.ConfigurationProperties; |
||||
import org.springframework.context.annotation.Configuration; |
import org.springframework.context.annotation.Configuration; |
||||
|
import org.springframework.stereotype.Component; |
||||
@Configuration("userSetup") |
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
//@Configuration("userSetup")
|
||||
|
//public class UserSetup {
|
||||
|
// @Value("${userSettings.savePositionHistory:false}")
|
||||
|
// boolean savePositionHistory;
|
||||
|
//
|
||||
|
// @Value("${userSettings.autoApplyPlay}")
|
||||
|
// private boolean autoApplyPlay;
|
||||
|
//
|
||||
|
// @Value("${userSettings.seniorSdp:false}")
|
||||
|
// private boolean seniorSdp;
|
||||
|
//
|
||||
|
// @Value("${userSettings.playTimeout:18000}")
|
||||
|
// private long playTimeout;
|
||||
|
//
|
||||
|
// @Value("${userSettings.waitTrack:false}")
|
||||
|
// private boolean waitTrack;
|
||||
|
//
|
||||
|
// @Value("${userSettings.interfaceAuthentication}")
|
||||
|
// private boolean interfaceAuthentication;
|
||||
|
//
|
||||
|
// @Value("${userSettings.recordPushLive}")
|
||||
|
// private boolean recordPushLive;
|
||||
|
//
|
||||
|
// @Value("${userSettings.interfaceAuthenticationExcludes:}")
|
||||
|
// private String interfaceAuthenticationExcludes;
|
||||
|
//
|
||||
|
// public boolean getSavePositionHistory() {
|
||||
|
// return savePositionHistory;
|
||||
|
// }
|
||||
|
//
|
||||
|
// public boolean isSavePositionHistory() {
|
||||
|
// return savePositionHistory;
|
||||
|
// }
|
||||
|
//
|
||||
|
// public boolean isAutoApplyPlay() {
|
||||
|
// return autoApplyPlay;
|
||||
|
// }
|
||||
|
//
|
||||
|
// public boolean isSeniorSdp() {
|
||||
|
// return seniorSdp;
|
||||
|
// }
|
||||
|
//
|
||||
|
// public long getPlayTimeout() {
|
||||
|
// return playTimeout;
|
||||
|
// }
|
||||
|
//
|
||||
|
// public boolean isWaitTrack() {
|
||||
|
// return waitTrack;
|
||||
|
// }
|
||||
|
//
|
||||
|
// public boolean isInterfaceAuthentication() {
|
||||
|
// return interfaceAuthentication;
|
||||
|
// }
|
||||
|
//
|
||||
|
// public boolean isRecordPushLive() {
|
||||
|
// return recordPushLive;
|
||||
|
// }
|
||||
|
//
|
||||
|
// public String getInterfaceAuthenticationExcludes() {
|
||||
|
// return interfaceAuthenticationExcludes;
|
||||
|
// }
|
||||
|
//}
|
||||
|
|
||||
|
|
||||
|
@Component |
||||
|
@ConfigurationProperties(prefix = "user-settings", ignoreInvalidFields = true) |
||||
public class UserSetup { |
public class UserSetup { |
||||
@Value("${userSettings.savePositionHistory:false}") |
|
||||
boolean savePositionHistory; |
|
||||
|
|
||||
@Value("${userSettings.autoApplyPlay}") |
private Boolean savePositionHistory = Boolean.FALSE; |
||||
private boolean autoApplyPlay; |
|
||||
|
private Boolean autoApplyPlay = Boolean.FALSE; |
||||
|
|
||||
|
private Boolean seniorSdp = Boolean.FALSE; |
||||
|
|
||||
@Value("${userSettings.seniorSdp:false}") |
private Long playTimeout = 18000L; |
||||
private boolean seniorSdp; |
|
||||
|
|
||||
@Value("${userSettings.playTimeout:18000}") |
private Boolean waitTrack = Boolean.FALSE; |
||||
private long playTimeout; |
|
||||
|
|
||||
@Value("${userSettings.waitTrack:false}") |
private Boolean interfaceAuthentication = Boolean.TRUE; |
||||
private boolean waitTrack; |
|
||||
|
|
||||
@Value("${userSettings.interfaceAuthentication}") |
private Boolean recordPushLive = Boolean.FALSE; |
||||
private boolean interfaceAuthentication; |
|
||||
|
|
||||
@Value("${userSettings.recordPushLive}") |
private List<String> interfaceAuthenticationExcludes = new ArrayList<>(); |
||||
private boolean recordPushLive; |
|
||||
|
|
||||
public boolean getSavePositionHistory() { |
public Boolean getSavePositionHistory() { |
||||
return savePositionHistory; |
return savePositionHistory; |
||||
} |
} |
||||
|
|
||||
public boolean isSavePositionHistory() { |
public Boolean isSavePositionHistory() { |
||||
return savePositionHistory; |
return savePositionHistory; |
||||
} |
} |
||||
|
|
||||
public boolean isAutoApplyPlay() { |
public Boolean isAutoApplyPlay() { |
||||
return autoApplyPlay; |
return autoApplyPlay; |
||||
} |
} |
||||
|
|
||||
public boolean isSeniorSdp() { |
public Boolean isSeniorSdp() { |
||||
return seniorSdp; |
return seniorSdp; |
||||
} |
} |
||||
|
|
||||
public long getPlayTimeout() { |
public Long getPlayTimeout() { |
||||
return playTimeout; |
return playTimeout; |
||||
} |
} |
||||
|
|
||||
public boolean isWaitTrack() { |
public Boolean isWaitTrack() { |
||||
return waitTrack; |
return waitTrack; |
||||
} |
} |
||||
|
|
||||
public boolean isInterfaceAuthentication() { |
public Boolean isInterfaceAuthentication() { |
||||
return interfaceAuthentication; |
return interfaceAuthentication; |
||||
} |
} |
||||
|
|
||||
public boolean isRecordPushLive() { |
public Boolean isRecordPushLive() { |
||||
return recordPushLive; |
return recordPushLive; |
||||
} |
} |
||||
|
|
||||
|
public List<String> getInterfaceAuthenticationExcludes() { |
||||
|
return interfaceAuthenticationExcludes; |
||||
|
} |
||||
} |
} |
||||
|
@ -0,0 +1,33 @@ |
|||||
|
package com.genersoft.iot.vmp.web; |
||||
|
|
||||
|
import com.genersoft.iot.vmp.common.StreamInfo; |
||||
|
import com.genersoft.iot.vmp.service.IMediaService; |
||||
|
import com.genersoft.iot.vmp.vmanager.bean.WVPResult; |
||||
|
import org.slf4j.Logger; |
||||
|
import org.slf4j.LoggerFactory; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
|
||||
|
@CrossOrigin |
||||
|
@RestController |
||||
|
public class ApiCompatibleController { |
||||
|
|
||||
|
private final static Logger logger = LoggerFactory.getLogger(ApiCompatibleController.class); |
||||
|
|
||||
|
@Autowired |
||||
|
private IMediaService mediaService; |
||||
|
|
||||
|
@GetMapping(value = "/api/v1/stream_info_by_app_and_stream") |
||||
|
@ResponseBody |
||||
|
public WVPResult<StreamInfo> getStreamInfoByAppAndStream(HttpServletRequest request, @RequestParam String app, @RequestParam String stream){ |
||||
|
String localAddr = request.getLocalAddr(); |
||||
|
StreamInfo streamINfo = mediaService.getStreamInfoByAppAndStreamWithCheck(app, stream, localAddr); |
||||
|
WVPResult<StreamInfo> wvpResult = new WVPResult<>(); |
||||
|
wvpResult.setCode(0); |
||||
|
wvpResult.setMsg("success"); |
||||
|
wvpResult.setData(streamINfo); |
||||
|
return wvpResult; |
||||
|
} |
||||
|
} |
File diff suppressed because it is too large
Loading…
Reference in new issue