feat: P5-2 작은 후속 (#338+#320+#340+#333)
#338: /api/version 신규 - HealthController에 @Value 빌드 정보 + GET /api/version 추가 - SecurityConfig.permitAll에 /api/version 추가 - application.yml app.build.version/commit (env APP_VERSION/APP_COMMIT) - 부수: SecurityConfig에서 /api/daemon/config permitAll 제거 (이미 admin-only) #320: findRegionFromCoords 거리 보정 - 유클리드 거리 → cos(lat) 가중치(equirectangular approx)로 위경도 실거리 보정 - 위도가 큰 지역(부산↔서울)에서 city 추정 정확도 향상 #340: MapView 마커/범례 ARIA - 클러스터 마커: role=button + aria-label - 개별 식당 마커: role=button + aria-label (name + 폐업 여부) - 채널 범례: role=region + aria-label, 색상 점은 aria-hidden #333: ChannelController 캐시 세분화 - cache.flush() 전체 무효화 → cache.del(makeKey("channels"))로 채널 키만 evict - 다른 모듈(restaurants/search) 캐시 hit율 보존 후속: deploy.sh에 APP_VERSION/APP_COMMIT env 주입은 별도 (현재 dev/unknown 응답) Refs: #338 #320 #340 #333
This commit is contained in:
@@ -30,13 +30,14 @@ public class SecurityConfig {
|
||||
.authorizeHttpRequests(auth -> auth
|
||||
// Public endpoints
|
||||
.requestMatchers("/api/health").permitAll()
|
||||
.requestMatchers("/api/version").permitAll() // #338 — 빌드 정보 공개
|
||||
.requestMatchers("/api/auth/**").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/api/restaurants/**").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/api/channels").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/api/search").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/api/restaurants/*/reviews").permitAll()
|
||||
.requestMatchers("/api/stats/**").permitAll()
|
||||
.requestMatchers(HttpMethod.GET, "/api/daemon/config").permitAll()
|
||||
// #275 — /api/daemon/config는 admin-only로 변경 (이전 permitAll 제거)
|
||||
// Everything else requires authentication (controller-level admin checks)
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
|
||||
@@ -62,7 +62,8 @@ public class ChannelController {
|
||||
}
|
||||
try {
|
||||
String id = channelService.create(channelId, channelName, titleFilter);
|
||||
cache.flush();
|
||||
// #333 — 전체 flush 대신 channels 키만 evict (다른 모듈 캐시 보존)
|
||||
cache.del(cache.makeKey("channels"));
|
||||
return Map.of("id", id, "channel_id", channelId);
|
||||
} catch (DataIntegrityViolationException e) {
|
||||
// #295 — 유니크 충돌을 메시지 문자열 매칭 대신 typed 예외로 감지 (제약명 변경에도 견고).
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.tasteby.controller;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@@ -8,8 +9,20 @@ import java.util.Map;
|
||||
@RestController
|
||||
public class HealthController {
|
||||
|
||||
// #338 — 배포 시 set되는 빌드 정보. 미설정 시 "dev"로 표시.
|
||||
@Value("${app.build.version:dev}")
|
||||
private String version;
|
||||
|
||||
@Value("${app.build.commit:unknown}")
|
||||
private String commit;
|
||||
|
||||
@GetMapping("/api/health")
|
||||
public Map<String, String> health() {
|
||||
return Map.of("status", "ok");
|
||||
}
|
||||
|
||||
@GetMapping("/api/version")
|
||||
public Map<String, String> version() {
|
||||
return Map.of("version", version, "commit", commit);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user