Commit b30c39764dda33f80420b05380b4b13702e2e98e
1 parent
7f5788ae
用户信息
Showing
2 changed files
with
108 additions
and
0 deletions
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/user/UserController.java
| 1 | 1 | package cn.iocoder.yudao.module.member.controller.admin.user; |
| 2 | 2 | |
| 3 | +import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; | |
| 4 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |
| 5 | +import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; | |
| 6 | +import cn.iocoder.yudao.module.member.service.user.MemberUserService; | |
| 7 | +import io.swagger.annotations.Api; | |
| 8 | +import io.swagger.annotations.ApiOperation; | |
| 9 | +import org.apache.commons.lang3.StringUtils; | |
| 10 | +import org.springframework.web.bind.annotation.GetMapping; | |
| 11 | +import org.springframework.web.bind.annotation.PathVariable; | |
| 12 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 13 | +import org.springframework.web.bind.annotation.RestController; | |
| 14 | + | |
| 15 | +import javax.annotation.Resource; | |
| 16 | + | |
| 17 | +@Api(tags = "用户管理 - 用户管理") | |
| 18 | +@RestController | |
| 19 | +@RequestMapping("/member-user") | |
| 3 | 20 | public class UserController { |
| 21 | + | |
| 22 | + @Resource | |
| 23 | + private MemberUserService memberUserService; | |
| 24 | + | |
| 25 | + @ApiOperation("获取用户信息") | |
| 26 | + @GetMapping("/query-info") | |
| 27 | + public CommonResult<MemberUserDO> queryInfo(@PathVariable String mobile) { | |
| 28 | + if (StringUtils.isBlank(mobile)) { | |
| 29 | + return CommonResult.error(GlobalErrorCodeConstants.BAD_REQUEST.getCode(),"手机号不能为空"); | |
| 30 | + } | |
| 31 | + return CommonResult.success(memberUserService.getUserByMobile(mobile)); | |
| 32 | + } | |
| 4 | 33 | } | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/user/MemberUser.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.member.dal.dataobject.user; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.annotation.IdType; | |
| 4 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 5 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 6 | +import io.swagger.annotations.ApiModel; | |
| 7 | +import io.swagger.annotations.ApiModelProperty; | |
| 8 | +import lombok.Data; | |
| 9 | +import lombok.EqualsAndHashCode; | |
| 10 | +import lombok.experimental.Accessors; | |
| 11 | + | |
| 12 | +import java.io.Serializable; | |
| 13 | +import java.time.LocalDateTime; | |
| 14 | + | |
| 15 | +/** | |
| 16 | + * <p> | |
| 17 | + * 用户 | |
| 18 | + * </p> | |
| 19 | + * | |
| 20 | + * @author author | |
| 21 | + * @since 2022-05-07 | |
| 22 | + */ | |
| 23 | +@Data | |
| 24 | +@EqualsAndHashCode(callSuper = false) | |
| 25 | +@Accessors(chain = true) | |
| 26 | +@TableName("member_user") | |
| 27 | +@ApiModel(value="MemberUser对象", description="用户") | |
| 28 | +public class MemberUser implements Serializable { | |
| 29 | + | |
| 30 | + private static final long serialVersionUID = 1L; | |
| 31 | + | |
| 32 | + @ApiModelProperty(value = "编号") | |
| 33 | + @TableId(value = "id", type = IdType.AUTO) | |
| 34 | + private Long id; | |
| 35 | + | |
| 36 | + @ApiModelProperty(value = "用户昵称") | |
| 37 | + private String nickname; | |
| 38 | + | |
| 39 | + @ApiModelProperty(value = "头像") | |
| 40 | + private String avatar; | |
| 41 | + | |
| 42 | + @ApiModelProperty(value = "状态") | |
| 43 | + private Integer status; | |
| 44 | + | |
| 45 | + @ApiModelProperty(value = "手机号") | |
| 46 | + private String mobile; | |
| 47 | + | |
| 48 | + @ApiModelProperty(value = "密码") | |
| 49 | + private String password; | |
| 50 | + | |
| 51 | + @ApiModelProperty(value = "注册 IP") | |
| 52 | + private String registerIp; | |
| 53 | + | |
| 54 | + @ApiModelProperty(value = "最后登录IP") | |
| 55 | + private String loginIp; | |
| 56 | + | |
| 57 | + @ApiModelProperty(value = "最后登录时间") | |
| 58 | + private LocalDateTime loginDate; | |
| 59 | + | |
| 60 | + @ApiModelProperty(value = "创建者") | |
| 61 | + private String creator; | |
| 62 | + | |
| 63 | + @ApiModelProperty(value = "创建时间") | |
| 64 | + private LocalDateTime createTime; | |
| 65 | + | |
| 66 | + @ApiModelProperty(value = "更新者") | |
| 67 | + private String updater; | |
| 68 | + | |
| 69 | + @ApiModelProperty(value = "更新时间") | |
| 70 | + private LocalDateTime updateTime; | |
| 71 | + | |
| 72 | + @ApiModelProperty(value = "是否删除") | |
| 73 | + private Boolean deleted; | |
| 74 | + | |
| 75 | + @ApiModelProperty(value = "租户编号") | |
| 76 | + private Long tenantId; | |
| 77 | + | |
| 78 | + | |
| 79 | +} | ... | ... |