Skip to content
Snippets Groups Projects
Commit f14a4762 authored by Yibo Zhu's avatar Yibo Zhu
Browse files

develope

parent 9c6c9176
No related branches found
No related tags found
3 merge requests!48Resolve issue 70,!47Revert "Merge branch '26-as-a-user-i-want-to-see-the-rankings-of-each-member' into 'main'",!33Resolve "As a user, I want to view and edit my personal information on my profile page so that I can manage and update my details"
......@@ -6,9 +6,13 @@ import java.util.List;
@Service
public class UserServiceImpl implements UserService{
private final userDao userDao; // 声明依赖
public UserServiceImpl(userDao userDao) {
this.userDao = userDao;
}
@Override
public List<User> getAllUsers() {
return null;
return userDao.getAllUsers();
}
@Override
......
......@@ -15,7 +15,7 @@ public class userDao {
this.jdbcTemplate = jdbcTemplate;
}
// 获取所有用户
// get all users
public List<User> getAllUsers() {
// 查询所有用户的 SQL 语句
String sql = "SELECT id, email, username FROM information";
......@@ -50,7 +50,7 @@ public class userDao {
return jdbcTemplate.update(sql, user.getEmail(), user.getUsername());
}
// 更新用户信息
// update user message
public int updateUser(User user) {
// 更新用户的 SQL 语句
String sql = "UPDATE information SET email = ?, username = ? WHERE id = ?";
......@@ -59,7 +59,7 @@ public class userDao {
return jdbcTemplate.update(sql, user.getEmail(), user.getUsername(), user.getId());
}
// 删除用户
// delete user
public int deleteUser(Long id) {
// 删除用户的 SQL 语句
String sql = "DELETE FROM information WHERE id = ?";
......
......@@ -26,7 +26,8 @@ public class SecurityConfig {
"/html/**", // static HTML
"/html/register.html", // register
"/html/login.html" , // login
"/rankings", //ranking data path
"/rankings",
"/UserCenter",//ranking data path
"/rankings/**"
};
......
......@@ -35,6 +35,7 @@
</tbody>
</table>
<div id="footer-container"></div>
<script src="/js/UserCenter.js"></script>
<script src="/js/navBar.js"></script>
<script src="/js/footer.js"></script>
<script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment