Skip to content
Snippets Groups Projects
Commit a45d4667 authored by Su Sandi  Ko's avatar Su Sandi Ko
Browse files

mid commit

parent ab3f2e66
Branches
No related tags found
No related merge requests found
......@@ -6,14 +6,18 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.google.gson.JsonObject;
@RestController
public class TestController {
@GetMapping(value = "/test")
public UserDto test() {
UserDto dto = new UserDto();
dto.setAge(17);
dto.setName("Jane");
return dto;
@RequestMapping(value = "/", method = RequestMethod.GET)
public String test(@RequestParam("id") String id) {
JsonObject obj = new JsonObject();
obj.addProperty("title", "산사와 아가싸");
obj.addProperty("content", "로맨틱 코메디");
JsonObject data = new JsonObject();
data.addProperty("time", "토일 8 시");
obj.add("data", data);
return obj.toString();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment