package com.owrawww.controller;

import com.owrawww.service.BbsService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
@RequiredArgsConstructor
public class HomeController {

    private final BbsService bbsService;

    @GetMapping("/")
    public String index(Model model) {
        model.addAttribute("progressList", bbsService.getPreview(1, 2, 1, 5));
        model.addAttribute("pressList",    bbsService.getPreview(1, 4, 1, 8));
        return "index";
    }

    @GetMapping("/include/header")
    public String header() { return "include/header"; }

    @GetMapping("/include/footer")
    public String footer() { return "include/footer"; }

    @GetMapping("/sitemap")
    public String sitemap() { return "sitemap"; }

    @GetMapping("/service")
    public String service() { return "service"; }

    @GetMapping("/etc")
    public String etc() { return "etc"; }

    @GetMapping("/pub_list")
    public String pubList() { return "pub_list"; }

    @GetMapping("/board_view")
    public String boardView() { return "board_view"; }

    // 회사소개
    @GetMapping("/company/intro")
    public String sub0101() { return "sub01_01"; }

    @GetMapping("/company/business")
    public String sub0102() { return "sub01_02"; }

    @GetMapping("/company/history")
    public String sub0103() { return "sub01_03"; }

    @GetMapping("/company/chart")
    public String sub0104() { return "sub01_04"; }

    @GetMapping("/company/map")
    public String sub0105() { return "sub01_05"; }

    // 사업소개
    @GetMapping("/business/intro")
    public String sub0201() { return "sub02_01"; }

    @GetMapping("/business/pg")
    public String sub0202() { return "sub02_02"; }

    @GetMapping("/business/prepayment")
    public String sub0203() { return "sub02_03"; }

    @GetMapping("/business/payment")
    public String sub0204() { return "sub02_04"; }

    @GetMapping("/business/sales")
    public String sub0205() { return "sub02_05"; }

    @GetMapping("/business/b2b")
    public String sub0206() { return "sub02_06"; }

    @GetMapping("/business/delivery")
    public String sub0207() { return "sub02_07"; }

    // /business/progress 는 BbsController에서 처리

    // 인재채용
    @GetMapping("/careers/talent")
    public String sub0301() { return "sub03_01"; }

    @GetMapping("/careers/benefit")
    public String sub0302() { return "sub03_02"; }

    @GetMapping("/careers/careers")
    public String sub0303() { return "sub03_03"; }

    @GetMapping("/etc/projectIng")
    public String projectIng() { return "project";}

    @GetMapping("/etc/infoProtection")
    public String infoProtection() { return "infoProtection";}

    // /careers/recruitment 는 CareersController에서 처리
    // 게시판 (/bbs/owrainfo 는 BbsController에서, /bbs/partnership 은 PartnershipController에서, /bbs/press 는 BbsController에서 처리)
}

    