기본 골격
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package com.eactive.httpmockserver.client.controller;
|
||||
|
||||
import com.eactive.httpmockserver.client.entity.Server;
|
||||
import com.eactive.httpmockserver.client.repository.ServerRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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.List;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/mgmt")
|
||||
public class ApiClientController {
|
||||
|
||||
@Autowired
|
||||
ServerRepository serverRepository;
|
||||
|
||||
@GetMapping("/api_tester.do")
|
||||
public String testView(ModelMap model){
|
||||
|
||||
List<Server> servers = serverRepository.findAll();
|
||||
|
||||
model.addAttribute("servers", servers);
|
||||
|
||||
return "page/apiTester";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.eactive.httpmockserver.client.dto;
|
||||
|
||||
public class ApiRequest {
|
||||
|
||||
private String uri;
|
||||
private String method;
|
||||
|
||||
private String body;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.eactive.httpmockserver.client.dto;
|
||||
|
||||
public class ApiResponse {
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.eactive.httpmockserver.client.entity;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Entity
|
||||
@Table(name = "SERVER")
|
||||
public class Server {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.SEQUENCE)
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String scheme;
|
||||
|
||||
private String hostname;
|
||||
|
||||
private int port;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getScheme() {
|
||||
return scheme;
|
||||
}
|
||||
|
||||
public void setScheme(String scheme) {
|
||||
this.scheme = scheme;
|
||||
}
|
||||
|
||||
public String getHostname() {
|
||||
return hostname;
|
||||
}
|
||||
|
||||
public void setHostname(String hostname) {
|
||||
this.hostname = hostname;
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setPort(int port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
@Transient
|
||||
public String getHostAddress() {
|
||||
return scheme + "://" + hostname + ":" + port;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.eactive.httpmockserver.client.repository;
|
||||
|
||||
import com.eactive.httpmockserver.client.entity.Server;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
public interface ServerRepository extends JpaRepository<Server, Long>, JpaSpecificationExecutor<Server> {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user