Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OP-21724-gate added parameters for new api #459

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,24 +112,25 @@ class OpsmxPlatformController {
@RequestParam(name = "canaryId", required = false) Integer canaryId,
@RequestParam(value = "applicationName", required = false) String applicationName,
@RequestParam(value = "argoName", required = false) String argoName,
@RequestParam(value = "argoId", required = false) String argoId,
HttpServletRequest httpServletRequest) {

String path = httpServletRequest.getRequestURI()
if (CacheUtil.isRegisteredCachingEndpoint(path)) {
return handleCaching(path, httpServletRequest, version, type, source, source1, agentName, cdName, datasourceType, permissionId,applicationName,argoName)
return handleCaching(path, httpServletRequest, version, type, source, source1, agentName, cdName, datasourceType, permissionId,applicationName,argoName,argoId)
} else {
return opsmxPlatformService.getPlatformResponse4(version, type, source, source1, agentName, cdName, datasourceType, permissionId, applicationId, canaryId,applicationName,argoName)
return opsmxPlatformService.getPlatformResponse4(version, type, source, source1, agentName, cdName, datasourceType, permissionId, applicationId, canaryId,applicationName,argoName,argoId)
}
}

private Object handleCaching(String path, HttpServletRequest httpServletRequest, String version, String type, String source, String source1, String agentName, String cdName, String datasourceType, String permissionId,String applicationName,String argoName) {
private Object handleCaching(String path, HttpServletRequest httpServletRequest, String version, String type, String source, String source1, String agentName, String cdName, String datasourceType, String permissionId,String applicationName,String argoName,String argoId) {
Object response
PlatformCachingService platformCachingService = platformCachingServiceBeanFactory.getBean(path)

String userName = httpServletRequest.getUserPrincipal().getName()
response = platformCachingService.fetchResponseFromCache(userName)
if (response == null) {
response = opsmxPlatformService.getPlatformResponse4(version, type, source, source1, agentName, cdName, datasourceType, permissionId,applicationName,argoName)
response = opsmxPlatformService.getPlatformResponse4(version, type, source, source1, agentName, cdName, datasourceType, permissionId,applicationName,argoName,argoId)
platformCachingService.cacheResponse(response, userName)
}
return response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ interface OpsmxPlatformService {
@Query("applicationId") Integer applicationId,
@Query("canaryId") Integer canaryId,
@Query("applicationName") String applicationName,
@Query("argoName") String argoName)
@Query("argoName") String argoName,
@Query("argoId") String argoId)

@GET("/platformservice/{version}/{type}/{source}/{source1}/{source2}")
Object getPlatformResponse5(@Path('version') String version,
Expand Down
Loading