FirtCommit
This commit is contained in:
36
src/main/java/com/rest/api/controller/HelloController.java
Normal file
36
src/main/java/com/rest/api/controller/HelloController.java
Normal file
@@ -0,0 +1,36 @@
|
||||
package com.rest.api.controller;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
@Controller
|
||||
public class HelloController {
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public static class Hello {
|
||||
private String message;
|
||||
}
|
||||
|
||||
@GetMapping(value = "/helloworld/string")
|
||||
@ResponseBody
|
||||
public String helloworldString() {
|
||||
return "helloworld";
|
||||
}
|
||||
|
||||
@GetMapping(value = "/helloworld/json")
|
||||
@ResponseBody
|
||||
public Hello helloworldJson() {
|
||||
Hello hello = new Hello();
|
||||
hello.message = "helloworld";
|
||||
return hello;
|
||||
}
|
||||
|
||||
@GetMapping(value = "/helloworld/page")
|
||||
public String helloworld() {
|
||||
return "helloworld";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user