添加了总部查看所有用户信息的功能模块

This commit is contained in:
XinYi Song 2021-12-24 10:52:56 +08:00
parent c4c2b3cc41
commit d068e6ea95
3 changed files with 30 additions and 1 deletions

View File

@ -24,6 +24,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -298,4 +299,19 @@ public class SysUserController {
} }
} }
/**
* 管理员查看全部的用户信息
* @return
*/
@GetMapping("/selectAllUser")
@PreAuthorize("hasAnyAuthority('auth_administor')")
public String selectAllUser(@RequestHeader(value="Authorization") String token){
Locale locale = LocaleContextHolder.getLocale();
List<Map<String, Object>> maps = sysUserDao.selectAllUser();
if(maps == null || maps.size() == 0){
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时没有任何用户数据!",locale);
}
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,maps,locale);
}
} }

View File

@ -7,6 +7,9 @@ import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
import java.util.List;
import java.util.Map;
/** /**
* SysUserDao * SysUserDao
* @author tajochen * @author tajochen
@ -141,4 +144,13 @@ public interface SysUserDao extends JpaRepository<SysUserEntity,Integer> {
@Modifying(clearAutomatically=true) @Modifying(clearAutomatically=true)
void updateDisable(Integer userId); void updateDisable(Integer userId);
/**
* 管理员查看所有的用户信息
* @return
*/
@Query(value = "select nick_name nickname,avatar,telephone,province,city,county," +
"identifier,identity,active_flag activeflag,last_entry_ip lastentryip," +
"last_entry_time lastentrytime,add_time addtime from sys_user",nativeQuery = true)
List<Map<String,Object>> selectAllUser();
} }

View File

@ -50,7 +50,8 @@ spring.cache.type = redis
spring.redis.database = 8 spring.redis.database = 8
spring.redis.host = localhost spring.redis.host = localhost
spring.redis.port = 6379 spring.redis.port = 6379
spring.redis.password=lybABC123 #spring.redis.password=lybABC123
spring.redis.password=sdust2020
spring.redis.timeout = 10000 spring.redis.timeout = 10000
spring.redis.lettuce.pool.max-active = 100 spring.redis.lettuce.pool.max-active = 100
spring.redis.lettuce.pool.max-wait = 10000 spring.redis.lettuce.pool.max-wait = 10000