package <%= packageName %>.controller;

import lombok.RequiredArgsConstructor;
<%_ if (isFullstack && isJwtAuth) { _%>
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
@RequiredArgsConstructor
public class HomeController {

    /** Serve the landing page */
    @GetMapping("/")
    public String home() {
        return "forward:/index.html";
    }

    /** Each page is standalone — just permit static file serving */
    @GetMapping({"/login", "/register"})
    public String authPages() {
        return "forward:/index.html";
    }
}
<%_ } else if (isFullstack && isSessionAuth) { _%>
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
@RequiredArgsConstructor
public class HomeController {

    @GetMapping("/")
    public String home() {
        return "redirect:/dashboard";
    }
}
<%_ } else { _%>
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.util.LinkedHashMap;
import java.util.Map;

@RestController
@RequiredArgsConstructor
public class HomeController {

    @GetMapping("/")
    public ResponseEntity<Map<String, Object>> home() {
        Map<String, Object> info = new LinkedHashMap<>();
        info.put("status",  "UP");
        info.put("app",     "<%= projectName %>");
        info.put("version", "1.0.0");
        info.put("auth",    "JWT");
        info.put("docs",    "/swagger-ui/index.html");
        info.put("health",  "/actuator/health");
        info.put("time",    LocalDateTime.now().toString());
        return ResponseEntity.ok(info);
    }
}
<%_ } _%>
