diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/user/UserController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/user/UserController.java index ce5667d329..0e881de287 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/user/UserController.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/user/UserController.java @@ -1,4 +1,33 @@ package cn.iocoder.yudao.module.member.controller.admin.user; +import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; +import cn.iocoder.yudao.module.member.service.user.MemberUserService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +@Api(tags = "用户管理 - 用户管理") +@RestController +@RequestMapping("/member-user") public class UserController { + + @Resource + private MemberUserService memberUserService; + + @ApiOperation("获取用户信息") + @GetMapping("/query-info") + public CommonResult queryInfo(@PathVariable String mobile) { + if (StringUtils.isBlank(mobile)) { + return CommonResult.error(GlobalErrorCodeConstants.BAD_REQUEST.getCode(),"手机号不能为空"); + } + return CommonResult.success(memberUserService.getUserByMobile(mobile)); + } } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/user/MemberUser.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/user/MemberUser.java new file mode 100644 index 0000000000..e24e99e104 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/user/MemberUser.java @@ -0,0 +1,79 @@ +package cn.iocoder.yudao.module.member.dal.dataobject.user; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 用户 + *

+ * + * @author author + * @since 2022-05-07 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("member_user") +@ApiModel(value="MemberUser对象", description="用户") +public class MemberUser implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "编号") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + @ApiModelProperty(value = "用户昵称") + private String nickname; + + @ApiModelProperty(value = "头像") + private String avatar; + + @ApiModelProperty(value = "状态") + private Integer status; + + @ApiModelProperty(value = "手机号") + private String mobile; + + @ApiModelProperty(value = "密码") + private String password; + + @ApiModelProperty(value = "注册 IP") + private String registerIp; + + @ApiModelProperty(value = "最后登录IP") + private String loginIp; + + @ApiModelProperty(value = "最后登录时间") + private LocalDateTime loginDate; + + @ApiModelProperty(value = "创建者") + private String creator; + + @ApiModelProperty(value = "创建时间") + private LocalDateTime createTime; + + @ApiModelProperty(value = "更新者") + private String updater; + + @ApiModelProperty(value = "更新时间") + private LocalDateTime updateTime; + + @ApiModelProperty(value = "是否删除") + private Boolean deleted; + + @ApiModelProperty(value = "租户编号") + private Long tenantId; + + +}