pom.xml
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.6.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.zhibao</groupId> <artifactId>searchinfo</artifactId> <version>1.0-SNAPSHOT</version> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build>
@RestController @RequestMapping("/searchImage") public class SearchImageController { @RequestMapping(value = "/test") @ResponseBody public String getPaymentMethod(@RequestParam(value = "name", required = false) String name) { return "test ok"; } }
@SpringBootApplication() public class SearchinfoApplication { public static void main(String[] args) { SpringApplication.run(SearchinfoApplication.class, args); } }