Archived
新建Hello world也404
This commit is contained in:
1 parent
ba081cec00
commit
03292ff18a
2 files changed
+34
-6
No files matched your search
@@ -0,0 +1,21 @@
|
||||
package com.xkrs.controller;
|
||||
|
||||
import com.xkrs.encapsulation.PromptMessageEnum;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import static com.xkrs.encapsulation.OutputEncapsulation.outputEncapsulationObject;
|
||||
|
||||
@RestController
|
||||
public class HelloWorldController {
|
||||
|
||||
@GetMapping("/hello")
|
||||
public String hello() {
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "hello", locale);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user