提交 1c9ff3b0 authored 作者: shaotianyang's avatar shaotianyang

third commit

上级 a443d9c0
package com.ai; package com.ai;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
......
...@@ -3,6 +3,7 @@ package com.ai.controller; ...@@ -3,6 +3,7 @@ package com.ai.controller;
import com.ai.service.UserService; import com.ai.service.UserService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -15,7 +16,7 @@ public class UserController { ...@@ -15,7 +16,7 @@ public class UserController {
private UserService userService; private UserService userService;
// http://localhost:8081/user/findAllUser // http://localhost:8081/user/findAllUser
@RequestMapping("/findAllUser") @GetMapping("/findAllUser")
public String findAllUser() { public String findAllUser() {
return userService.findAllUser().toString(); return userService.findAllUser().toString();
} }
......
...@@ -5,7 +5,6 @@ import com.ai.pojo.User; ...@@ -5,7 +5,6 @@ import com.ai.pojo.User;
import com.ai.service.UserService; import com.ai.service.UserService;
import com.ai.util.MyBatisUtils; import com.ai.util.MyBatisUtils;
import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
<mapper namespace="com.ai.mapper.UserMapper"> <mapper namespace="com.ai.mapper.UserMapper">
<select id="findAllUser" resultType="com.ai.pojo.User"> <select id="findAllUser" resultType="com.ai.pojo.User">
select * from user; select *
from user;
</select> </select>
</mapper> </mapper>
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</environments> </environments>
<mappers> <mappers>
<package name="com.ai.mapper"/> <mapper resource="mapper/UserMapper.xml"/>
</mappers> </mappers>
</configuration> </configuration>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论