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;

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);
    }
}
