diff --git a/pom.xml b/pom.xml index af97408..9d2e7b7 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ 1.8 - 1.1.14 + 1.1.23 3.3.2 2.5 3.2.2 diff --git a/waynboot-admin-api/src/main/java/com/wayn/admin/api/controller/shop/MemberController.java b/waynboot-admin-api/src/main/java/com/wayn/admin/api/controller/shop/MemberController.java new file mode 100644 index 0000000..bc8ad94 --- /dev/null +++ b/waynboot-admin-api/src/main/java/com/wayn/admin/api/controller/shop/MemberController.java @@ -0,0 +1,42 @@ +package com.wayn.admin.api.controller.shop; + + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wayn.admin.api.domain.shop.Goods; +import com.wayn.admin.api.domain.shop.Member; +import com.wayn.admin.api.service.shop.IMemberService; +import com.wayn.common.util.R; +import org.springframework.beans.factory.annotation.Autowired; +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 com.wayn.common.base.BaseController; + +/** + *

+ * 用户表 前端控制器 + *

+ * + * @author wayn + * @since 2020-07-21 + */ +@RestController +@RequestMapping("shop/member") +public class MemberController extends BaseController { + + @Autowired + private IMemberService iMemberService; + + @GetMapping("list") + public R list(Member member) { + Page page = getPage(); + return R.success().add("page", iMemberService.listPage(page, member)); + } + + @GetMapping("{memberId}") + public R getMember(@PathVariable Long memberId) { + return R.success().add("data", iMemberService.getById(memberId)); + } +} diff --git a/waynboot-admin-api/src/main/java/com/wayn/admin/api/domain/shop/Member.java b/waynboot-admin-api/src/main/java/com/wayn/admin/api/domain/shop/Member.java new file mode 100644 index 0000000..f8fa18d --- /dev/null +++ b/waynboot-admin-api/src/main/java/com/wayn/admin/api/domain/shop/Member.java @@ -0,0 +1,110 @@ +package com.wayn.admin.api.domain.shop; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; +import com.wayn.common.base.ShopBaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.apache.ibatis.type.LocalDateTimeTypeHandler; +import org.apache.ibatis.type.LocalDateTypeHandler; + +/** + *

+ * 用户表 + *

+ * + * @author wayn + * @since 2020-07-21 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName(value = "shop_member") +public class Member extends ShopBaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 用户名称 + */ + private String username; + + /** + * 用户密码 + */ + private String password; + + /** + * 性别:0 未知, 1男, 1 女 + */ + private Integer gender; + + /** + * 生日 + */ + private LocalDate birthday; + + /** + * 最近一次登录时间 + */ + private LocalDateTime lastLoginTime; + + /** + * 最近一次登录IP地址 + */ + private String lastLoginIp; + + /** + * 0 普通用户,1 VIP用户,2 高级VIP用户 + */ + private Integer userLevel; + + /** + * 用户昵称或网络名称 + */ + private String nickname; + + /** + * 用户手机号码 + */ + private String mobile; + + /** + * 用户头像图片 + */ + private String avatar; + + /** + * 微信登录openid + */ + private String weixinOpenid; + + /** + * 微信登录会话KEY + */ + private String sessionKey; + + /** + * 0 可用, 1 禁用, 2 注销 + */ + private Integer status; + + /** + * 删除标志(0代表存在 1代表删除) + */ + private Boolean delFlag; + + +} diff --git a/waynboot-admin-api/src/main/java/com/wayn/admin/api/mapper/shop/MemberMapper.java b/waynboot-admin-api/src/main/java/com/wayn/admin/api/mapper/shop/MemberMapper.java new file mode 100644 index 0000000..36acac3 --- /dev/null +++ b/waynboot-admin-api/src/main/java/com/wayn/admin/api/mapper/shop/MemberMapper.java @@ -0,0 +1,21 @@ +package com.wayn.admin.api.mapper.shop; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wayn.admin.api.domain.shop.Goods; +import com.wayn.admin.api.domain.shop.Member; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 用户表 Mapper 接口 + *

+ * + * @author wayn + * @since 2020-07-21 + */ +public interface MemberMapper extends BaseMapper { + + IPage selectMemberListPage(Page page, Member member); + +} diff --git a/waynboot-admin-api/src/main/java/com/wayn/admin/api/service/impl/shop/MemberServiceImpl.java b/waynboot-admin-api/src/main/java/com/wayn/admin/api/service/impl/shop/MemberServiceImpl.java new file mode 100644 index 0000000..b72e4a7 --- /dev/null +++ b/waynboot-admin-api/src/main/java/com/wayn/admin/api/service/impl/shop/MemberServiceImpl.java @@ -0,0 +1,30 @@ +package com.wayn.admin.api.service.impl.shop; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wayn.admin.api.domain.shop.Member; +import com.wayn.admin.api.mapper.shop.MemberMapper; +import com.wayn.admin.api.service.shop.IMemberService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + *

+ * 用户表 服务实现类 + *

+ * + * @author wayn + * @since 2020-07-21 + */ +@Service +public class MemberServiceImpl extends ServiceImpl implements IMemberService { + + @Autowired + private MemberMapper memberMapper; + + @Override + public IPage listPage(Page page, Member member) { + return memberMapper.selectMemberListPage(page,member); + } +} diff --git a/waynboot-admin-api/src/main/java/com/wayn/admin/api/service/shop/IMemberService.java b/waynboot-admin-api/src/main/java/com/wayn/admin/api/service/shop/IMemberService.java new file mode 100644 index 0000000..4f84cf6 --- /dev/null +++ b/waynboot-admin-api/src/main/java/com/wayn/admin/api/service/shop/IMemberService.java @@ -0,0 +1,28 @@ +package com.wayn.admin.api.service.shop; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wayn.admin.api.domain.shop.Banner; +import com.wayn.admin.api.domain.shop.Member; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 用户表 服务类 + *

+ * + * @author wayn + * @since 2020-07-21 + */ +public interface IMemberService extends IService { + + /** + * 查询会员分页列表 + * + * @param page 分页对象 + * @param member 查询参数 + * @return 会员分页列表 + */ + IPage listPage(Page page, Member member); + +} diff --git a/waynboot-admin-api/src/main/resources/mapper/shop/MemberMapper.xml b/waynboot-admin-api/src/main/resources/mapper/shop/MemberMapper.xml new file mode 100644 index 0000000..8dedef3 --- /dev/null +++ b/waynboot-admin-api/src/main/resources/mapper/shop/MemberMapper.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, + username, password, gender, birthday, last_login_time, last_login_ip, user_level, nickname, mobile, avatar, weixin_openid, session_key, status, create_time, update_time, del_flag + from shop_member + + + +