查询用户
Former-commit-id: 48ab172e0cd40480b0cf3e40392afb0328a1500f
This commit is contained in:
parent
f088f0aa7e
commit
d3a3ca2e02
|
|
@ -0,0 +1,57 @@
|
|||
server:
|
||||
port: 8081
|
||||
servlet:
|
||||
context-path: /
|
||||
|
||||
logging:
|
||||
config: classpath:logback/logback.xml
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
# 配置数据源类型
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://47.102.109.233:3306/forge_development?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: Moshenglv_1
|
||||
druid:
|
||||
#初始化大小
|
||||
initialSize: 5
|
||||
#最小值
|
||||
min-idle: 5
|
||||
#最大值
|
||||
max-active: 20
|
||||
jackson:
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
time-zone: GMT+8
|
||||
serialization:
|
||||
write-dates-as-timestamps: false
|
||||
devtools:
|
||||
livereload:
|
||||
enabled: true
|
||||
restart:
|
||||
enabled: true
|
||||
mvc:
|
||||
view:
|
||||
prefix: /
|
||||
suffix: .html
|
||||
|
||||
|
||||
## mybatis-plus
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:mapper/**/*.xml
|
||||
type-aliases-package: com.xjy.ai.model.dao.domain
|
||||
|
||||
## vsftp
|
||||
#ftp相关配置
|
||||
FTP:
|
||||
ADDRESS: 47.102.109.233
|
||||
PORT: 21
|
||||
USERNAME: vsftp
|
||||
PASSWORD: Test123!@#
|
||||
BASEPATHFILE: /var/public_root/file
|
||||
#文件地址
|
||||
FILE:
|
||||
BASE:
|
||||
URL: http://47.102.109.233:8080/file
|
||||
TEMP_PATH: /usr/local/project/
|
||||
|
|
@ -0,0 +1 @@
|
|||
java -jar share-api-1.0.0.jar --spring.config.location=application.yml
|
||||
|
|
@ -3,8 +3,6 @@ package com.xjy.ai.api.controller.sys;
|
|||
import com.xjy.ai.common.response.DataPacketUtil;
|
||||
import com.xjy.ai.common.response.ResponseData;
|
||||
import com.xjy.ai.model.service.sys.UserService;
|
||||
import com.xjy.ai.model.service.sys.impl.UserServiceImpl;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
|
|
@ -16,7 +14,6 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/user")
|
||||
|
|
@ -47,4 +44,10 @@ public class UserController {
|
|||
public ResponseData logout( HttpServletRequest request, HttpServletResponse response){
|
||||
return DataPacketUtil.jsonResult(userService.logout(request, response));
|
||||
}
|
||||
|
||||
@ApiOperation("获取所有用户")
|
||||
@RequestMapping(value = "getUsers", method = RequestMethod.GET)
|
||||
public ResponseData getUsers(){
|
||||
return DataPacketUtil.jsonResult(userService.getAllUsers());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ public class Constants {
|
|||
|
||||
public static final String COOKIE_NAME = "autologin_forge_military";
|
||||
public static final String GROUP_NAME = "运营管理组";
|
||||
public static final String REQUIREMENT_STATUS = "requirement_status";
|
||||
|
||||
|
||||
public static final String MAIL_REG = "^[a-zA-Z0-9]+([.\\-_\\\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$";
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.xjy.ai.model.service.requirement.impl;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xjy.ai.common.constant.Constants;
|
||||
import com.xjy.ai.common.enums.StatusEnum;
|
||||
import com.xjy.ai.model.dao.requirement.entity.Requirement;
|
||||
import com.xjy.ai.model.dao.requirement.mapper.RequirementMapper;
|
||||
|
|
@ -71,7 +72,7 @@ public class RequirementServiceImpl extends ServiceImpl<RequirementMapper, Requi
|
|||
}
|
||||
requirement.setAttachmentList(attachments);
|
||||
requirement.setAchievementList(achievements);
|
||||
DicItem item = dicItemService.getItemByTypeAndCode("requirement_status", requirement.getStatus());
|
||||
DicItem item = dicItemService.getItemByTypeAndCode(Constants.REQUIREMENT_STATUS, requirement.getStatus());
|
||||
requirement.setStatus(item.getDicItemName());
|
||||
return requirement;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import com.xjy.ai.model.dao.sys.entity.UserVo;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface UserService extends IService<User> {
|
||||
|
||||
|
|
@ -14,4 +16,6 @@ public interface UserService extends IService<User> {
|
|||
UserVo logout(HttpServletRequest request, HttpServletResponse response);
|
||||
|
||||
UserVo getCurrentUser(HttpServletRequest request, HttpServletResponse response);
|
||||
|
||||
List<Map> getAllUsers();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.xjy.ai.model.service.sys.impl;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xjy.ai.common.constant.Constants;
|
||||
|
|
@ -20,7 +21,7 @@ import org.springframework.stereotype.Service;
|
|||
import javax.servlet.http.Cookie;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Date;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
|
||||
|
|
@ -118,6 +119,21 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|||
return getVisitor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map> getAllUsers() {
|
||||
QueryWrapper<User> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("status", 1);
|
||||
List<User> users = baseMapper.selectList(wrapper);
|
||||
List<Map> results = new ArrayList<>();
|
||||
users.forEach(item -> {
|
||||
HashMap<String, String> user = new HashMap<>();
|
||||
user.put("login", item.getLogin());
|
||||
user.put("nickName",item.getNickname());
|
||||
results.add(user);
|
||||
});
|
||||
return results;
|
||||
}
|
||||
|
||||
private UserVo getUserVo(User user) {
|
||||
String roleName = roleService.getRoleNameByUserId(user.getId());
|
||||
UserExtension extention = extentionService.getUserExtensionByUserId(user.getId());
|
||||
|
|
|
|||
Loading…
Reference in New Issue