package incheon.sgp.sample.web;


import incheon.sgp.sample.service.service.SgpSampleService;
import incheon.sgp.sample.vo.SgpSampleVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Arrays;
import java.util.List;

/**
 * @author : JungHoon, Lee
 * @version 1.0
 * @Class Name  : SgpSampleController.java
 * @Description :
 * @Modification Information
 * 개정일자			     개정자                  개정내용
 * ------------------ ----------- --------------------------
 * 2025. 09. 23        JungHoon, Lee         최초생성
 * <p>
 * <p>
 * Copyright 2025. 올포랜드 INC.All rights reserved.
 * @since : 2025. 09. 23
 */

@Controller
@RequestMapping("/sgp/sample")
@RequiredArgsConstructor
@Slf4j
public class SgpSampleController {

    private final SgpSampleService sgpSampleService;

    @GetMapping("/main.do")
    public String sampleMain(ModelMap model) {
        // 데모를 위해 더미 데이터(실서비스 시 DB로 교체)
        List<SgpSampleVO> places = Arrays.asList(
                SgpSampleVO.builder()
                        .id(1L).name("송도 센트럴 파크")
                        .address("인천광역시 연수구 컨벤시아대로 160")
                        .lat(37.392521).lon(126.639393)
                        .description("국내 최초의 해수공원. 야경이 아름다운 도심 속 휴식공간.")
                        .imageUrl("/images/sample/centralpark.jpg")
                        .build(),
                SgpSampleVO.builder()
                        .id(2L).name("인천대교 전망대")
                        .address("인천광역시 연수구 송도동")
                        .lat(37.375290).lon(126.625830)
                        .description("세계적 규모의 해상 교량. 탁 트인 경관과 일몰 명소.")
                        .imageUrl("/images/sample/bridge.jpg")
                        .build(),
                SgpSampleVO.builder()
                        .id(3L).name("차이나타운")
                        .address("인천광역시 중구 차이나타운로")
                        .lat(37.474911).lon(126.617441)
                        .description("한국 최대 중국 문화 거리. 맛집과 볼거리가 풍부.")
                        .imageUrl("/images/sample/chinatown.jpg")
                        .build()
        );

        model.addAttribute("places", places);
        return "/sgp/sample/sampleMapMain";
    }

}
