新建Hello world也404
This commit is contained in:
parent
ba081cec00
commit
03292ff18a
19
pom.xml
19
pom.xml
@ -147,11 +147,11 @@
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.tomcat/servlet-api -->
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>6.0.35</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.apache.tomcat</groupId>-->
|
||||
<!-- <artifactId>servlet-api</artifactId>-->
|
||||
<!-- <version>6.0.35</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
@ -162,12 +162,19 @@
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<release>11</release>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
21
src/main/java/com/xkrs/controller/HelloWorldController.java
Normal file
21
src/main/java/com/xkrs/controller/HelloWorldController.java
Normal file
@ -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);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user