From dfafdf9acf4806169ab7d81c2c1f5e092e241a5e Mon Sep 17 00:00:00 2001 From: "Ray.Hao" <1490493387@qq.com> Date: Fri, 14 Jun 2024 18:35:57 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=9A=E5=91=98=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=92=8C=E8=90=A5=E9=94=80=E6=A8=A1=E5=9D=97=E9=87=8D?= =?UTF-8?q?=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 +- docs/sql/mysql5/youlai_system.sql | 4 +- docs/sql/mysql8/youlai_system.sql | 4 +- .../marketing-api}/pom.xml | 6 +- .../api}/CouponRecordFeignClient.java | 8 +- .../marketing-boot}/Dockerfile | 0 .../marketing-boot}/pom.xml | 6 +- .../youlai/mall/sms/MarketingApplication.java | 4 +- .../controller/admin/AdvertController.java | 30 +++--- .../controller/admin/CouponController.java | 6 +- .../controller/app/AdvertAppController.java | 8 +- .../mall/sms/converter/AdvertConverter.java | 10 +- .../mall/sms/converter/CouponConverter.java | 10 +- .../sms/enums/CouponApplicationScopeEnum.java | 0 .../sms/enums/CouponFaceValueTypeEnum.java | 0 .../youlai/mall/sms/enums/CouponTypeEnum.java | 0 .../youlai/mall/sms/enums/PlatformEnum.java | 0 .../sms/enums/ValidityPeriodTypeEnum.java | 0 .../youlai/mall/sms/mapper/AdvertMapper.java | 6 +- .../mall/sms/mapper/CouponHistoryMapper.java | 4 +- .../youlai/mall/sms/mapper/CouponMapper.java | 6 +- .../sms/mapper/CouponSpuCategoryMapper.java | 4 +- .../mall/sms/mapper/CouponSpuMapper.java | 4 +- .../youlai/mall/sms/model/entity/Advert.java | 8 +- .../youlai/mall/sms/model/entity/Coupon.java | 12 +-- .../mall/sms/model/entity/CouponHistory.java | 5 +- .../mall/sms/model/entity/CouponSpu.java | 6 +- .../sms/model/entity/CouponSpuCategory.java | 2 +- .../mall/sms/model/form/CouponForm.java | 0 .../mall/sms/model/query/AdvertPageQuery.java | 0 .../mall/sms/model/query/CouponPageQuery.java | 0 .../mall/sms/model/vo/AdvertPageVO.java | 0 .../youlai/mall/sms/model/vo/BannerVO.java | 0 .../mall/sms/model/vo/CouponPageVO.java | 0 .../mall/sms/service/AdvertService.java | 4 +- .../sms/service/CouponHistoryService.java | 11 +++ .../mall/sms/service/CouponService.java | 4 +- .../sms/service/CouponSpuCategoryService.java | 11 +++ .../mall/sms/service/CouponSpuService.java | 11 +++ .../sms/service/impl/AdvertServiceImpl.java | 16 ++-- .../impl/CouponHistoryServiceImpl.java | 20 ++++ .../sms/service/impl/CouponServiceImpl.java | 80 ++++++++-------- .../impl/CouponSpuCategoryServiceImpl.java | 20 ++++ .../service/impl/CouponSpuServiceImpl.java | 20 ++++ .../com/youlai/mall/sms/util/CouponUtils.java | 0 .../src/main/resources/bootstrap-dev.yml | 0 .../src/main/resources/bootstrap-prod.yml | 0 .../src/main/resources/bootstrap.yml | 3 +- .../main/resources/mapper/AdvertMapper.xml | 4 +- .../resources/mapper/CouponHistoryMapper.xml | 4 +- .../main/resources/mapper/CouponMapper.xml | 4 +- .../mapper/CouponSpuCategoryMapper.xml | 2 +- .../main/resources/mapper/CouponSpuMapper.xml | 4 +- .../mall/sms/MarketingApplicationTest.java | 2 +- {mall-sms => mall-marketing}/pom.xml | 6 +- .../member-api}/pom.xml | 4 +- .../mall/member}/api/MemberFeignClient.java | 13 ++- .../youlai/mall/member}/dto/CartItemDTO.java | 2 +- .../mall/member}/dto/MemberAddressDTO.java | 2 +- .../mall/member}/dto/MemberAuthDTO.java | 2 +- .../mall/member}/dto/MemberInfoDTO.java | 2 +- .../mall/member}/dto/MemberRegisterDTO.java | 2 +- .../youlai/mall/member}/dto/RechargeDTO.java | 4 +- .../youlai/mall/member}/dto/ResultPayDTO.java | 2 +- .../member-boot}/Dockerfile | 2 +- .../member-boot}/pom.xml | 6 +- .../youlai/mall/member/MemberApplication.java | 6 +- .../controller/admin/MemberController.java | 28 +++--- .../controller/app/AddressController.java | 20 ++-- .../member/controller/app/CartController.java | 8 +- .../controller/app/MemberAppController.java | 24 ++--- .../mall/member/convert/AddressConvert.java | 21 +++++ .../mall/member/convert/CartConverter.java | 25 +++++ .../mall/member}/convert/MemberConvert.java | 19 ++-- .../mall/member}/listener/CartListener.java | 4 +- .../mall/member/mapper/AddressMapper.java | 8 +- .../mall/member/mapper/MemberMapper.java | 16 +--- .../mall/member}/model/bo/AddressBO.java | 2 +- .../mall/member}/model/bo/MemberBO.java | 2 +- .../member/model/cache}/CartItemCache.java | 2 +- .../mall/member}/model/dto/MemberDTO.java | 2 +- .../mall/member/model/entity/Address.java | 12 ++- .../mall/member/model/entity/Member.java | 4 +- .../mall/member}/model/form/AddressForm.java | 2 +- .../member}/model/query/MemberPageQuery.java | 2 +- .../mall/member}/model/vo/MemberPageVO.java | 4 +- .../mall/member/service/AddressService.java | 10 +- .../mall/member}/service/CartService.java | 4 +- .../mall/member/service/MemberService.java | 18 ++-- .../service/impl/AddressServiceImpl.java | 56 +++++------ .../member}/service/impl/CartServiceImpl.java | 12 +-- .../service/impl/MemberServiceImpl.java | 78 ++++++++-------- .../src/main/resources/bootstrap-dev.yml | 0 .../src/main/resources/bootstrap-prod.yml | 0 .../src/main/resources/bootstrap.yml | 3 +- .../main/resources/mapper/AddressMapper.xml | 2 +- .../main/resources/mapper/MemberMapper.xml | 4 +- {mall-ums => mall-member}/pom.xml | 6 +- mall-order/order-boot/pom.xml | 2 +- .../youlai/mall/order/OrderApplication.java | 2 +- .../mall/order/model/vo/OrderConfirmVO.java | 2 +- .../order/service/impl/OrderServiceImpl.java | 6 +- mall-product/product-boot/pom.xml | 2 +- .../mall/product/ProductApplication.java | 2 +- .../controller/admin/AttributeController.java | 10 +- .../controller/admin/SpecController.java | 4 +- .../mall/product/converter/AttrConverter.java | 15 +-- .../product/converter/CategoryConverter.java | 2 +- .../mall/product/converter/SpecConverter.java | 6 +- .../mall/product/enums/AttributeTypeEnum.java | 32 ------- .../product/enums/ProductOrderByEnum.java | 2 - .../mall/product/listener/StockListener.java | 8 +- .../mall/product/mapper/AttrGroupMapper.java | 8 +- .../mall/product/mapper/AttrMapper.java | 12 +-- .../mall/product/mapper/SpecMapper.java | 2 +- .../youlai/mall/product/model/bo/AttrBO.java | 21 ++--- .../youlai/mall/product/model/bo/SpecBO.java | 14 ++- .../mall/product/model/entity/Attr.java | 3 +- .../mall/product/model/entity/Spec.java | 6 +- .../mall/product/model/form/AttrForm.java | 8 +- ...PageQuery.java => AttrGroupPageQuery.java} | 14 +-- .../model/query/AttributePageQuery.java | 30 ------ .../product/model/vo/AttrGroupPageVO.java | 67 ++++++++++++++ .../mall/product/model/vo/AttrPageVO.java | 48 ---------- .../mall/product/model/vo/SpecPageVO.java | 37 +++----- .../product/service/AttrGroupService.java | 27 +----- .../mall/product/service/AttrService.java | 18 +--- .../service/impl/AttrGroupServiceImpl.java | 92 +++++-------------- .../product/service/impl/AttrServiceImpl.java | 59 +++--------- .../service/impl/CategoryServiceImpl.java | 2 +- .../product/service/impl/SpecServiceImpl.java | 6 +- .../main/resources/mapper/AttrGroupMapper.xml | 36 +++++--- .../src/main/resources/mapper/AttrMapper.xml | 79 +++------------- .../src/main/resources/mapper/SpecMapper.xml | 32 ++----- .../sms/service/SmsCouponHistoryService.java | 11 --- .../service/SmsCouponSpuCategoryService.java | 11 --- .../mall/sms/service/SmsCouponSpuService.java | 11 --- .../impl/SmsCouponHistoryServiceImpl.java | 20 ---- .../impl/SmsCouponSpuCategoryServiceImpl.java | 20 ---- .../service/impl/SmsCouponSpuServiceImpl.java | 20 ---- .../mall/ums/convert/AddressConvert.java | 21 ----- .../mall/ums/convert/CartConverter.java | 26 ------ pom.xml | 8 +- youlai-auth/pom.xml | 2 +- .../java/com/youlai/auth/AuthApplication.java | 2 +- .../com/youlai/auth/model/MemberDetails.java | 2 +- .../auth/service/MemberDetailsService.java | 6 +- .../filter/TokenValidationGlobalFilter.java | 3 - .../system/converter/DeptConverter.java | 2 +- .../system/converter/MenuConverter.java | 2 +- .../service/impl/SysDeptServiceImpl.java | 2 +- .../service/impl/SysMenuServiceImpl.java | 2 +- 152 files changed, 732 insertions(+), 987 deletions(-) rename {mall-sms/sms-api => mall-marketing/marketing-api}/pom.xml (90%) rename {mall-sms/sms-api/src/main/java/com/youlai/mall/sms/api/app => mall-marketing/marketing-api/src/main/java/com/youlai/mall/marketing/api}/CouponRecordFeignClient.java (85%) rename {mall-sms/sms-boot => mall-marketing/marketing-boot}/Dockerfile (100%) rename {mall-sms/sms-boot => mall-marketing/marketing-boot}/pom.xml (94%) rename mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/SmsApplication.java => mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/MarketingApplication.java (88%) rename mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/admin/SmsAdvertController.java => mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/controller/admin/AdvertController.java (68%) rename mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/admin/SmsCouponController.java => mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/controller/admin/CouponController.java (94%) rename mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/app/AdvertController.java => mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/controller/app/AdvertAppController.java (80%) rename {mall-sms/sms-boot => mall-marketing/marketing-boot}/src/main/java/com/youlai/mall/sms/converter/AdvertConverter.java (60%) rename {mall-sms/sms-boot => mall-marketing/marketing-boot}/src/main/java/com/youlai/mall/sms/converter/CouponConverter.java (87%) rename {mall-sms/sms-boot => mall-marketing/marketing-boot}/src/main/java/com/youlai/mall/sms/enums/CouponApplicationScopeEnum.java (100%) rename {mall-sms/sms-boot => mall-marketing/marketing-boot}/src/main/java/com/youlai/mall/sms/enums/CouponFaceValueTypeEnum.java (100%) rename {mall-sms/sms-boot => mall-marketing/marketing-boot}/src/main/java/com/youlai/mall/sms/enums/CouponTypeEnum.java (100%) rename {mall-sms/sms-boot => mall-marketing/marketing-boot}/src/main/java/com/youlai/mall/sms/enums/PlatformEnum.java (100%) rename {mall-sms/sms-boot => mall-marketing/marketing-boot}/src/main/java/com/youlai/mall/sms/enums/ValidityPeriodTypeEnum.java (100%) rename mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/mapper/SmsAdvertMapper.java => mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/mapper/AdvertMapper.java (65%) rename mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/mapper/SmsCouponHistoryMapper.java => mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/mapper/CouponHistoryMapper.java (53%) rename mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/mapper/SmsCouponMapper.java => mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/mapper/CouponMapper.java (63%) rename mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/mapper/SmsCouponSpuCategoryMapper.java => mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/mapper/CouponSpuCategoryMapper.java (61%) rename mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/mapper/SmsCouponSpuMapper.java => mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/mapper/CouponSpuMapper.java (65%) rename mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsAdvert.java => mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/entity/Advert.java (76%) rename mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsCoupon.java => mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/entity/Coupon.java (90%) rename mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsCouponHistory.java => mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/entity/CouponHistory.java (93%) rename mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsCouponSpu.java => mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/entity/CouponSpu.java (89%) rename mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsCouponSpuCategory.java => mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/entity/CouponSpuCategory.java (92%) rename {mall-sms/sms-boot => mall-marketing/marketing-boot}/src/main/java/com/youlai/mall/sms/model/form/CouponForm.java (100%) rename {mall-sms/sms-boot => mall-marketing/marketing-boot}/src/main/java/com/youlai/mall/sms/model/query/AdvertPageQuery.java (100%) rename {mall-sms/sms-boot => mall-marketing/marketing-boot}/src/main/java/com/youlai/mall/sms/model/query/CouponPageQuery.java (100%) rename {mall-sms/sms-boot => mall-marketing/marketing-boot}/src/main/java/com/youlai/mall/sms/model/vo/AdvertPageVO.java (100%) rename {mall-sms/sms-boot => mall-marketing/marketing-boot}/src/main/java/com/youlai/mall/sms/model/vo/BannerVO.java (100%) rename {mall-sms/sms-boot => mall-marketing/marketing-boot}/src/main/java/com/youlai/mall/sms/model/vo/CouponPageVO.java (100%) rename mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/SmsAdvertService.java => mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/AdvertService.java (82%) create mode 100644 mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/CouponHistoryService.java rename mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/SmsCouponService.java => mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/CouponService.java (91%) create mode 100644 mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/CouponSpuCategoryService.java create mode 100644 mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/CouponSpuService.java rename mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/impl/SmsAdvertServiceImpl.java => mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/impl/AdvertServiceImpl.java (68%) create mode 100644 mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/impl/CouponHistoryServiceImpl.java rename mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/impl/SmsCouponServiceImpl.java => mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/impl/CouponServiceImpl.java (66%) create mode 100644 mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/impl/CouponSpuCategoryServiceImpl.java create mode 100644 mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/impl/CouponSpuServiceImpl.java rename {mall-sms/sms-boot => mall-marketing/marketing-boot}/src/main/java/com/youlai/mall/sms/util/CouponUtils.java (100%) rename {mall-sms/sms-boot => mall-marketing/marketing-boot}/src/main/resources/bootstrap-dev.yml (100%) rename {mall-sms/sms-boot => mall-marketing/marketing-boot}/src/main/resources/bootstrap-prod.yml (100%) rename {mall-ums/ums-boot => mall-marketing/marketing-boot}/src/main/resources/bootstrap.yml (66%) rename mall-sms/sms-boot/src/main/resources/mapper/SmsAdvertMapper.xml => mall-marketing/marketing-boot/src/main/resources/mapper/AdvertMapper.xml (87%) rename mall-sms/sms-boot/src/main/resources/mapper/SmsCouponHistoryMapper.xml => mall-marketing/marketing-boot/src/main/resources/mapper/CouponHistoryMapper.xml (93%) rename mall-sms/sms-boot/src/main/resources/mapper/SmsCouponMapper.xml => mall-marketing/marketing-boot/src/main/resources/mapper/CouponMapper.xml (80%) rename mall-sms/sms-boot/src/main/resources/mapper/SmsCouponSpuCategoryMapper.xml => mall-marketing/marketing-boot/src/main/resources/mapper/CouponSpuCategoryMapper.xml (70%) rename mall-sms/sms-boot/src/main/resources/mapper/SmsCouponSpuMapper.xml => mall-marketing/marketing-boot/src/main/resources/mapper/CouponSpuMapper.xml (87%) rename mall-sms/sms-boot/src/test/java/com/youlai/mall/sms/SmsApplicationTest.java => mall-marketing/marketing-boot/src/test/java/com/youlai/mall/sms/MarketingApplicationTest.java (86%) rename {mall-sms => mall-marketing}/pom.xml (80%) rename {mall-ums/ums-api => mall-member/member-api}/pom.xml (92%) rename {mall-ums/ums-api/src/main/java/com/youlai/mall/ums => mall-member/member-api/src/main/java/com/youlai/mall/member}/api/MemberFeignClient.java (83%) rename {mall-ums/ums-api/src/main/java/com/youlai/mall/ums => mall-member/member-api/src/main/java/com/youlai/mall/member}/dto/CartItemDTO.java (95%) rename {mall-ums/ums-api/src/main/java/com/youlai/mall/ums => mall-member/member-api/src/main/java/com/youlai/mall/member}/dto/MemberAddressDTO.java (92%) rename {mall-ums/ums-api/src/main/java/com/youlai/mall/ums => mall-member/member-api/src/main/java/com/youlai/mall/member}/dto/MemberAuthDTO.java (92%) rename {mall-ums/ums-api/src/main/java/com/youlai/mall/ums => mall-member/member-api/src/main/java/com/youlai/mall/member}/dto/MemberInfoDTO.java (85%) rename {mall-ums/ums-api/src/main/java/com/youlai/mall/ums => mall-member/member-api/src/main/java/com/youlai/mall/member}/dto/MemberRegisterDTO.java (93%) rename {mall-ums/ums-api/src/main/java/com/youlai/mall/ums => mall-member/member-api/src/main/java/com/youlai/mall/member}/dto/RechargeDTO.java (90%) rename {mall-ums/ums-api/src/main/java/com/youlai/mall/ums => mall-member/member-api/src/main/java/com/youlai/mall/member}/dto/ResultPayDTO.java (90%) rename {mall-ums/ums-boot => mall-member/member-boot}/Dockerfile (96%) rename {mall-ums/ums-boot => mall-member/member-boot}/pom.xml (95%) rename mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/UmsApplication.java => mall-member/member-boot/src/main/java/com/youlai/mall/member/MemberApplication.java (78%) rename {mall-ums/ums-boot/src/main/java/com/youlai/mall/ums => mall-member/member-boot/src/main/java/com/youlai/mall/member}/controller/admin/MemberController.java (72%) rename mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/AppAddressController.java => mall-member/member-boot/src/main/java/com/youlai/mall/member/controller/app/AddressController.java (79%) rename mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/AppCartController.java => mall-member/member-boot/src/main/java/com/youlai/mall/member/controller/app/CartController.java (92%) rename mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/AppMemberController.java => mall-member/member-boot/src/main/java/com/youlai/mall/member/controller/app/MemberAppController.java (82%) create mode 100644 mall-member/member-boot/src/main/java/com/youlai/mall/member/convert/AddressConvert.java create mode 100644 mall-member/member-boot/src/main/java/com/youlai/mall/member/convert/CartConverter.java rename {mall-ums/ums-boot/src/main/java/com/youlai/mall/ums => mall-member/member-boot/src/main/java/com/youlai/mall/member}/convert/MemberConvert.java (59%) rename {mall-ums/ums-boot/src/main/java/com/youlai/mall/ums => mall-member/member-boot/src/main/java/com/youlai/mall/member}/listener/CartListener.java (93%) rename mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/mapper/UmsAddressMapper.java => mall-member/member-boot/src/main/java/com/youlai/mall/member/mapper/AddressMapper.java (66%) rename mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/mapper/UmsMemberMapper.java => mall-member/member-boot/src/main/java/com/youlai/mall/member/mapper/MemberMapper.java (51%) rename {mall-ums/ums-boot/src/main/java/com/youlai/mall/ums => mall-member/member-boot/src/main/java/com/youlai/mall/member}/model/bo/AddressBO.java (94%) rename {mall-ums/ums-boot/src/main/java/com/youlai/mall/ums => mall-member/member-boot/src/main/java/com/youlai/mall/member}/model/bo/MemberBO.java (96%) rename {mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/dto => mall-member/member-boot/src/main/java/com/youlai/mall/member/model/cache}/CartItemCache.java (91%) rename {mall-ums/ums-boot/src/main/java/com/youlai/mall/ums => mall-member/member-boot/src/main/java/com/youlai/mall/member}/model/dto/MemberDTO.java (93%) rename mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/entity/UmsAddress.java => mall-member/member-boot/src/main/java/com/youlai/mall/member/model/entity/Address.java (79%) rename mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/entity/UmsMember.java => mall-member/member-boot/src/main/java/com/youlai/mall/member/model/entity/Member.java (94%) rename {mall-ums/ums-boot/src/main/java/com/youlai/mall/ums => mall-member/member-boot/src/main/java/com/youlai/mall/member}/model/form/AddressForm.java (96%) rename {mall-ums/ums-boot/src/main/java/com/youlai/mall/ums => mall-member/member-boot/src/main/java/com/youlai/mall/member}/model/query/MemberPageQuery.java (91%) rename {mall-ums/ums-boot/src/main/java/com/youlai/mall/ums => mall-member/member-boot/src/main/java/com/youlai/mall/member}/model/vo/MemberPageVO.java (93%) rename mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/service/UmsAddressService.java => mall-member/member-boot/src/main/java/com/youlai/mall/member/service/AddressService.java (69%) rename {mall-ums/ums-boot/src/main/java/com/youlai/mall/ums => mall-member/member-boot/src/main/java/com/youlai/mall/member}/service/CartService.java (91%) rename mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/service/UmsMemberService.java => mall-member/member-boot/src/main/java/com/youlai/mall/member/service/MemberService.java (73%) rename mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/service/impl/UmsAddressServiceImpl.java => mall-member/member-boot/src/main/java/com/youlai/mall/member/service/impl/AddressServiceImpl.java (56%) rename {mall-ums/ums-boot/src/main/java/com/youlai/mall/ums => mall-member/member-boot/src/main/java/com/youlai/mall/member}/service/impl/CartServiceImpl.java (94%) rename mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/service/impl/UmsMemberServiceImpl.java => mall-member/member-boot/src/main/java/com/youlai/mall/member/service/impl/MemberServiceImpl.java (61%) rename {mall-ums/ums-boot => mall-member/member-boot}/src/main/resources/bootstrap-dev.yml (100%) rename {mall-ums/ums-boot => mall-member/member-boot}/src/main/resources/bootstrap-prod.yml (100%) rename {mall-sms/sms-boot => mall-member/member-boot}/src/main/resources/bootstrap.yml (69%) rename mall-ums/ums-boot/src/main/resources/mapper/UmsAddressMapper.xml => mall-member/member-boot/src/main/resources/mapper/AddressMapper.xml (95%) rename mall-ums/ums-boot/src/main/resources/mapper/UmsMemberMapper.xml => mall-member/member-boot/src/main/resources/mapper/MemberMapper.xml (88%) rename {mall-ums => mall-member}/pom.xml (81%) delete mode 100644 mall-product/product-boot/src/main/java/com/youlai/mall/product/enums/AttributeTypeEnum.java rename mall-product/product-boot/src/main/java/com/youlai/mall/product/model/query/{AttributeGroupPageQuery.java => AttrGroupPageQuery.java} (68%) delete mode 100644 mall-product/product-boot/src/main/java/com/youlai/mall/product/model/query/AttributePageQuery.java create mode 100644 mall-product/product-boot/src/main/java/com/youlai/mall/product/model/vo/AttrGroupPageVO.java delete mode 100644 mall-product/product-boot/src/main/java/com/youlai/mall/product/model/vo/AttrPageVO.java delete mode 100644 mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/SmsCouponHistoryService.java delete mode 100644 mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/SmsCouponSpuCategoryService.java delete mode 100644 mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/SmsCouponSpuService.java delete mode 100644 mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/impl/SmsCouponHistoryServiceImpl.java delete mode 100644 mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/impl/SmsCouponSpuCategoryServiceImpl.java delete mode 100644 mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/impl/SmsCouponSpuServiceImpl.java delete mode 100644 mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/convert/AddressConvert.java delete mode 100644 mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/convert/CartConverter.java diff --git a/README.md b/README.md index f5f0fd73a..18f861127 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ youlai-mall ├── sql # SQL脚本 ├── mysql5 # MySQL5脚本 ├── mysql8 # MySQL8脚本 -├── mall-sms # 营销服务(Sales Management Service) +├── mall-marketing # 营销服务(Sales Management Service) ├── sms-api # 营销服务-Feign客户端 ├── sms-boot # 营销服务-启动应用 ├── mall-product # 商品服务(Product Management Service) @@ -76,9 +76,9 @@ youlai-mall ├── product-boot # 商品服务-启动应用 ├── mall-order # 订单服务(Order Management Service) ├── order-boot # 订单服务-启动应用 -├── mall-ums # 会员服务(User Management Service) - ├── ums-api # 会员服务-Feign客户端 - ├── ums-boot # 会员服务-启动应用 +├── mall-member # 会员服务(User Management Service) + ├── member-api # 会员服务-Feign客户端 + ├── member-boot # 会员服务-启动应用 ├── youlai-auth # 认证授权中心 ├── youlai-common # 公共模块 ├── common-core # 基础依赖 diff --git a/docs/sql/mysql5/youlai_system.sql b/docs/sql/mysql5/youlai_system.sql index b2e7701da..2c9c7566e 100644 --- a/docs/sql/mysql5/youlai_system.sql +++ b/docs/sql/mysql5/youlai_system.sql @@ -115,8 +115,8 @@ INSERT INTO `sys_menu` VALUES (11, 0, 1, '商品管理', '/product', 'Layout', N INSERT INTO `sys_menu` VALUES (12, 11, 1, '商品列表', 'goods', 'product/goods/index', NULL, 'goods-list', 1, 1, NULL, NULL, NULL, 1, '2021-08-28 09:12:21', '2021-08-28 09:12:21'); INSERT INTO `sys_menu` VALUES (13, 0, 2, '订单管理', '/oms', 'Layout', NULL, 'el-icon-ShoppingCart', 3, 1, '/oms/order', '0', 1, 1, '2021-08-28 09:12:21', '2024-03-03 23:52:32'); INSERT INTO `sys_menu` VALUES (14, 13, 1, '订单列表', 'order', 'oms/order/index', NULL, 'el-icon-Document', 1, 1, NULL, 'null,13', NULL, 1, '2021-08-28 09:12:21', '2024-03-03 23:45:09'); -INSERT INTO `sys_menu` VALUES (15, 0, 1, '会员管理', '/ums', 'Layout', NULL, 'user', 4, 1, '/ums/member', NULL, NULL, 1, '2021-08-28 09:12:21', '2021-08-28 09:12:21'); -INSERT INTO `sys_menu` VALUES (16, 15, 1, '会员列表', 'member', 'ums/member/index', NULL, 'peoples', 1, 1, NULL, NULL, NULL, 1, '2021-08-28 09:12:21', '2021-08-28 09:12:21'); +INSERT INTO `sys_menu` VALUES (15, 0, 1, '会员管理', '/member', 'Layout', NULL, 'user', 4, 1, '/member/member', NULL, NULL, 1, '2021-08-28 09:12:21', '2021-08-28 09:12:21'); +INSERT INTO `sys_menu` VALUES (16, 15, 1, '会员列表', 'member', 'member/member/index', NULL, 'peoples', 1, 1, NULL, NULL, NULL, 1, '2021-08-28 09:12:21', '2021-08-28 09:12:21'); INSERT INTO `sys_menu` VALUES (17, 11, 1, '品牌管理', 'brand', 'product/brand/index', NULL, 'brand', 5, 1, NULL, NULL, NULL, 1, '2021-08-28 09:12:21', '2021-08-28 09:12:21'); INSERT INTO `sys_menu` VALUES (18, 11, 1, '商品分类', 'category', 'product/category/index', NULL, 'menu', 3, 1, NULL, NULL, NULL, 1, '2021-08-28 09:12:21', '2021-08-28 09:12:21'); INSERT INTO `sys_menu` VALUES (19, 11, 1, '商品上架', 'goods-detail', 'product/goods/detail', NULL, 'publish', 2, 1, NULL, NULL, NULL, NULL, '2021-08-28 09:12:21', '2021-08-28 09:12:21'); diff --git a/docs/sql/mysql8/youlai_system.sql b/docs/sql/mysql8/youlai_system.sql index f081db125..7a9fbaadb 100644 --- a/docs/sql/mysql8/youlai_system.sql +++ b/docs/sql/mysql8/youlai_system.sql @@ -130,8 +130,8 @@ INSERT INTO `sys_menu` VALUES (11, 0, 1, '商品管理', '/product', 'Layout', N INSERT INTO `sys_menu` VALUES (12, 11, 1, '商品列表', 'goods', 'product/goods/index', NULL, 'goods-list', 1, 1, NULL, NULL, NULL, 1, NULL, '2021-08-28 09:12:21', '2021-08-28 09:12:21'); INSERT INTO `sys_menu` VALUES (13, 0, 2, '订单管理', '/oms', 'Layout', NULL, 'el-icon-ShoppingCart', 3, 1, '/oms/order', '0', 1, 1, NULL, '2021-08-28 09:12:21', '2024-03-03 23:52:32'); INSERT INTO `sys_menu` VALUES (14, 13, 1, '订单列表', 'order', 'oms/order/index', NULL, 'el-icon-Document', 1, 1, NULL, 'null,13', NULL, 1, NULL, '2021-08-28 09:12:21', '2024-03-03 23:45:09'); -INSERT INTO `sys_menu` VALUES (15, 0, 1, '会员管理', '/ums', 'Layout', NULL, 'user', 4, 1, '/ums/member', NULL, NULL, 1, NULL, '2021-08-28 09:12:21', '2021-08-28 09:12:21'); -INSERT INTO `sys_menu` VALUES (16, 15, 1, '会员列表', 'member', 'ums/member/index', NULL, 'peoples', 1, 1, NULL, NULL, NULL, 1, NULL, '2021-08-28 09:12:21', '2021-08-28 09:12:21'); +INSERT INTO `sys_menu` VALUES (15, 0, 1, '会员管理', '/member', 'Layout', NULL, 'user', 4, 1, '/member/member', NULL, NULL, 1, NULL, '2021-08-28 09:12:21', '2021-08-28 09:12:21'); +INSERT INTO `sys_menu` VALUES (16, 15, 1, '会员列表', 'member', 'member/member/index', NULL, 'peoples', 1, 1, NULL, NULL, NULL, 1, NULL, '2021-08-28 09:12:21', '2021-08-28 09:12:21'); INSERT INTO `sys_menu` VALUES (17, 11, 1, '品牌管理', 'brand', 'product/brand/index', NULL, 'brand', 5, 1, NULL, NULL, NULL, 1, NULL, '2021-08-28 09:12:21', '2021-08-28 09:12:21'); INSERT INTO `sys_menu` VALUES (18, 11, 1, '商品分类', 'category', 'product/category/index', NULL, 'menu', 3, 1, NULL, NULL, NULL, 1, NULL, '2021-08-28 09:12:21', '2021-08-28 09:12:21'); INSERT INTO `sys_menu` VALUES (19, 11, 1, '商品上架', 'goods-detail', 'product/goods/detail', NULL, 'publish', 2, 1, NULL, NULL, NULL, NULL, NULL, '2021-08-28 09:12:21', '2021-08-28 09:12:21'); diff --git a/mall-sms/sms-api/pom.xml b/mall-marketing/marketing-api/pom.xml similarity index 90% rename from mall-sms/sms-api/pom.xml rename to mall-marketing/marketing-api/pom.xml index e4264ef9b..9deb455d0 100644 --- a/mall-sms/sms-api/pom.xml +++ b/mall-marketing/marketing-api/pom.xml @@ -3,13 +3,13 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - mall-sms + mall-marketing com.youlai 3.2.1 4.0.0 - sms-api + marketing-api @@ -36,7 +36,7 @@ com.youlai - ums-api + member-api diff --git a/mall-sms/sms-api/src/main/java/com/youlai/mall/sms/api/app/CouponRecordFeignClient.java b/mall-marketing/marketing-api/src/main/java/com/youlai/mall/marketing/api/CouponRecordFeignClient.java similarity index 85% rename from mall-sms/sms-api/src/main/java/com/youlai/mall/sms/api/app/CouponRecordFeignClient.java rename to mall-marketing/marketing-api/src/main/java/com/youlai/mall/marketing/api/CouponRecordFeignClient.java index 51d53cdf4..080a447b0 100644 --- a/mall-sms/sms-api/src/main/java/com/youlai/mall/sms/api/app/CouponRecordFeignClient.java +++ b/mall-marketing/marketing-api/src/main/java/com/youlai/mall/marketing/api/CouponRecordFeignClient.java @@ -1,4 +1,4 @@ -package com.youlai.mall.sms.api.app; +package com.youlai.mall.marketing.api; import com.youlai.common.result.Result; import org.springframework.cloud.openfeign.FeignClient; @@ -8,12 +8,12 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; /** + * 优惠券领券记录APP端Feign接口 + * * @author huawei - * @desc 优惠券领券记录APP端Feign接口 - * @email huawei_code@163.com * @since 2021/3/17 */ -@FeignClient(value = "mall-sms") +@FeignClient(value = "mall-marketing") public interface CouponRecordFeignClient { @GetMapping("/api.app/v1/coupon_record/list") diff --git a/mall-sms/sms-boot/Dockerfile b/mall-marketing/marketing-boot/Dockerfile similarity index 100% rename from mall-sms/sms-boot/Dockerfile rename to mall-marketing/marketing-boot/Dockerfile diff --git a/mall-sms/sms-boot/pom.xml b/mall-marketing/marketing-boot/pom.xml similarity index 94% rename from mall-sms/sms-boot/pom.xml rename to mall-marketing/marketing-boot/pom.xml index cc4f118ef..abb7e68dc 100644 --- a/mall-sms/sms-boot/pom.xml +++ b/mall-marketing/marketing-boot/pom.xml @@ -3,13 +3,13 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - mall-sms + mall-marketing com.youlai 3.2.1 4.0.0 - sms-boot + marketing-boot 8804 @@ -55,7 +55,7 @@ com.youlai - sms-api + marketing-api diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/SmsApplication.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/MarketingApplication.java similarity index 88% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/SmsApplication.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/MarketingApplication.java index 2c40ac997..d5711020e 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/SmsApplication.java +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/MarketingApplication.java @@ -16,9 +16,9 @@ import org.springframework.scheduling.annotation.EnableScheduling; @EnableDiscoveryClient @EnableFeignClients @EnableScheduling -public class SmsApplication { +public class MarketingApplication { public static void main(String[] args) { - SpringApplication.run(SmsApplication.class, args); + SpringApplication.run(MarketingApplication.class, args); } } diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/admin/SmsAdvertController.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/controller/admin/AdvertController.java similarity index 68% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/admin/SmsAdvertController.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/controller/admin/AdvertController.java index d132e08eb..f9803a904 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/admin/SmsAdvertController.java +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/controller/admin/AdvertController.java @@ -5,9 +5,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.youlai.common.result.PageResult; import com.youlai.common.result.Result; -import com.youlai.mall.sms.model.entity.SmsAdvert; +import com.youlai.mall.sms.model.entity.Advert; import com.youlai.mall.sms.model.query.AdvertPageQuery; -import com.youlai.mall.sms.service.SmsAdvertService; +import com.youlai.mall.sms.service.AdvertService; import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -20,13 +20,13 @@ import java.util.Arrays; @RestController @RequestMapping("/api/v1/adverts") @RequiredArgsConstructor -public class SmsAdvertController { +public class AdvertController { - private final SmsAdvertService smsAdvertService; + private final AdvertService advertService; @Operation(summary= "广告分页列表") @GetMapping("/page") - public PageResult getAdvertPage(AdvertPageQuery queryParams) { + public PageResult getAdvertPage(AdvertPageQuery queryParams) { // 查询参数 int pageNum = queryParams.getPageNum(); @@ -34,11 +34,11 @@ public class SmsAdvertController { String keywords = queryParams.getKeywords(); // 分页查询 - Page result = smsAdvertService.page( + Page result = advertService.page( new Page<>(pageNum, pageSize), - new LambdaQueryWrapper() - .like(StrUtil.isNotBlank(keywords), SmsAdvert::getTitle, keywords) - .orderByAsc(SmsAdvert::getSort) + new LambdaQueryWrapper() + .like(StrUtil.isNotBlank(keywords), Advert::getTitle, keywords) + .orderByAsc(Advert::getSort) ); return PageResult.success(result); } @@ -48,14 +48,14 @@ public class SmsAdvertController { public Result getAdvertDetail( @Parameter(description = "广告ID") @PathVariable Long id ) { - SmsAdvert advert = smsAdvertService.getById(id); + Advert advert = advertService.getById(id); return Result.success(advert); } @Operation(summary= "新增广告") @PostMapping - public Result addAvert(@RequestBody SmsAdvert advert) { - boolean status = smsAdvertService.save(advert); + public Result addAvert(@RequestBody Advert advert) { + boolean status = advertService.save(advert); return Result.judge(status); } @@ -63,15 +63,15 @@ public class SmsAdvertController { @PutMapping(value = "/{id}") public Result updateAdvert( @Parameter(description = "广告ID") @PathVariable Long id, - @RequestBody SmsAdvert advert) { - boolean status = smsAdvertService.updateById(advert); + @RequestBody Advert advert) { + boolean status = advertService.updateById(advert); return Result.judge(status); } @Operation(summary= "删除广告") @DeleteMapping("/{ids}") public Result deleteAdverts(@Parameter(description = "广告ID,多个以英文逗号(,)分割") @PathVariable("ids") String ids) { - boolean status = smsAdvertService.removeByIds(Arrays.asList(ids.split(","))); + boolean status = advertService.removeByIds(Arrays.asList(ids.split(","))); return Result.judge(status); diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/admin/SmsCouponController.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/controller/admin/CouponController.java similarity index 94% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/admin/SmsCouponController.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/controller/admin/CouponController.java index 86844105a..5dc7f1aeb 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/admin/SmsCouponController.java +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/controller/admin/CouponController.java @@ -6,7 +6,7 @@ import com.youlai.common.result.Result; import com.youlai.mall.sms.model.form.CouponForm; import com.youlai.mall.sms.model.query.CouponPageQuery; import com.youlai.mall.sms.model.vo.CouponPageVO; -import com.youlai.mall.sms.service.SmsCouponService; +import com.youlai.mall.sms.service.CouponService; import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -19,9 +19,9 @@ import jakarta.validation.Valid; @RestController @RequestMapping("/api/v1/coupons") @RequiredArgsConstructor -public class SmsCouponController { +public class CouponController { - private final SmsCouponService couponService; + private final CouponService couponService; @Operation(summary= "优惠券分页列表") @GetMapping("/pages") diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/app/AdvertController.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/controller/app/AdvertAppController.java similarity index 80% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/app/AdvertController.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/controller/app/AdvertAppController.java index 8e4d647fe..361023e50 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/controller/app/AdvertController.java +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/controller/app/AdvertAppController.java @@ -2,7 +2,7 @@ package com.youlai.mall.sms.controller.app; import com.youlai.common.result.Result; import com.youlai.mall.sms.model.vo.BannerVO; -import com.youlai.mall.sms.service.SmsAdvertService; +import com.youlai.mall.sms.service.AdvertService; import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Operation; import lombok.AllArgsConstructor; @@ -18,13 +18,13 @@ import java.util.List; @RequestMapping("/app-api/v1/adverts") @Slf4j @AllArgsConstructor -public class AdvertController { +public class AdvertAppController { - private SmsAdvertService smsAdvertService; + private AdvertService advertService; @Operation(summary= "APP首页广告横幅列表") @GetMapping("/banners") public Result> getBannerList() { - List list = smsAdvertService.getBannerList(); + List list = advertService.getBannerList(); return Result.success(list); } } diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/converter/AdvertConverter.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/converter/AdvertConverter.java similarity index 60% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/converter/AdvertConverter.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/converter/AdvertConverter.java index f2970e384..b289a0d6b 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/converter/AdvertConverter.java +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/converter/AdvertConverter.java @@ -2,7 +2,7 @@ package com.youlai.mall.sms.converter; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.youlai.mall.sms.model.entity.SmsAdvert; +import com.youlai.mall.sms.model.entity.Advert; import com.youlai.mall.sms.model.vo.BannerVO; import com.youlai.mall.sms.model.vo.AdvertPageVO; import org.mapstruct.Mapper; @@ -18,11 +18,11 @@ import java.util.List; @Mapper(componentModel = "spring") public interface AdvertConverter { - AdvertPageVO entity2PageVo(SmsAdvert entity); + AdvertPageVO entity2PageVo(Advert entity); - Page entity2PageVo(Page po); + Page entity2PageVo(Page po); - BannerVO entity2BannerVo(SmsAdvert entity); + BannerVO entity2BannerVo(Advert entity); - List entity2BannerVo(List entities); + List entity2BannerVo(List entities); } \ No newline at end of file diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/converter/CouponConverter.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/converter/CouponConverter.java similarity index 87% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/converter/CouponConverter.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/converter/CouponConverter.java index b6ece536e..e45768d39 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/converter/CouponConverter.java +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/converter/CouponConverter.java @@ -1,7 +1,7 @@ package com.youlai.mall.sms.converter; -import com.youlai.mall.sms.model.entity.SmsCoupon; +import com.youlai.mall.sms.model.entity.Coupon; import com.youlai.mall.sms.model.form.CouponForm; import com.youlai.mall.sms.model.vo.CouponPageVO; import org.mapstruct.Mapper; @@ -29,20 +29,20 @@ public interface CouponConverter { ), @Mapping(target = "minPointLabel", expression = "java(cn.hutool.core.util.NumberUtil.toStr(cn.hutool.core.util.NumberUtil.div(entity.getMinPoint(),new java.math.BigDecimal(100)).setScale(2)))"), }) - CouponPageVO entity2PageVO(SmsCoupon entity); + CouponPageVO entity2PageVO(Coupon entity); - List entity2PageVO(List entities); + List entity2PageVO(List entities); @Mappings({ @Mapping(target = "discount",expression = "java(cn.hutool.core.util.NumberUtil.div(form.getDiscount(),10L))"), }) - SmsCoupon toEntity(CouponForm form); + Coupon toEntity(CouponForm form); @Mappings({ @Mapping(target = "discount",expression = "java(cn.hutool.core.util.NumberUtil.mul(entity.getDiscount(),10L))"), }) - CouponForm toForm(SmsCoupon entity); + CouponForm toForm(Coupon entity); } \ No newline at end of file diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/enums/CouponApplicationScopeEnum.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/enums/CouponApplicationScopeEnum.java similarity index 100% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/enums/CouponApplicationScopeEnum.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/enums/CouponApplicationScopeEnum.java diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/enums/CouponFaceValueTypeEnum.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/enums/CouponFaceValueTypeEnum.java similarity index 100% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/enums/CouponFaceValueTypeEnum.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/enums/CouponFaceValueTypeEnum.java diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/enums/CouponTypeEnum.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/enums/CouponTypeEnum.java similarity index 100% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/enums/CouponTypeEnum.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/enums/CouponTypeEnum.java diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/enums/PlatformEnum.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/enums/PlatformEnum.java similarity index 100% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/enums/PlatformEnum.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/enums/PlatformEnum.java diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/enums/ValidityPeriodTypeEnum.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/enums/ValidityPeriodTypeEnum.java similarity index 100% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/enums/ValidityPeriodTypeEnum.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/enums/ValidityPeriodTypeEnum.java diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/mapper/SmsAdvertMapper.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/mapper/AdvertMapper.java similarity index 65% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/mapper/SmsAdvertMapper.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/mapper/AdvertMapper.java index f87fd655b..cd1fbcab5 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/mapper/SmsAdvertMapper.java +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/mapper/AdvertMapper.java @@ -2,12 +2,12 @@ package com.youlai.mall.sms.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.youlai.mall.sms.model.entity.SmsAdvert; +import com.youlai.mall.sms.model.entity.Advert; import com.youlai.mall.sms.model.query.AdvertPageQuery; import org.apache.ibatis.annotations.Mapper; @Mapper -public interface SmsAdvertMapper extends BaseMapper { +public interface AdvertMapper extends BaseMapper { /** * 广告分页列表 @@ -16,5 +16,5 @@ public interface SmsAdvertMapper extends BaseMapper { * @param queryParams * @return */ - Page getAdvertPage(Page page, AdvertPageQuery queryParams); + Page getAdvertPage(Page page, AdvertPageQuery queryParams); } diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/mapper/SmsCouponHistoryMapper.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/mapper/CouponHistoryMapper.java similarity index 53% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/mapper/SmsCouponHistoryMapper.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/mapper/CouponHistoryMapper.java index 796f69d09..c05463f32 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/mapper/SmsCouponHistoryMapper.java +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/mapper/CouponHistoryMapper.java @@ -1,12 +1,12 @@ package com.youlai.mall.sms.mapper; -import com.youlai.mall.sms.model.entity.SmsCouponHistory; +import com.youlai.mall.sms.model.entity.CouponHistory; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; @Mapper -public interface SmsCouponHistoryMapper extends BaseMapper { +public interface CouponHistoryMapper extends BaseMapper { } diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/mapper/SmsCouponMapper.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/mapper/CouponMapper.java similarity index 63% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/mapper/SmsCouponMapper.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/mapper/CouponMapper.java index e049e9738..d20ca9982 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/mapper/SmsCouponMapper.java +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/mapper/CouponMapper.java @@ -1,7 +1,7 @@ package com.youlai.mall.sms.mapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.youlai.mall.sms.model.entity.SmsCoupon; +import com.youlai.mall.sms.model.entity.Coupon; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.youlai.mall.sms.model.query.CouponPageQuery; import com.youlai.mall.sms.model.vo.CouponPageVO; @@ -11,9 +11,9 @@ import java.util.List; @Mapper -public interface SmsCouponMapper extends BaseMapper { +public interface CouponMapper extends BaseMapper { - List getCouponPage(Page page, CouponPageQuery queryParams); + List getCouponPage(Page page, CouponPageQuery queryParams); } diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/mapper/SmsCouponSpuCategoryMapper.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/mapper/CouponSpuCategoryMapper.java similarity index 61% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/mapper/SmsCouponSpuCategoryMapper.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/mapper/CouponSpuCategoryMapper.java index ec7c5ca68..8849b916f 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/mapper/SmsCouponSpuCategoryMapper.java +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/mapper/CouponSpuCategoryMapper.java @@ -1,6 +1,6 @@ package com.youlai.mall.sms.mapper; -import com.youlai.mall.sms.model.entity.SmsCouponSpuCategory; +import com.youlai.mall.sms.model.entity.CouponSpuCategory; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; @@ -11,7 +11,7 @@ import org.apache.ibatis.annotations.Mapper; * @since 2022/6/30 */ @Mapper -public interface SmsCouponSpuCategoryMapper extends BaseMapper { +public interface CouponSpuCategoryMapper extends BaseMapper { } diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/mapper/SmsCouponSpuMapper.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/mapper/CouponSpuMapper.java similarity index 65% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/mapper/SmsCouponSpuMapper.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/mapper/CouponSpuMapper.java index c9a85ece1..908225c17 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/mapper/SmsCouponSpuMapper.java +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/mapper/CouponSpuMapper.java @@ -1,6 +1,6 @@ package com.youlai.mall.sms.mapper; -import com.youlai.mall.sms.model.entity.SmsCouponSpu; +import com.youlai.mall.sms.model.entity.CouponSpu; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; @@ -11,7 +11,7 @@ import org.apache.ibatis.annotations.Mapper; * @since 2022/6/30 */ @Mapper -public interface SmsCouponSpuMapper extends BaseMapper { +public interface CouponSpuMapper extends BaseMapper { } diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsAdvert.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/entity/Advert.java similarity index 76% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsAdvert.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/entity/Advert.java index 0a49be8ac..8df31d356 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsAdvert.java +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/entity/Advert.java @@ -1,5 +1,6 @@ package com.youlai.mall.sms.model.entity; +import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import com.youlai.common.base.BaseEntity; import lombok.Data; @@ -14,14 +15,15 @@ import java.util.Date; * @since 2024/6/7 */ @EqualsAndHashCode(callSuper = true) +@TableName("sms_advert") @Data -public class SmsAdvert extends BaseEntity { +public class Advert extends BaseEntity { private String title; private String imageUrl; - @JsonFormat( pattern = "yyyy-MM-dd", timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date startTime; @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @@ -40,7 +42,7 @@ public class SmsAdvert extends BaseEntity { /** * 跳转URL */ - private String redirectUrl; + private String redirectUrl; private String remark; diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsCoupon.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/entity/Coupon.java similarity index 90% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsCoupon.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/entity/Coupon.java index 0554dc411..50b33848a 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsCoupon.java +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/entity/Coupon.java @@ -18,9 +18,9 @@ import java.util.Date; * @since 2024/6/7 */ @EqualsAndHashCode(callSuper = true) -@TableName +@TableName("sms_coupon") @Data -public class SmsCoupon extends BaseEntity { +public class Coupon extends BaseEntity { /** * ID */ @@ -85,7 +85,7 @@ public class SmsCoupon extends BaseEntity { /** * 有效期起始时间 */ - private Date validityBeginTime; + private Date validityStartTime; /** * 有效期截止时间 @@ -117,10 +117,4 @@ public class SmsCoupon extends BaseEntity { */ private String remark; - /** - * 逻辑删除标识(0:正常;1:删除) - */ - @TableLogic(value = "0", delval = "1") - private Integer deleted; - } \ No newline at end of file diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsCouponHistory.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/entity/CouponHistory.java similarity index 93% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsCouponHistory.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/entity/CouponHistory.java index 6c40aeeed..395d3a7c2 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsCouponHistory.java +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/entity/CouponHistory.java @@ -8,12 +8,11 @@ import java.util.Date; import lombok.Data; /** - * - * @TableName sms_coupon_history + * 优惠券领取历史记录 */ @TableName(value ="sms_coupon_history") @Data -public class SmsCouponHistory implements Serializable { +public class CouponHistory implements Serializable { /** * */ diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsCouponSpu.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/entity/CouponSpu.java similarity index 89% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsCouponSpu.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/entity/CouponSpu.java index 4a2eb57b5..f97775487 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsCouponSpu.java +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/entity/CouponSpu.java @@ -10,13 +10,13 @@ import lombok.experimental.Accessors; import java.io.Serializable; /** - * - * @TableName sms_coupon_spu + * 优惠券与产品关联表 */ + @TableName(value ="sms_coupon_spu") @Data @Accessors(chain = true) -public class SmsCouponSpu implements Serializable { +public class CouponSpu implements Serializable { /** * */ diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsCouponSpuCategory.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/entity/CouponSpuCategory.java similarity index 92% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsCouponSpuCategory.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/entity/CouponSpuCategory.java index cefc8be6a..55f1283a3 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/entity/SmsCouponSpuCategory.java +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/entity/CouponSpuCategory.java @@ -12,7 +12,7 @@ import java.io.Serializable; @TableName(value ="sms_coupon_spu_category") @Data @Accessors(chain = true) -public class SmsCouponSpuCategory implements Serializable { +public class CouponSpuCategory implements Serializable { /** * */ diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/form/CouponForm.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/form/CouponForm.java similarity index 100% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/form/CouponForm.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/form/CouponForm.java diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/query/AdvertPageQuery.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/query/AdvertPageQuery.java similarity index 100% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/query/AdvertPageQuery.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/query/AdvertPageQuery.java diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/query/CouponPageQuery.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/query/CouponPageQuery.java similarity index 100% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/query/CouponPageQuery.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/query/CouponPageQuery.java diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/vo/AdvertPageVO.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/vo/AdvertPageVO.java similarity index 100% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/vo/AdvertPageVO.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/vo/AdvertPageVO.java diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/vo/BannerVO.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/vo/BannerVO.java similarity index 100% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/vo/BannerVO.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/vo/BannerVO.java diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/vo/CouponPageVO.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/vo/CouponPageVO.java similarity index 100% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/model/vo/CouponPageVO.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/model/vo/CouponPageVO.java diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/SmsAdvertService.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/AdvertService.java similarity index 82% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/SmsAdvertService.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/AdvertService.java index c32af1b14..aa3aff8ce 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/SmsAdvertService.java +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/AdvertService.java @@ -2,14 +2,14 @@ package com.youlai.mall.sms.service; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; -import com.youlai.mall.sms.model.entity.SmsAdvert; +import com.youlai.mall.sms.model.entity.Advert; import com.youlai.mall.sms.model.query.AdvertPageQuery; import com.youlai.mall.sms.model.vo.BannerVO; import com.youlai.mall.sms.model.vo.AdvertPageVO; import java.util.List; -public interface SmsAdvertService extends IService { +public interface AdvertService extends IService { /** * 广告分页列表 diff --git a/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/CouponHistoryService.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/CouponHistoryService.java new file mode 100644 index 000000000..32ecde00f --- /dev/null +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/CouponHistoryService.java @@ -0,0 +1,11 @@ +package com.youlai.mall.sms.service; + +import com.youlai.mall.sms.model.entity.CouponHistory; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * + */ +public interface CouponHistoryService extends IService { + +} diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/SmsCouponService.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/CouponService.java similarity index 91% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/SmsCouponService.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/CouponService.java index 12e203914..2eb6d3454 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/SmsCouponService.java +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/CouponService.java @@ -1,7 +1,7 @@ package com.youlai.mall.sms.service; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.youlai.mall.sms.model.entity.SmsCoupon; +import com.youlai.mall.sms.model.entity.Coupon; import com.baomidou.mybatisplus.extension.service.IService; import com.youlai.mall.sms.model.form.CouponForm; import com.youlai.mall.sms.model.query.CouponPageQuery; @@ -13,7 +13,7 @@ import com.youlai.mall.sms.model.vo.CouponPageVO; * @author Ray * @since 2022/5/29 */ -public interface SmsCouponService extends IService { +public interface CouponService extends IService { /** * 优惠券分页列表 diff --git a/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/CouponSpuCategoryService.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/CouponSpuCategoryService.java new file mode 100644 index 000000000..3d3a8a84a --- /dev/null +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/CouponSpuCategoryService.java @@ -0,0 +1,11 @@ +package com.youlai.mall.sms.service; + +import com.youlai.mall.sms.model.entity.CouponSpuCategory; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * + */ +public interface CouponSpuCategoryService extends IService { + +} diff --git a/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/CouponSpuService.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/CouponSpuService.java new file mode 100644 index 000000000..ce6441a10 --- /dev/null +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/CouponSpuService.java @@ -0,0 +1,11 @@ +package com.youlai.mall.sms.service; + +import com.youlai.mall.sms.model.entity.CouponSpu; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * + */ +public interface CouponSpuService extends IService { + +} diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/impl/SmsAdvertServiceImpl.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/impl/AdvertServiceImpl.java similarity index 68% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/impl/SmsAdvertServiceImpl.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/impl/AdvertServiceImpl.java index 826191477..024161ddb 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/impl/SmsAdvertServiceImpl.java +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/impl/AdvertServiceImpl.java @@ -5,12 +5,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.youlai.common.enums.StatusEnum; import com.youlai.mall.sms.converter.AdvertConverter; -import com.youlai.mall.sms.model.entity.SmsAdvert; -import com.youlai.mall.sms.mapper.SmsAdvertMapper; +import com.youlai.mall.sms.model.entity.Advert; +import com.youlai.mall.sms.mapper.AdvertMapper; import com.youlai.mall.sms.model.query.AdvertPageQuery; import com.youlai.mall.sms.model.vo.BannerVO; import com.youlai.mall.sms.model.vo.AdvertPageVO; -import com.youlai.mall.sms.service.SmsAdvertService; +import com.youlai.mall.sms.service.AdvertService; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @@ -24,7 +24,7 @@ import java.util.List; */ @Service @RequiredArgsConstructor -public class SmsAdvertServiceImpl extends ServiceImpl implements SmsAdvertService { +public class AdvertServiceImpl extends ServiceImpl implements AdvertService { private final AdvertConverter advertConverter; @@ -36,7 +36,7 @@ public class SmsAdvertServiceImpl extends ServiceImpl getAdvertPage(AdvertPageQuery queryParams) { - Page page = this.baseMapper.getAdvertPage(new Page<>(queryParams.getPageNum(), + Page page = this.baseMapper.getAdvertPage(new Page<>(queryParams.getPageNum(), queryParams.getPageSize()), queryParams); return advertConverter.entity2PageVo(page); @@ -48,9 +48,9 @@ public class SmsAdvertServiceImpl extends ServiceImpl getBannerList() { - List entities = this.list(new LambdaQueryWrapper(). - eq(SmsAdvert::getStatus, StatusEnum.ENABLE.getValue()) - .select(SmsAdvert::getTitle, SmsAdvert::getImageUrl, SmsAdvert::getRedirectUrl) + List entities = this.list(new LambdaQueryWrapper(). + eq(Advert::getStatus, StatusEnum.ENABLE.getValue()) + .select(Advert::getTitle, Advert::getImageUrl, Advert::getRedirectUrl) ); return advertConverter.entity2BannerVo(entities); } diff --git a/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/impl/CouponHistoryServiceImpl.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/impl/CouponHistoryServiceImpl.java new file mode 100644 index 000000000..738b2217b --- /dev/null +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/impl/CouponHistoryServiceImpl.java @@ -0,0 +1,20 @@ +package com.youlai.mall.sms.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.youlai.mall.sms.model.entity.CouponHistory; +import com.youlai.mall.sms.service.CouponHistoryService; +import com.youlai.mall.sms.mapper.CouponHistoryMapper; +import org.springframework.stereotype.Service; + +/** + * + */ +@Service +public class CouponHistoryServiceImpl extends ServiceImpl +implements CouponHistoryService { + +} + + + + diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/impl/SmsCouponServiceImpl.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/impl/CouponServiceImpl.java similarity index 66% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/impl/SmsCouponServiceImpl.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/impl/CouponServiceImpl.java index 24575147e..b524170dc 100644 --- a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/service/impl/SmsCouponServiceImpl.java +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/impl/CouponServiceImpl.java @@ -9,16 +9,16 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.youlai.common.base.IBaseEnum; import com.youlai.mall.sms.enums.CouponApplicationScopeEnum; import com.youlai.mall.sms.converter.CouponConverter; -import com.youlai.mall.sms.mapper.SmsCouponMapper; -import com.youlai.mall.sms.model.entity.SmsCoupon; -import com.youlai.mall.sms.model.entity.SmsCouponSpu; -import com.youlai.mall.sms.model.entity.SmsCouponSpuCategory; +import com.youlai.mall.sms.mapper.CouponMapper; +import com.youlai.mall.sms.model.entity.Coupon; +import com.youlai.mall.sms.model.entity.CouponSpu; +import com.youlai.mall.sms.model.entity.CouponSpuCategory; import com.youlai.mall.sms.model.form.CouponForm; import com.youlai.mall.sms.model.query.CouponPageQuery; import com.youlai.mall.sms.model.vo.CouponPageVO; -import com.youlai.mall.sms.service.SmsCouponService; -import com.youlai.mall.sms.service.SmsCouponSpuCategoryService; -import com.youlai.mall.sms.service.SmsCouponSpuService; +import com.youlai.mall.sms.service.CouponService; +import com.youlai.mall.sms.service.CouponSpuCategoryService; +import com.youlai.mall.sms.service.CouponSpuService; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -35,13 +35,13 @@ import java.util.stream.Collectors; */ @Service @RequiredArgsConstructor -public class SmsCouponServiceImpl extends ServiceImpl implements SmsCouponService { +public class CouponServiceImpl extends ServiceImpl implements CouponService { private final CouponConverter couponConverter; - private final SmsCouponSpuCategoryService smsCouponSpuCategoryService; + private final CouponSpuCategoryService couponSpuCategoryService; - private final SmsCouponSpuService smsCouponSpuService; + private final CouponSpuService couponSpuService; /** * 优惠券分页列表 @@ -53,7 +53,7 @@ public class SmsCouponServiceImpl extends ServiceImpl getCouponPage(CouponPageQuery queryParams) { Page page = new Page<>(queryParams.getPageNum(), queryParams.getPageSize()); // 查询数据 - List couponList = this.baseMapper.getCouponPage(page, queryParams); + List couponList = this.baseMapper.getCouponPage(page, queryParams); // 实体转换 List records = couponConverter.entity2PageVO(couponList); page.setRecords(records); @@ -68,7 +68,7 @@ public class SmsCouponServiceImpl extends ServiceImplform CouponForm couponForm = couponConverter.toForm(entity); @@ -78,17 +78,17 @@ public class SmsCouponServiceImpl extends ServiceImpl couponSpuCategoryList = smsCouponSpuCategoryService.list(new LambdaQueryWrapper() - .eq(SmsCouponSpuCategory::getCouponId, couponId) - .select(SmsCouponSpuCategory::getCategoryId) + List couponSpuCategoryList = couponSpuCategoryService.list(new LambdaQueryWrapper() + .eq(CouponSpuCategory::getCouponId, couponId) + .select(CouponSpuCategory::getCategoryId) ); List categoryIds = couponSpuCategoryList.stream().map(item -> item.getCategoryId()).collect(Collectors.toList()); couponForm.setSpuCategoryIds(categoryIds); break; case SPU: - List couponSpuList = smsCouponSpuService.list(new LambdaQueryWrapper() - .eq(SmsCouponSpu::getCouponId, couponId) - .select(SmsCouponSpu::getSpuId) + List couponSpuList = couponSpuService.list(new LambdaQueryWrapper() + .eq(CouponSpu::getCouponId, couponId) + .select(CouponSpu::getSpuId) ); List spuIds = couponSpuList.stream().map(item -> item.getSpuId()).collect(Collectors.toList()); couponForm.setSpuIds(spuIds); @@ -106,7 +106,7 @@ public class SmsCouponServiceImpl extends ServiceImpl spuCategoryIds = couponForm.getSpuCategoryIds(); if (CollectionUtil.isNotEmpty(spuCategoryIds)) { - List smsCouponSpuCategories = spuCategoryIds.stream() - .map(spuCategoryId -> new SmsCouponSpuCategory().setCouponId(couponId).setCategoryId(spuCategoryId)) + List smsCouponSpuCategories = spuCategoryIds.stream() + .map(spuCategoryId -> new CouponSpuCategory().setCouponId(couponId).setCategoryId(spuCategoryId)) .collect(Collectors.toList()); - smsCouponSpuCategoryService.saveBatch(smsCouponSpuCategories); + couponSpuCategoryService.saveBatch(smsCouponSpuCategories); } break; case SPU: List spuIds = couponForm.getSpuIds(); if (CollectionUtil.isNotEmpty(spuIds)) { - List smsCouponSpuList = spuIds.stream() - .map(spuId -> new SmsCouponSpu().setCouponId(couponId).setSpuId(spuId)) + List couponSpuList = spuIds.stream() + .map(spuId -> new CouponSpu().setCouponId(couponId).setSpuId(spuId)) .collect(Collectors.toList()); - smsCouponSpuService.saveBatch(smsCouponSpuList); + couponSpuService.saveBatch(couponSpuList); } break; } @@ -152,7 +152,7 @@ public class SmsCouponServiceImpl extends ServiceImpl() - .eq(SmsCouponSpuCategory::getCouponId, couponId) + couponSpuCategoryService.remove(new LambdaQueryWrapper() + .eq(CouponSpuCategory::getCouponId, couponId) ); - smsCouponSpuService.remove(new LambdaQueryWrapper() - .eq(SmsCouponSpu::getCouponId, couponId) + couponSpuService.remove(new LambdaQueryWrapper() + .eq(CouponSpu::getCouponId, couponId) ); break; case SPU_CATEGORY: List spuCategoryIds = couponForm.getSpuCategoryIds(); if (CollectionUtil.isNotEmpty(spuCategoryIds)) { - smsCouponSpuCategoryService.remove(new LambdaQueryWrapper() - .eq(SmsCouponSpuCategory::getCouponId, couponId) + couponSpuCategoryService.remove(new LambdaQueryWrapper() + .eq(CouponSpuCategory::getCouponId, couponId) ); - List smsCouponSpuCategories = spuCategoryIds.stream() - .map(spuCategoryId -> new SmsCouponSpuCategory().setCouponId(couponId) + List smsCouponSpuCategories = spuCategoryIds.stream() + .map(spuCategoryId -> new CouponSpuCategory().setCouponId(couponId) .setCategoryId(spuCategoryId)) .collect(Collectors.toList()); - smsCouponSpuCategoryService.saveBatch(smsCouponSpuCategories); + couponSpuCategoryService.saveBatch(smsCouponSpuCategories); } break; case SPU: List spuIds = couponForm.getSpuIds(); if (CollectionUtil.isNotEmpty(spuIds)) { - smsCouponSpuService.remove(new LambdaQueryWrapper() - .eq(SmsCouponSpu::getCouponId, couponId) + couponSpuService.remove(new LambdaQueryWrapper() + .eq(CouponSpu::getCouponId, couponId) ); - List smsCouponSpuList = spuIds.stream() - .map(spuId -> new SmsCouponSpu().setCouponId(couponId).setSpuId(spuId)) + List couponSpuList = spuIds.stream() + .map(spuId -> new CouponSpu().setCouponId(couponId).setSpuId(spuId)) .collect(Collectors.toList()); - smsCouponSpuService.saveBatch(smsCouponSpuList); + couponSpuService.saveBatch(couponSpuList); } break; } diff --git a/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/impl/CouponSpuCategoryServiceImpl.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/impl/CouponSpuCategoryServiceImpl.java new file mode 100644 index 000000000..ddd06a5a6 --- /dev/null +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/impl/CouponSpuCategoryServiceImpl.java @@ -0,0 +1,20 @@ +package com.youlai.mall.sms.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.youlai.mall.sms.model.entity.CouponSpuCategory; +import com.youlai.mall.sms.service.CouponSpuCategoryService; +import com.youlai.mall.sms.mapper.CouponSpuCategoryMapper; +import org.springframework.stereotype.Service; + +/** + * + */ +@Service +public class CouponSpuCategoryServiceImpl extends ServiceImpl +implements CouponSpuCategoryService { + +} + + + + diff --git a/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/impl/CouponSpuServiceImpl.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/impl/CouponSpuServiceImpl.java new file mode 100644 index 000000000..5ca86b25e --- /dev/null +++ b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/service/impl/CouponSpuServiceImpl.java @@ -0,0 +1,20 @@ +package com.youlai.mall.sms.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.youlai.mall.sms.model.entity.CouponSpu; +import com.youlai.mall.sms.service.CouponSpuService; +import com.youlai.mall.sms.mapper.CouponSpuMapper; +import org.springframework.stereotype.Service; + +/** + * + */ +@Service +public class CouponSpuServiceImpl extends ServiceImpl +implements CouponSpuService { + +} + + + + diff --git a/mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/util/CouponUtils.java b/mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/util/CouponUtils.java similarity index 100% rename from mall-sms/sms-boot/src/main/java/com/youlai/mall/sms/util/CouponUtils.java rename to mall-marketing/marketing-boot/src/main/java/com/youlai/mall/sms/util/CouponUtils.java diff --git a/mall-sms/sms-boot/src/main/resources/bootstrap-dev.yml b/mall-marketing/marketing-boot/src/main/resources/bootstrap-dev.yml similarity index 100% rename from mall-sms/sms-boot/src/main/resources/bootstrap-dev.yml rename to mall-marketing/marketing-boot/src/main/resources/bootstrap-dev.yml diff --git a/mall-sms/sms-boot/src/main/resources/bootstrap-prod.yml b/mall-marketing/marketing-boot/src/main/resources/bootstrap-prod.yml similarity index 100% rename from mall-sms/sms-boot/src/main/resources/bootstrap-prod.yml rename to mall-marketing/marketing-boot/src/main/resources/bootstrap-prod.yml diff --git a/mall-ums/ums-boot/src/main/resources/bootstrap.yml b/mall-marketing/marketing-boot/src/main/resources/bootstrap.yml similarity index 66% rename from mall-ums/ums-boot/src/main/resources/bootstrap.yml rename to mall-marketing/marketing-boot/src/main/resources/bootstrap.yml index 5131bdfcc..8dbb58c87 100644 --- a/mall-ums/ums-boot/src/main/resources/bootstrap.yml +++ b/mall-marketing/marketing-boot/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ spring: application: - name: mall-ums + name: mall-marketing profiles: active: dev + diff --git a/mall-sms/sms-boot/src/main/resources/mapper/SmsAdvertMapper.xml b/mall-marketing/marketing-boot/src/main/resources/mapper/AdvertMapper.xml similarity index 87% rename from mall-sms/sms-boot/src/main/resources/mapper/SmsAdvertMapper.xml rename to mall-marketing/marketing-boot/src/main/resources/mapper/AdvertMapper.xml index 63a6fd0ed..9838842a3 100644 --- a/mall-sms/sms-boot/src/main/resources/mapper/SmsAdvertMapper.xml +++ b/mall-marketing/marketing-boot/src/main/resources/mapper/AdvertMapper.xml @@ -2,10 +2,10 @@ - + - SELECT * FROM diff --git a/mall-sms/sms-boot/src/main/resources/mapper/SmsCouponHistoryMapper.xml b/mall-marketing/marketing-boot/src/main/resources/mapper/CouponHistoryMapper.xml similarity index 93% rename from mall-sms/sms-boot/src/main/resources/mapper/SmsCouponHistoryMapper.xml rename to mall-marketing/marketing-boot/src/main/resources/mapper/CouponHistoryMapper.xml index e1086c5cc..c1b5fcfb5 100644 --- a/mall-sms/sms-boot/src/main/resources/mapper/SmsCouponHistoryMapper.xml +++ b/mall-marketing/marketing-boot/src/main/resources/mapper/CouponHistoryMapper.xml @@ -2,9 +2,9 @@ - + - + diff --git a/mall-sms/sms-boot/src/main/resources/mapper/SmsCouponMapper.xml b/mall-marketing/marketing-boot/src/main/resources/mapper/CouponMapper.xml similarity index 80% rename from mall-sms/sms-boot/src/main/resources/mapper/SmsCouponMapper.xml rename to mall-marketing/marketing-boot/src/main/resources/mapper/CouponMapper.xml index 5a6ae2e3d..5c9079eb7 100644 --- a/mall-sms/sms-boot/src/main/resources/mapper/SmsCouponMapper.xml +++ b/mall-marketing/marketing-boot/src/main/resources/mapper/CouponMapper.xml @@ -2,10 +2,10 @@ - + - SELECT * FROM diff --git a/mall-sms/sms-boot/src/main/resources/mapper/SmsCouponSpuCategoryMapper.xml b/mall-marketing/marketing-boot/src/main/resources/mapper/CouponSpuCategoryMapper.xml similarity index 70% rename from mall-sms/sms-boot/src/main/resources/mapper/SmsCouponSpuCategoryMapper.xml rename to mall-marketing/marketing-boot/src/main/resources/mapper/CouponSpuCategoryMapper.xml index 864e6ed5c..7f83143f1 100644 --- a/mall-sms/sms-boot/src/main/resources/mapper/SmsCouponSpuCategoryMapper.xml +++ b/mall-marketing/marketing-boot/src/main/resources/mapper/CouponSpuCategoryMapper.xml @@ -2,7 +2,7 @@ - + diff --git a/mall-sms/sms-boot/src/main/resources/mapper/SmsCouponSpuMapper.xml b/mall-marketing/marketing-boot/src/main/resources/mapper/CouponSpuMapper.xml similarity index 87% rename from mall-sms/sms-boot/src/main/resources/mapper/SmsCouponSpuMapper.xml rename to mall-marketing/marketing-boot/src/main/resources/mapper/CouponSpuMapper.xml index 8e0f5da5a..e037ddc18 100644 --- a/mall-sms/sms-boot/src/main/resources/mapper/SmsCouponSpuMapper.xml +++ b/mall-marketing/marketing-boot/src/main/resources/mapper/CouponSpuMapper.xml @@ -2,9 +2,9 @@ - + - + diff --git a/mall-sms/sms-boot/src/test/java/com/youlai/mall/sms/SmsApplicationTest.java b/mall-marketing/marketing-boot/src/test/java/com/youlai/mall/sms/MarketingApplicationTest.java similarity index 86% rename from mall-sms/sms-boot/src/test/java/com/youlai/mall/sms/SmsApplicationTest.java rename to mall-marketing/marketing-boot/src/test/java/com/youlai/mall/sms/MarketingApplicationTest.java index 03de2b28e..0b400249c 100644 --- a/mall-sms/sms-boot/src/test/java/com/youlai/mall/sms/SmsApplicationTest.java +++ b/mall-marketing/marketing-boot/src/test/java/com/youlai/mall/sms/MarketingApplicationTest.java @@ -9,7 +9,7 @@ import org.springframework.boot.test.context.SpringBootTest; * @since 2021/7/3 */ @SpringBootTest -public class SmsApplicationTest { +public class MarketingApplicationTest { @Test public void contestLoad(){ diff --git a/mall-sms/pom.xml b/mall-marketing/pom.xml similarity index 80% rename from mall-sms/pom.xml rename to mall-marketing/pom.xml index dc2101f0f..813f41b52 100644 --- a/mall-sms/pom.xml +++ b/mall-marketing/pom.xml @@ -9,12 +9,12 @@ 4.0.0 - mall-sms + mall-marketing pom - sms-api - sms-boot + marketing-api + marketing-boot diff --git a/mall-ums/ums-api/pom.xml b/mall-member/member-api/pom.xml similarity index 92% rename from mall-ums/ums-api/pom.xml rename to mall-member/member-api/pom.xml index 63fa441be..547ab9660 100644 --- a/mall-ums/ums-api/pom.xml +++ b/mall-member/member-api/pom.xml @@ -3,13 +3,13 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - mall-ums + mall-member com.youlai 3.2.1 4.0.0 - ums-api + member-api diff --git a/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/api/MemberFeignClient.java b/mall-member/member-api/src/main/java/com/youlai/mall/member/api/MemberFeignClient.java similarity index 83% rename from mall-ums/ums-api/src/main/java/com/youlai/mall/ums/api/MemberFeignClient.java rename to mall-member/member-api/src/main/java/com/youlai/mall/member/api/MemberFeignClient.java index a6e781c4e..45cdc7efc 100644 --- a/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/api/MemberFeignClient.java +++ b/mall-member/member-api/src/main/java/com/youlai/mall/member/api/MemberFeignClient.java @@ -1,11 +1,10 @@ -package com.youlai.mall.ums.api; +package com.youlai.mall.member.api; -import com.youlai.common.result.Result; import com.youlai.common.web.config.FeignDecoderConfig; -import com.youlai.mall.ums.dto.CartItemDTO; -import com.youlai.mall.ums.dto.MemberAddressDTO; -import com.youlai.mall.ums.dto.MemberAuthDTO; -import com.youlai.mall.ums.dto.MemberRegisterDTO; +import com.youlai.mall.member.dto.CartItemDTO; +import com.youlai.mall.member.dto.MemberAddressDTO; +import com.youlai.mall.member.dto.MemberAuthDTO; +import com.youlai.mall.member.dto.MemberRegisterDTO; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.*; @@ -17,7 +16,7 @@ import java.util.List; * @author Ray * @since 2022/11/29 */ -@FeignClient(name = "mall-ums", contextId = "member", configuration = {FeignDecoderConfig.class}) +@FeignClient(name = "mall-member", contextId = "member", configuration = {FeignDecoderConfig.class}) public interface MemberFeignClient { /** diff --git a/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/dto/CartItemDTO.java b/mall-member/member-api/src/main/java/com/youlai/mall/member/dto/CartItemDTO.java similarity index 95% rename from mall-ums/ums-api/src/main/java/com/youlai/mall/ums/dto/CartItemDTO.java rename to mall-member/member-api/src/main/java/com/youlai/mall/member/dto/CartItemDTO.java index 31d0ebdf2..b8d49d233 100644 --- a/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/dto/CartItemDTO.java +++ b/mall-member/member-api/src/main/java/com/youlai/mall/member/dto/CartItemDTO.java @@ -1,4 +1,4 @@ -package com.youlai.mall.ums.dto; +package com.youlai.mall.member.dto; import lombok.Data; diff --git a/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/dto/MemberAddressDTO.java b/mall-member/member-api/src/main/java/com/youlai/mall/member/dto/MemberAddressDTO.java similarity index 92% rename from mall-ums/ums-api/src/main/java/com/youlai/mall/ums/dto/MemberAddressDTO.java rename to mall-member/member-api/src/main/java/com/youlai/mall/member/dto/MemberAddressDTO.java index cf11a723d..32a122882 100644 --- a/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/dto/MemberAddressDTO.java +++ b/mall-member/member-api/src/main/java/com/youlai/mall/member/dto/MemberAddressDTO.java @@ -1,4 +1,4 @@ -package com.youlai.mall.ums.dto; +package com.youlai.mall.member.dto; import lombok.Data; diff --git a/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/dto/MemberAuthDTO.java b/mall-member/member-api/src/main/java/com/youlai/mall/member/dto/MemberAuthDTO.java similarity index 92% rename from mall-ums/ums-api/src/main/java/com/youlai/mall/ums/dto/MemberAuthDTO.java rename to mall-member/member-api/src/main/java/com/youlai/mall/member/dto/MemberAuthDTO.java index 23e732c78..9d15c7040 100644 --- a/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/dto/MemberAuthDTO.java +++ b/mall-member/member-api/src/main/java/com/youlai/mall/member/dto/MemberAuthDTO.java @@ -1,4 +1,4 @@ -package com.youlai.mall.ums.dto; +package com.youlai.mall.member.dto; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/dto/MemberInfoDTO.java b/mall-member/member-api/src/main/java/com/youlai/mall/member/dto/MemberInfoDTO.java similarity index 85% rename from mall-ums/ums-api/src/main/java/com/youlai/mall/ums/dto/MemberInfoDTO.java rename to mall-member/member-api/src/main/java/com/youlai/mall/member/dto/MemberInfoDTO.java index 4ee7a2731..7a3a734c1 100644 --- a/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/dto/MemberInfoDTO.java +++ b/mall-member/member-api/src/main/java/com/youlai/mall/member/dto/MemberInfoDTO.java @@ -1,4 +1,4 @@ -package com.youlai.mall.ums.dto; +package com.youlai.mall.member.dto; import lombok.Data; diff --git a/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/dto/MemberRegisterDTO.java b/mall-member/member-api/src/main/java/com/youlai/mall/member/dto/MemberRegisterDTO.java similarity index 93% rename from mall-ums/ums-api/src/main/java/com/youlai/mall/ums/dto/MemberRegisterDTO.java rename to mall-member/member-api/src/main/java/com/youlai/mall/member/dto/MemberRegisterDTO.java index 7457b33bf..6558cd140 100644 --- a/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/dto/MemberRegisterDTO.java +++ b/mall-member/member-api/src/main/java/com/youlai/mall/member/dto/MemberRegisterDTO.java @@ -1,4 +1,4 @@ -package com.youlai.mall.ums.dto; +package com.youlai.mall.member.dto; import lombok.Data; diff --git a/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/dto/RechargeDTO.java b/mall-member/member-api/src/main/java/com/youlai/mall/member/dto/RechargeDTO.java similarity index 90% rename from mall-ums/ums-api/src/main/java/com/youlai/mall/ums/dto/RechargeDTO.java rename to mall-member/member-api/src/main/java/com/youlai/mall/member/dto/RechargeDTO.java index 4b3a4cba3..ce764e9e6 100644 --- a/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/dto/RechargeDTO.java +++ b/mall-member/member-api/src/main/java/com/youlai/mall/member/dto/RechargeDTO.java @@ -1,10 +1,8 @@ -package com.youlai.mall.ums.dto; +package com.youlai.mall.member.dto; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -import java.math.BigDecimal; - @Schema @Data public class RechargeDTO { diff --git a/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/dto/ResultPayDTO.java b/mall-member/member-api/src/main/java/com/youlai/mall/member/dto/ResultPayDTO.java similarity index 90% rename from mall-ums/ums-api/src/main/java/com/youlai/mall/ums/dto/ResultPayDTO.java rename to mall-member/member-api/src/main/java/com/youlai/mall/member/dto/ResultPayDTO.java index 32c2a6ab6..1d694ace0 100644 --- a/mall-ums/ums-api/src/main/java/com/youlai/mall/ums/dto/ResultPayDTO.java +++ b/mall-member/member-api/src/main/java/com/youlai/mall/member/dto/ResultPayDTO.java @@ -1,4 +1,4 @@ -package com.youlai.mall.ums.dto; +package com.youlai.mall.member.dto; import lombok.Data; diff --git a/mall-ums/ums-boot/Dockerfile b/mall-member/member-boot/Dockerfile similarity index 96% rename from mall-ums/ums-boot/Dockerfile rename to mall-member/member-boot/Dockerfile index ffb6f4614..8099eb4f3 100644 --- a/mall-ums/ums-boot/Dockerfile +++ b/mall-member/member-boot/Dockerfile @@ -14,7 +14,7 @@ RUN echo "https://mirrors.ustc.edu.cn/alpine/v3.7/main/" > /etc/apk/repositories VOLUME /tmp # 复制主机文件至镜像内,复制的目录需放置在 Dockerfile 文件同级目录下 -ADD target/ums-boot.jar app.jar +ADD target/member-boot.jar app.jar # 容器启动执行命令 CMD java \ diff --git a/mall-ums/ums-boot/pom.xml b/mall-member/member-boot/pom.xml similarity index 95% rename from mall-ums/ums-boot/pom.xml rename to mall-member/member-boot/pom.xml index 29f60e2ca..85d5ef99c 100644 --- a/mall-ums/ums-boot/pom.xml +++ b/mall-member/member-boot/pom.xml @@ -3,13 +3,13 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - mall-ums + mall-member com.youlai 3.2.1 4.0.0 - ums-boot + member-boot 8801 @@ -80,7 +80,7 @@ com.youlai - ums-api + member-api diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/UmsApplication.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/MemberApplication.java similarity index 78% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/UmsApplication.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/MemberApplication.java index 11370566a..a0932a7fd 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/UmsApplication.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/MemberApplication.java @@ -1,4 +1,4 @@ -package com.youlai.mall.ums; +package com.youlai.mall.member; import com.youlai.mall.product.api.SkuFeignClient; import org.springframework.boot.SpringApplication; @@ -9,8 +9,8 @@ import org.springframework.cloud.openfeign.EnableFeignClients; @SpringBootApplication @EnableDiscoveryClient() @EnableFeignClients(basePackageClasses = { SkuFeignClient.class}) -public class UmsApplication { +public class MemberApplication { public static void main(String[] args) { - SpringApplication.run(UmsApplication.class, args); + SpringApplication.run(MemberApplication.class, args); } } diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/admin/MemberController.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/controller/admin/MemberController.java similarity index 72% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/admin/MemberController.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/controller/admin/MemberController.java index 2afcb5883..84e5dca45 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/admin/MemberController.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/controller/admin/MemberController.java @@ -1,14 +1,14 @@ -package com.youlai.mall.ums.controller.admin; +package com.youlai.mall.member.controller.admin; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.youlai.common.constant.GlobalConstants; import com.youlai.common.result.PageResult; import com.youlai.common.result.Result; -import com.youlai.mall.ums.model.entity.UmsMember; -import com.youlai.mall.ums.model.query.MemberPageQuery; -import com.youlai.mall.ums.model.vo.MemberPageVO; -import com.youlai.mall.ums.service.UmsMemberService; +import com.youlai.mall.member.model.entity.Member; +import com.youlai.mall.member.model.query.MemberPageQuery; +import com.youlai.mall.member.model.vo.MemberPageVO; +import com.youlai.mall.member.service.MemberService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -24,7 +24,7 @@ import java.util.Arrays; @RequiredArgsConstructor public class MemberController { - private final UmsMemberService memberService; + private final MemberService memberService; @Operation(summary= "会员分页列表") @GetMapping("/page") @@ -37,7 +37,7 @@ public class MemberController { @PutMapping(value = "/{memberId}") public Result update( @Parameter(description = "会员ID") @PathVariable Long memberId, - @RequestBody UmsMember member + @RequestBody Member member ) { boolean status = memberService.updateById(member); return Result.judge(status); @@ -47,12 +47,12 @@ public class MemberController { @PatchMapping("/{memberId}/status") public Result updateMemberStatus( @Parameter(description = "会员ID") @PathVariable Long memberId, - @RequestBody UmsMember member + @RequestBody Member member ) { boolean status = memberService.update( - new LambdaUpdateWrapper() - .eq(UmsMember::getId, memberId) - .set(UmsMember::getStatus, member.getStatus()) + new LambdaUpdateWrapper() + .eq(Member::getId, memberId) + .set(Member::getStatus, member.getStatus()) ); return Result.judge(status); } @@ -62,9 +62,9 @@ public class MemberController { public Result delete( @Parameter(description = "会员ID,多个以英文逗号(,)拼接") @PathVariable String ids ) { - boolean status = memberService.update(new LambdaUpdateWrapper() - .in(UmsMember::getId, Arrays.asList(ids.split(","))) - .set(UmsMember::getIsDeleted, GlobalConstants.STATUS_YES)); + boolean status = memberService.update(new LambdaUpdateWrapper() + .in(Member::getId, Arrays.asList(ids.split(","))) + .set(Member::getIsDeleted, GlobalConstants.STATUS_YES)); return Result.judge(status); } diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/AppAddressController.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/controller/app/AddressController.java similarity index 79% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/AppAddressController.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/controller/app/AddressController.java index 4eef23846..c38207332 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/AppAddressController.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/controller/app/AddressController.java @@ -1,10 +1,10 @@ -package com.youlai.mall.ums.controller.app; +package com.youlai.mall.member.controller.app; import com.youlai.common.result.Result; -import com.youlai.mall.ums.dto.MemberAddressDTO; -import com.youlai.mall.ums.model.entity.UmsAddress; -import com.youlai.mall.ums.model.form.AddressForm; -import com.youlai.mall.ums.service.UmsAddressService; +import com.youlai.mall.member.dto.MemberAddressDTO; +import com.youlai.mall.member.model.entity.Address; +import com.youlai.mall.member.model.form.AddressForm; +import com.youlai.mall.member.service.AddressService; import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -19,9 +19,9 @@ import java.util.List; @RestController @RequestMapping("/app-api/v1/addresses") @RequiredArgsConstructor -public class AppAddressController { +public class AddressController { - private final UmsAddressService addressService; + private final AddressService addressService; @Operation(summary= "获取当前会员地址列表") @GetMapping @@ -32,11 +32,11 @@ public class AppAddressController { @Operation(summary= "获取地址详情") @GetMapping("/{addressId}") - public Result getAddressDetail( + public Result
getAddressDetail( @Parameter(description = "地址ID") @PathVariable Long addressId ) { - UmsAddress umsAddress = addressService.getById(addressId); - return Result.success(umsAddress); + Address address = addressService.getById(addressId); + return Result.success(address); } @Operation(summary= "新增地址") diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/AppCartController.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/controller/app/CartController.java similarity index 92% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/AppCartController.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/controller/app/CartController.java index c76b286c3..8d3e17b2e 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/AppCartController.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/controller/app/CartController.java @@ -1,9 +1,9 @@ -package com.youlai.mall.ums.controller.app; +package com.youlai.mall.member.controller.app; import com.youlai.common.result.Result; import com.youlai.common.security.util.SecurityUtils; -import com.youlai.mall.ums.dto.CartItemDTO; -import com.youlai.mall.ums.service.CartService; +import com.youlai.mall.member.dto.CartItemDTO; +import com.youlai.mall.member.service.CartService; import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -24,7 +24,7 @@ import java.util.List; @RestController @RequestMapping("/app-api/v1/cart-items") @RequiredArgsConstructor -public class AppCartController { +public class CartController { private final CartService cartService; diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/AppMemberController.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/controller/app/MemberAppController.java similarity index 82% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/AppMemberController.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/controller/app/MemberAppController.java index 0f1121daa..40e7d7572 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/controller/app/AppMemberController.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/controller/app/MemberAppController.java @@ -1,14 +1,14 @@ -package com.youlai.mall.ums.controller.app; +package com.youlai.mall.member.controller.app; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.youlai.common.result.Result; import com.youlai.common.security.util.SecurityUtils; -import com.youlai.mall.ums.dto.MemberAddressDTO; -import com.youlai.mall.ums.dto.MemberAuthDTO; -import com.youlai.mall.ums.dto.MemberRegisterDTO; -import com.youlai.mall.ums.model.dto.MemberDTO; -import com.youlai.mall.ums.model.entity.UmsMember; -import com.youlai.mall.ums.service.UmsMemberService; +import com.youlai.mall.member.dto.MemberAddressDTO; +import com.youlai.mall.member.dto.MemberAuthDTO; +import com.youlai.mall.member.dto.MemberRegisterDTO; +import com.youlai.mall.member.model.dto.MemberDTO; +import com.youlai.mall.member.model.entity.Member; +import com.youlai.mall.member.service.MemberService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -21,18 +21,18 @@ import java.util.List; @RestController @RequestMapping("/app-api/v1/members") @RequiredArgsConstructor -public class AppMemberController { +public class MemberAppController { - private final UmsMemberService memberService; + private final MemberService memberService; @Operation(summary = "根据会员ID获取OpenId") @GetMapping("/{memberId}/openid") public Result getMemberOpenId( @Parameter(description = "会员ID") @PathVariable Long memberId ) { - UmsMember member = memberService.getOne(new LambdaQueryWrapper() - .eq(UmsMember::getId, memberId) - .select(UmsMember::getOpenid)); + Member member = memberService.getOne(new LambdaQueryWrapper() + .eq(Member::getId, memberId) + .select(Member::getOpenid)); String openid = member.getOpenid(); return Result.success(openid); } diff --git a/mall-member/member-boot/src/main/java/com/youlai/mall/member/convert/AddressConvert.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/convert/AddressConvert.java new file mode 100644 index 000000000..3bad1de8e --- /dev/null +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/convert/AddressConvert.java @@ -0,0 +1,21 @@ +package com.youlai.mall.member.convert; + +import com.youlai.mall.member.dto.MemberAddressDTO; +import com.youlai.mall.member.model.entity.Address; +import org.mapstruct.Mapper; + +import java.util.List; + +/** + * 会员地址对象转换器 + * + * @author Ray + * @since 2022/6/21 23:52 + */ +@Mapper(componentModel = "spring") +public interface AddressConvert { + + MemberAddressDTO entity2Dto(Address entity); + + List entity2Dto(List
entities); +} diff --git a/mall-member/member-boot/src/main/java/com/youlai/mall/member/convert/CartConverter.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/convert/CartConverter.java new file mode 100644 index 000000000..1028ecf10 --- /dev/null +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/convert/CartConverter.java @@ -0,0 +1,25 @@ + +package com.youlai.mall.member.convert; + +import com.youlai.mall.member.model.cache.CartItemCache; +import org.mapstruct.Mapper; + +import java.util.List; + +/** + * 购物车对象转化器 + * + * @author Ray + * @since 2.0.0 + */ +@Mapper(componentModel = "spring") +public interface CartConverter { + + + com.youlai.mall.member.dto.CartItemDTO convertToDto(CartItemCache cache); + + List convertToDto(List caches); + + + +} \ No newline at end of file diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/convert/MemberConvert.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/convert/MemberConvert.java similarity index 59% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/convert/MemberConvert.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/convert/MemberConvert.java index ee4a162a7..874b7f2dd 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/convert/MemberConvert.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/convert/MemberConvert.java @@ -1,12 +1,11 @@ -package com.youlai.mall.ums.convert; +package com.youlai.mall.member.convert; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.youlai.mall.ums.dto.MemberAuthDTO; -import com.youlai.mall.ums.dto.MemberRegisterDTO; -import com.youlai.mall.ums.model.bo.MemberBO; -import com.youlai.mall.ums.model.entity.UmsMember; -import com.youlai.mall.ums.model.vo.MemberPageVO; +import com.youlai.mall.member.dto.MemberAuthDTO; +import com.youlai.mall.member.dto.MemberRegisterDTO; +import com.youlai.mall.member.model.bo.MemberBO; +import com.youlai.mall.member.model.entity.Member; +import com.youlai.mall.member.model.vo.MemberPageVO; import org.mapstruct.Mapper; import org.mapstruct.Mapping; import org.mapstruct.Mappings; @@ -22,14 +21,14 @@ public interface MemberConvert { @Mappings({ @Mapping(target = "username", source = "openid") }) - MemberAuthDTO entity2OpenidAuthDTO(UmsMember entity); + MemberAuthDTO entity2OpenidAuthDTO(Member entity); @Mappings({ @Mapping(target = "username", source = "mobile") }) - MemberAuthDTO entity2MobileAuthDTO(UmsMember entity); + MemberAuthDTO entity2MobileAuthDTO(Member entity); - UmsMember registerDto2Entity(MemberRegisterDTO memberRegisterDTO); + Member registerDto2Entity(MemberRegisterDTO memberRegisterDTO); @Mappings({ diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/listener/CartListener.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/listener/CartListener.java similarity index 93% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/listener/CartListener.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/listener/CartListener.java index 7ae3e5f6f..21058449d 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/listener/CartListener.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/listener/CartListener.java @@ -1,9 +1,9 @@ -package com.youlai.mall.ums.listener; +package com.youlai.mall.member.listener; import com.rabbitmq.client.Channel; import com.youlai.common.rabbitmq.constant.RabbitMqConstants; -import com.youlai.mall.ums.service.CartService; +import com.youlai.mall.member.service.CartService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.amqp.core.Message; diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/mapper/UmsAddressMapper.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/mapper/AddressMapper.java similarity index 66% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/mapper/UmsAddressMapper.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/mapper/AddressMapper.java index 0c18432e5..d29748702 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/mapper/UmsAddressMapper.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/mapper/AddressMapper.java @@ -1,8 +1,8 @@ -package com.youlai.mall.ums.mapper; +package com.youlai.mall.member.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.youlai.mall.ums.model.bo.AddressBO; -import com.youlai.mall.ums.model.entity.UmsAddress; +import com.youlai.mall.member.model.bo.AddressBO; +import com.youlai.mall.member.model.entity.Address; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -14,7 +14,7 @@ import java.util.List; * @since 2024/4/8 */ @Mapper -public interface UmsAddressMapper extends BaseMapper { +public interface AddressMapper extends BaseMapper
{ /** diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/mapper/UmsMemberMapper.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/mapper/MemberMapper.java similarity index 51% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/mapper/UmsMemberMapper.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/mapper/MemberMapper.java index e717b4259..143256873 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/mapper/UmsMemberMapper.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/mapper/MemberMapper.java @@ -1,18 +1,12 @@ -package com.youlai.mall.ums.mapper; +package com.youlai.mall.member.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.youlai.mall.ums.model.bo.MemberBO; -import com.youlai.mall.ums.model.entity.UmsMember; -import com.youlai.mall.ums.model.query.MemberPageQuery; -import org.apache.ibatis.annotations.Many; -import org.apache.ibatis.annotations.Result; -import org.apache.ibatis.annotations.Results; -import org.apache.ibatis.annotations.Select; +import com.youlai.mall.member.model.bo.MemberBO; +import com.youlai.mall.member.model.entity.Member; +import com.youlai.mall.member.model.query.MemberPageQuery; import org.apache.ibatis.annotations.Mapper; -import java.util.List; - /** * 会员访问层 @@ -21,7 +15,7 @@ import java.util.List; * @since 2024/4/7 */ @Mapper -public interface UmsMemberMapper extends BaseMapper { +public interface MemberMapper extends BaseMapper { /** diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/bo/AddressBO.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/model/bo/AddressBO.java similarity index 94% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/bo/AddressBO.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/model/bo/AddressBO.java index eaaf9cb4d..401a4813c 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/bo/AddressBO.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/model/bo/AddressBO.java @@ -1,4 +1,4 @@ -package com.youlai.mall.ums.model.bo; +package com.youlai.mall.member.model.bo; import lombok.Data; diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/bo/MemberBO.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/model/bo/MemberBO.java similarity index 96% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/bo/MemberBO.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/model/bo/MemberBO.java index 4f677bc90..f2a8f11c5 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/bo/MemberBO.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/model/bo/MemberBO.java @@ -1,4 +1,4 @@ -package com.youlai.mall.ums.model.bo; +package com.youlai.mall.member.model.bo; import lombok.Data; diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/dto/CartItemCache.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/model/cache/CartItemCache.java similarity index 91% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/dto/CartItemCache.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/model/cache/CartItemCache.java index b091745a3..52487bc34 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/dto/CartItemCache.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/model/cache/CartItemCache.java @@ -1,4 +1,4 @@ -package com.youlai.mall.ums.model.dto; +package com.youlai.mall.member.model.cache; import lombok.Data; diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/dto/MemberDTO.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/model/dto/MemberDTO.java similarity index 93% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/dto/MemberDTO.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/model/dto/MemberDTO.java index e439ba338..25a47c864 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/dto/MemberDTO.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/model/dto/MemberDTO.java @@ -1,4 +1,4 @@ -package com.youlai.mall.ums.model.dto; +package com.youlai.mall.member.model.dto; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/entity/UmsAddress.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/model/entity/Address.java similarity index 79% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/entity/UmsAddress.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/model/entity/Address.java index 01f2178d3..df00f2466 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/entity/UmsAddress.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/model/entity/Address.java @@ -1,9 +1,11 @@ -package com.youlai.mall.ums.model.entity; +package com.youlai.mall.member.model.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; import com.youlai.common.base.BaseEntity; -import lombok.Data; +import lombok.Getter; +import lombok.Setter; /** * 会员地址实体类 @@ -11,8 +13,10 @@ import lombok.Data; * @author Ray Hao * @since 2022/2/12 */ -@Data -public class UmsAddress extends BaseEntity { +@TableName("ums_address") +@Getter +@Setter +public class Address extends BaseEntity { @TableId(type = IdType.AUTO) private Long id; diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/entity/UmsMember.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/model/entity/Member.java similarity index 94% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/entity/UmsMember.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/model/entity/Member.java index f651cedd6..51b9923ae 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/entity/UmsMember.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/model/entity/Member.java @@ -1,4 +1,4 @@ -package com.youlai.mall.ums.model.entity; +package com.youlai.mall.member.model.entity; import com.baomidou.mybatisplus.annotation.TableLogic; import com.youlai.common.base.BaseEntity; @@ -13,7 +13,7 @@ import java.time.LocalDate; * @since 2022/2/12 */ @Data -public class UmsMember extends BaseEntity { +public class Member extends BaseEntity { /** * 会员性别 diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/form/AddressForm.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/model/form/AddressForm.java similarity index 96% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/form/AddressForm.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/model/form/AddressForm.java index 46ef76e6c..0f170add7 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/form/AddressForm.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/model/form/AddressForm.java @@ -1,4 +1,4 @@ -package com.youlai.mall.ums.model.form; +package com.youlai.mall.member.model.form; import com.youlai.common.web.constraint.CheckCityValid; import com.youlai.common.web.constraint.CityType; diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/query/MemberPageQuery.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/model/query/MemberPageQuery.java similarity index 91% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/query/MemberPageQuery.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/model/query/MemberPageQuery.java index b8bf39c2e..204d22e55 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/query/MemberPageQuery.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/model/query/MemberPageQuery.java @@ -1,4 +1,4 @@ -package com.youlai.mall.ums.model.query; +package com.youlai.mall.member.model.query; import com.youlai.common.base.BasePageQuery; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/vo/MemberPageVO.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/model/vo/MemberPageVO.java similarity index 93% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/vo/MemberPageVO.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/model/vo/MemberPageVO.java index b799d8762..48dd2d1ec 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/model/vo/MemberPageVO.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/model/vo/MemberPageVO.java @@ -1,6 +1,6 @@ -package com.youlai.mall.ums.model.vo; +package com.youlai.mall.member.model.vo; -import com.youlai.mall.ums.model.bo.AddressBO; +import com.youlai.mall.member.model.bo.AddressBO; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/service/UmsAddressService.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/service/AddressService.java similarity index 69% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/service/UmsAddressService.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/service/AddressService.java index ed6a7cda9..2c3a57c66 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/service/UmsAddressService.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/service/AddressService.java @@ -1,10 +1,10 @@ -package com.youlai.mall.ums.service; +package com.youlai.mall.member.service; import com.baomidou.mybatisplus.extension.service.IService; -import com.youlai.mall.ums.dto.MemberAddressDTO; -import com.youlai.mall.ums.model.entity.UmsAddress; -import com.youlai.mall.ums.model.form.AddressForm; +import com.youlai.mall.member.dto.MemberAddressDTO; +import com.youlai.mall.member.model.entity.Address; +import com.youlai.mall.member.model.form.AddressForm; import java.util.List; @@ -14,7 +14,7 @@ import java.util.List; * @author Ray * @since 2022/2/12 */ -public interface UmsAddressService extends IService { +public interface AddressService extends IService
{ /** * 新增地址 diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/service/CartService.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/service/CartService.java similarity index 91% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/service/CartService.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/service/CartService.java index 0500eba45..873c1fc9f 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/service/CartService.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/service/CartService.java @@ -1,7 +1,7 @@ -package com.youlai.mall.ums.service; +package com.youlai.mall.member.service; -import com.youlai.mall.ums.dto.CartItemDTO; +import com.youlai.mall.member.dto.CartItemDTO; import java.util.List; diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/service/UmsMemberService.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/service/MemberService.java similarity index 73% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/service/UmsMemberService.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/service/MemberService.java index 4e2953182..dc7d0e5fe 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/service/UmsMemberService.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/service/MemberService.java @@ -1,15 +1,15 @@ -package com.youlai.mall.ums.service; +package com.youlai.mall.member.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; -import com.youlai.mall.ums.dto.MemberAddressDTO; -import com.youlai.mall.ums.dto.MemberAuthDTO; -import com.youlai.mall.ums.dto.MemberRegisterDTO; -import com.youlai.mall.ums.model.dto.MemberDTO; -import com.youlai.mall.ums.model.entity.UmsMember; -import com.youlai.mall.ums.model.query.MemberPageQuery; -import com.youlai.mall.ums.model.vo.MemberPageVO; +import com.youlai.mall.member.dto.MemberAddressDTO; +import com.youlai.mall.member.dto.MemberAuthDTO; +import com.youlai.mall.member.dto.MemberRegisterDTO; +import com.youlai.mall.member.model.dto.MemberDTO; +import com.youlai.mall.member.model.entity.Member; +import com.youlai.mall.member.model.query.MemberPageQuery; +import com.youlai.mall.member.model.vo.MemberPageVO; import java.util.List; @@ -19,7 +19,7 @@ import java.util.List; * @author Ray * @since 2022/2/12 */ -public interface UmsMemberService extends IService { +public interface MemberService extends IService { /** diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/service/impl/UmsAddressServiceImpl.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/service/impl/AddressServiceImpl.java similarity index 56% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/service/impl/UmsAddressServiceImpl.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/service/impl/AddressServiceImpl.java index 90dbf5a78..d9562ac8f 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/service/impl/UmsAddressServiceImpl.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/service/impl/AddressServiceImpl.java @@ -1,4 +1,4 @@ -package com.youlai.mall.ums.service.impl; +package com.youlai.mall.member.service.impl; import cn.hutool.core.bean.BeanUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -6,11 +6,11 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.youlai.common.constant.GlobalConstants; import com.youlai.common.security.util.SecurityUtils; -import com.youlai.mall.ums.dto.MemberAddressDTO; -import com.youlai.mall.ums.mapper.UmsAddressMapper; -import com.youlai.mall.ums.model.entity.UmsAddress; -import com.youlai.mall.ums.model.form.AddressForm; -import com.youlai.mall.ums.service.UmsAddressService; +import com.youlai.mall.member.dto.MemberAddressDTO; +import com.youlai.mall.member.mapper.AddressMapper; +import com.youlai.mall.member.model.entity.Address; +import com.youlai.mall.member.model.form.AddressForm; +import com.youlai.mall.member.service.AddressService; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -26,7 +26,7 @@ import java.util.stream.Collectors; * @since 2022/2/12 */ @Service -public class UmsAddressServiceImpl extends ServiceImpl implements UmsAddressService { +public class AddressServiceImpl extends ServiceImpl implements AddressService { /** * 新增地址 @@ -39,18 +39,18 @@ public class UmsAddressServiceImpl extends ServiceImpl() - .eq(UmsAddress::getMemberId, memberId) - .eq(UmsAddress::getIsDefault, 1) - .ne(UmsAddress::getId,umsAddress.getId()) - .set(UmsAddress::getIsDefault, 0) + this.update(new LambdaUpdateWrapper
() + .eq(Address::getMemberId, memberId) + .eq(Address::getIsDefault, 1) + .ne(Address::getId, address.getId()) + .set(Address::getIsDefault, 0) ); } } @@ -67,19 +67,19 @@ public class UmsAddressServiceImpl extends ServiceImpl() - .eq(UmsAddress::getMemberId, memberId) - .eq(UmsAddress::getIsDefault, 1) - .ne(UmsAddress::getId, umsAddress.getId()) - .set(UmsAddress::getIsDefault, 0) + this.update(new LambdaUpdateWrapper
() + .eq(Address::getMemberId, memberId) + .eq(Address::getIsDefault, 1) + .ne(Address::getId, address.getId()) + .set(Address::getIsDefault, 0) ); } } @@ -94,11 +94,11 @@ public class UmsAddressServiceImpl extends ServiceImpl listCurrentMemberAddresses() { Long memberId = SecurityUtils.getMemberId(); - List umsAddressList = this.list(new LambdaQueryWrapper() - .eq(UmsAddress::getMemberId, memberId) - .orderByDesc(UmsAddress::getIsDefault) // 默认地址排在首位 + List
addressList = this.list(new LambdaQueryWrapper
() + .eq(Address::getMemberId, memberId) + .orderByDesc(Address::getIsDefault) // 默认地址排在首位 ); - List memberAddressList = Optional.ofNullable(umsAddressList).orElse(new ArrayList<>()).stream() + List memberAddressList = Optional.ofNullable(addressList).orElse(new ArrayList<>()).stream() .map(umsAddress -> { MemberAddressDTO memberAddressDTO = new MemberAddressDTO(); BeanUtil.copyProperties(umsAddress, memberAddressDTO); diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/service/impl/CartServiceImpl.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/service/impl/CartServiceImpl.java similarity index 94% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/service/impl/CartServiceImpl.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/service/impl/CartServiceImpl.java index 413b56517..a88bd8d10 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/service/impl/CartServiceImpl.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/service/impl/CartServiceImpl.java @@ -1,14 +1,14 @@ -package com.youlai.mall.ums.service.impl; +package com.youlai.mall.member.service.impl; import cn.hutool.core.collection.CollectionUtil; import com.youlai.common.constant.RedisConstants; import com.youlai.common.security.util.SecurityUtils; +import com.youlai.mall.member.dto.CartItemDTO; import com.youlai.mall.product.api.SkuFeignClient; import com.youlai.mall.product.model.dto.SkuDTO; -import com.youlai.mall.ums.convert.CartConverter; -import com.youlai.mall.ums.model.dto.CartItemCache; -import com.youlai.mall.ums.dto.CartItemDTO; -import com.youlai.mall.ums.service.CartService; +import com.youlai.mall.member.convert.CartConverter; +import com.youlai.mall.member.model.cache.CartItemCache; +import com.youlai.mall.member.service.CartService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.data.redis.core.BoundHashOperations; @@ -54,7 +54,7 @@ public class CartServiceImpl implements CartService { return Collections.emptyList(); } - List cartItems = cartConverter.cartItemCacheToVo(cartItemCaches); + List cartItems = cartConverter.convertToDto(cartItemCaches); // 动态获取商品信息(实时商品价格、库存、图片)到购物车列表 List skuIds = cartItems.stream().map(CartItemDTO::getSkuId).toList(); diff --git a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/service/impl/UmsMemberServiceImpl.java b/mall-member/member-boot/src/main/java/com/youlai/mall/member/service/impl/MemberServiceImpl.java similarity index 61% rename from mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/service/impl/UmsMemberServiceImpl.java rename to mall-member/member-boot/src/main/java/com/youlai/mall/member/service/impl/MemberServiceImpl.java index 568032910..25375c58f 100644 --- a/mall-ums/ums-boot/src/main/java/com/youlai/mall/ums/service/impl/UmsMemberServiceImpl.java +++ b/mall-member/member-boot/src/main/java/com/youlai/mall/member/service/impl/MemberServiceImpl.java @@ -1,4 +1,4 @@ -package com.youlai.mall.ums.service.impl; +package com.youlai.mall.member.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.lang.Assert; @@ -9,20 +9,20 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.youlai.common.result.ResultCode; import com.youlai.common.security.util.SecurityUtils; import com.youlai.common.web.exception.BizException; -import com.youlai.mall.ums.convert.AddressConvert; -import com.youlai.mall.ums.convert.MemberConvert; -import com.youlai.mall.ums.dto.MemberAddressDTO; -import com.youlai.mall.ums.dto.MemberAuthDTO; -import com.youlai.mall.ums.dto.MemberRegisterDTO; -import com.youlai.mall.ums.mapper.UmsMemberMapper; -import com.youlai.mall.ums.model.bo.MemberBO; -import com.youlai.mall.ums.model.entity.UmsAddress; -import com.youlai.mall.ums.model.entity.UmsMember; -import com.youlai.mall.ums.model.dto.MemberDTO; -import com.youlai.mall.ums.model.query.MemberPageQuery; -import com.youlai.mall.ums.model.vo.MemberPageVO; -import com.youlai.mall.ums.service.UmsAddressService; -import com.youlai.mall.ums.service.UmsMemberService; +import com.youlai.mall.member.convert.AddressConvert; +import com.youlai.mall.member.convert.MemberConvert; +import com.youlai.mall.member.dto.MemberAddressDTO; +import com.youlai.mall.member.dto.MemberAuthDTO; +import com.youlai.mall.member.dto.MemberRegisterDTO; +import com.youlai.mall.member.mapper.MemberMapper; +import com.youlai.mall.member.model.bo.MemberBO; +import com.youlai.mall.member.model.entity.Address; +import com.youlai.mall.member.model.entity.Member; +import com.youlai.mall.member.model.dto.MemberDTO; +import com.youlai.mall.member.model.query.MemberPageQuery; +import com.youlai.mall.member.model.vo.MemberPageVO; +import com.youlai.mall.member.service.AddressService; +import com.youlai.mall.member.service.MemberService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -38,10 +38,10 @@ import java.util.List; @Service @RequiredArgsConstructor @Slf4j -public class UmsMemberServiceImpl extends ServiceImpl implements UmsMemberService { +public class MemberServiceImpl extends ServiceImpl implements MemberService { - private final UmsAddressService addressService; + private final AddressService addressService; private final MemberConvert memberConvert; private final AddressConvert addressConvert; @@ -67,11 +67,11 @@ public class UmsMemberServiceImpl extends ServiceImpl() - .eq(UmsMember::getOpenid, openid) - .select(UmsMember::getId, - UmsMember::getOpenid, - UmsMember::getStatus + Member entity = this.getOne(new LambdaQueryWrapper() + .eq(Member::getOpenid, openid) + .select(Member::getId, + Member::getOpenid, + Member::getStatus ) ); @@ -89,11 +89,11 @@ public class UmsMemberServiceImpl extends ServiceImpl() - .eq(UmsMember::getMobile, mobile) - .select(UmsMember::getId, - UmsMember::getMobile, - UmsMember::getStatus + Member entity = this.getOne(new LambdaQueryWrapper() + .eq(Member::getMobile, mobile) + .select(Member::getId, + Member::getMobile, + Member::getStatus ) ); @@ -108,7 +108,7 @@ public class UmsMemberServiceImpl extends ServiceImpl() - .eq(UmsMember::getId, memberId) - .select(UmsMember::getId, - UmsMember::getNickName, - UmsMember::getAvatarUrl, - UmsMember::getMobile, - UmsMember::getBalance + Member member = this.getOne(new LambdaQueryWrapper() + .eq(Member::getId, memberId) + .select(Member::getId, + Member::getNickName, + Member::getAvatarUrl, + Member::getMobile, + Member::getBalance ) ); MemberDTO memberDTO = new MemberDTO(); - BeanUtil.copyProperties(umsMember, memberDTO); + BeanUtil.copyProperties(member, memberDTO); return memberDTO; } @@ -142,8 +142,8 @@ public class UmsMemberServiceImpl extends ServiceImpl listMemberAddress(Long memberId) { - List entities = addressService.list(new LambdaQueryWrapper() - .eq(UmsAddress::getMemberId, memberId) + List
entities = addressService.list(new LambdaQueryWrapper
() + .eq(Address::getMemberId, memberId) ); return addressConvert.entity2Dto(entities); } @@ -157,7 +157,7 @@ public class UmsMemberServiceImpl extends ServiceImpl= deductionAmount, "会员账户余额不足"); member.setBalance(member.getBalance() - deductionAmount); return this.updateById(member); diff --git a/mall-ums/ums-boot/src/main/resources/bootstrap-dev.yml b/mall-member/member-boot/src/main/resources/bootstrap-dev.yml similarity index 100% rename from mall-ums/ums-boot/src/main/resources/bootstrap-dev.yml rename to mall-member/member-boot/src/main/resources/bootstrap-dev.yml diff --git a/mall-ums/ums-boot/src/main/resources/bootstrap-prod.yml b/mall-member/member-boot/src/main/resources/bootstrap-prod.yml similarity index 100% rename from mall-ums/ums-boot/src/main/resources/bootstrap-prod.yml rename to mall-member/member-boot/src/main/resources/bootstrap-prod.yml diff --git a/mall-sms/sms-boot/src/main/resources/bootstrap.yml b/mall-member/member-boot/src/main/resources/bootstrap.yml similarity index 69% rename from mall-sms/sms-boot/src/main/resources/bootstrap.yml rename to mall-member/member-boot/src/main/resources/bootstrap.yml index 26abac39f..d43c109ea 100644 --- a/mall-sms/sms-boot/src/main/resources/bootstrap.yml +++ b/mall-member/member-boot/src/main/resources/bootstrap.yml @@ -1,6 +1,5 @@ spring: application: - name: mall-sms + name: mall-member profiles: active: dev - diff --git a/mall-ums/ums-boot/src/main/resources/mapper/UmsAddressMapper.xml b/mall-member/member-boot/src/main/resources/mapper/AddressMapper.xml similarity index 95% rename from mall-ums/ums-boot/src/main/resources/mapper/UmsAddressMapper.xml rename to mall-member/member-boot/src/main/resources/mapper/AddressMapper.xml index 0e1b1caec..1033f8efb 100644 --- a/mall-ums/ums-boot/src/main/resources/mapper/UmsAddressMapper.xml +++ b/mall-member/member-boot/src/main/resources/mapper/AddressMapper.xml @@ -5,7 +5,7 @@ - SELECT id, member_id, diff --git a/mall-ums/ums-boot/src/main/resources/mapper/UmsMemberMapper.xml b/mall-member/member-boot/src/main/resources/mapper/MemberMapper.xml similarity index 88% rename from mall-ums/ums-boot/src/main/resources/mapper/UmsMemberMapper.xml rename to mall-member/member-boot/src/main/resources/mapper/MemberMapper.xml index 43df58699..1d9b2b0d3 100644 --- a/mall-ums/ums-boot/src/main/resources/mapper/UmsMemberMapper.xml +++ b/mall-member/member-boot/src/main/resources/mapper/MemberMapper.xml @@ -4,10 +4,10 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + + select="com.youlai.mall.member.mapper.AddressMapper$listAddressesByMemberId"> diff --git a/mall-ums/pom.xml b/mall-member/pom.xml similarity index 81% rename from mall-ums/pom.xml rename to mall-member/pom.xml index 87ebcdf72..3fc006fed 100644 --- a/mall-ums/pom.xml +++ b/mall-member/pom.xml @@ -9,11 +9,11 @@ 4.0.0 - mall-ums + mall-member pom - ums-api - ums-boot + member-api + member-boot diff --git a/mall-order/order-boot/pom.xml b/mall-order/order-boot/pom.xml index 577781cd2..55a9e5144 100644 --- a/mall-order/order-boot/pom.xml +++ b/mall-order/order-boot/pom.xml @@ -55,7 +55,7 @@ com.youlai - ums-api + member-api diff --git a/mall-order/order-boot/src/main/java/com/youlai/mall/order/OrderApplication.java b/mall-order/order-boot/src/main/java/com/youlai/mall/order/OrderApplication.java index 69cb27aa0..4fe658207 100644 --- a/mall-order/order-boot/src/main/java/com/youlai/mall/order/OrderApplication.java +++ b/mall-order/order-boot/src/main/java/com/youlai/mall/order/OrderApplication.java @@ -1,7 +1,7 @@ package com.youlai.mall.order; import com.youlai.mall.product.api.SkuFeignClient; -import com.youlai.mall.ums.api.MemberFeignClient; +import com.youlai.mall.member.api.MemberFeignClient; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; diff --git a/mall-order/order-boot/src/main/java/com/youlai/mall/order/model/vo/OrderConfirmVO.java b/mall-order/order-boot/src/main/java/com/youlai/mall/order/model/vo/OrderConfirmVO.java index 25ce57387..a9050f8f1 100644 --- a/mall-order/order-boot/src/main/java/com/youlai/mall/order/model/vo/OrderConfirmVO.java +++ b/mall-order/order-boot/src/main/java/com/youlai/mall/order/model/vo/OrderConfirmVO.java @@ -1,7 +1,7 @@ package com.youlai.mall.order.model.vo; import com.youlai.mall.order.model.dto.OrderItemDTO; -import com.youlai.mall.ums.dto.MemberAddressDTO; +import com.youlai.mall.member.dto.MemberAddressDTO; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; diff --git a/mall-order/order-boot/src/main/java/com/youlai/mall/order/service/impl/OrderServiceImpl.java b/mall-order/order-boot/src/main/java/com/youlai/mall/order/service/impl/OrderServiceImpl.java index ffbd08642..5c5e1442f 100644 --- a/mall-order/order-boot/src/main/java/com/youlai/mall/order/service/impl/OrderServiceImpl.java +++ b/mall-order/order-boot/src/main/java/com/youlai/mall/order/service/impl/OrderServiceImpl.java @@ -53,9 +53,9 @@ import com.youlai.mall.order.util.OrderUtils; import com.youlai.mall.product.api.SkuFeignClient; import com.youlai.mall.product.model.dto.LockSkuDTO; import com.youlai.mall.product.model.dto.SkuDTO; -import com.youlai.mall.ums.api.MemberFeignClient; -import com.youlai.mall.ums.dto.CartItemDTO; -import com.youlai.mall.ums.dto.MemberAddressDTO; +import com.youlai.mall.member.api.MemberFeignClient; +import com.youlai.mall.member.dto.CartItemDTO; +import com.youlai.mall.member.dto.MemberAddressDTO; import io.seata.spring.annotation.GlobalTransactional; import io.seata.spring.util.OrderUtil; import lombok.RequiredArgsConstructor; diff --git a/mall-product/product-boot/pom.xml b/mall-product/product-boot/pom.xml index 588497e2c..72affd82d 100644 --- a/mall-product/product-boot/pom.xml +++ b/mall-product/product-boot/pom.xml @@ -59,7 +59,7 @@ com.youlai - ums-api + member-api diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/ProductApplication.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/ProductApplication.java index 9da27079c..4bf58a214 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/ProductApplication.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/ProductApplication.java @@ -1,6 +1,6 @@ package com.youlai.mall.product; -import com.youlai.mall.ums.api.MemberFeignClient; +import com.youlai.mall.member.api.MemberFeignClient; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/controller/admin/AttributeController.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/controller/admin/AttributeController.java index 117ac2f16..c237ea6c2 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/controller/admin/AttributeController.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/controller/admin/AttributeController.java @@ -6,8 +6,8 @@ import com.youlai.common.result.PageResult; import com.youlai.common.result.Result; import com.youlai.mall.product.model.form.AttrForm; import com.youlai.mall.product.model.form.AttrGroupForm; -import com.youlai.mall.product.model.query.AttributePageQuery; -import com.youlai.mall.product.model.vo.AttrPageVO; +import com.youlai.mall.product.model.query.AttrGroupPageQuery; +import com.youlai.mall.product.model.vo.AttrGroupPageVO; import com.youlai.mall.product.service.AttrGroupService; import com.youlai.mall.product.service.AttrService; import io.swagger.v3.oas.annotations.Operation; @@ -37,10 +37,10 @@ public class AttributeController { @ApiOperationSupport(order = 1) @Operation(summary = "属性组分页列表") @GetMapping("/group/page") - public PageResult listPagedAttributes( - AttributePageQuery queryParams + public PageResult listPagedAttrGroups( + AttrGroupPageQuery queryParams ) { - IPage page = attrService.listPagedAttributes(queryParams); + IPage page = attrGroupService.listPagedAttrGroups(queryParams); return PageResult.success(page); } diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/controller/admin/SpecController.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/controller/admin/SpecController.java index 821a3bcae..513ca8b84 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/controller/admin/SpecController.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/controller/admin/SpecController.java @@ -19,12 +19,12 @@ import jakarta.validation.Valid; /** - * 规格前端控制器 + * 规格前端控制器 * * @author Ray Hao * @since 2024-06-13 */ -@Tag(name = "商品规格接口") +@Tag(name = "【Admin】规格接口") @RestController @RequestMapping("/api/v1/specs") @RequiredArgsConstructor diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/converter/AttrConverter.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/converter/AttrConverter.java index 45e0ecbcb..06a23ec3b 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/converter/AttrConverter.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/converter/AttrConverter.java @@ -2,23 +2,12 @@ package com.youlai.mall.product.converter; import com.youlai.mall.product.model.entity.Attr; import com.youlai.mall.product.model.form.AttrForm; -import org.mapstruct.*; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; - -import com.youlai.mall.product.model.vo.AttrPageVO; -import com.youlai.mall.product.model.bo.AttrBO; +import org.mapstruct.Mapper; @Mapper(componentModel = "spring") public interface AttrConverter { - @Mappings({ - @Mapping(target = "inputTypeLabel", expression = "java(bo.getInputType()!=null? bo.getInputType().getLabel():\"\")") - }) - AttrPageVO toPageVo(AttrBO bo); - - Page toPageVo(Page bo); - - AttrForm convertToForm(Attr entity); + AttrForm toForm(Attr entity); Attr toEntity(AttrForm entity); } \ No newline at end of file diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/converter/CategoryConverter.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/converter/CategoryConverter.java index 6fef47192..2468abb47 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/converter/CategoryConverter.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/converter/CategoryConverter.java @@ -10,7 +10,7 @@ import org.mapstruct.Mappings; @Mapper(componentModel = "spring") public interface CategoryConverter { - CategoryForm convertToForm(Category entity); + CategoryForm toForm(Category entity); Category toEntity(CategoryForm formData); diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/converter/SpecConverter.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/converter/SpecConverter.java index daf91ce28..5579653b1 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/converter/SpecConverter.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/converter/SpecConverter.java @@ -8,6 +8,7 @@ import com.youlai.mall.product.model.entity.Spec; import com.youlai.mall.product.model.vo.SpecPageVO; import com.youlai.mall.product.model.form.SpecForm; import com.youlai.mall.product.model.bo.SpecBO; +import org.mapstruct.Mapping; /** * 转换器 @@ -16,8 +17,11 @@ import com.youlai.mall.product.model.bo.SpecBO; * @since 2024-06-13 */ @Mapper(componentModel = "spring") -public interface SpecConverter{ +public interface SpecConverter { + @Mapping(target = "inputTypeLabel", + expression = "java(bo.getInputType()!=null ? bo.getInputType().getLabel(): Strings.EMPTY)" + ) SpecPageVO toPageVo(SpecBO bo); Page toPageVo(Page bo); diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/enums/AttributeTypeEnum.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/enums/AttributeTypeEnum.java deleted file mode 100644 index aad8bc623..000000000 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/enums/AttributeTypeEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.youlai.mall.product.enums; - -import com.baomidou.mybatisplus.annotation.EnumValue; -import com.fasterxml.jackson.annotation.JsonValue; -import com.youlai.common.base.IBaseEnum; -import lombok.Getter; - -/** - * 商品属性类型 - * - * @author Ray Hao - * @since 2024/5/23 - */ -@Getter -public enum AttributeTypeEnum implements IBaseEnum { - - BASE(1, "基础属性"), - SALE(2, "销售属性"); - - AttributeTypeEnum(Integer value, String label) { - this.value = value; - this.label = label; - } - - @EnumValue - @JsonValue - private final Integer value; - - - private final String label; - -} diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/enums/ProductOrderByEnum.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/enums/ProductOrderByEnum.java index 6ef36b151..f090c3cdf 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/enums/ProductOrderByEnum.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/enums/ProductOrderByEnum.java @@ -5,8 +5,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.youlai.common.base.IBaseEnum; import lombok.Getter; -import java.util.Objects; - /** * 商品排序字段枚举 * diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/listener/StockListener.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/listener/StockListener.java index 956c4546b..6bf516bbb 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/listener/StockListener.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/listener/StockListener.java @@ -11,7 +11,6 @@ import org.springframework.stereotype.Component; import java.io.IOException; - /** * 商品库存释放监听器 * @@ -25,7 +24,6 @@ public class StockListener { private final SkuService skuService; - /** * 订单取消释放库存 */ @@ -38,11 +36,11 @@ public class StockListener { ackMode = "MANUAL" // 手动ACK ) @RabbitHandler - public void releaseStock(String orderSn, Message message, Channel channel) throws IOException { - log.info("订单【{}】取消释放库存消息监听", orderSn); + public void releaseStock(String orderNo, Message message, Channel channel) throws IOException { + log.info("订单【{}】取消释放库存消息监听", orderNo); long deliveryTag = message.getMessageProperties().getDeliveryTag(); // 消息序号 try { - skuService.unlockStock(orderSn); + skuService.unlockStock(orderNo); channel.basicAck(deliveryTag, false); } catch (Exception e) { channel.basicReject(deliveryTag, true); diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/AttrGroupMapper.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/AttrGroupMapper.java index 3135a045e..878998855 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/AttrGroupMapper.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/AttrGroupMapper.java @@ -1,10 +1,11 @@ package com.youlai.mall.product.mapper; -import com.youlai.mall.product.model.bo.AttrGroupBO; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.youlai.mall.product.model.entity.AttrGroup; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.youlai.mall.product.model.query.AttributeGroupPageQuery; +import com.youlai.mall.product.model.query.AttrGroupPageQuery; +import com.youlai.mall.product.model.vo.AttrGroupPageVO; import org.apache.ibatis.annotations.Mapper; /** @@ -24,6 +25,5 @@ public interface AttrGroupMapper extends BaseMapper { * @param queryParams 查询参数 * @return */ - Page listPagedAttributeGroups(Page page, AttributeGroupPageQuery queryParams); - + IPage listPagedAttrGroups(Page page, AttrGroupPageQuery queryParams); } diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/AttrMapper.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/AttrMapper.java index a30e688ed..2f2237486 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/AttrMapper.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/AttrMapper.java @@ -4,9 +4,8 @@ import com.youlai.mall.product.model.bo.AttrBO; import com.youlai.mall.product.model.entity.Attr; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.youlai.mall.product.model.query.AttributePageQuery; +import com.youlai.mall.product.model.query.AttrGroupPageQuery; import com.youlai.mall.product.model.vo.AttributeGroupVO; -import com.youlai.mall.product.model.vo.AttributeVO; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -27,7 +26,7 @@ public interface AttrMapper extends BaseMapper { * @param page 分页参数 * @param queryParams 查询参数 */ - Page listPagedAttributes(Page page, AttributePageQuery queryParams); + Page listPagedAttrGroups(Page page, AttrGroupPageQuery queryParams); /** @@ -36,11 +35,4 @@ public interface AttrMapper extends BaseMapper { * @param categoryId 分类ID */ List listAttributesByCategoryId(Long categoryId); - - /** - * 根据分类ID获取销售属性列表 - * - * @param categoryId 分类ID - */ - List listSaleAttributes(Long categoryId); } diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/SpecMapper.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/SpecMapper.java index dcc379b81..2cc4b0d6a 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/SpecMapper.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/mapper/SpecMapper.java @@ -28,7 +28,7 @@ public interface SpecMapper extends BaseMapper { * @param queryParams 查询参数 * @return */ - Page listPagedSpecs(Page page, SpecPageQuery queryParams); + Page listPagedSpecs(Page page, SpecPageQuery queryParams); /** * 根据分类ID查询规格列表 diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/bo/AttrBO.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/bo/AttrBO.java index 97595facd..abb204036 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/bo/AttrBO.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/bo/AttrBO.java @@ -1,15 +1,15 @@ package com.youlai.mall.product.model.bo; +import java.io.Serial; import java.io.Serializable; import java.time.LocalDateTime; import com.youlai.mall.product.enums.AttributeInputTypeEnum; -import com.youlai.mall.product.enums.AttributeTypeEnum; import lombok.Getter; import lombok.Setter; /** - * 属性 + * 属性业务对象 * * @author Ray Hao * @since 2024-04-19 @@ -18,6 +18,7 @@ import lombok.Setter; @Setter public class AttrBO implements Serializable { + @Serial private static final long serialVersionUID = 1L; /** @@ -28,38 +29,28 @@ public class AttrBO implements Serializable { /** * 属性组主键 */ - private Long attributeGroupId; + private Long attrGroupId; /** * 属性名称 */ private String name; - /** - * 属性类型(1:基础属性,2:销售属性) - */ - private AttributeTypeEnum type; - /** * 输入方式(1:手动输入,2:从列表选择) */ private AttributeInputTypeEnum inputType; /** - * 可选值列表(以逗号分隔,仅当输入方式为2时使用 + * 可选值列表(以逗号分隔,仅当输入方式为2时使用) */ - private String selectableValues; + private String options; /** * 属性组名称 */ private String attributeGroupName; - /** - * 分类名称 - */ - private String categoryName; - /** * 创建时间 */ diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/bo/SpecBO.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/bo/SpecBO.java index 688088143..f19f27788 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/bo/SpecBO.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/bo/SpecBO.java @@ -3,14 +3,19 @@ package com.youlai.mall.product.model.bo; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serial; import java.io.Serializable; import java.time.LocalDateTime; + +import com.youlai.mall.product.enums.AttributeInputTypeEnum; import lombok.Getter; import lombok.Setter; + import java.time.LocalDateTime; /** - * + * 规格BO * * @author Ray Hao * @since 2024-06-13 @@ -19,6 +24,7 @@ import java.time.LocalDateTime; @Setter public class SpecBO implements Serializable { + @Serial private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) @@ -30,12 +36,12 @@ public class SpecBO implements Serializable { private String name; /** - * 输入方式(1:手动输入,2:列表选择) + * 输入方式:1->手动输入,2->列表选择 */ - private Byte inputType; + private AttributeInputTypeEnum inputType; /** - * 可选值列表(以逗号分隔,仅当输入方式为2时使用) + * 可选值(以逗号分隔,仅当输入方式为2时使用) */ private String options; diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/entity/Attr.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/entity/Attr.java index 75c560319..34a7aeb7b 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/entity/Attr.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/entity/Attr.java @@ -3,7 +3,6 @@ package com.youlai.mall.product.model.entity; import com.baomidou.mybatisplus.annotation.TableName; import com.youlai.common.base.BaseEntity; import com.youlai.mall.product.enums.AttributeInputTypeEnum; -import com.youlai.mall.product.enums.AttributeTypeEnum; import lombok.Getter; import lombok.Setter; @@ -21,7 +20,7 @@ public class Attr extends BaseEntity { /** * 属性组主键 */ - private Long attributeGroupId; + private Long attrGroupId; /** * 属性名称 diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/entity/Spec.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/entity/Spec.java index 8ccbff7c6..5997c1535 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/entity/Spec.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/entity/Spec.java @@ -30,9 +30,9 @@ public class Spec implements Serializable { private String name; /** - * 输入方式(1:手动输入,2:列表选择) + * 输入方式:1->手动输入,2->列表选择 */ - private Byte inputType; + private Integer inputType; /** * 可选值列表(以逗号分隔,仅当输入方式为2时使用) @@ -62,5 +62,5 @@ public class Spec implements Serializable { /** * 逻辑删除标识(0:未删除,1:已删除) */ - private Byte isDeleted; + private Integer isDeleted; } diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/form/AttrForm.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/form/AttrForm.java index 6770a8a45..4628827f3 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/form/AttrForm.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/form/AttrForm.java @@ -1,7 +1,6 @@ package com.youlai.mall.product.model.form; import com.youlai.mall.product.enums.AttributeInputTypeEnum; -import com.youlai.mall.product.enums.AttributeTypeEnum; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Getter; import lombok.Setter; @@ -27,7 +26,7 @@ public class AttrForm implements Serializable { private Long id; @Schema(description = "属性组ID",example = "1") - private Long attributeGroupId; + private Long attrGroupId; @Schema(description = "分类ID",example = "1") private Long categoryId; @@ -35,14 +34,11 @@ public class AttrForm implements Serializable { @Schema(description = "属性名称",example = "屏幕分辨率") private String name; - @Schema(description = "属性类型(1:基础属性,2:销售属性)",example = "1") - private AttributeTypeEnum type; - @Schema(description = "输入方式(1:手动输入,2:从列表选择)",example = "2") private AttributeInputTypeEnum inputType; @Schema(description = "可选值列表(以逗号分隔,仅当输入方式为2时使用)",example = "1920x1080,2560x1440") - private String selectableValues; + private String options; @Schema(description = "排序",example = "1") private Integer sort; diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/query/AttributeGroupPageQuery.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/query/AttrGroupPageQuery.java similarity index 68% rename from mall-product/product-boot/src/main/java/com/youlai/mall/product/model/query/AttributeGroupPageQuery.java rename to mall-product/product-boot/src/main/java/com/youlai/mall/product/model/query/AttrGroupPageQuery.java index 753403a2c..0ce3cb2bb 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/query/AttributeGroupPageQuery.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/query/AttrGroupPageQuery.java @@ -6,21 +6,24 @@ import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; /** - * 属性组分页查询对象 + * 属性分页查询对象 * * @author Ray Hao * @since 2024-04-19 */ -@Schema(description ="属性组分页查询对象") +@Schema(description ="属性分页查询对象") @Data -public class AttributeGroupPageQuery extends BasePageQuery { +public class AttrGroupPageQuery extends BasePageQuery { - @Schema(description="关键字") + @Schema(description="关键字(属性名称/属性组名称/分类名称)") private String keywords; @Schema(description="分类ID") private Long categoryId; + @Schema(description="属性组ID") + private Long attrGroupId; + @Schema(description="创建时间-开始") @DateTimeFormat(pattern = "yyyy-MM-dd") private String startTime; @@ -28,6 +31,5 @@ public class AttributeGroupPageQuery extends BasePageQuery { @Schema(description="创建时间-结束") @DateTimeFormat(pattern = "yyyy-MM-dd") private String endTime; - - + } diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/query/AttributePageQuery.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/query/AttributePageQuery.java deleted file mode 100644 index 1c4934ad3..000000000 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/query/AttributePageQuery.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.youlai.mall.product.model.query; - -import com.youlai.common.base.BasePageQuery; -import com.youlai.mall.product.enums.AttributeTypeEnum; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * 属性分页查询对象 - * - * @author Ray Hao - * @since 2024-04-19 - */ -@Schema(description ="属性分页查询对象") -@Data -public class AttributePageQuery extends BasePageQuery { - - @Schema(description="关键字(属性名称/属性组名称/分类名称)") - private String keywords; - - @Schema(description="分类ID") - private Long categoryId; - - @Schema(description="属性组ID") - private Long attributeGroupId; - - @Schema(description="属性类型(1:基础属性,2:销售属性)") - private Integer attributeType; - -} diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/vo/AttrGroupPageVO.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/vo/AttrGroupPageVO.java new file mode 100644 index 000000000..1e61072c7 --- /dev/null +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/vo/AttrGroupPageVO.java @@ -0,0 +1,67 @@ +package com.youlai.mall.product.model.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + +/** + * 属性 分页VO + * + * @author Ray + * @since 2024-04-19 + */ +@Getter +@Setter +@Schema(description = "属性分页对象") +public class AttrGroupPageVO implements Serializable { + + @Schema(description = "属性组主键") + private Long id; + + @Schema(description = "属性组名称") + private String name; + + @Schema(description = "分类名称") + private String categoryName; + + @Schema(description = "排序") + private Integer sort; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime createTime; + + @Schema(description = "属性列表") + private List attrs; + + @Schema(description = "属性") + @Getter + @Setter + public static class Attr{ + @Schema(description = "属性主键") + private Long id; + + @Schema(description = "属性名称") + private String name; + + @Schema(description = "输入录入方式标签") + private String inputTypeLabel; + + @Schema(description = "逗号分割的可选值列表,仅当input_type是2使用") + private String options; + + @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime createTime; + + @Schema(description = "排序") + private Integer sort; + } + + +} \ No newline at end of file diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/vo/AttrPageVO.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/vo/AttrPageVO.java deleted file mode 100644 index 22ca0bb97..000000000 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/vo/AttrPageVO.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.youlai.mall.product.model.vo; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; -import lombok.Setter; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 属性 分页VO - * - * @author Ray Hao - * @since 2024-04-19 - */ -@Getter -@Setter -@Schema(description = "属性分页对象") -public class AttrPageVO implements Serializable { - - - @Schema(description = "属性主键") - private Long id; - - @Schema(description = "属性名称") - private String name; - - @Schema(description = "输入录入方式标签") - private String inputTypeLabel; - - @Schema(description = "逗号分割的可选值列表,仅当input_method是2使用") - private String selectableValues; - - @Schema(description = "属性组名称") - private String attributeGroupName; - - @Schema(description = "分类名称") - private String categoryName; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm") - private LocalDateTime createTime; - - @Schema(description = "排序") - private Integer sort; - -} \ No newline at end of file diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/vo/SpecPageVO.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/vo/SpecPageVO.java index a68693d1d..192bd73e6 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/vo/SpecPageVO.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/model/vo/SpecPageVO.java @@ -3,57 +3,46 @@ package com.youlai.mall.product.model.vo; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; + import java.io.Serializable; import java.time.LocalDateTime; + import io.swagger.v3.oas.annotations.media.Schema; import lombok.Getter; import lombok.Setter; /** - * 分页VO + * 规格分页VO * * @author Ray Hao * @since 2024-06-13 */ @Getter @Setter -@Schema( description = "分页视图对象") +@Schema(description = "规格分页视图对象") public class SpecPageVO implements Serializable { private static final long serialVersionUID = 1L; - + @Schema(description = "属性") private Long id; - @Schema(description = "属性名称") - + @Schema(description = "属性名称") private String name; - @Schema(description = "输入方式(1:手动输入,2:列表选择)") - - private Byte inputType; - - @Schema(description = "可选值列表(以逗号分隔,仅当输入方式为2时使用)") + @Schema(description = "输入方式Label") + private String inputTypeLabel; + @Schema(description = "可选值(以逗号分隔,仅当输入方式为2时使用)") private String options; - @Schema(description = "分类ID") - - private Long categoryId; - - @Schema(description = "排序") + @Schema(description = "分类ID") + private String categoryId; + @Schema(description = "排序") private Short sort; - @Schema(description = "创建时间") - + @Schema(description = "创建时间") private LocalDateTime createTime; - @Schema(description = "更新时间") - - private LocalDateTime updateTime; - - @Schema(description = "逻辑删除标识(0:未删除,1:已删除)") - - private Byte isDeleted; } diff --git a/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/AttrGroupService.java b/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/AttrGroupService.java index 044d2565d..df47f9d3e 100644 --- a/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/AttrGroupService.java +++ b/mall-product/product-boot/src/main/java/com/youlai/mall/product/service/AttrGroupService.java @@ -1,15 +1,12 @@ package com.youlai.mall.product.service; -import com.youlai.common.web.model.Option; import com.youlai.mall.product.model.entity.AttrGroup; import com.baomidou.mybatisplus.extension.service.IService; import com.youlai.mall.product.model.form.AttrGroupForm; -import com.youlai.mall.product.model.query.AttributeGroupPageQuery; -import com.youlai.mall.product.model.vo.AttributeGroupPageVO; +import com.youlai.mall.product.model.query.AttrGroupPageQuery; +import com.youlai.mall.product.model.vo.AttrGroupPageVO; import com.baomidou.mybatisplus.core.metadata.IPage; -import java.util.List; - /** * 属性组 服务类 * @@ -24,17 +21,7 @@ public interface AttrGroupService extends IService { * * @return */ - IPage listPagedAttributeGroups(AttributeGroupPageQuery queryParams); - - - /** - * 获取属性组表单数据 - * - * @param id 属性组ID - * @return - */ - AttrGroupForm getAttributeGroupFormData(Long id); - + IPage listPagedAttrGroups(AttrGroupPageQuery queryParams); /** * 新增属性组 @@ -61,10 +48,6 @@ public interface AttrGroupService extends IService { */ void deleteAttributeGroups(String ids); - /** - * 获取属性组选项列表 - * - * @return - */ - List