Skip to content

Commit c788f86

Browse files
committed
[#noissue] Extract ServerTime module
1 parent db35caf commit c788f86

File tree

5 files changed

+67
-12
lines changed

5 files changed

+67
-12
lines changed

web/src/main/java/com/navercorp/pinpoint/web/PinpointWebModule.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import com.navercorp.pinpoint.web.problem.ProblemSpringWebConfig;
3535
import com.navercorp.pinpoint.web.query.QueryServiceConfiguration;
3636
import com.navercorp.pinpoint.web.realtime.RealtimeConfig;
37+
import com.navercorp.pinpoint.web.servertime.ServerTimeConfiguration;
3738
import com.navercorp.pinpoint.web.uid.WebUidConfiguration;
3839
import com.navercorp.pinpoint.web.webhook.WebhookFacadeModule;
3940
import org.springframework.context.annotation.Bean;
@@ -59,6 +60,7 @@
5960

6061
CacheConfiguration.class,
6162

63+
ServerTimeConfiguration.class,
6264
ApplicationMapModule.class,
6365
WebHbaseModule.class,
6466

web/src/main/java/com/navercorp/pinpoint/web/controller/MainController.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2014 NAVER Corp.
2+
* Copyright 2025 NAVER Corp.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* http://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,12 +18,11 @@
1818

1919
import com.navercorp.pinpoint.web.service.CacheService;
2020
import com.navercorp.pinpoint.web.service.CommonService;
21+
import com.navercorp.pinpoint.web.util.TagApplicationsUtils;
2122
import com.navercorp.pinpoint.web.util.etag.ETag;
2223
import com.navercorp.pinpoint.web.util.etag.ETagUtils;
23-
import com.navercorp.pinpoint.web.util.TagApplicationsUtils;
2424
import com.navercorp.pinpoint.web.validation.NullOrNotBlank;
2525
import com.navercorp.pinpoint.web.view.ApplicationGroup;
26-
import com.navercorp.pinpoint.web.view.ServerTime;
2726
import com.navercorp.pinpoint.web.view.TagApplications;
2827
import com.navercorp.pinpoint.web.vo.Application;
2928
import org.apache.logging.log4j.LogManager;
@@ -125,9 +124,4 @@ private static boolean needClearCache(ETag eTag, String clearCache) {
125124
return eTag == null || clearCache != null;
126125
}
127126

128-
@GetMapping(value = {"/api/serverTime", "/api-public/serverTime"})
129-
public ServerTime getServerTime() {
130-
return new ServerTime();
131-
}
132-
133127
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright 2025 NAVER Corp.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.navercorp.pinpoint.web.servertime;
18+
19+
import org.springframework.context.annotation.ComponentScan;
20+
import org.springframework.context.annotation.Configuration;
21+
22+
@ComponentScan(basePackages = "com.navercorp.pinpoint.web.controller")
23+
@Configuration
24+
public class ServerTimeConfiguration {
25+
26+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright 2025 NAVER Corp.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.navercorp.pinpoint.web.servertime.controller;
18+
19+
import com.navercorp.pinpoint.web.servertime.view.ServerTime;
20+
import org.springframework.validation.annotation.Validated;
21+
import org.springframework.web.bind.annotation.GetMapping;
22+
import org.springframework.web.bind.annotation.RestController;
23+
24+
@RestController
25+
@Validated
26+
public class ServerTimeController {
27+
28+
@GetMapping(value = {"/api/serverTime", "/api-public/serverTime"})
29+
public ServerTime getServerTime() {
30+
return new ServerTime();
31+
}
32+
33+
}

web/src/main/java/com/navercorp/pinpoint/web/view/ServerTime.java renamed to web/src/main/java/com/navercorp/pinpoint/web/servertime/view/ServerTime.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2014 NAVER Corp.
2+
* Copyright 2025 NAVER Corp.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* http://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.navercorp.pinpoint.web.view;
17+
package com.navercorp.pinpoint.web.servertime.view;
1818

1919
import com.fasterxml.jackson.annotation.JsonProperty;
2020

0 commit comments

Comments
 (0)