mirror of
https://gitee.com/likeadmin/likeadmin_java.git
synced 2026-05-31 22:19:35 +08:00
调整用户管理接口
This commit is contained in:
@@ -21,6 +21,13 @@ public interface IUserService {
|
||||
*/
|
||||
PageResult<UserVo> list(PageParam pageParam, Map<String, String> params);
|
||||
|
||||
/**
|
||||
* 用户详情
|
||||
*
|
||||
* @author fzr
|
||||
* @param id 主键
|
||||
* @return UserVo
|
||||
*/
|
||||
UserVo detail(Integer id);
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.mdd.admin.vo.article.ArticleListVo;
|
||||
import com.mdd.admin.vo.user.UserVo;
|
||||
import com.mdd.common.core.PageResult;
|
||||
import com.mdd.common.entity.user.User;
|
||||
import com.mdd.common.enums.ClientEnum;
|
||||
import com.mdd.common.mapper.user.UserMapper;
|
||||
import com.mdd.common.utils.StringUtil;
|
||||
import com.mdd.common.utils.TimeUtil;
|
||||
@@ -31,6 +32,14 @@ public class UserServiceImpl implements IUserService {
|
||||
@Resource
|
||||
UserMapper userMapper;
|
||||
|
||||
/**
|
||||
* 用户列表
|
||||
*
|
||||
* @author fzr
|
||||
* @param pageParam (分页参数)
|
||||
* @param params (搜索参数)
|
||||
* @return PageResult<UserVo>
|
||||
*/
|
||||
@Override
|
||||
public PageResult<UserVo> list(PageParam pageParam, Map<String, String> params) {
|
||||
Integer pageNo = pageParam.getPageNo();
|
||||
@@ -67,6 +76,8 @@ public class UserServiceImpl implements IUserService {
|
||||
UserVo vo = new UserVo();
|
||||
BeanUtils.copyProperties(user, vo);
|
||||
|
||||
vo.setSex(user.getSex());
|
||||
vo.setChannel(ClientEnum.getMsgByCode(user.getChannel()));
|
||||
vo.setAvatar(UrlUtil.toAbsoluteUrl(user.getAvatar()));
|
||||
vo.setLastLoginTime(TimeUtil.timestampToDate(user.getLastLoginTime()));
|
||||
vo.setCreateTime(TimeUtil.timestampToDate(user.getCreateTime()));
|
||||
@@ -109,6 +120,8 @@ public class UserServiceImpl implements IUserService {
|
||||
UserVo vo = new UserVo();
|
||||
BeanUtils.copyProperties(user, vo);
|
||||
|
||||
vo.setSex(user.getSex());
|
||||
vo.setChannel(ClientEnum.getMsgByCode(user.getChannel()));
|
||||
vo.setAvatar(UrlUtil.toAbsoluteUrl(user.getAvatar()));
|
||||
vo.setLastLoginTime(TimeUtil.timestampToDate(user.getLastLoginTime()));
|
||||
vo.setCreateTime(TimeUtil.timestampToDate(user.getCreateTime()));
|
||||
|
||||
@@ -13,7 +13,7 @@ public class UserVo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer id;
|
||||
private String sn;
|
||||
private Integer sn;
|
||||
private String avatar;
|
||||
private String realName;
|
||||
private String nickname;
|
||||
@@ -25,4 +25,18 @@ public class UserVo implements Serializable {
|
||||
private String lastLoginTime;
|
||||
private String createTime;
|
||||
|
||||
public void setSex(Integer sex) {
|
||||
switch (sex) {
|
||||
case 0:
|
||||
this.sex = "未知";
|
||||
break;
|
||||
case 1:
|
||||
this.sex = "男";
|
||||
break;
|
||||
case 2:
|
||||
this.sex = "女";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user