PENEKhun / springdog

(개발중) 캡스톤 디자인 - SW의 안정성 지원을 위한 서비스형 보안 라이브러리 개발
Apache License 2.0
0 stars 0 forks source link

Create Skeleton layouts of the Agent's #3

Closed PENEKhun closed 5 months ago

PENEKhun commented 5 months ago

Change the view of the agent being autoconfigured to the appropriate view for the current plan

⚠️ This should have been done once before #7.

PENEKhun commented 5 months ago

Self question

How to automatically organize the view end code that holds the various parameters and logic?
The current ViewStructure.java is limited.

package org.epsec.samplemethodban;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Controller
public class View {
  @GetMapping("/")
  public String MAIN() {
    return "/templates/content/main.html";
  }

  @GetMapping("/login")
  public String LOGIN() {
    return "/templates/content/login.html";
  }

  @GetMapping("/rate-limit/manage")
  public String rateLimitManage() {
    return "/templates/content/rate-limit/manage.html";
  }

  @GetMapping("/rate-limit/manage/{id}")
  public String rateLimitManage(@PathVariable("id") Integer id, Model model) {
    model.addAttribute("apiPath", "/api/test");
    model.addAttribute("requestType", "POST");
    model.addAttribute("controllerClass", "UserController");
    List<String> parameters = new ArrayList<>();
    parameters.add("username");
    parameters.add("keyword");
    model.addAttribute("paramItems", parameters);

    List<String> headers = new ArrayList<>();
    headers.add("X-Auth-Token");
    model.addAttribute("headerItems", headers);

    return "/templates/content/rate-limit/actions/setting.html";
  }

  @GetMapping("/service/change-pw")
  public String changePW() {
    return "/templates/content/service/change-pw.html";
  }
}