라우팅 충돌 해결: imageId 경로 변수에 숫자 정규식 추가
- /images/{imageId}를 /images/{imageId:[0-9]+}로 변경
- /images/generate와의 라우팅 충돈 해결
- NumberFormatException 오류 수정
- content-service Kubernetes Deployment 파일 추가
This commit is contained in:
parent
b9514257b0
commit
bc57b27852
64
content-service-deployment.yaml
Normal file
64
content-service-deployment.yaml
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: content-service
|
||||||
|
namespace: kt-event-marketing
|
||||||
|
labels:
|
||||||
|
app: content-service
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: content-service
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: content-service
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: content-service
|
||||||
|
image: acrdigitalgarage01.azurecr.io/kt-event-marketing/content-service:latest
|
||||||
|
imagePullPolicy: Always
|
||||||
|
ports:
|
||||||
|
- containerPort: 8084
|
||||||
|
name: http
|
||||||
|
protocol: TCP
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: cm-common
|
||||||
|
- configMapRef:
|
||||||
|
name: cm-content-service
|
||||||
|
- secretRef:
|
||||||
|
name: secret-common
|
||||||
|
- secretRef:
|
||||||
|
name: secret-content-service
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 256m
|
||||||
|
memory: 512Mi
|
||||||
|
limits:
|
||||||
|
cpu: 1024m
|
||||||
|
memory: 1024Mi
|
||||||
|
startupProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /actuator/health
|
||||||
|
port: 8084
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 10
|
||||||
|
failureThreshold: 30
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /actuator/health/liveness
|
||||||
|
port: 8084
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 10
|
||||||
|
failureThreshold: 3
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /actuator/health/readiness
|
||||||
|
port: 8084
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 5
|
||||||
|
failureThreshold: 3
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: kt-event-marketing
|
||||||
@ -124,7 +124,7 @@ public class ContentController {
|
|||||||
* @param imageId 이미지 ID
|
* @param imageId 이미지 ID
|
||||||
* @return 200 OK - 이미지 상세 정보
|
* @return 200 OK - 이미지 상세 정보
|
||||||
*/
|
*/
|
||||||
@GetMapping("/images/{imageId}")
|
@GetMapping("/images/{imageId:[0-9]+}")
|
||||||
public ResponseEntity<ImageInfo> getImageById(@PathVariable Long imageId) {
|
public ResponseEntity<ImageInfo> getImageById(@PathVariable Long imageId) {
|
||||||
log.info("이미지 상세 조회: imageId={}", imageId);
|
log.info("이미지 상세 조회: imageId={}", imageId);
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ public class ContentController {
|
|||||||
* @param imageId 이미지 ID
|
* @param imageId 이미지 ID
|
||||||
* @return 204 NO CONTENT
|
* @return 204 NO CONTENT
|
||||||
*/
|
*/
|
||||||
@DeleteMapping("/images/{imageId}")
|
@DeleteMapping("/images/{imageId:[0-9]+}")
|
||||||
public ResponseEntity<Void> deleteImage(@PathVariable Long imageId) {
|
public ResponseEntity<Void> deleteImage(@PathVariable Long imageId) {
|
||||||
log.info("이미지 삭제 요청: imageId={}", imageId);
|
log.info("이미지 삭제 요청: imageId={}", imageId);
|
||||||
|
|
||||||
@ -157,7 +157,7 @@ public class ContentController {
|
|||||||
* @param requestBody 재생성 요청 정보 (선택)
|
* @param requestBody 재생성 요청 정보 (선택)
|
||||||
* @return 202 ACCEPTED - Job ID 반환
|
* @return 202 ACCEPTED - Job ID 반환
|
||||||
*/
|
*/
|
||||||
@PostMapping("/images/{imageId}/regenerate")
|
@PostMapping("/images/{imageId:[0-9]+}/regenerate")
|
||||||
public ResponseEntity<JobInfo> regenerateImage(
|
public ResponseEntity<JobInfo> regenerateImage(
|
||||||
@PathVariable Long imageId,
|
@PathVariable Long imageId,
|
||||||
@RequestBody(required = false) ContentCommand.RegenerateImage requestBody) {
|
@RequestBody(required = false) ContentCommand.RegenerateImage requestBody) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user