package com.song.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @Controller @RequestMapping("/hello") public class HelloController { @GetMapping("/hello") @ResponseBody public String use(){ return "hello"; } }
package com.song; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; @SpringBootApplication @MapperScan("com.song.mapper") public class Boot2Application { public static void main(String[] args) { SpringApplication.run(Boot2Application.class); } }
搜索
复制