新建Hello world也404

This commit is contained in:
liuchengqian committed 2022-02-28 17:41:14 +08:00
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);
}
}