diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuBaseVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuBaseVO.java index 5a0a64ef3..cc72cc23e 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuBaseVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuBaseVO.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.product.controller.admin.spu.vo; +import cn.iocoder.yudao.module.product.enums.spu.ProductSpuStatusEnum; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -54,7 +55,13 @@ public class ProductSpuBaseVO { @Schema(description = "排序字段", required = true, example = "1") @NotNull(message = "商品排序字段不能为空") private Integer sort; - + /** + * 商品状态 + * + * 枚举 {@link ProductSpuStatusEnum} + */ + @Schema(description = "商品状态") + private Integer status; // ========== SKU 相关字段 ========= @Schema(description = "规格类型", required = true, example = "true") @@ -97,7 +104,7 @@ public class ProductSpuBaseVO { private List giveCouponTemplateIds; @Schema(description = "分销类型") - @NotNull(message = "商品分销类型不能为空") +// @NotNull(message = "商品分销类型不能为空") private Boolean subCommissionType; @Schema(description = "活动展示顺序") // TODO 这块前端还未实现 diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuPageRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuPageRespVO.java index 83933ebdb..2884c3e88 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuPageRespVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuPageRespVO.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.product.controller.admin.spu.vo; +import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -18,11 +19,25 @@ public class ProductSpuPageRespVO { private String name; @Schema(description = "商品价格", example = "1") private Integer price; + /** + * 市场价,单位使用:分 + * + * 基于其对应的 {@link ProductSkuDO#getMarketPrice()} sku单价最低的商品的 + */ + @Schema(description = "市场价", example = "1") + private Integer marketPrice; + /** + * 成本价,单位使用:分 + * + * 基于其对应的 {@link ProductSkuDO#getCostPrice()} sku单价最低的商品的 + */ + @Schema(description = "成本价", example = "1") + private Integer costPrice; @Schema(description = "商品销量", example = "1") private Integer salesCount; - @Schema(description = "商品排序", example = "1") + @Schema(description = "库存", example = "1") private Integer stock; - @Schema(description = "商品封面图", example = "1") + @Schema(description = "商品排序", example = "1") private Integer sort; @Schema(description = "商品创建时间", example = "1") private LocalDateTime createTime; diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/user/AdminUserController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/user/AdminUserController.java new file mode 100644 index 000000000..461f09911 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/user/AdminUserController.java @@ -0,0 +1,96 @@ +package cn.iocoder.yudao.module.member.controller.admin.user; + +import cn.binarywang.wx.miniapp.api.WxMaService; +import cn.hutool.core.collection.CollUtil; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.member.controller.admin.user.dto.AdminUserQueryDTO; +import cn.iocoder.yudao.module.member.controller.admin.user.vo.AdminUserInfoRespVO; +import cn.iocoder.yudao.module.member.convert.user.UserConvert; +import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; +import cn.iocoder.yudao.module.member.service.user.MemberUserService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; +import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.FILE_IS_EMPTY; + +@Tag(name = "管理后台 - 用户个人中心") +@RestController +@RequestMapping("/member/user") +@Validated +@Slf4j +public class AdminUserController { + + @Resource + private MemberUserService userService; + @Resource + private WxMaService wxMaService; + + @PutMapping("/update-nickname") + @Operation(summary = "修改用户昵称") + @PreAuthorize("@ss.hasPermission('member:user:update')") + public CommonResult updateUserNickname(@RequestParam("nickname") String nickname) { + userService.updateUserNickname(getLoginUserId(), nickname); + return success(true); + } + + + @PostMapping("/update-avatar") + @Operation(summary = "修改用户头像") + @PreAuthorize("@ss.hasPermission('member:user:update')") + public CommonResult updateUserAvatar(@RequestParam("avatarFile") MultipartFile file) throws Exception { + if (file.isEmpty()) { + throw exception(FILE_IS_EMPTY); + } + String avatar = userService.updateUserAvatar(getLoginUserId(), file.getInputStream()); + return success(avatar); + } + + @GetMapping("/get") + @Operation(summary = "获得基本信息") + @PreAuthorize("@ss.hasPermission('member:user:query')") + public CommonResult getUserInfo(Long id) { + MemberUserDO user = userService.getUser(id); + AdminUserInfoRespVO adminUserInfoRespVO = UserConvert.INSTANCE.convertAdmin(user); + if(StringUtils.isNotEmpty(adminUserInfoRespVO.getProvinceId())){ + Integer[] areaId = new Integer[]{Integer.valueOf(adminUserInfoRespVO.getProvinceId()),Integer.valueOf(adminUserInfoRespVO.getCityId()),Integer.valueOf(adminUserInfoRespVO.getDistrictId())}; + adminUserInfoRespVO.setAreaId(areaId); + } + return success(UserConvert.INSTANCE.convertAdmin(user)); + } + + /** + * 分页查询 + * @param queryDTO + * @return + * @author perry + * @date 2018/7/13 23:46 + */ + @PostMapping(value = "page") + @Operation(summary = "获取会员列表") + @PreAuthorize("@ss.hasPermission('member:user:query')") + public CommonResult> findPageList(@RequestBody AdminUserQueryDTO queryDTO) { + // 获得用户分页列表 + PageResult pageResult = userService.findPageList(queryDTO); + if (CollUtil.isEmpty(pageResult.getList())) { + // 返回空 + return success(new PageResult<>(pageResult.getTotal())); + } + // 拼接结果返回 + List userList = UserConvert.INSTANCE.convertList3(pageResult.getList()); + return success(new PageResult<>(userList, pageResult.getTotal())); + } +} + diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/user/dto/AdminUserEditDTO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/user/dto/AdminUserEditDTO.java new file mode 100644 index 000000000..d4741d603 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/user/dto/AdminUserEditDTO.java @@ -0,0 +1,130 @@ +package cn.iocoder.yudao.module.member.controller.admin.user.dto; + +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import cn.iocoder.yudao.module.system.enums.common.SexEnum; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.time.LocalDate; + +/** + * @author perry + */ +@Data +public class AdminUserEditDTO { + + /** + * 用户ID + */ + private Long id; + + + @Schema(description = "用户id", example = "15601691300") + @NotNull(message = "用户id不能为空") + private Long userId; + + @Schema(description = "用户手机号", example = "15601691300") + private String mobile; + @Schema(description = "用户昵称", example = "芋艿") + private String nickname; + /** + * 帐号状态 + *

+ * 枚举 {@link CommonStatusEnum} + */ + @Schema(description = "帐号状态") + private Integer status; + + /** + * 真实姓名 + */ + @Schema(description = "真实姓名") + private String realName; + + + /** + * 生日 + */ + @Schema(description = "生日") + private LocalDate userBirthday; + + /** + * 身份证号码 + */ + @Schema(description = "身份证号码") + private String idCard; + + + /** + * 省份 + */ + @Schema(description = "省份") + private String provinceId; + + /** + * 市 + */ + @Schema(description = "市") + private String cityId; + + /** + * 区 + */ + @Schema(description = "区") + private String districtId; + + @Schema(description = "省市区") + private Integer[] areaId; + /** + * 地址 + */ + @Schema(description = "地址") + private String userAddress; + + + /** + * 出行最关注 + */ + @Schema(description = "出行最关注") + private String travelFollow; + /** + * 出行目的 + */ + @Schema(description = "出行目的") + private String travelPurpose; + /** + * 性格特征 + */ + @Schema(description = "性格特征") + private String characterFeatures; + /** + * 健康状况 + */ + @Schema(description = "健康状况") + private String healthyStatus; + /** + * 出行要求 + */ + @Schema(description = "出行要求") + private String travelClaim; + /** + * 个人服务说明 + */ + @Schema(description = "个人服务说明") + private String personalServiceExplain; + /** + * 备注 + */ + @Schema(description = "备注") + private String remark; + /** + * 用户性别 + *

+ * 枚举类 {@link SexEnum} + */ + @Schema(description = "用户性别") + private Integer sex; + + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/user/dto/AdminUserQueryDTO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/user/dto/AdminUserQueryDTO.java new file mode 100644 index 000000000..4c2eb0e70 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/user/dto/AdminUserQueryDTO.java @@ -0,0 +1,37 @@ +package cn.iocoder.yudao.module.member.controller.admin.user.dto; + +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.module.system.enums.common.SexEnum; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class AdminUserQueryDTO extends PageParam { + @Schema(description = "用户手机号", example = "15601691300") + private String mobile; + @Schema(description = "用户昵称", example = "芋艿") + private String nickname; + /** + * 帐号状态 + *

+ * 枚举 {@link CommonStatusEnum} + */ + @Schema(description = "帐号状态") + private Integer status; + + /** + * 用户性别 + *

+ * 枚举类 {@link SexEnum} + */ + @Schema(description = "用户性别") + private Integer sex; + + + /** + * 真实姓名 + */ + @Schema(description = "真实姓名") + private String realName; +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/user/vo/AdminUserInfoRespVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/user/vo/AdminUserInfoRespVO.java new file mode 100644 index 000000000..1bd152bd5 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/user/vo/AdminUserInfoRespVO.java @@ -0,0 +1,164 @@ +package cn.iocoder.yudao.module.member.controller.admin.user.vo; + +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import cn.iocoder.yudao.module.system.enums.common.SexEnum; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +/** + * @author perry + */ +@Schema(description = "用户 APP - 用户个人信息 Response VO") +@Data +@NoArgsConstructor +@AllArgsConstructor +public class AdminUserInfoRespVO { + /** + * 用户ID + */ + private Long id; + + @Schema(description = "用户昵称", example = "芋艿") + private String nickname; + + @Schema(description = "用户头像", example = "/infra/file/get/35a12e57-4297-4faa-bf7d-7ed2f211c952") + private String avatar; + + @Schema(description = "用户手机号", example = "15601691300") + private String mobile; + + /** + * 帐号状态 + *

+ * 枚举 {@link CommonStatusEnum} + */ + @Schema(description = "帐号状态") + private Integer status; + + + /** + * 注册 IP + */ + @Schema(description = "注册 IP") + private String registerIp; + /** + * 最后登录IP + */ + @Schema(description = "最后登录IP") + private String loginIp; + /** + * 最后登录时间 + */ + @Schema(description = "最后登录时间") + private LocalDateTime loginDate; + + /** + * 用户账号 + */ + @Schema(description = "用户账号") + private String username; + + /** + * 用户性别 + *

+ * 枚举类 {@link SexEnum} + */ + @Schema(description = "用户性别") + private Integer sex; + + + /** + * 真实姓名 + */ + @Schema(description = "真实姓名") + private String realName; + + + /** + * 生日 + */ + @Schema(description = "生日") + private LocalDate userBirthday; + + /** + * 身份证号码 + */ + @Schema(description = "身份证号码") + private String idCard; + + + /** + * 省份 + */ + @Schema(description = "省份") + private String provinceId; + + /** + * 市 + */ + @Schema(description = "市") + private String cityId; + + /** + * 区 + */ + @Schema(description = "区") + private String districtId; + + @Schema(description = "省市区") + private Integer[] areaId; + /** + * 地址 + */ + @Schema(description = "地址") + private String userAddress; + + + /** + * 出行最关注 + */ + @Schema(description = "出行最关注") + private String travelFollow; + /** + * 出行目的 + */ + @Schema(description = "出行目的") + private String travelPurpose; + /** + * 性格特征 + */ + @Schema(description = "性格特征") + private String characterFeatures; + /** + * 健康状况 + */ + @Schema(description = "健康状况") + private String healthyStatus; + /** + * 出行要求 + */ + @Schema(description = "出行要求") + private String travelClaim; + /** + * 个人服务说明 + */ + @Schema(description = "个人服务说明") + private String personalServiceExplain; + /** + * 备注 + */ + @Schema(description = "备注") + private String remark; + + /** + * 注册时间 + */ + @Schema(description = "注册时间") + private LocalDateTime createTime; + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/user/UserConvert.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/user/UserConvert.java index 805ade807..11d1d0087 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/user/UserConvert.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/user/UserConvert.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.member.convert.user; import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; +import cn.iocoder.yudao.module.member.controller.admin.user.vo.AdminUserInfoRespVO; import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserInfoRespVO; import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; import org.mapstruct.Mapper; @@ -14,9 +15,11 @@ public interface UserConvert { UserConvert INSTANCE = Mappers.getMapper(UserConvert.class); AppUserInfoRespVO convert(MemberUserDO bean); - + AdminUserInfoRespVO convertAdmin(MemberUserDO bean); MemberUserRespDTO convert2(MemberUserDO bean); List convertList2(List list); + List convertList3(List list); + } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/user/MemberUserMapper.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/user/MemberUserMapper.java index 5e63aae36..5c751d92d 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/user/MemberUserMapper.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/user/MemberUserMapper.java @@ -1,7 +1,9 @@ package cn.iocoder.yudao.module.member.dal.mysql.user; +import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.module.member.controller.admin.user.dto.AdminUserQueryDTO; import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; import org.apache.ibatis.annotations.Mapper; @@ -23,5 +25,11 @@ public interface MemberUserMapper extends BaseMapperX { return selectList(new LambdaQueryWrapperX() .likeIfPresent(MemberUserDO::getNickname, nickname)); } - + default PageResult selectPage(AdminUserQueryDTO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(MemberUserDO::getMobile, reqVO.getMobile()) + .likeIfPresent(MemberUserDO::getNickname,reqVO.getNickname()) + .eqIfPresent(MemberUserDO::getStatus,reqVO.getStatus()) + .orderByDesc(MemberUserDO::getId)); + } } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserService.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserService.java index b0a2edc79..8f8cbb4c4 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserService.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserService.java @@ -1,6 +1,8 @@ package cn.iocoder.yudao.module.member.service.user; +import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.validation.Mobile; +import cn.iocoder.yudao.module.member.controller.admin.user.dto.AdminUserQueryDTO; import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobileReqVO; import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; @@ -96,4 +98,15 @@ public interface MemberUserService { */ boolean isPasswordMatch(String rawPassword, String encodedPassword); + + /** + * 分页查询 + * + * @param queryDTO + * @return + * @author perry + * @date 2018/7/13 23:46 + */ + PageResult findPageList(AdminUserQueryDTO queryDTO); + } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java index 2657e922e..a2f497892 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java @@ -3,7 +3,9 @@ package cn.iocoder.yudao.module.member.service.user; import cn.hutool.core.io.IoUtil; import cn.hutool.core.util.IdUtil; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.infra.api.file.FileApi; +import cn.iocoder.yudao.module.member.controller.admin.user.dto.AdminUserQueryDTO; import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobileReqVO; import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; import cn.iocoder.yudao.module.member.dal.mysql.user.MemberUserMapper; @@ -144,7 +146,19 @@ public class MemberUserServiceImpl implements MemberUserService { public boolean isPasswordMatch(String rawPassword, String encodedPassword) { return passwordEncoder.matches(rawPassword, encodedPassword); } - + /** + * 分页查询 + * + * @param queryDTO + * @return + * @author perry + * @date 2018/7/13 23:46 + */ + @Override + public PageResult findPageList(AdminUserQueryDTO queryDTO) { + PageResult commonLableEntityList = memberUserMapper.selectPage(queryDTO); + return commonLableEntityList; + } /** * 对密码进行加密 * diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index cd3ff94cb..0b65e44d7 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -44,34 +44,31 @@ spring: primary: master datasource: master: - name: ruoyi-vue-pro-v2 - url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 - # url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT # MySQL Connector/J 5.X 连接的示例 - # url: jdbc:postgresql://127.0.0.1:5432/${spring.datasource.dynamic.datasource.slave.name} # PostgreSQL 连接的示例 - # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 - # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=${spring.datasource.dynamic.datasource.master.name} # SQLServer 连接的示例 + name: cyywl + url: jdbc:mysql://117.33.142.185:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true + driver-class-name: com.mysql.jdbc.Driver username: root - password: 123456 + password: axzsd110 # username: sa # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W - slave: # 模拟从库,可根据自己需要修改 - name: ruoyi-vue-pro-v2 - url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 - # url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT # MySQL Connector/J 5.X 连接的示例 - # url: jdbc:postgresql://127.0.0.1:5432/${spring.datasource.dynamic.datasource.slave.name} # PostgreSQL 连接的示例 - # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 - # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=${spring.datasource.dynamic.datasource.slave.name} # SQLServer 连接的示例 - username: root - password: 123456 +# slave: # 模拟从库,可根据自己需要修改 +# name: ruoyi-vue-pro-v2 +# url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 +# # url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT # MySQL Connector/J 5.X 连接的示例 +# # url: jdbc:postgresql://127.0.0.1:5432/${spring.datasource.dynamic.datasource.slave.name} # PostgreSQL 连接的示例 +# # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 +# # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=${spring.datasource.dynamic.datasource.slave.name} # SQLServer 连接的示例 +# username: root +# password: 123456 # username: sa # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 redis: - host: 127.0.0.1 # 地址 - port: 6379 # 端口 - database: 0 # 数据库索引 -# password: dev # 密码,建议生产环境开启 + host: 117.33.142.185 # 地址 + port: 6369 # 端口 + database: 6 # 数据库索引 + password: 20221122@dev # 密码,建议生产环境开启 --- #################### 定时任务相关配置 #################### diff --git a/yudao-ui-admin/src/api/member/user.js b/yudao-ui-admin/src/api/member/user.js new file mode 100644 index 000000000..bd4915c4f --- /dev/null +++ b/yudao-ui-admin/src/api/member/user.js @@ -0,0 +1,54 @@ +import request from '@/utils/request' + +// 创建用户 +export function createUser(data) { + return request({ + url: '/member/user/create', + method: 'post', + data: data + }) +} + +// 更新用户 +export function updateUser(data) { + return request({ + url: '/member/user/update', + method: 'put', + data: data + }) +} + +// 删除用户 +export function deleteUser(id) { + return request({ + url: '/member/user/delete?id=' + id, + method: 'delete' + }) +} + +// 获得用户 +export function getUser(id) { + return request({ + url: '/member/user/get?id=' + id, + method: 'get' + }) +} + +// 获得用户分页 +export function getUserPage(query) { + return request({ + url: '/member/user/page', + method: 'post', + data: query + }) +} + +// 导出用户 Excel +export function exportUserExcel(query) { + return request({ + url: '/member/user/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/yudao-ui-admin/src/views/member/user/index.vue b/yudao-ui-admin/src/views/member/user/index.vue new file mode 100644 index 000000000..c04b6cd6e --- /dev/null +++ b/yudao-ui-admin/src/views/member/user/index.vue @@ -0,0 +1,266 @@ + + +