Update admin
This commit is contained in:
@@ -10,7 +10,7 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yaoyuan2.chu
|
||||
* @author Chuyaoyuan
|
||||
* @Title:
|
||||
* @Package com.yaoyuan.jiscuss.common
|
||||
* @Description:
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author yaoyuan2.chu
|
||||
* @author Chuyaoyuan
|
||||
* @Title: 工具类
|
||||
* @Package com.yaoyuan.jiscuss.common
|
||||
* @Description: 通用工具类
|
||||
|
||||
@@ -40,7 +40,7 @@ import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author yaoyuan2.chu
|
||||
* @author Chuyaoyuan
|
||||
* 后台系统控制器
|
||||
*/
|
||||
@Controller
|
||||
@@ -98,9 +98,9 @@ public class AdminSystemController extends BaseController {
|
||||
|
||||
List<User> users = usersRepository.findAll(Sort.by(Sort.Direction.ASC, "id"));
|
||||
List<Role> roles = roleRepository.findAllByOrderByIdAsc();
|
||||
Map<Integer, Set<Integer>> userRoleIds = new HashMap<>();
|
||||
Map<String, Set<Integer>> userRoleIds = new HashMap<>();
|
||||
for (UserRole ur : userRoleRepository.findAll()) {
|
||||
userRoleIds.computeIfAbsent(ur.getUserId(), key -> new HashSet<>()).add(ur.getRoleId());
|
||||
userRoleIds.computeIfAbsent(String.valueOf(ur.getUserId()), key -> new HashSet<>()).add(ur.getRoleId());
|
||||
}
|
||||
|
||||
map.put("users", users);
|
||||
@@ -222,10 +222,10 @@ public class AdminSystemController extends BaseController {
|
||||
Set<Integer> userIds = posts.stream().map(Post::getCreateId).filter(v -> v != null).collect(Collectors.toSet());
|
||||
Set<Integer> discussionIds = posts.stream().map(Post::getDiscussionId).filter(v -> v != null).collect(Collectors.toSet());
|
||||
|
||||
Map<Integer, String> userNames = usersRepository.findAllById(userIds).stream()
|
||||
.collect(Collectors.toMap(User::getId, User::getUsername));
|
||||
Map<Integer, String> discussionNames = discussionsRepository.findAllById(discussionIds).stream()
|
||||
.collect(Collectors.toMap(Discussion::getId, Discussion::getTitle));
|
||||
Map<String, String> userNames = usersRepository.findAllById(userIds).stream()
|
||||
.collect(Collectors.toMap(user -> String.valueOf(user.getId()), User::getUsername));
|
||||
Map<String, String> discussionNames = discussionsRepository.findAllById(discussionIds).stream()
|
||||
.collect(Collectors.toMap(discussion -> String.valueOf(discussion.getId()), Discussion::getTitle));
|
||||
|
||||
map.put("userNames", userNames);
|
||||
map.put("discussionNames", discussionNames);
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.springframework.security.core.context.SecurityContext;
|
||||
/**
|
||||
* Base controller exposing helpers shared by web controllers.
|
||||
*
|
||||
* @author yaoyuan2.chu
|
||||
* @author Chuyaoyuan
|
||||
*/
|
||||
public class BaseController {
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.yaoyuan.jiscuss.controller;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* @author yaoyuan2.chu
|
||||
* @author Chuyaoyuan
|
||||
* 用户消息控制器
|
||||
*/
|
||||
@Controller
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.yaoyuan.jiscuss.controller;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* @author yaoyuan2.chu
|
||||
* @author Chuyaoyuan
|
||||
* 其他控制器——积分/权限等
|
||||
*/
|
||||
@Controller
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @author yaoyuan2.chu
|
||||
* @author Chuyaoyuan
|
||||
* @Title:
|
||||
* @Package com.yaoyuan.jiscuss.controller
|
||||
* @Description:
|
||||
|
||||
@@ -33,7 +33,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author yaoyuan2.chu
|
||||
* @author Chuyaoyuan
|
||||
* 主题帖子评论控制器
|
||||
*/
|
||||
@Controller
|
||||
|
||||
@@ -34,7 +34,7 @@ import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author yaoyuan2.chu
|
||||
* @author Chuyaoyuan
|
||||
* 首页页面系统控制器
|
||||
*/
|
||||
@Controller
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author yaoyuan2.chu
|
||||
* @author Chuyaoyuan
|
||||
*/
|
||||
@Data
|
||||
@Entity
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.springframework.security.core.userdetails.UserDetails;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @author yaoyuan2.chu
|
||||
* @author Chuyaoyuan
|
||||
* @Title:
|
||||
* @Package com.yaoyuan.jiscuss.entity
|
||||
* @Description:
|
||||
|
||||
@@ -8,7 +8,7 @@ import lombok.Setter;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yaoyuan2.chu
|
||||
* @author Chuyaoyuan
|
||||
* @Title:
|
||||
* @Package com.yaoyuan.jiscuss.entity.custom
|
||||
* @Description:
|
||||
|
||||
@@ -8,7 +8,7 @@ import lombok.Setter;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yaoyuan2.chu
|
||||
* @author Chuyaoyuan
|
||||
* @Title:
|
||||
* @Package com.yaoyuan.jiscuss.entity.custom
|
||||
* @Description:
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.Setter;
|
||||
import jakarta.persistence.Column;
|
||||
|
||||
/**
|
||||
* @author yaoyuan2.chu
|
||||
* @author Chuyaoyuan
|
||||
* @Title:
|
||||
* @Package com.yaoyuan.jiscuss.entity.custom
|
||||
* @Description:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.yaoyuan.jiscuss.util;
|
||||
|
||||
/**
|
||||
* @author yaoyuan2.chu
|
||||
* @author Chuyaoyuan
|
||||
* @Title: 去除内容页代码里的HTML标签
|
||||
* @Package com.yaoyuan.jiscuss.util
|
||||
* @Description:
|
||||
|
||||
Reference in New Issue
Block a user