From f4ee990b1ce3f757147c21ce13b0fa9b29dd8c2c Mon Sep 17 00:00:00 2001 From: YourName <1982673145@qq.com> Date: Mon, 7 Dec 2020 16:50:02 +0800 Subject: [PATCH] =?UTF-8?q?2020=E5=B9=B412=E6=9C=887=E6=97=A516:49:09?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 +- gulimall-auth-server/pom.xml | 117 - .../GulimallAuthServerApplication.java | 23 - .../config/GulimallSessionConfig.java | 24 - .../config/GulimallWebConfig.java | 17 - .../controller/LoginController.java | 166 - .../controller/OAuth2Controller.java | 83 - .../feign/MemberFeignService.java | 22 - .../feign/ThirdPartFeignService.java | 12 - .../gulimallauthserver/utils/HttpUtils.java | 316 - .../gulimallauthserver/vo/MemberRespVo.java | 89 - .../gulimallauthserver/vo/SocialUserVo.java | 13 - .../gulimallauthserver/vo/UserLoginVo.java | 14 - .../gulimallauthserver/vo/UserRegistVo.java | 25 - .../src/main/resources/application.properties | 17 - .../src/main/resources/application.yml | 15 - .../src/main/resources/templates/index.html | 193 - .../src/main/resources/templates/reg.html | 6310 ----------------- .../GulimallAuthServerApplicationTests.java | 66 - gulimall-cart/pom.xml | 110 - .../cart/GulimallCartApplication.java | 20 - .../cart/config/GulimallSessionConfig.java | 25 - .../cart/config/GulimallWebConfig.java | 14 - .../gulimall/cart/config/MyThreadConfig.java | 20 - .../config/ThreadPoolConfigProperties.java | 14 - .../cart/controller/CartController.java | 131 - .../cart/feign/ProductFeignService.java | 22 - .../cart/interceptor/CartInterceptor.java | 96 - .../gulimall/cart/service/CartService.java | 63 - .../cart/service/impl/CartServiceImpl.java | 227 - .../forth/gulimall/gulimall/cart/vo/Cart.java | 76 - .../gulimall/gulimall/cart/vo/CartItem.java | 99 - .../gulimall/gulimall/cart/vo/SkuInfoVo.java | 53 - .../gulimall/gulimall/cart/vo/UserInfoVo.java | 13 - .../src/main/resources/application.properties | 20 - .../main/resources/templates/cartList.html | 792 --- .../src/main/resources/templates/index.html | 122 - .../src/main/resources/templates/success.html | 110 - .../cart/GulimallCartApplicationTests.java | 13 - gulimall-common/pom.xml | 71 +- .../common/constant/AuthServerConstant.java | 8 - .../forth/common/constant/CartConstant.java | 7 - .../forth/common/exception/BizCodeEnume.java | 25 +- .../common/exception/NoStockException.java | 23 - .../com/forth/common/utils/HttpUtils.java | 315 - .../main/java/com/forth/common/utils/R.java | 143 +- .../com/forth/common/vo/MemberRespVo.java | 89 - gulimall-coupon/pom.xml | 2 +- .../coupon/GulimallCouponApplication.java | 2 - .../coupon/controller/CouponController.java | 32 +- .../controller/CouponHistoryController.java | 7 +- .../CouponSpuCategoryRelationController.java | 7 +- .../CouponSpuRelationController.java | 7 +- .../coupon/controller/HomeAdvController.java | 7 +- .../controller/HomeSubjectController.java | 7 +- .../controller/HomeSubjectSpuController.java | 7 +- .../controller/MemberPriceController.java | 7 +- .../SeckillPromotionController.java | 7 +- .../controller/SeckillSessionController.java | 21 +- .../SeckillSkuNoticeController.java | 7 +- .../SeckillSkuRelationController.java | 7 +- .../SkuFullReductionController.java | 7 +- .../controller/SkuLadderController.java | 7 +- .../controller/SpuBoundsController.java | 7 +- .../forth/gulimall/coupon/dao/CouponDao.java | 6 +- .../gulimall/coupon/dao/CouponHistoryDao.java | 6 +- .../dao/CouponSpuCategoryRelationDao.java | 6 +- .../coupon/dao/CouponSpuRelationDao.java | 6 +- .../forth/gulimall/coupon/dao/HomeAdvDao.java | 6 +- .../gulimall/coupon/dao/HomeSubjectDao.java | 6 +- .../coupon/dao/HomeSubjectSpuDao.java | 6 +- .../gulimall/coupon/dao/MemberPriceDao.java | 6 +- .../coupon/dao/SeckillPromotionDao.java | 6 +- .../coupon/dao/SeckillSessionDao.java | 6 +- .../coupon/dao/SeckillSkuNoticeDao.java | 6 +- .../coupon/dao/SeckillSkuRelationDao.java | 6 +- .../coupon/dao/SkuFullReductionDao.java | 6 +- .../gulimall/coupon/dao/SkuLadderDao.java | 6 +- .../gulimall/coupon/dao/SpuBoundsDao.java | 6 +- .../gulimall/coupon/entity/CouponEntity.java | 6 +- .../coupon/entity/CouponHistoryEntity.java | 6 +- .../CouponSpuCategoryRelationEntity.java | 6 +- .../entity/CouponSpuRelationEntity.java | 6 +- .../gulimall/coupon/entity/HomeAdvEntity.java | 6 +- .../coupon/entity/HomeSubjectEntity.java | 6 +- .../coupon/entity/HomeSubjectSpuEntity.java | 6 +- .../coupon/entity/MemberPriceEntity.java | 6 +- .../coupon/entity/SeckillPromotionEntity.java | 6 +- .../coupon/entity/SeckillSessionEntity.java | 12 +- .../coupon/entity/SeckillSkuNoticeEntity.java | 6 +- .../entity/SeckillSkuRelationEntity.java | 12 +- .../coupon/entity/SkuFullReductionEntity.java | 6 +- .../coupon/entity/SkuLadderEntity.java | 6 +- .../coupon/entity/SpuBoundsEntity.java | 6 +- .../coupon/service/CouponHistoryService.java | 6 +- .../coupon/service/CouponService.java | 6 +- .../CouponSpuCategoryRelationService.java | 6 +- .../service/CouponSpuRelationService.java | 6 +- .../coupon/service/HomeAdvService.java | 6 +- .../coupon/service/HomeSubjectService.java | 6 +- .../coupon/service/HomeSubjectSpuService.java | 6 +- .../coupon/service/MemberPriceService.java | 6 +- .../service/SeckillPromotionService.java | 6 +- .../coupon/service/SeckillSessionService.java | 9 +- .../service/SeckillSkuNoticeService.java | 6 +- .../service/SeckillSkuRelationService.java | 6 +- .../service/SkuFullReductionService.java | 6 +- .../coupon/service/SkuLadderService.java | 6 +- .../coupon/service/SpuBoundsService.java | 6 +- .../impl/SeckillSessionServiceImpl.java | 53 + .../impl/SeckillSkuRelationServiceImpl.java | 8 +- .../src/main/resources/application.yml | 16 +- .../src/main/resources/bootstrap.properties | 23 +- .../GulimallCouponApplicationTests.java | 20 +- gulimall-gateway/pom.xml | 26 +- .../gateway/GulimallGatewayApplication.java | 19 - .../config/GulimallCorsConfiguration.java | 29 - .../src/main/resources/application.yml | 95 +- .../src/main/resources/bootstrap.properties | 9 +- .../GulimallGatewayApplicationTests.java | 13 - gulimall-member/pom.xml | 4 +- .../member/GulimallMemberApplication.java | 17 +- .../GrowthChangeHistoryController.java | 6 +- .../IntegrationChangeHistoryController.java | 6 +- .../MemberCollectSpuController.java | 6 +- .../MemberCollectSubjectController.java | 6 +- .../member/controller/MemberController.java | 97 +- .../controller/MemberLevelController.java | 6 +- .../controller/MemberLoginLogController.java | 6 +- .../MemberReceiveAddressController.java | 19 +- .../MemberStatisticsInfoController.java | 6 +- .../member/dao/GrowthChangeHistoryDao.java | 6 +- .../dao/IntegrationChangeHistoryDao.java | 6 +- .../member/dao/MemberCollectSpuDao.java | 6 +- .../member/dao/MemberCollectSubjectDao.java | 6 +- .../forth/gulimall/member/dao/MemberDao.java | 6 +- .../gulimall/member/dao/MemberLevelDao.java | 10 +- .../member/dao/MemberLoginLogDao.java | 6 +- .../member/dao/MemberReceiveAddressDao.java | 6 +- .../member/dao/MemberStatisticsInfoDao.java | 6 +- .../entity/GrowthChangeHistoryEntity.java | 6 +- .../IntegrationChangeHistoryEntity.java | 6 +- .../member/entity/MemberCollectSpuEntity.java | 6 +- .../entity/MemberCollectSubjectEntity.java | 6 +- .../gulimall/member/entity/MemberEntity.java | 10 +- .../member/entity/MemberLevelEntity.java | 6 +- .../member/entity/MemberLoginLogEntity.java | 6 +- .../entity/MemberReceiveAddressEntity.java | 6 +- .../entity/MemberStatisticsInfoEntity.java | 6 +- .../member/exception/PhoneExistException.java | 8 - .../exception/UsernameExistException.java | 7 - .../member/feign/CouponFeignService.java | 5 +- .../service/GrowthChangeHistoryService.java | 6 +- .../IntegrationChangeHistoryService.java | 6 +- .../service/MemberCollectSpuService.java | 6 +- .../service/MemberCollectSubjectService.java | 6 +- .../member/service/MemberLevelService.java | 6 +- .../member/service/MemberLoginLogService.java | 6 +- .../service/MemberReceiveAddressService.java | 9 +- .../member/service/MemberService.java | 20 +- .../service/MemberStatisticsInfoService.java | 6 +- .../impl/MemberReceiveAddressServiceImpl.java | 8 - .../service/impl/MemberServiceImpl.java | 167 - .../gulimall/member/vo/MemberLoginVo.java | 13 - .../gulimall/member/vo/MemberRegistVo.java | 15 - .../gulimall/member/vo/SocialUserVo.java | 13 - .../src/main/resources/application.yml | 14 +- .../src/main/resources/bootstrap.properties | 21 +- .../mapper/member/MemberLevelDao.xml | 4 +- .../GulimallMemberApplicationTests.java | 23 - gulimall-order/pom.xml | 39 +- .../order/GulimallOrderApplication.java | 9 +- .../order/config/GuliFeginConfig.java | 38 - .../order/config/GulimallSessionConfig.java | 26 - .../gulimall/order/config/MyThreadConfig.java | 20 - .../order/config/OrderWebConfiguration.java | 18 - .../config/ThreadPoolConfigProperties.java | 15 - .../order/constant/OrderConstant.java | 5 - .../order/controller/OrderController.java | 6 +- .../order/controller/OrderItemController.java | 6 +- .../OrderOperateHistoryController.java | 6 +- .../OrderReturnApplyController.java | 6 +- .../OrderReturnReasonController.java | 6 +- .../controller/OrderSettingController.java | 6 +- .../controller/PaymentInfoController.java | 6 +- .../controller/RefundInfoController.java | 6 +- .../forth/gulimall/order/dao/OrderDao.java | 6 +- .../gulimall/order/dao/OrderItemDao.java | 6 +- .../order/dao/OrderOperateHistoryDao.java | 6 +- .../order/dao/OrderReturnApplyDao.java | 6 +- .../order/dao/OrderReturnReasonDao.java | 6 +- .../gulimall/order/dao/OrderSettingDao.java | 6 +- .../gulimall/order/dao/PaymentInfoDao.java | 6 +- .../gulimall/order/dao/RefundInfoDao.java | 6 +- .../gulimall/order/entity/OrderEntity.java | 6 +- .../order/entity/OrderItemEntity.java | 6 +- .../entity/OrderOperateHistoryEntity.java | 6 +- .../order/entity/OrderReturnApplyEntity.java | 6 +- .../order/entity/OrderReturnReasonEntity.java | 6 +- .../order/entity/OrderSettingEntity.java | 6 +- .../order/entity/PaymentInfoEntity.java | 6 +- .../order/entity/RefundInfoEntity.java | 6 +- .../gulimall/order/enume/OrderStatusEnum.java | 26 - .../order/fegin/CartFeignService.java | 15 - .../order/fegin/MemberFeignService.java | 16 - .../order/fegin/ProductFeignService.java | 12 - .../gulimall/order/fegin/WmsFeignService.java | 17 - .../interceptor/LoginUserInterceptor.java | 32 - .../order/service/OrderItemService.java | 6 +- .../service/OrderOperateHistoryService.java | 6 +- .../service/OrderReturnApplyService.java | 6 +- .../service/OrderReturnReasonService.java | 6 +- .../gulimall/order/service/OrderService.java | 25 +- .../order/service/OrderSettingService.java | 6 +- .../order/service/PaymentInfoService.java | 6 +- .../order/service/RefundInfoService.java | 6 +- .../order/service/impl/OrderServiceImpl.java | 321 +- .../gulimall/order/to/OrderCreateTo.java | 22 - .../gulimall/order/vo/MemberAddressVo.java | 48 - .../forth/gulimall/order/vo/MemberRespVo.java | 90 - .../gulimall/order/vo/OrderConfirmVo.java | 64 - .../forth/gulimall/order/vo/OrderItemVo.java | 21 - .../gulimall/order/vo/OrderSubmitVo.java | 21 - .../forth/gulimall/order/vo/SkuStockVo.java | 9 - .../forth/gulimall/order/vo/SpuInfoVo.java | 49 - .../order/vo/SubmitOrderResponseVo.java | 12 - .../gulimall/order/vo/WareSkuLockVo.java | 10 - .../gulimall/order/web/HelloController.java | 14 - .../order/web/OrderWebController.java | 62 - .../src/main/resources/application.yml | 13 +- .../src/main/resources/bootstrap.properties | 13 - .../resources/static/js/jquery-3.1.1.min.js | 3242 --------- .../src/main/resources/templates/confirm.html | 1035 --- .../src/main/resources/templates/detail.html | 1234 ---- .../src/main/resources/templates/list.html | 944 --- .../src/main/resources/templates/pay.html | 179 - .../order/GulimallOrderApplicationTests.java | 12 - gulimall-product/pom.xml | 28 +- .../product/GulimallProductApplication.java | 7 +- .../product/config/GulimallSessionConfig.java | 23 - .../AttrAttrgroupRelationController.java | 90 - .../product/controller/AttrController.java | 90 - .../controller/AttrGroupController.java | 90 - .../product/controller/BrandController.java | 90 - .../CategoryBrandRelationController.java | 90 - .../controller/CategoryController.java | 91 - .../controller/CommentReplayController.java | 90 - .../ProductAttrValueController.java | 90 - .../controller/SkuImagesController.java | 90 - .../product/controller/SkuInfoController.java | 96 - .../SkuSaleAttrValueController.java | 93 - .../controller/SpuCommentController.java | 90 - .../controller/SpuImagesController.java | 90 - .../product/controller/SpuInfoController.java | 91 - .../controller/SpuInfoDescController.java | 90 - .../product/dao/SkuSaleAttrValueDao.java | 6 +- .../product/entity/CategoryEntity.java | 4 +- .../product/service/CategoryService.java | 8 + .../product/service/SkuInfoService.java | 5 - .../service/SkuSaleAttrValueService.java | 3 - .../product/service/SpuInfoService.java | 2 - .../service/impl/CategoryServiceImpl.java | 78 +- .../service/impl/SkuInfoServiceImpl.java | 7 - .../impl/SkuSaleAttrValueServiceImpl.java | 13 - .../service/impl/SpuInfoServiceImpl.java | 14 - .../gulimall/product/vo/MemberRespVo.java | 89 - .../src/main/resources/application.yml | 18 +- .../src/main/resources/bootstrap.properties | 10 +- .../product/AttrAttrgroupRelationDao.xml | 6 + .../product/CategoryBrandRelationDao.xml | 4 +- .../mapper/product/SkuSaleAttrValueDao.xml | 3 - .../modules/product/attr-add-or-update.vue | 147 - .../src/views/modules/product/attr.vue | 205 - .../attrattrgrouprelation-add-or-update.vue | 102 - .../modules/product/attrattrgrouprelation.vue | 175 - .../product/attrgroup-add-or-update.vue | 120 - .../src/views/modules/product/attrgroup.vue | 187 - .../modules/product/brand-add-or-update.vue | 129 - .../src/views/modules/product/brand.vue | 193 - .../product/category-add-or-update.vue | 147 - .../src/views/modules/product/category.vue | 205 - .../categorybrandrelation-add-or-update.vue | 111 - .../modules/product/categorybrandrelation.vue | 181 - .../product/commentreplay-add-or-update.vue | 93 - .../views/modules/product/commentreplay.vue | 169 - .../productattrvalue-add-or-update.vue | 129 - .../modules/product/productattrvalue.vue | 193 - .../product/skuimages-add-or-update.vue | 111 - .../src/views/modules/product/skuimages.vue | 181 - .../modules/product/skuinfo-add-or-update.vue | 165 - .../src/views/modules/product/skuinfo.vue | 217 - .../skusaleattrvalue-add-or-update.vue | 120 - .../modules/product/skusaleattrvalue.vue | 187 - .../product/spucomment-add-or-update.vue | 210 - .../src/views/modules/product/spucomment.vue | 247 - .../product/spuimages-add-or-update.vue | 120 - .../src/views/modules/product/spuimages.vue | 187 - .../modules/product/spuinfo-add-or-update.vue | 147 - .../src/views/modules/product/spuinfo.vue | 205 - .../product/spuinfodesc-add-or-update.vue | 84 - .../src/views/modules/product/spuinfodesc.vue | 163 - .../GulimallProductApplicationTests.java | 78 +- gulimall-third-party/pom.xml | 105 - .../GulimallThirdPartyApplication.java | 15 - .../thirdparty/component/SmsComponent.java | 55 - .../thirdparty/controller/OssController.java | 78 - .../controller/SmsSendController.java | 28 - .../gulimall/thirdparty/utils/HttpUtils.java | 315 - .../src/main/resources/application.properties | 1 - .../src/main/resources/application.yml | 20 - .../src/main/resources/bootstrap.properties | 10 - .../GulimallThirdPartyApplicationTests.java | 66 - gulimall-ware/pom.xml | 8 +- .../ware/GulimallWareApplication.java | 2 + .../ware/controller/PurchaseController.java | 78 +- .../controller/PurchaseDetailController.java | 25 +- .../ware/controller/UndoLogController.java | 25 +- .../ware/controller/WareInfoController.java | 30 +- .../controller/WareOrderTaskController.java | 25 +- .../WareOrderTaskDetailController.java | 25 +- .../ware/controller/WareSkuController.java | 48 +- .../forth/gulimall/ware/dao/PurchaseDao.java | 8 +- .../gulimall/ware/dao/PurchaseDetailDao.java | 8 +- .../forth/gulimall/ware/dao/UndoLogDao.java | 8 +- .../forth/gulimall/ware/dao/WareInfoDao.java | 8 +- .../gulimall/ware/dao/WareOrderTaskDao.java | 8 +- .../ware/dao/WareOrderTaskDetailDao.java | 8 +- .../forth/gulimall/ware/dao/WareSkuDao.java | 17 +- .../ware/entity/PurchaseDetailEntity.java | 11 +- .../gulimall/ware/entity/PurchaseEntity.java | 10 +- .../gulimall/ware/entity/UndoLogEntity.java | 10 +- .../gulimall/ware/entity/WareInfoEntity.java | 9 +- .../entity/WareOrderTaskDetailEntity.java | 9 +- .../ware/entity/WareOrderTaskEntity.java | 8 +- .../gulimall/ware/entity/WareSkuEntity.java | 9 +- .../ware/feign/MemberFeignService.java | 13 - .../ware/service/PurchaseDetailService.java | 9 +- .../ware/service/PurchaseService.java | 17 +- .../gulimall/ware/service/UndoLogService.java | 6 +- .../ware/service/WareInfoService.java | 16 +- .../service/WareOrderTaskDetailService.java | 6 +- .../ware/service/WareOrderTaskService.java | 6 +- .../gulimall/ware/service/WareSkuService.java | 13 +- .../impl/PurchaseDetailServiceImpl.java | 39 +- .../service/impl/PurchaseServiceImpl.java | 144 +- .../ware/service/impl/UndoLogServiceImpl.java | 6 +- .../service/impl/WareInfoServiceImpl.java | 50 +- .../impl/WareOrderTaskDetailServiceImpl.java | 6 +- .../impl/WareOrderTaskServiceImpl.java | 6 +- .../ware/service/impl/WareSkuServiceImpl.java | 137 +- .../com/forth/gulimall/ware/vo/FareVo.java | 10 - .../gulimall/ware/vo/LockStockResult.java | 11 - .../gulimall/ware/vo/MemberAddressVo.java | 48 - .../forth/gulimall/ware/vo/OrderItemVo.java | 22 - .../forth/gulimall/ware/vo/SkuHasStockVo.java | 9 - .../forth/gulimall/ware/vo/WareSkuLockVo.java | 11 - .../src/main/resources/application.yml | 16 +- .../src/main/resources/bootstrap.properties | 7 - .../main/resources/mapper/ware/WareSkuDao.xml | 11 +- .../ware/GulimallWareApplicationTests.java | 10 - pom.xml | 5 +- renren-fast/pom.xml | 6 +- .../src/main/resources/application.yml | 4 +- .../src/main/resources/application.yml | 2 +- .../src/main/resources/generator.properties | 16 +- 365 files changed, 1393 insertions(+), 26525 deletions(-) delete mode 100644 gulimall-auth-server/pom.xml delete mode 100644 gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/GulimallAuthServerApplication.java delete mode 100644 gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/config/GulimallSessionConfig.java delete mode 100644 gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/config/GulimallWebConfig.java delete mode 100644 gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/controller/LoginController.java delete mode 100644 gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/controller/OAuth2Controller.java delete mode 100644 gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/feign/MemberFeignService.java delete mode 100644 gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/feign/ThirdPartFeignService.java delete mode 100644 gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/utils/HttpUtils.java delete mode 100644 gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/vo/MemberRespVo.java delete mode 100644 gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/vo/SocialUserVo.java delete mode 100644 gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/vo/UserLoginVo.java delete mode 100644 gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/vo/UserRegistVo.java delete mode 100644 gulimall-auth-server/src/main/resources/application.properties delete mode 100644 gulimall-auth-server/src/main/resources/application.yml delete mode 100644 gulimall-auth-server/src/main/resources/templates/index.html delete mode 100644 gulimall-auth-server/src/main/resources/templates/reg.html delete mode 100644 gulimall-auth-server/src/test/java/com/forth/gulimall/gulimallauthserver/GulimallAuthServerApplicationTests.java delete mode 100644 gulimall-cart/pom.xml delete mode 100644 gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/GulimallCartApplication.java delete mode 100644 gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/config/GulimallSessionConfig.java delete mode 100644 gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/config/GulimallWebConfig.java delete mode 100644 gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/config/MyThreadConfig.java delete mode 100644 gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/config/ThreadPoolConfigProperties.java delete mode 100644 gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/controller/CartController.java delete mode 100644 gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/feign/ProductFeignService.java delete mode 100644 gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/interceptor/CartInterceptor.java delete mode 100644 gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/service/CartService.java delete mode 100644 gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/service/impl/CartServiceImpl.java delete mode 100644 gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/vo/Cart.java delete mode 100644 gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/vo/CartItem.java delete mode 100644 gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/vo/SkuInfoVo.java delete mode 100644 gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/vo/UserInfoVo.java delete mode 100644 gulimall-cart/src/main/resources/application.properties delete mode 100644 gulimall-cart/src/main/resources/templates/cartList.html delete mode 100644 gulimall-cart/src/main/resources/templates/index.html delete mode 100644 gulimall-cart/src/main/resources/templates/success.html delete mode 100644 gulimall-cart/src/test/java/com/forth/gulimall/gulimall/cart/GulimallCartApplicationTests.java delete mode 100644 gulimall-common/src/main/java/com/forth/common/constant/AuthServerConstant.java delete mode 100644 gulimall-common/src/main/java/com/forth/common/constant/CartConstant.java delete mode 100644 gulimall-common/src/main/java/com/forth/common/exception/NoStockException.java delete mode 100644 gulimall-common/src/main/java/com/forth/common/utils/HttpUtils.java delete mode 100644 gulimall-common/src/main/java/com/forth/common/vo/MemberRespVo.java delete mode 100644 gulimall-gateway/src/main/java/com/forth/gulimall/gateway/GulimallGatewayApplication.java delete mode 100644 gulimall-gateway/src/main/java/com/forth/gulimall/gateway/config/GulimallCorsConfiguration.java delete mode 100644 gulimall-gateway/src/test/java/com/forth/gulimall/gateway/GulimallGatewayApplicationTests.java delete mode 100644 gulimall-member/src/main/java/com/forth/gulimall/member/exception/PhoneExistException.java delete mode 100644 gulimall-member/src/main/java/com/forth/gulimall/member/exception/UsernameExistException.java delete mode 100644 gulimall-member/src/main/java/com/forth/gulimall/member/vo/MemberLoginVo.java delete mode 100644 gulimall-member/src/main/java/com/forth/gulimall/member/vo/MemberRegistVo.java delete mode 100644 gulimall-member/src/main/java/com/forth/gulimall/member/vo/SocialUserVo.java delete mode 100644 gulimall-member/src/test/java/com/forth/gulimall/member/GulimallMemberApplicationTests.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/config/GuliFeginConfig.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/config/GulimallSessionConfig.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/config/MyThreadConfig.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/config/OrderWebConfiguration.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/config/ThreadPoolConfigProperties.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/constant/OrderConstant.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/enume/OrderStatusEnum.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/fegin/CartFeignService.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/fegin/MemberFeignService.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/fegin/ProductFeignService.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/fegin/WmsFeignService.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/interceptor/LoginUserInterceptor.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/to/OrderCreateTo.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/vo/MemberAddressVo.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/vo/MemberRespVo.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/vo/OrderConfirmVo.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/vo/OrderItemVo.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/vo/OrderSubmitVo.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/vo/SkuStockVo.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/vo/SpuInfoVo.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/vo/SubmitOrderResponseVo.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/vo/WareSkuLockVo.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/web/HelloController.java delete mode 100644 gulimall-order/src/main/java/com/forth/gulimall/order/web/OrderWebController.java delete mode 100644 gulimall-order/src/main/resources/bootstrap.properties delete mode 100644 gulimall-order/src/main/resources/static/js/jquery-3.1.1.min.js delete mode 100644 gulimall-order/src/main/resources/templates/confirm.html delete mode 100644 gulimall-order/src/main/resources/templates/detail.html delete mode 100644 gulimall-order/src/main/resources/templates/list.html delete mode 100644 gulimall-order/src/main/resources/templates/pay.html delete mode 100644 gulimall-product/src/main/java/com/forth/gulimall/product/config/GulimallSessionConfig.java delete mode 100644 gulimall-product/src/main/java/com/forth/gulimall/product/controller/AttrAttrgroupRelationController.java delete mode 100644 gulimall-product/src/main/java/com/forth/gulimall/product/controller/AttrController.java delete mode 100644 gulimall-product/src/main/java/com/forth/gulimall/product/controller/AttrGroupController.java delete mode 100644 gulimall-product/src/main/java/com/forth/gulimall/product/controller/BrandController.java delete mode 100644 gulimall-product/src/main/java/com/forth/gulimall/product/controller/CategoryBrandRelationController.java delete mode 100644 gulimall-product/src/main/java/com/forth/gulimall/product/controller/CategoryController.java delete mode 100644 gulimall-product/src/main/java/com/forth/gulimall/product/controller/CommentReplayController.java delete mode 100644 gulimall-product/src/main/java/com/forth/gulimall/product/controller/ProductAttrValueController.java delete mode 100644 gulimall-product/src/main/java/com/forth/gulimall/product/controller/SkuImagesController.java delete mode 100644 gulimall-product/src/main/java/com/forth/gulimall/product/controller/SkuInfoController.java delete mode 100644 gulimall-product/src/main/java/com/forth/gulimall/product/controller/SkuSaleAttrValueController.java delete mode 100644 gulimall-product/src/main/java/com/forth/gulimall/product/controller/SpuCommentController.java delete mode 100644 gulimall-product/src/main/java/com/forth/gulimall/product/controller/SpuImagesController.java delete mode 100644 gulimall-product/src/main/java/com/forth/gulimall/product/controller/SpuInfoController.java delete mode 100644 gulimall-product/src/main/java/com/forth/gulimall/product/controller/SpuInfoDescController.java delete mode 100644 gulimall-product/src/main/java/com/forth/gulimall/product/vo/MemberRespVo.java delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/attr-add-or-update.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/attr.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/attrattrgrouprelation-add-or-update.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/attrattrgrouprelation.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/attrgroup-add-or-update.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/attrgroup.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/brand-add-or-update.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/brand.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/category-add-or-update.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/category.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/categorybrandrelation-add-or-update.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/categorybrandrelation.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/commentreplay-add-or-update.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/commentreplay.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/productattrvalue-add-or-update.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/productattrvalue.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/skuimages-add-or-update.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/skuimages.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/skuinfo-add-or-update.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/skuinfo.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/skusaleattrvalue-add-or-update.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/skusaleattrvalue.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/spucomment-add-or-update.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/spucomment.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/spuimages-add-or-update.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/spuimages.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/spuinfo-add-or-update.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/spuinfo.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/spuinfodesc-add-or-update.vue delete mode 100644 gulimall-product/src/main/resources/src/views/modules/product/spuinfodesc.vue delete mode 100644 gulimall-third-party/pom.xml delete mode 100644 gulimall-third-party/src/main/java/com/forth/gulimall/thirdparty/GulimallThirdPartyApplication.java delete mode 100644 gulimall-third-party/src/main/java/com/forth/gulimall/thirdparty/component/SmsComponent.java delete mode 100644 gulimall-third-party/src/main/java/com/forth/gulimall/thirdparty/controller/OssController.java delete mode 100644 gulimall-third-party/src/main/java/com/forth/gulimall/thirdparty/controller/SmsSendController.java delete mode 100644 gulimall-third-party/src/main/java/com/forth/gulimall/thirdparty/utils/HttpUtils.java delete mode 100644 gulimall-third-party/src/main/resources/application.properties delete mode 100644 gulimall-third-party/src/main/resources/application.yml delete mode 100644 gulimall-third-party/src/main/resources/bootstrap.properties delete mode 100644 gulimall-third-party/src/test/java/com/forth/gulimall/thirdparty/GulimallThirdPartyApplicationTests.java delete mode 100644 gulimall-ware/src/main/java/com/forth/gulimall/ware/feign/MemberFeignService.java delete mode 100644 gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/FareVo.java delete mode 100644 gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/LockStockResult.java delete mode 100644 gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/MemberAddressVo.java delete mode 100644 gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/OrderItemVo.java delete mode 100644 gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/SkuHasStockVo.java delete mode 100644 gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/WareSkuLockVo.java delete mode 100644 gulimall-ware/src/main/resources/bootstrap.properties diff --git a/.gitignore b/.gitignore index 45d7ecc..70a04bf 100644 --- a/.gitignore +++ b/.gitignore @@ -11,10 +11,8 @@ buildNumber.properties +#上传git时屏蔽掉不需要上传的部分 .idea -renren-fast -renren-generator - **/.mvn **/target/ diff --git a/gulimall-auth-server/pom.xml b/gulimall-auth-server/pom.xml deleted file mode 100644 index 07fbe38..0000000 --- a/gulimall-auth-server/pom.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - 2.3.5.RELEASE - - - com.forth.gulimall - gulimall-auth-server - 0.0.1-SNAPSHOT - gulimall-auth-server - 认证中心(社交登录,单点登录,OAuth2) - - - 1.8 - Hoxton.SR8 - - - - - com.forth.gulimall - gulimall-common - 0.0.1-SNAPSHOT - - - com.baomidou - mybatis-plus-boot-starter - - - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.cloud - spring-cloud-starter-openfeign - - - - org.springframework.boot - spring-boot-devtools - runtime - true - - - org.projectlombok - lombok - true - - - org.springframework.boot - spring-boot-starter-test - test - - - org.apache.httpcomponents - httpclient - - - - - org.springframework.boot - spring-boot-starter-data-redis - - - - org.springframework.session - spring-session-data-redis - - - - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - - - diff --git a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/GulimallAuthServerApplication.java b/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/GulimallAuthServerApplication.java deleted file mode 100644 index b39144a..0000000 --- a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/GulimallAuthServerApplication.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.forth.gulimall.gulimallauthserver; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.openfeign.EnableFeignClients; -import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession; - -/** - * - */ -//整合redis 作为session -@EnableRedisHttpSession -@EnableFeignClients -@EnableDiscoveryClient -@SpringBootApplication -public class GulimallAuthServerApplication { - - public static void main(String[] args) { - SpringApplication.run(GulimallAuthServerApplication.class, args); - } - -} diff --git a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/config/GulimallSessionConfig.java b/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/config/GulimallSessionConfig.java deleted file mode 100644 index 7e8e7f8..0000000 --- a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/config/GulimallSessionConfig.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.forth.gulimall.gulimallauthserver.config; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; -import org.springframework.data.redis.serializer.RedisSerializer; -import org.springframework.session.web.http.CookieSerializer; -import org.springframework.session.web.http.DefaultCookieSerializer; - -@Configuration -public class GulimallSessionConfig { - @Bean - public CookieSerializer cookieSerializer(){ - DefaultCookieSerializer cookieSerializer = new DefaultCookieSerializer(); - // - cookieSerializer.setDomainName("localhost"); - cookieSerializer.setCookieName("GULISESSION"); - return cookieSerializer; - } - @Bean - public RedisSerializer springSessionDefaultCookieSerializer(){ - return new GenericJackson2JsonRedisSerializer(); - } -} diff --git a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/config/GulimallWebConfig.java b/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/config/GulimallWebConfig.java deleted file mode 100644 index d5c5147..0000000 --- a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/config/GulimallWebConfig.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.forth.gulimall.gulimallauthserver.config; - -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@Configuration -public class GulimallWebConfig implements WebMvcConfigurer { - /** - *试图映射 - */ - @Override - public void addViewControllers(ViewControllerRegistry registry) { - registry.addViewController("/index.html").setViewName("index"); - registry.addViewController("/reg.html").setViewName("reg"); - } -} diff --git a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/controller/LoginController.java b/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/controller/LoginController.java deleted file mode 100644 index 2167bf9..0000000 --- a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/controller/LoginController.java +++ /dev/null @@ -1,166 +0,0 @@ -package com.forth.gulimall.gulimallauthserver.controller; - -import com.alibaba.fastjson.TypeReference; -import com.forth.common.constant.AuthServerConstant; -import com.forth.common.utils.R; -import com.forth.gulimall.gulimallauthserver.feign.MemberFeignService; -import com.forth.gulimall.gulimallauthserver.feign.ThirdPartFeignService; - - -import com.forth.gulimall.gulimallauthserver.vo.MemberRespVo; -import com.forth.gulimall.gulimallauthserver.vo.UserLoginVo; -import com.forth.gulimall.gulimallauthserver.vo.UserRegistVo; -import org.apache.commons.lang.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.stereotype.Controller; - - -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.mvc.support.RedirectAttributes; - -import javax.servlet.http.HttpSession; -import javax.validation.Valid; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; - -@Controller -public class LoginController { - - @Autowired - ThirdPartFeignService thirdPartFeignService; - //注入redis 操作工具类 - @Autowired - StringRedisTemplate redisTemplate; - @Autowired - MemberFeignService memberFeignService; - - @ResponseBody - @GetMapping("/sms/sendcode") - public R SendCode(@RequestParam("phone") String phone) { - //1,接口防刷 - String redisCode = redisTemplate.opsForValue().get(AuthServerConstant.SMS_CODE_CACHE_PREFIX + phone); - - if (!StringUtils.isEmpty(redisCode)) { - long l = Long.parseLong(redisCode.split("_")[1]); - if (System.currentTimeMillis() - l < 60000) { - //60秒不能再发 - return R.error(1111,"60秒不能再发"); - } - } - - //String code = UUID.randomUUID().toString().substring(0, 5); - String code = "12345"; - String code2 = code + "_" + System.currentTimeMillis(); - - //2,验证码的再次验证 存 key -phone value-code - //redis 缓存 - redisTemplate.opsForValue().set(AuthServerConstant.SMS_CODE_CACHE_PREFIX + phone, code2, 1000, TimeUnit.MINUTES); - thirdPartFeignService.sendCode(phone, code); - return R.ok(); - } - - /** - *RedirectAttributes attributes 重定向 - * @param vo - * @param result - * @param attributes - * @return - */ - @PostMapping("/regist") - public String regist(@Valid UserRegistVo vo, BindingResult result, RedirectAttributes attributes) { - //注册成功回到登录 - if (result.hasErrors()) { - //创建map - - /** - * .map(fieldError -> { - * String field = fieldError.getField(); - * String defaultMessage = fieldError.getDefaultMessage(); - * error.put(field,defaultMessage); - * return - * }) - */ - Map errors = result.getFieldErrors().stream().collect(Collectors.toMap(FieldError::getField, FieldError::getDefaultMessage)); - - System.out.println(errors); - // model.addAttribute("errors", errors); - attributes.addFlashAttribute("errors", errors); - //return "redirect:http://localhost:20000/reg.html"; - return "redirect:http://localhost:20000/reg.html"; - } - - - //注册 - String code = vo.getCode(); - - String s = redisTemplate.opsForValue().get(AuthServerConstant.SMS_CODE_CACHE_PREFIX + vo.getPhone()); - if (!StringUtils.isEmpty(s)){ - - if (code.equals(s.split("_")[0])){ - //删除 - //edisTemplate.delete(AuthServerConstant.SMS_CODE_CACHE_PREFIX + vo.getPhone()); - System.out.println("---------"+111); - R r = memberFeignService.regist(vo); - System.out.println("----------------"+r.toString()); - - if(r.get("code").equals(0)){ - - return "redirect:http://localhost:20000/index.html"; - }else{ - Map errors = new HashMap<>(); - errors.put("msg",r.toString()); - attributes.addFlashAttribute("errors", errors); - return "redirect:http://localhost:20000/reg.html"; - } - - - }else{ - Map errors = new HashMap<>(); - System.out.println("---------------1"); - errors.put("code","验证码错误"); - attributes.addFlashAttribute("errors", errors); - return "redirect:http://localhost:20000/reg.html"; - } - }else{ - Map errors = new HashMap<>(); - System.out.println("---------------2"); - errors.put("code","验证码错误"); - attributes.addFlashAttribute("errors", errors); - - return "redirect:http://localhost:20000/reg.html"; - } - - - } -@PostMapping("/login") -public String login(UserLoginVo vo, RedirectAttributes redirectAttributes, HttpSession session){ - System.out.println("------------"+vo); - //远程登录 - R login = memberFeignService.login(vo); - System.out.println("-----"+login.toString()); - if(login.get("code").equals(0)){ - MemberRespVo data = login.getData("data", new TypeReference() { - }); - session.setAttribute(AuthServerConstant.LOGIN_USER,data); - System.out.println("----"+session.getAttribute(AuthServerConstant.LOGIN_USER)); - - return "redirect:http://localhost:30000"; - }else{ - Map errors =new HashMap<>(); - errors.put("msg","账号密码错误"); - redirectAttributes.addFlashAttribute("errors",errors); - return "redirect:http://localhost:20000/index.html"; - } - - -} - - - -} diff --git a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/controller/OAuth2Controller.java b/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/controller/OAuth2Controller.java deleted file mode 100644 index cf90cac..0000000 --- a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/controller/OAuth2Controller.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.forth.gulimall.gulimallauthserver.controller; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.TypeReference; -import com.forth.common.constant.AuthServerConstant; -import com.forth.common.utils.R; -import com.forth.gulimall.gulimallauthserver.feign.MemberFeignService; -import com.forth.gulimall.gulimallauthserver.vo.MemberRespVo; -import com.forth.gulimall.gulimallauthserver.vo.SocialUserVo; -import lombok.extern.slf4j.Slf4j; -import org.apache.http.HttpResponse; -import org.apache.http.util.EntityUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestParam; -import com.forth.gulimall.gulimallauthserver.utils.HttpUtils; - -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import java.util.HashMap; -import java.util.Map; -@Slf4j -@Controller -public class OAuth2Controller { - - @Autowired - MemberFeignService memberFeignService; - - @GetMapping("/oauth2.0/weibo/success") - public String weibo (@RequestParam("code") String code, HttpSession session, HttpServletResponse servletResponse) throws Exception { - Map map = new HashMap<>(); - map.put("client_id", "2789270821"); - map.put("client_secret", "cc3a93781eb4593907325e4c50e31eae"); - map.put("grant_type", "authorization_code"); - map.put("redirect_uri", "http://localhost:20000/oauth2.0/weibo/success"); - map.put("code", code); - System.out.println("----" + map); - - Map map2 = new HashMap<>(); - map.put("Cookie", "JSESSIONID=C3EBCF908AC5BF68C3380F0612C2D943"); - map.put("Cache-Control", "Jno-cache"); - map.put("Postman-Token", ""); - - //1,code换取 accessToke" - HttpResponse response = HttpUtils.doPost("https://api.weibo.com", "/oauth2/access_token", "post", map2, null, map); - - System.out.println("------------->>code换取 "+response.getStatusLine().getStatusCode()); - //2,处理 - if (response.getStatusLine().getStatusCode() == 200) { - //获取 accessToke - String json = EntityUtils.toString(response.getEntity()); - System.out.println("-------" + json.toString()); - SocialUserVo socialUserVo = JSON.parseObject(json, SocialUserVo.class); - System.out.println("-------" + socialUserVo); - - //知道是呢个用户 - //如果第一次登录,自动祖册 - //登录或者注册 - ///问题 - R oauthlogin = memberFeignService.oauthlogin(socialUserVo); - if (oauthlogin.get("code").equals(0)) { - MemberRespVo data = oauthlogin.getData("data", new TypeReference() { - }); - System.out.println("登录成功:用户信息"+data); - session.setAttribute(AuthServerConstant.LOGIN_USER,data); - System.out.println(session.getAttribute(AuthServerConstant.LOGIN_USER)); -//TODO 1,默认发的令牌 key seeion 值 是唯一字符串 作用域 解决不了子域的session -//TODO 2,使用json 的序列画 来存储到redis - // servletResponse.addCookie("JSESSIONID","dadaa"); - // log.info("登录成功:用户信息",data.toString()); - //2,成功挑转首页 - return "redirect:http://localhost:30000/"; - } - - } else { - return "redirect:http://localhost:20000/index.html"; - } -return ""; - } -} - diff --git a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/feign/MemberFeignService.java b/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/feign/MemberFeignService.java deleted file mode 100644 index a6651ab..0000000 --- a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/feign/MemberFeignService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.forth.gulimall.gulimallauthserver.feign; - -import com.forth.common.utils.R; - -import com.forth.gulimall.gulimallauthserver.vo.SocialUserVo; -import com.forth.gulimall.gulimallauthserver.vo.UserLoginVo; -import com.forth.gulimall.gulimallauthserver.vo.UserRegistVo; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; - -@FeignClient("member") -public interface MemberFeignService { - - @PostMapping("member/member/regist") - R regist(@RequestBody UserRegistVo vo) ; - - @PostMapping("member/member/login") - R login(@RequestBody UserLoginVo vo); - @PostMapping("member/member/oauth/login") - R oauthlogin(@RequestBody SocialUserVo svo) throws Exception; -} diff --git a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/feign/ThirdPartFeignService.java b/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/feign/ThirdPartFeignService.java deleted file mode 100644 index f55726e..0000000 --- a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/feign/ThirdPartFeignService.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.forth.gulimall.gulimallauthserver.feign; - -import com.forth.common.utils.R; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; - -@FeignClient("gulimall-third-party") -public interface ThirdPartFeignService { - @GetMapping("/sms/sendcode") - public R sendCode(@RequestParam("phone") String phone, @RequestParam("code") String code); -} \ No newline at end of file diff --git a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/utils/HttpUtils.java b/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/utils/HttpUtils.java deleted file mode 100644 index 143aaba..0000000 --- a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/utils/HttpUtils.java +++ /dev/null @@ -1,316 +0,0 @@ -package com.forth.gulimall.gulimallauthserver.utils; - -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.security.KeyManagementException; -import java.security.NoSuchAlgorithmException; -import java.security.cert.X509Certificate; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManager; -import javax.net.ssl.X509TrustManager; - -import org.apache.commons.lang.StringUtils; -import org.apache.http.HttpResponse; -import org.apache.http.NameValuePair; -import org.apache.http.client.HttpClient; -import org.apache.http.client.entity.UrlEncodedFormEntity; -import org.apache.http.client.methods.HttpDelete; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.methods.HttpPut; -import org.apache.http.conn.ClientConnectionManager; -import org.apache.http.conn.scheme.Scheme; -import org.apache.http.conn.scheme.SchemeRegistry; -import org.apache.http.conn.ssl.SSLSocketFactory; -import org.apache.http.entity.ByteArrayEntity; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.message.BasicNameValuePair; - -public class HttpUtils { - - /** - * get - * - * @param host - * @param path - * @param method - * @param headers - * @param querys - * @return - * @throws Exception - */ - public static HttpResponse doGet(String host, String path, String method, - Map headers, - Map querys) - throws Exception { - HttpClient httpClient = wrapClient(host); - - HttpGet request = new HttpGet(buildUrl(host, path, querys)); - for (Map.Entry e : headers.entrySet()) { - request.addHeader(e.getKey(), e.getValue()); - } - - return httpClient.execute(request); - } - - /** - * post form - * - * @param host - * @param path - * @param method - * @param headers - * @param querys - * @param bodys - * @return - * @throws Exception - */ - public static HttpResponse doPost(String host, String path, String method, - Map headers, - Map querys, - Map bodys) - throws Exception { - HttpClient httpClient = wrapClient(host); - - HttpPost request = new HttpPost(buildUrl(host, path, querys)); - for (Map.Entry e : headers.entrySet()) { - request.addHeader(e.getKey(), e.getValue()); - } - - if (bodys != null) { - List nameValuePairList = new ArrayList(); - - for (String key : bodys.keySet()) { - nameValuePairList.add(new BasicNameValuePair(key, bodys.get(key))); - } - UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nameValuePairList, "utf-8"); - formEntity.setContentType("application/x-www-form-urlencoded; charset=UTF-8"); - request.setEntity(formEntity); - } - - return httpClient.execute(request); - } - - /** - * Post String - * - * @param host - * @param path - * @param method - * @param headers - * @param querys - * @param body - * @return - * @throws Exception - */ - public static HttpResponse doPost(String host, String path, String method, - Map headers, - Map querys, - String body) - throws Exception { - HttpClient httpClient = wrapClient(host); - - HttpPost request = new HttpPost(buildUrl(host, path, querys)); - for (Map.Entry e : headers.entrySet()) { - request.addHeader(e.getKey(), e.getValue()); - } - - if (StringUtils.isNotBlank(body)) { - request.setEntity(new StringEntity(body, "utf-8")); - } - - return httpClient.execute(request); - } - - /** - * Post stream - * - * @param host - * @param path - * @param method - * @param headers - * @param querys - * @param body - * @return - * @throws Exception - */ - public static HttpResponse doPost(String host, String path, String method, - Map headers, - Map querys, - byte[] body) - throws Exception { - HttpClient httpClient = wrapClient(host); - - HttpPost request = new HttpPost(buildUrl(host, path, querys)); - for (Map.Entry e : headers.entrySet()) { - request.addHeader(e.getKey(), e.getValue()); - } - - if (body != null) { - request.setEntity(new ByteArrayEntity(body)); - } - - return httpClient.execute(request); - } - - /** - * Put String - * - * @param host - * @param path - * @param method - * @param headers - * @param querys - * @param body - * @return - * @throws Exception - */ - public static HttpResponse doPut(String host, String path, String method, - Map headers, - Map querys, - String body) - throws Exception { - HttpClient httpClient = wrapClient(host); - - HttpPut request = new HttpPut(buildUrl(host, path, querys)); - for (Map.Entry e : headers.entrySet()) { - request.addHeader(e.getKey(), e.getValue()); - } - - if (StringUtils.isNotBlank(body)) { - request.setEntity(new StringEntity(body, "utf-8")); - } - - return httpClient.execute(request); - } - - /** - * Put stream - * - * @param host - * @param path - * @param method - * @param headers - * @param querys - * @param body - * @return - * @throws Exception - */ - public static HttpResponse doPut(String host, String path, String method, - Map headers, - Map querys, - byte[] body) - throws Exception { - HttpClient httpClient = wrapClient(host); - - HttpPut request = new HttpPut(buildUrl(host, path, querys)); - for (Map.Entry e : headers.entrySet()) { - request.addHeader(e.getKey(), e.getValue()); - } - - if (body != null) { - request.setEntity(new ByteArrayEntity(body)); - } - - return httpClient.execute(request); - } - - /** - * Delete - * - * @param host - * @param path - * @param method - * @param headers - * @param querys - * @return - * @throws Exception - */ - public static HttpResponse doDelete(String host, String path, String method, - Map headers, - Map querys) - throws Exception { - HttpClient httpClient = wrapClient(host); - - HttpDelete request = new HttpDelete(buildUrl(host, path, querys)); - for (Map.Entry e : headers.entrySet()) { - request.addHeader(e.getKey(), e.getValue()); - } - - return httpClient.execute(request); - } - - private static String buildUrl(String host, String path, Map querys) throws UnsupportedEncodingException { - StringBuilder sbUrl = new StringBuilder(); - sbUrl.append(host); - if (!StringUtils.isBlank(path)) { - sbUrl.append(path); - } - if (null != querys) { - StringBuilder sbQuery = new StringBuilder(); - for (Map.Entry query : querys.entrySet()) { - if (0 < sbQuery.length()) { - sbQuery.append("&"); - } - if (StringUtils.isBlank(query.getKey()) && !StringUtils.isBlank(query.getValue())) { - sbQuery.append(query.getValue()); - } - if (!StringUtils.isBlank(query.getKey())) { - sbQuery.append(query.getKey()); - if (!StringUtils.isBlank(query.getValue())) { - sbQuery.append("="); - sbQuery.append(URLEncoder.encode(query.getValue(), "utf-8")); - } - } - } - if (0 < sbQuery.length()) { - sbUrl.append("?").append(sbQuery); - } - } - - return sbUrl.toString(); - } - - private static HttpClient wrapClient(String host) { - HttpClient httpClient = new DefaultHttpClient(); - if (host.startsWith("https://")) { - sslClient(httpClient); - } - - return httpClient; - } - - private static void sslClient(HttpClient httpClient) { - try { - SSLContext ctx = SSLContext.getInstance("TLS"); - X509TrustManager tm = new X509TrustManager() { - public X509Certificate[] getAcceptedIssuers() { - return null; - } - - public void checkClientTrusted(X509Certificate[] xcs, String str) { - - } - - public void checkServerTrusted(X509Certificate[] xcs, String str) { - - } - }; - ctx.init(null, new TrustManager[]{tm}, null); - SSLSocketFactory ssf = new SSLSocketFactory(ctx); - ssf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); - ClientConnectionManager ccm = httpClient.getConnectionManager(); - SchemeRegistry registry = ccm.getSchemeRegistry(); - registry.register(new Scheme("https", 443, ssf)); - } catch (KeyManagementException ex) { - throw new RuntimeException(ex); - } catch (NoSuchAlgorithmException ex) { - throw new RuntimeException(ex); - } - } -} \ No newline at end of file diff --git a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/vo/MemberRespVo.java b/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/vo/MemberRespVo.java deleted file mode 100644 index a2c0427..0000000 --- a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/vo/MemberRespVo.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.forth.gulimall.gulimallauthserver.vo; - -import lombok.Data; -import lombok.ToString; - -import java.io.Serializable; -import java.util.Date; -@ToString -@Data -public class MemberRespVo implements Serializable { - /** - * id - */ - - private Long id; - /** - * 会员等级id - */ - private Long levelId; - /** - * 用户名 - */ - private String username; - /** - * 密码 - */ - private String password; - /** - * 昵称 - */ - private String nickname; - /** - * 手机号码 - */ - private String mobile; - /** - * 邮箱 - */ - private String email; - /** - * 头像 - */ - private String header; - /** - * 性别 - */ - private Integer gender; - /** - * 生日 - */ - private Date birth; - /** - * 所在城市 - */ - private String city; - /** - * 职业 - */ - private String job; - /** - * 个性签名 - */ - private String sign; - /** - * 用户来源 - */ - private Integer sourceType; - /** - * 积分 - */ - private Integer integration; - /** - * 成长值 - */ - private Integer growth; - /** - * 启用状态 - */ - private Integer status; - /** - * 注册时间 - */ - private Date createTime; - - private String socialUid; - private String accessToken; - private Long expiresIn; - -} diff --git a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/vo/SocialUserVo.java b/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/vo/SocialUserVo.java deleted file mode 100644 index 7b0937c..0000000 --- a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/vo/SocialUserVo.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.forth.gulimall.gulimallauthserver.vo; - -import lombok.Data; - -@Data -public class SocialUserVo { - - private String access_token; - private String remind_in; - private long expires_in; - private String uid; - private String isRealName; -} diff --git a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/vo/UserLoginVo.java b/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/vo/UserLoginVo.java deleted file mode 100644 index 2183675..0000000 --- a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/vo/UserLoginVo.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.forth.gulimall.gulimallauthserver.vo; - -import lombok.Data; - -@Data -public class UserLoginVo { - private String loginacct; - private String password; - -} - - - - diff --git a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/vo/UserRegistVo.java b/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/vo/UserRegistVo.java deleted file mode 100644 index bb96810..0000000 --- a/gulimall-auth-server/src/main/java/com/forth/gulimall/gulimallauthserver/vo/UserRegistVo.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.forth.gulimall.gulimallauthserver.vo; - -import lombok.Data; -import org.hibernate.validator.constraints.Length; - -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.Pattern; - -@Data -public class UserRegistVo { - - @NotEmpty(message = "用户名必须提交") - @Length(min = 6,max = 18,message = "用户名必须满足6-18位字符") - private String userName; - @NotEmpty(message = "密码必须填写") - @Length(min = 6,max = 18,message = "密码必须满足6-18位字符") - private String password; - @NotEmpty(message = "手机号必须填写") - @Pattern(regexp = "^[1]([3-9])[0-9]{9}$",message = "手机号格式不对") - private String phone; - @NotEmpty(message = "验证码不能为空") - private String code; - - -} diff --git a/gulimall-auth-server/src/main/resources/application.properties b/gulimall-auth-server/src/main/resources/application.properties deleted file mode 100644 index c17ba54..0000000 --- a/gulimall-auth-server/src/main/resources/application.properties +++ /dev/null @@ -1,17 +0,0 @@ -spring.application.name=gulimall-auth-server -spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848 -server.port=20000 - -spring.thymeleaf.cache=false -spring.mvc.view.prefix=/pages/ -spring.mvc.view.suffix=.html - - - -spring.redis.host=39.97.249.66 -spring.redis.port=6379 - - -spring.session.store-type=redis - -server.servlet.session.timeout=30m diff --git a/gulimall-auth-server/src/main/resources/application.yml b/gulimall-auth-server/src/main/resources/application.yml deleted file mode 100644 index f8360c5..0000000 --- a/gulimall-auth-server/src/main/resources/application.yml +++ /dev/null @@ -1,15 +0,0 @@ -spring: - cloud: - nacos: - discovery: - server-addr: 127.0.0.1:8848 - application: - name: gulimall-auth-server - thymeleaf: - cache: false - mvc: - view: - prefix: /pages/ - suffix: .html -server: - port: 20000 \ No newline at end of file diff --git a/gulimall-auth-server/src/main/resources/templates/index.html b/gulimall-auth-server/src/main/resources/templates/index.html deleted file mode 100644 index 4b8ed2a..0000000 --- a/gulimall-auth-server/src/main/resources/templates/index.html +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - gulimall - - - -
- -

欢迎登录

-
- 登录页面,调查问卷 -
-
- -
-
- -

依据《网络安全法》,为保障您的账户安全和正常使用,请尽快完成手机号验证!新版《谷粒商城隐私政策》已上线,将更有利于保护您的个人隐私。

-
-
- - -
-
- -
-
-
-

- 谷粒商城不会以任何理由要求您转账汇款,谨防诈骗。 -
[[${session.msg}]]
-

- - -
-
-

扫码登录

- | -

账户登录

-
-
- - -
打开手机谷粒商城 扫描二维码
-

- - 免输入 - - 更快 - - 更安全 -

-
- -
- -
- - 立即注册 -
-
-
-
- - - - - - - - diff --git a/gulimall-auth-server/src/main/resources/templates/reg.html b/gulimall-auth-server/src/main/resources/templates/reg.html deleted file mode 100644 index 3600fb7..0000000 --- a/gulimall-auth-server/src/main/resources/templates/reg.html +++ /dev/null @@ -1,6310 +0,0 @@ - - - - - - gulimall注册页面 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
欢迎注册
- -
- -
-
-
- -
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- - - 发送验证码 -
- -
- -
-
- 阅读并同意 - 《谷粒商城用户注册协议》 - 《隐私政策》 -
- -
-
-
- -
-
- -
-
-
-
- - 企业用户注册 -
-
- - INTERNATIONAL
CUSTOMERS
-
-
-
-
-

-
- -

Copyright©2004-2016 谷粒商城gulimall.com 版权所有

-

- - - - diff --git a/gulimall-auth-server/src/test/java/com/forth/gulimall/gulimallauthserver/GulimallAuthServerApplicationTests.java b/gulimall-auth-server/src/test/java/com/forth/gulimall/gulimallauthserver/GulimallAuthServerApplicationTests.java deleted file mode 100644 index 952d298..0000000 --- a/gulimall-auth-server/src/test/java/com/forth/gulimall/gulimallauthserver/GulimallAuthServerApplicationTests.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.forth.gulimall.gulimallauthserver; - -import com.forth.common.constant.AuthServerConstant; -import org.apache.http.HttpResponse; -import org.apache.http.util.EntityUtils; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.data.redis.core.StringRedisTemplate; -import com.forth.gulimall.gulimallauthserver.utils.HttpUtils; - - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import java.util.concurrent.TimeUnit; - -@SpringBootTest -class GulimallAuthServerApplicationTests { - @Autowired - StringRedisTemplate redisTemplate; - @Test - void contextLoads() { - - String code = UUID.randomUUID().toString().substring(0, 5)+"_"+System.currentTimeMillis(); - - String phone ="17634362804"; - //2,验证码的再次验证 存 key -phone value-code - //redis 缓存 - redisTemplate.opsForValue().set(AuthServerConstant.SMS_CODE_CACHE_PREFIX+phone,code,5, TimeUnit.MINUTES); - - } - @Test - public void send() { - String host = "https://aliapi.market.alicloudapi.com"; - String path = "/smsApi/verifyCode/send"; - String method = "POST"; - String appcode = "0995740d4ffe4f64bd63dcea04160b07"; - Map headers = new HashMap(); - //最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105 - headers.put("Authorization", "APPCODE " + appcode); - Map querys = new HashMap(); - querys.put("phone", "17634362804"); - querys.put("templateId", "540"); - querys.put("variables", "12345"); - Map bodys = new HashMap(); - - - try { - /** - * 重要提示如下: - * HttpUtils请从 - * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/src/main/java/com/aliyun/api/gateway/demo/util/HttpUtils.java - * 下载 - * - * 相应的依赖请参照 - * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/pom.xml - */ - HttpResponse response = HttpUtils.doPost(host, path, method, headers, querys, bodys); - System.out.println(response.toString()); - //获取response的body - //System.out.println(EntityUtils.toString(response.getEntity())); - } catch (Exception e) { - e.printStackTrace(); - }}} - diff --git a/gulimall-cart/pom.xml b/gulimall-cart/pom.xml deleted file mode 100644 index ea3bc8e..0000000 --- a/gulimall-cart/pom.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - 2.3.5.RELEASE - - - - com.forth.gulimall - gulimall-cart - 0.0.1-SNAPSHOT - gulimall-cart - 购物车 - - - 1.8 - Hoxton.SR8 - - - - - com.forth.gulimall - gulimall-common - 0.0.1-SNAPSHOT - - - com.forth.gulimall - gulimall-auth-server - 0.0.1-SNAPSHOT - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.cloud - spring-cloud-starter-openfeign - - - - org.springframework.boot - spring-boot-devtools - runtime - true - - - org.projectlombok - lombok - true - - - org.springframework.boot - spring-boot-starter-test - test - - - - - org.springframework.boot - spring-boot-starter-data-redis - - - - - org.springframework.session - spring-session-data-redis - - - - - - - - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - - - diff --git a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/GulimallCartApplication.java b/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/GulimallCartApplication.java deleted file mode 100644 index 3a8891d..0000000 --- a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/GulimallCartApplication.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.forth.gulimall.gulimall.cart; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.openfeign.EnableFeignClients; -import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession; - -@EnableRedisHttpSession -@EnableDiscoveryClient -@EnableFeignClients -@SpringBootApplication(exclude = DataSourceAutoConfiguration.class) -public class GulimallCartApplication { - - public static void main(String[] args) { - SpringApplication.run(GulimallCartApplication.class, args); - } - -} diff --git a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/config/GulimallSessionConfig.java b/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/config/GulimallSessionConfig.java deleted file mode 100644 index 7a5f2fd..0000000 --- a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/config/GulimallSessionConfig.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.forth.gulimall.gulimall.cart.config; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; -import org.springframework.data.redis.serializer.RedisSerializer; -import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession; -import org.springframework.session.web.http.CookieSerializer; -import org.springframework.session.web.http.DefaultCookieSerializer; -@EnableRedisHttpSession -@Configuration -public class GulimallSessionConfig { - @Bean - public CookieSerializer cookieSerializer(){ - DefaultCookieSerializer cookieSerializer = new DefaultCookieSerializer(); - - cookieSerializer.setDomainName("localhost"); - cookieSerializer.setCookieName("GULISESSION"); - return cookieSerializer; - } - @Bean - public RedisSerializer springSessionDefaultCookieSerializer(){ - return new GenericJackson2JsonRedisSerializer(); - } -} diff --git a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/config/GulimallWebConfig.java b/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/config/GulimallWebConfig.java deleted file mode 100644 index 40c04b7..0000000 --- a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/config/GulimallWebConfig.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.forth.gulimall.gulimall.cart.config; - -import com.forth.gulimall.gulimall.cart.interceptor.CartInterceptor; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.InterceptorRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -@Configuration -public class GulimallWebConfig implements WebMvcConfigurer { - - @Override - public void addInterceptors(InterceptorRegistry registry) { - registry.addInterceptor(new CartInterceptor()).addPathPatterns("/**"); - } -} diff --git a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/config/MyThreadConfig.java b/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/config/MyThreadConfig.java deleted file mode 100644 index 322e035..0000000 --- a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/config/MyThreadConfig.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.forth.gulimall.gulimall.cart.config; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import java.util.concurrent.Executors; -import java.util.concurrent.LinkedBlockingDeque; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -@Configuration -public class MyThreadConfig { - - @Bean - public ThreadPoolExecutor threadPoolExecutor(ThreadPoolConfigProperties pool){ - return new ThreadPoolExecutor(pool.getCoreSize(),pool.getMaxSize(),pool.getKeepAliveTime(), - TimeUnit.SECONDS,new LinkedBlockingDeque<>(100000), Executors.defaultThreadFactory(), - new ThreadPoolExecutor.AbortPolicy()); - } -} diff --git a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/config/ThreadPoolConfigProperties.java b/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/config/ThreadPoolConfigProperties.java deleted file mode 100644 index e859433..0000000 --- a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/config/ThreadPoolConfigProperties.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.forth.gulimall.gulimall.cart.config; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; -@ConfigurationProperties(prefix = "gulimall.thread") -@Component -@Data -public class ThreadPoolConfigProperties { - - private Integer coreSize; - private Integer maxSize; - private Integer keepAliveTime; -} diff --git a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/controller/CartController.java b/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/controller/CartController.java deleted file mode 100644 index 4d1825b..0000000 --- a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/controller/CartController.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.forth.gulimall.gulimall.cart.controller; - - -import com.forth.gulimall.gulimall.cart.feign.ProductFeignService; -import com.forth.gulimall.gulimall.cart.interceptor.CartInterceptor; -import com.forth.gulimall.gulimall.cart.service.CartService; -import com.forth.gulimall.gulimall.cart.vo.Cart; -import com.forth.gulimall.gulimall.cart.vo.CartItem; -import com.forth.gulimall.gulimall.cart.vo.UserInfoVo; -import org.checkerframework.checker.units.qual.C; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.mvc.support.RedirectAttributes; - -import java.util.List; -import java.util.concurrent.ExecutionException; - - -@Controller -public class CartController { - - @Autowired - private CartService cartService; - - - @GetMapping("/currentUserCartItems") - @ResponseBody - public List getCurrentUserCartItems(){ - List items=cartService.getUserCartItems(); - - return items; - - } - - @GetMapping("/deleteItem") - public String deleteItem(@RequestParam("skuId") Long skuId){ - -cartService.deleteItem(skuId); - return "redirect:/cart.html"; - } - - @GetMapping("/countItem") - public String countItem(@RequestParam("skuId") Long skuId,@RequestParam("num") Integer num){ - cartService.countItem(skuId,num); - return "redirect:/cart.html"; - } - - @GetMapping("/checkItem") - public String checkItem(@RequestParam("skuId") Long skuId,@RequestParam("check")Integer check){ - cartService.checkItem(skuId,check); - return "redirect:/cart.html"; - - - } - - /** - * 查看购物车 - * @param model - * @return - * @throws ExecutionException - * @throws InterruptedException - */ - @GetMapping("/cart.html") - public String cartListPage(Model model) throws ExecutionException, InterruptedException { - - UserInfoVo userInfoVo = CartInterceptor.threadLocal.get(); - - Cart cart =cartService.getCart(); - model.addAttribute("cart",cart); - System.out.println("--------------" + userInfoVo); - System.out.println("--------------" + cart.getItems()); - System.out.println("--------------" + cart); - - return "cartList"; - } - - - /** - * 添加商品到购物车 - * - * @return - */ - @GetMapping("/add") - public String add() { - - UserInfoVo userInfoVo = CartInterceptor.threadLocal.get(); - System.out.println("--------------" + userInfoVo); - - return "index"; - } - - /** - * 添加商品到购物车 - * - * @return - */ - @GetMapping("/addToCart") - public String addToCart(@RequestParam("skuId") Long skuId, @RequestParam("num") Integer num, RedirectAttributes ra) throws ExecutionException, InterruptedException { - - - System.out.println("--" + skuId + "---" + num); - - CartItem cartItem = cartService.addToCart(skuId, num); - UserInfoVo userInfoVo = CartInterceptor.threadLocal.get(); - System.out.println("--------------" + userInfoVo); - - // model.addAttribute("item", cartItem); - ra.addAttribute("skuId",skuId); - return "redirect:/addToCartSuccess.html"; - } - - /** - * 跳转到成功页 - * @param skuId - * @param model - * @return - */ - @GetMapping("/addToCartSuccess.html") - public String addToCartSuccessPage(@RequestParam("skuId") Long skuId,Model model) { - //重定向成功页面,再次查询购物车数据 - CartItem item = cartService.getCaerItem(skuId); - model.addAttribute("item",item); - - return "success"; - } - -} diff --git a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/feign/ProductFeignService.java b/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/feign/ProductFeignService.java deleted file mode 100644 index 24b6a6d..0000000 --- a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/feign/ProductFeignService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.forth.gulimall.gulimall.cart.feign; - -import com.forth.common.utils.R; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; - -import java.math.BigDecimal; -import java.util.List; - -@FeignClient("product") -public interface ProductFeignService { - @RequestMapping("/product/skuinfo/info/{skuId}") - //@RequiresPermissions("product:skuinfo:info") - R getSkuInfo(@PathVariable("skuId") Long skuId); - - @GetMapping("/product/skusaleattrvalue/stringlist/{skuId}") - List getSkuSaleAttrValue(@PathVariable("skuId") Long skuId); - @GetMapping("/product/skuinfo/{skuId}/price") - BigDecimal getPrice(@PathVariable("skuId") Long skuId); -} diff --git a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/interceptor/CartInterceptor.java b/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/interceptor/CartInterceptor.java deleted file mode 100644 index ef2cbf5..0000000 --- a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/interceptor/CartInterceptor.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.forth.gulimall.gulimall.cart.interceptor; - -import com.forth.common.constant.AuthServerConstant; -import com.forth.common.constant.CartConstant; - -import com.forth.gulimall.gulimall.cart.vo.UserInfoVo; -import com.forth.gulimall.gulimallauthserver.vo.MemberRespVo; -import org.apache.commons.lang.StringUtils; - -import org.springframework.web.servlet.HandlerInterceptor; -import org.springframework.web.servlet.ModelAndView; - -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import java.util.UUID; - -/** - * 在执行目标方法判断用户的登录状态 封装传递给controller 目标请求 - */ - -public class CartInterceptor implements HandlerInterceptor { - public static ThreadLocal threadLocal=new ThreadLocal<>(); - - /** - * 目标方法执行之前 - * - * @param request - * @param response - * @param handler - * @return - * @throws Exception - */ - @Override - public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { - - - - UserInfoVo userInfoVo = new UserInfoVo(); - HttpSession session = request.getSession(); - MemberRespVo attribute = (MemberRespVo) session.getAttribute(AuthServerConstant.LOGIN_USER); - - if (attribute != null) { - //用户登录 - userInfoVo.setUserId(attribute.getId()); - } else { - - } - - Cookie[] cookies = request.getCookies(); - if(cookies!=null &&cookies.length>0){ - for (Cookie cookie : cookies) { - //user-key - String name = cookie.getName(); - - if (name.equals(CartConstant.TEMP_USER_COOKIE_NAME)){ - userInfoVo.setUserKey(cookie.getValue()); - //获取到临时用户 改true - userInfoVo.setTempUser(true); - } - } - } - //如果没有临时用户 一定分配临时用户 -if(StringUtils.isEmpty(userInfoVo.getUserKey())){ - String s = UUID.randomUUID().toString(); - userInfoVo.setUserKey(s); -} - - //目标方法执行之前 - threadLocal.set(userInfoVo); - return true; - } - - /** - * 业务执行之后,分配临时用户,让浏览器保存 - * @param request - * @param response - * @param handler - * @param modelAndView - * @throws Exception - */ - @Override - public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { - UserInfoVo userInfoVo = threadLocal.get(); - //如果没有临时用户,会自动保存一个 - if(!userInfoVo.isTempUser()){ - //持续延长用户信息 - Cookie cookie = new Cookie(CartConstant.TEMP_USER_COOKIE_NAME, userInfoVo.getUserKey()); - cookie.setDomain("localhost"); - cookie.setMaxAge(CartConstant.TEMP_USER_COOKIE_NAME_TIMEOUT); - response.addCookie(cookie); - } - - } -} diff --git a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/service/CartService.java b/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/service/CartService.java deleted file mode 100644 index 6e1d2f3..0000000 --- a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/service/CartService.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.forth.gulimall.gulimall.cart.service; - -import com.forth.gulimall.gulimall.cart.vo.Cart; -import com.forth.gulimall.gulimall.cart.vo.CartItem; - -import java.util.List; -import java.util.concurrent.ExecutionException; - -public interface CartService { - /** - * 将商品添加到购物车 - * @param skuId - * @param num - * @return - * @throws ExecutionException - * @throws InterruptedException - */ - CartItem addToCart(Long skuId, Integer num) throws ExecutionException, InterruptedException; - - /**获取购物车的购物项 - * - * @param skuId - * @return - */ - CartItem getCaerItem(Long skuId); - - /** - * 获取购物车 - * @return - */ - Cart getCart() throws ExecutionException, InterruptedException; - - /** - * 清空购物车 - * @param cartKey - */ - void clearCart(String cartKey); - - /** - * 勾选购物项 - * @param skuId - * @param check - */ - void checkItem(Long skuId, Integer check); - - /** - * 修改购物项数量 - * @param skuId - * @param num - */ - void countItem(Long skuId, Integer num); - - /** - * 删除购物项 - * @param skuId - */ - void deleteItem(Long skuId); - - - List getUserCartItems(); - - -} diff --git a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/service/impl/CartServiceImpl.java b/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/service/impl/CartServiceImpl.java deleted file mode 100644 index 6fd1456..0000000 --- a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/service/impl/CartServiceImpl.java +++ /dev/null @@ -1,227 +0,0 @@ -package com.forth.gulimall.gulimall.cart.service.impl; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.TypeReference; -import com.forth.common.utils.R; -import com.forth.gulimall.gulimall.cart.feign.ProductFeignService; -import com.forth.gulimall.gulimall.cart.interceptor.CartInterceptor; -import com.forth.gulimall.gulimall.cart.service.CartService; -import com.forth.gulimall.gulimall.cart.vo.Cart; -import com.forth.gulimall.gulimall.cart.vo.CartItem; -import com.forth.gulimall.gulimall.cart.vo.SkuInfoVo; -import com.forth.gulimall.gulimall.cart.vo.UserInfoVo; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.BoundHashOperations; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.stereotype.Service; - -import java.math.BigDecimal; -import java.util.List; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.stream.Collectors; - -@Slf4j -@Service -public class CartServiceImpl implements CartService { - - @Autowired - StringRedisTemplate redisTemplate; - @Autowired - ProductFeignService productFeignService; - - @Autowired - ThreadPoolExecutor executor; - - - - private final String CART_PREFIX = "gulimall:cart:"; - - @Override - public CartItem addToCart(Long skuId, Integer num) throws ExecutionException, InterruptedException { - - BoundHashOperations cartOps = getCartOps(); - String res = (String) cartOps.get(skuId.toString()); - - if (StringUtils.isEmpty(res)) { - CartItem cartItem = new CartItem(); - //购物车没有此商品 - // 2.添加新商品到购物车 - //1,远程查到的商品信息 - CompletableFuture getSkuInfoTask = CompletableFuture.runAsync(() -> { - //查询要添加的商品 - R skuInfo = productFeignService.getSkuInfo(skuId); - System.out.println("查到的数据======>>>" + skuInfo); - - SkuInfoVo data = skuInfo.getData("skuInfo", new TypeReference() { - }); - System.out.println("查到的数据======>>>" + data); - cartItem.setCheck(true); - cartItem.setCount(num); - cartItem.setImage(data.getSkuDefaultImg()); - cartItem.setTitle(data.getSkuTitle()); - cartItem.setSkuId(skuId); - cartItem.setPrice(data.getPrice()); - }, executor); - //远程查询sku的;组合信息 - CompletableFuture getSkuSaleAttrValues = CompletableFuture.runAsync(() -> { - - List values = productFeignService.getSkuSaleAttrValue(skuId); - cartItem.setSkuAttr(values); - }, executor); - CompletableFuture.allOf(getSkuInfoTask, getSkuSaleAttrValues).get(); - String s = JSON.toJSONString(cartItem); - cartOps.put(skuId.toString(), s); - return cartItem; - } else { - // CartItem cartItem = new CartItem(); - //购物车由此商品 修改数量 - CartItem cartItem = JSON.parseObject(res, CartItem.class); - cartItem.setCount(cartItem.getCount() + num); - cartOps.put(skuId.toString(), JSON.toJSONString(cartItem)); - return cartItem; - } - - - } - - @Override - public CartItem getCaerItem(Long skuId) { - BoundHashOperations cartOps = getCartOps(); - String str = (String) cartOps.get(skuId.toString()); - CartItem cartItem = JSON.parseObject(str, CartItem.class); - - return cartItem; - } - - @Override - public Cart getCart() throws ExecutionException, InterruptedException { - Cart cart = new Cart(); - //是否登录 - UserInfoVo userInfoVo = CartInterceptor.threadLocal.get(); - if (userInfoVo.getUserId() != null) { - //1,登录 - String cartKey =CART_PREFIX + userInfoVo.getUserId(); - //登录后的购物车 - BoundHashOperations hashOps = redisTemplate.boundHashOps(cartKey); - //2,如果临时购物车的数据没有合并 - - //临时购物车 - String tempCartKey =CART_PREFIX + userInfoVo.getUserKey(); - List temCartItem = getCartItem(tempCartKey); - if(temCartItem!=null){ - //临时购物车有数据,需要合并【合并购物车】 - for (CartItem item : temCartItem) { - addToCart(item.getSkuId(),item.getCount()); - } - //清空临时购物车的数据 - clearCart(tempCartKey); - } - //3,获取登录后的购物车的数据【包括合并的】 - List cartItems = getCartItem(cartKey); - cart.setItems(cartItems); - }else { - //不登录 - String cartKey =CART_PREFIX + userInfoVo.getUserKey(); - //获取临时购物车的所有购物项 - List cartItem = getCartItem(cartKey); - cart.setItems(cartItem); - - } - - return cart; - } - - /** - * 获取要操作的购物车 - * - * @return - */ - private BoundHashOperations getCartOps() { - UserInfoVo userInfoVo = CartInterceptor.threadLocal.get(); - String cartKey = ""; - if (userInfoVo.getUserId() != null) { - cartKey = CART_PREFIX + userInfoVo.getUserId(); - } else { - cartKey = CART_PREFIX + userInfoVo.getUserKey(); - } - BoundHashOperations operations = redisTemplate.boundHashOps(cartKey); - return operations; - } - - /** - * 获取购物车 - * @param cartKey - * @return - */ - private List getCartItem(String cartKey){ - BoundHashOperations hashOps = redisTemplate.boundHashOps(cartKey); - List values = hashOps.values(); - if (values!=null&&values.size()>0){ - List collect = values.stream().map((obj) -> { - String str = (String) obj; - CartItem cartItem = JSON.parseObject(str, CartItem.class); - return cartItem; - }).collect(Collectors.toList()); - return collect; - } - - return null ; - } - @Override - public void clearCart(String cartKey){ - redisTemplate.delete(cartKey); - } - - @Override - public void checkItem(Long skuId, Integer check) { - BoundHashOperations cartOps = getCartOps(); - CartItem cardItem = getCaerItem(skuId); - cardItem.setCheck(check==1?true:false); - String s = JSON.toJSONString(cardItem); - cartOps.put(skuId.toString(),s); - - } - - @Override - public void countItem(Long skuId, Integer num) { - BoundHashOperations cartOps = getCartOps(); - CartItem cardItem = getCaerItem(skuId); - cardItem.setCount(num); - String s = JSON.toJSONString(cardItem); - cartOps.put(skuId.toString(),s); - } - - @Override - public void deleteItem(Long skuId) { - BoundHashOperations cartOps = getCartOps(); - cartOps.delete(skuId.toString()); - } - - @Override - public List getUserCartItems() { - UserInfoVo userInfoVo = CartInterceptor.threadLocal.get(); - if (userInfoVo.getUserId() == null) { - return null; - } else { - String cartKey = CART_PREFIX + userInfoVo.getUserId(); - List cartItem = getCartItem(cartKey); - //购物车里所有被选择的商品 - List collect = cartItem.stream() - .filter(item -> item.getCheck()) - .map(item->{ - //商品的最新价格 - BigDecimal price = productFeignService.getPrice(item.getSkuId()); - item.setPrice(price); - return item; - }) - .collect(Collectors.toList()); - return collect; - } - - - } -} diff --git a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/vo/Cart.java b/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/vo/Cart.java deleted file mode 100644 index 6e614bb..0000000 --- a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/vo/Cart.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.forth.gulimall.gulimall.cart.vo; - -import java.math.BigDecimal; -import java.util.List; - -public class Cart { - - List items; - private Integer countNum; - private Integer countType; - private BigDecimal totalAmount; - private BigDecimal reduce =new BigDecimal("0.00"); - - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public Integer getCountNum() { - int count =0; - if(items!=null && items.size()>0){ - for (CartItem item :items){ - count += item.getCount(); - } - } - return count; - } - - - - public Integer getCountType() { - int count =0; - if(items!=null && items.size()>0){ - for (CartItem item :items){ - count += 1; - - } - } - return count; - - } - - - - public BigDecimal getTotalAmount() { - BigDecimal amount = new BigDecimal("0"); - //计算购物项的总价 - if(items!=null && items.size()>0){ - for (CartItem item :items){ - if (item.getCheck()){ - BigDecimal totalPrice = item.getTotalPrice(); - amount = amount.add(totalPrice); - } - - } - } - //减去优惠的总价 - BigDecimal subtract = amount.subtract(getReduce()); - return subtract; - } - - public void setTotalAmount(BigDecimal totalAmount) { - this.totalAmount = totalAmount; - } - - public BigDecimal getReduce() { - return reduce; - } - - public void setReduce(BigDecimal reduce) { - this.reduce = reduce; - } -} diff --git a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/vo/CartItem.java b/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/vo/CartItem.java deleted file mode 100644 index 84926de..0000000 --- a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/vo/CartItem.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.forth.gulimall.gulimall.cart.vo; - - - -import java.math.BigDecimal; -import java.util.List; - -/**private long skuId; - private boolean check =true; - private String title; - private String image; - private List skuAttr; - private BigDecimal price; - private Integer count; - private BigDecimal totalPrice; - * 购物车内容 - */ - -public class CartItem { - - private long skuId; - private boolean check =true; - private String title; - private String image; - private List skuAttr; - private BigDecimal price; - private Integer count; - private BigDecimal totalPrice; - - public boolean getCheck() { - return check; - } - - public void setCheck(boolean check) { - this.check = check; - } - - /** - * 计算当前项的总价 - * @return - */ - public BigDecimal getTotalPrice() { - - return this.price.multiply(new BigDecimal(""+this.count)); - } - - public long getSkuId() { - return skuId; - } - - public void setSkuId(long skuId) { - this.skuId = skuId; - } - - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getImage() { - return image; - } - - public void setImage(String image) { - this.image = image; - } - - public List getSkuAttr() { - return skuAttr; - } - - public void setSkuAttr(List skuAttr) { - this.skuAttr = skuAttr; - } - - public BigDecimal getPrice() { - return price; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public Integer getCount() { - return count; - } - - public void setCount(Integer count) { - this.count = count; - } - - public void setTotalPrice(BigDecimal totalPrice) { - this.totalPrice = totalPrice; - } -} diff --git a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/vo/SkuInfoVo.java b/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/vo/SkuInfoVo.java deleted file mode 100644 index ae38268..0000000 --- a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/vo/SkuInfoVo.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.forth.gulimall.gulimall.cart.vo; - -import lombok.Data; -import lombok.ToString; - -import java.math.BigDecimal; -import java.util.Date; -@Data -@ToString -public class SkuInfoVo { - private Long skuId; - /** - * spuId - */ - private Long spuId; - /** - * sku名称 - */ - private String skuName; - /** - * sku介绍描述 - */ - private String skuDesc; - /** - * 所属分类id - */ - private Long catalogId; - /** - * 品牌id - */ - private Long brandId; - /** - * 默认图片 - */ - private String skuDefaultImg; - /** - * 标题 - */ - private String skuTitle; - /** - * 副标题 - */ - private String skuSubtitle; - /** - * 价格 - */ - private BigDecimal price; - /** - * 销量 - */ - private Long saleCount; - -} diff --git a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/vo/UserInfoVo.java b/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/vo/UserInfoVo.java deleted file mode 100644 index 65c7971..0000000 --- a/gulimall-cart/src/main/java/com/forth/gulimall/gulimall/cart/vo/UserInfoVo.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.forth.gulimall.gulimall.cart.vo; - -import lombok.Data; -import lombok.ToString; - - -@Data -public class UserInfoVo { - - private Long userId; - private String userKey; - private boolean tempUser =false; -} diff --git a/gulimall-cart/src/main/resources/application.properties b/gulimall-cart/src/main/resources/application.properties deleted file mode 100644 index a2cc5c2..0000000 --- a/gulimall-cart/src/main/resources/application.properties +++ /dev/null @@ -1,20 +0,0 @@ -server.port=30000 - -spring.application.name=gulimall-cart -spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848 - - -spring.thymeleaf.cache=false -spring.mvc.view.prefix=/pages/ -spring.mvc.view.suffix=.html - -spring.session.store-type=redis - -spring.redis.host=39.97.249.66 -spring.redis.port=6379 - -gulimall.thread.core-size=20 -gulimall.thread.max-size=200 -gulimall.thread.keep-alive-time=10 - - diff --git a/gulimall-cart/src/main/resources/templates/cartList.html b/gulimall-cart/src/main/resources/templates/cartList.html deleted file mode 100644 index cbee90e..0000000 --- a/gulimall-cart/src/main/resources/templates/cartList.html +++ /dev/null @@ -1,792 +0,0 @@ - - - - - 购物车 - - - - - - - - -
- - - - -
- - - -
-
-
-
- 全部商品 - -
- -
-
-
    -
  • 全选
  • -
  • 商品
  • -
  • 单价
  • -
  • 数量
  • -
  • 小计
  • -
  • 操作
  • -
-
- -
-

- 购物车还没商品,去购物 -

-
    -
  • -
    -
    -
    -
      -
    1. -
    2. -
      -
      -

      - TCL 55A950C 55英寸32核 -
      - 尺码: 55时 超薄曲面 人工智能 -

      - - -
      -
    3. -
    4. -

      ¥4599.00

      -
    5. -
    6. -

      - - - 5 - + -

      -
    7. -
    8. - ¥[[${#numbers.formatDecimal(item.totalPrice,3,2)}]]

    9. -
    10. -

      删除

      - -
    11. -
    -
    -
  • - -
-
-
-
-
    -
  • 全选
  • -
  • 删除选中的商品
  • -
  • 移到我的关注
  • -
  • 清除下柜商品
  • -
-
-
-   - -
    -
  • -
  • -
-
-
-
    -
  1. 总价:¥:[[${#numbers.formatDecimal(cart.totalAmount,3,2)}]] -
  2. -
  3. 优惠:¥[[${#numbers.formatDecimal(cart.reduce,1,2)}]]
  4. -
-
-
- -
-
-
-
- -
-

- 删除 -

-
-
-
-
-
  • 删除商品?
  • -
  • 您可以选择移到关注,或删除商品。
  • -
    -
    -
    -
    - - -
    -
    -
    -

    - 删除 -

    -
    -
    -
    请至少选中一件商品!
    -
    -
    -
    -

    - 删除 -

    -
    -
    -
    -
    -
  • 移到关注
  • -
  • 移动后选中商品将不再购物车中显示
  • -
    -
    -
    -
    - - -
    -
    -
    -

    - 提示 -

    -
    -
    -
    没有下柜商品!
    -
    -
    - - - - - - - diff --git a/gulimall-cart/src/main/resources/templates/index.html b/gulimall-cart/src/main/resources/templates/index.html deleted file mode 100644 index b72046a..0000000 --- a/gulimall-cart/src/main/resources/templates/index.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -
    - -
    -
    -
    -
    -
    -
    -

    商品已成功加入购物车

    - -
    -
    -
    - -
    -
    - a -
    -
    -
    -
    -
    - -
    - - - - diff --git a/gulimall-cart/src/main/resources/templates/success.html b/gulimall-cart/src/main/resources/templates/success.html deleted file mode 100644 index 1309f24..0000000 --- a/gulimall-cart/src/main/resources/templates/success.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -
    - -
    -
    -
    - -
    -
    -
    -

    商品已成功加入购物车

    - -
    - -
    -
    -

    购物车中无商品

    去购物 -
    -
    - -
    -
    - -
    - - - - diff --git a/gulimall-cart/src/test/java/com/forth/gulimall/gulimall/cart/GulimallCartApplicationTests.java b/gulimall-cart/src/test/java/com/forth/gulimall/gulimall/cart/GulimallCartApplicationTests.java deleted file mode 100644 index f86fc42..0000000 --- a/gulimall-cart/src/test/java/com/forth/gulimall/gulimall/cart/GulimallCartApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.forth.gulimall.gulimall.cart; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class GulimallCartApplicationTests { - - @Test - void contextLoads() { - } - -} diff --git a/gulimall-common/pom.xml b/gulimall-common/pom.xml index 75a5875..c30a20d 100644 --- a/gulimall-common/pom.xml +++ b/gulimall-common/pom.xml @@ -44,75 +44,44 @@ 2.6 - com.alibaba.cloud spring-cloud-starter-alibaba-nacos-discovery - + - com.alibaba.cloud - spring-cloud-starter-alibaba-nacos-config - - - - - - - - - - - - - - - - - - - - - org.springframework.boot - spring-boot-configuration-processor - true - - - org.springframework.boot - spring-boot-starter-validation + mysql + mysql-connector-java + 8.0.17 - com.alibaba fastjson - 1.2.15 + 1.2.72 - org.apache.httpcomponents - httpclient - 4.2.1 - - - org.apache.httpcomponents - httpcore - 4.2.1 + javax.servlet + servlet-api + 2.5 + provided + - commons-lang - commons-lang - 2.6 + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + - org.eclipse.jetty - jetty-util - 9.3.7.v20160115 + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + - junit - junit - 4.5 - test + javax.validation + validation-api + 2.0.1.Final + diff --git a/gulimall-common/src/main/java/com/forth/common/constant/AuthServerConstant.java b/gulimall-common/src/main/java/com/forth/common/constant/AuthServerConstant.java deleted file mode 100644 index b55f5c8..0000000 --- a/gulimall-common/src/main/java/com/forth/common/constant/AuthServerConstant.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.forth.common.constant; - -public class AuthServerConstant { - - public static final String SMS_CODE_CACHE_PREFIX ="sms:code:"; - public static final String LOGIN_USER ="loginUser"; - -} diff --git a/gulimall-common/src/main/java/com/forth/common/constant/CartConstant.java b/gulimall-common/src/main/java/com/forth/common/constant/CartConstant.java deleted file mode 100644 index ce5b0b2..0000000 --- a/gulimall-common/src/main/java/com/forth/common/constant/CartConstant.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.forth.common.constant; - -public class CartConstant { - - public static final String TEMP_USER_COOKIE_NAME="user-key"; - public static final int TEMP_USER_COOKIE_NAME_TIMEOUT=60*60*24*30; -} diff --git a/gulimall-common/src/main/java/com/forth/common/exception/BizCodeEnume.java b/gulimall-common/src/main/java/com/forth/common/exception/BizCodeEnume.java index 143f865..8bdc97a 100644 --- a/gulimall-common/src/main/java/com/forth/common/exception/BizCodeEnume.java +++ b/gulimall-common/src/main/java/com/forth/common/exception/BizCodeEnume.java @@ -1,16 +1,27 @@ package com.forth.common.exception; +/*** + * 错误码和错误信息定义类 + * 1. 错误码定义规则为5为数字 + * 2. 前两位表示业务场景,最后三位表示错误码。例如:100001。10:通用 001:系统未知异常 + * 3. 维护错误码后需要维护错误描述,将他们定义为枚举形式 + * 错误码列表: + * 10: 通用 + * 001:参数格式校验 + * 11: 商品 + * 12: 订单 + * 13: 购物车 + * 14: 物流 + * + * + */ public enum BizCodeEnume { - UNKNOW_EXCEPTION(10000, "系统未知异常"), - VAILD_EXCEPTION(10001, "参数格式校验失败"), - LOGINACCT_PASSWORD_EXCEPTION(15003, "账号密码错误"), - NO_STOCK_EXCEPTION(21000, "商品库存不足"); - + UNKNOW_EXCEPTION(10000,"系统未知异常"), + VAILD_EXCEPTION(10001,"参数格式校验失败"); private int code; private String msg; - - BizCodeEnume(int code, String msg) { + BizCodeEnume(int code,String msg){ this.code = code; this.msg = msg; } diff --git a/gulimall-common/src/main/java/com/forth/common/exception/NoStockException.java b/gulimall-common/src/main/java/com/forth/common/exception/NoStockException.java deleted file mode 100644 index 374b73c..0000000 --- a/gulimall-common/src/main/java/com/forth/common/exception/NoStockException.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.forth.common.exception; - - -public class NoStockException extends RuntimeException{ - private Long skuId; - public NoStockException(Long skuId){ - super("商品id:"+skuId+";没有足够库存"); - - } - - public NoStockException(String msg) { - super("商品id:没有足够库存"); - } - - public Long getSkuId() { - return skuId; - } - - public void setSkuId(Long skuId) { - this.skuId = skuId; - } -} - diff --git a/gulimall-common/src/main/java/com/forth/common/utils/HttpUtils.java b/gulimall-common/src/main/java/com/forth/common/utils/HttpUtils.java deleted file mode 100644 index 3ec251c..0000000 --- a/gulimall-common/src/main/java/com/forth/common/utils/HttpUtils.java +++ /dev/null @@ -1,315 +0,0 @@ -package com.forth.common.utils; - -import org.apache.commons.lang.StringUtils; -import org.apache.http.HttpResponse; -import org.apache.http.NameValuePair; -import org.apache.http.client.HttpClient; -import org.apache.http.client.entity.UrlEncodedFormEntity; -import org.apache.http.client.methods.HttpDelete; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.methods.HttpPut; -import org.apache.http.conn.ClientConnectionManager; -import org.apache.http.conn.scheme.Scheme; -import org.apache.http.conn.scheme.SchemeRegistry; -import org.apache.http.conn.ssl.SSLSocketFactory; -import org.apache.http.entity.ByteArrayEntity; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.message.BasicNameValuePair; - -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManager; -import javax.net.ssl.X509TrustManager; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.security.KeyManagementException; -import java.security.NoSuchAlgorithmException; -import java.security.cert.X509Certificate; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -public class HttpUtils { - - /** - * get - * - * @param host - * @param path - * @param method - * @param headers - * @param querys - * @return - * @throws Exception - */ - public static HttpResponse doGet(String host, String path, String method, - Map headers, - Map querys) - throws Exception { - HttpClient httpClient = wrapClient(host); - - HttpGet request = new HttpGet(buildUrl(host, path, querys)); - for (Map.Entry e : headers.entrySet()) { - request.addHeader(e.getKey(), e.getValue()); - } - - return httpClient.execute(request); - } - - /** - * post form - * - * @param host - * @param path - * @param method - * @param headers - * @param querys - * @param bodys - * @return - * @throws Exception - */ - public static HttpResponse doPost(String host, String path, String method, - Map headers, - Map querys, - Map bodys) - throws Exception { - HttpClient httpClient = wrapClient(host); - - HttpPost request = new HttpPost(buildUrl(host, path, querys)); - for (Map.Entry e : headers.entrySet()) { - request.addHeader(e.getKey(), e.getValue()); - } - - if (bodys != null) { - List nameValuePairList = new ArrayList(); - - for (String key : bodys.keySet()) { - nameValuePairList.add(new BasicNameValuePair(key, bodys.get(key))); - } - UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nameValuePairList, "utf-8"); - formEntity.setContentType("application/x-www-form-urlencoded; charset=UTF-8"); - request.setEntity(formEntity); - } - - return httpClient.execute(request); - } - - /** - * Post String - * - * @param host - * @param path - * @param method - * @param headers - * @param querys - * @param body - * @return - * @throws Exception - */ - public static HttpResponse doPost(String host, String path, String method, - Map headers, - Map querys, - String body) - throws Exception { - HttpClient httpClient = wrapClient(host); - - HttpPost request = new HttpPost(buildUrl(host, path, querys)); - for (Map.Entry e : headers.entrySet()) { - request.addHeader(e.getKey(), e.getValue()); - } - - if (StringUtils.isNotBlank(body)) { - request.setEntity(new StringEntity(body, "utf-8")); - } - - return httpClient.execute(request); - } - - /** - * Post stream - * - * @param host - * @param path - * @param method - * @param headers - * @param querys - * @param body - * @return - * @throws Exception - */ - public static HttpResponse doPost(String host, String path, String method, - Map headers, - Map querys, - byte[] body) - throws Exception { - HttpClient httpClient = wrapClient(host); - - HttpPost request = new HttpPost(buildUrl(host, path, querys)); - for (Map.Entry e : headers.entrySet()) { - request.addHeader(e.getKey(), e.getValue()); - } - - if (body != null) { - request.setEntity(new ByteArrayEntity(body)); - } - - return httpClient.execute(request); - } - - /** - * Put String - * - * @param host - * @param path - * @param method - * @param headers - * @param querys - * @param body - * @return - * @throws Exception - */ - public static HttpResponse doPut(String host, String path, String method, - Map headers, - Map querys, - String body) - throws Exception { - HttpClient httpClient = wrapClient(host); - - HttpPut request = new HttpPut(buildUrl(host, path, querys)); - for (Map.Entry e : headers.entrySet()) { - request.addHeader(e.getKey(), e.getValue()); - } - - if (StringUtils.isNotBlank(body)) { - request.setEntity(new StringEntity(body, "utf-8")); - } - - return httpClient.execute(request); - } - - /** - * Put stream - * - * @param host - * @param path - * @param method - * @param headers - * @param querys - * @param body - * @return - * @throws Exception - */ - public static HttpResponse doPut(String host, String path, String method, - Map headers, - Map querys, - byte[] body) - throws Exception { - HttpClient httpClient = wrapClient(host); - - HttpPut request = new HttpPut(buildUrl(host, path, querys)); - for (Map.Entry e : headers.entrySet()) { - request.addHeader(e.getKey(), e.getValue()); - } - - if (body != null) { - request.setEntity(new ByteArrayEntity(body)); - } - - return httpClient.execute(request); - } - - /** - * Delete - * - * @param host - * @param path - * @param method - * @param headers - * @param querys - * @return - * @throws Exception - */ - public static HttpResponse doDelete(String host, String path, String method, - Map headers, - Map querys) - throws Exception { - HttpClient httpClient = wrapClient(host); - - HttpDelete request = new HttpDelete(buildUrl(host, path, querys)); - for (Map.Entry e : headers.entrySet()) { - request.addHeader(e.getKey(), e.getValue()); - } - - return httpClient.execute(request); - } - - private static String buildUrl(String host, String path, Map querys) throws UnsupportedEncodingException { - StringBuilder sbUrl = new StringBuilder(); - sbUrl.append(host); - if (!StringUtils.isBlank(path)) { - sbUrl.append(path); - } - if (null != querys) { - StringBuilder sbQuery = new StringBuilder(); - for (Map.Entry query : querys.entrySet()) { - if (0 < sbQuery.length()) { - sbQuery.append("&"); - } - if (StringUtils.isBlank(query.getKey()) && !StringUtils.isBlank(query.getValue())) { - sbQuery.append(query.getValue()); - } - if (!StringUtils.isBlank(query.getKey())) { - sbQuery.append(query.getKey()); - if (!StringUtils.isBlank(query.getValue())) { - sbQuery.append("="); - sbQuery.append(URLEncoder.encode(query.getValue(), "utf-8")); - } - } - } - if (0 < sbQuery.length()) { - sbUrl.append("?").append(sbQuery); - } - } - - return sbUrl.toString(); - } - - private static HttpClient wrapClient(String host) { - HttpClient httpClient = new DefaultHttpClient(); - if (host.startsWith("https://")) { - sslClient(httpClient); - } - - return httpClient; - } - - private static void sslClient(HttpClient httpClient) { - try { - SSLContext ctx = SSLContext.getInstance("TLS"); - X509TrustManager tm = new X509TrustManager() { - public X509Certificate[] getAcceptedIssuers() { - return null; - } - - public void checkClientTrusted(X509Certificate[] xcs, String str) { - - } - - public void checkServerTrusted(X509Certificate[] xcs, String str) { - - } - }; - ctx.init(null, new TrustManager[]{tm}, null); - SSLSocketFactory ssf = new SSLSocketFactory(ctx); - ssf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); - ClientConnectionManager ccm = httpClient.getConnectionManager(); - SchemeRegistry registry = ccm.getSchemeRegistry(); - registry.register(new Scheme("https", 443, ssf)); - } catch (KeyManagementException ex) { - throw new RuntimeException(ex); - } catch (NoSuchAlgorithmException ex) { - throw new RuntimeException(ex); - } - } -} \ No newline at end of file diff --git a/gulimall-common/src/main/java/com/forth/common/utils/R.java b/gulimall-common/src/main/java/com/forth/common/utils/R.java index 2abbaf8..90b548f 100644 --- a/gulimall-common/src/main/java/com/forth/common/utils/R.java +++ b/gulimall-common/src/main/java/com/forth/common/utils/R.java @@ -1,8 +1,8 @@ /** * Copyright (c) 2016-2019 人人开源 All rights reserved. - *

    + * * https://www.renren.io - *

    + * * 版权所有,侵权必究! */ @@ -12,8 +12,6 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.TypeReference; import org.apache.http.HttpStatus; - - import java.util.HashMap; import java.util.Map; @@ -23,70 +21,75 @@ import java.util.Map; * @author Mark sunlightcs@gmail.com */ public class R extends HashMap { - private static final long serialVersionUID = 1L; - - public T getData(String key,TypeReference typeReference){ - Object data =get(key); - String s = JSON.toJSONString(data); - T t = JSON.parseObject(s,typeReference); - return t; - } - public T getData(TypeReference typeReference){ - Object data =get("data");//默认map - String s = JSON.toJSONString(data); - T t = JSON.parseObject(s,typeReference); - return t; - } - - public R() { - put("code", 0); - put("msg", "success"); - } - - public static R error() { - return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, "未知异常,请联系管理员"); - } - - public static R error(String msg) { - return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, msg); - } - - public R setData(Object data) { - put("data", data); - return this; - } - - public static R error(int code, String msg) { - R r = new R(); - r.put("code", code); - r.put("msg", msg); - return r; - } - - public static R ok(String msg) { - R r = new R(); - r.put("msg", msg); - return r; - } - - public static R ok(Map map) { - R r = new R(); - r.putAll(map); - return r; - } - - public static R ok() { - return new R(); - } - - public R put(String key, Object value) { - super.put(key, value); - return this; - } - - - public Integer getCode() { - - return (Integer) this.get("code"); - } + private static final long serialVersionUID = 1L; + + //利用alibaba提供的fastjson进行逆转 + public T getData(String key, TypeReference typeReference) { + //默认是map + Object data = get(key); + + String s = JSON.toJSONString(data); + T t = JSON.parseObject(s, typeReference); + return t; + } + //返回数据 + public R setData(Object data) { + put("data", data); + return this; + } + //利用alibaba提供的fastjson进行逆转 + public T getData(TypeReference typeReference) { + //默认是map + Object data = get("data"); + + String s = JSON.toJSONString(data); + T t = JSON.parseObject(s, typeReference); + return t; + } + + + public R() { + put("code", 0); + put("msg", "success"); + } + + public static R error() { + return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, "未知异常,请联系管理员"); + } + + public static R error(String msg) { + return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, msg); + } + + public static R error(int code, String msg) { + R r = new R(); + r.put("code", code); + r.put("msg", msg); + return r; + } + + public static R ok(String msg) { + R r = new R(); + r.put("msg", msg); + return r; + } + + public static R ok(Map map) { + R r = new R(); + r.putAll(map); + return r; + } + + public static R ok() { + return new R(); + } + + public R put(String key, Object value) { + super.put(key, value); + return this; + } + + public Integer getCode() { + return (Integer) this.get("code"); + } } diff --git a/gulimall-common/src/main/java/com/forth/common/vo/MemberRespVo.java b/gulimall-common/src/main/java/com/forth/common/vo/MemberRespVo.java deleted file mode 100644 index eab6950..0000000 --- a/gulimall-common/src/main/java/com/forth/common/vo/MemberRespVo.java +++ /dev/null @@ -1,89 +0,0 @@ -//package com.forth.common.vo; -// -//import lombok.Data; -//import lombok.ToString; -// -//import java.io.Serializable; -//import java.util.Date; -//@ToString -//@Data -//public class MemberRespVo implements Serializable { -// /** -// * id -// */ -// -// private Long id; -// /** -// * 会员等级id -// */ -// private Long levelId; -// /** -// * 用户名 -// */ -// private String username; -// /** -// * 密码 -// */ -// private String password; -// /** -// * 昵称 -// */ -// private String nickname; -// /** -// * 手机号码 -// */ -// private String mobile; -// /** -// * 邮箱 -// */ -// private String email; -// /** -// * 头像 -// */ -// private String header; -// /** -// * 性别 -// */ -// private Integer gender; -// /** -// * 生日 -// */ -// private Date birth; -// /** -// * 所在城市 -// */ -// private String city; -// /** -// * 职业 -// */ -// private String job; -// /** -// * 个性签名 -// */ -// private String sign; -// /** -// * 用户来源 -// */ -// private Integer sourceType; -// /** -// * 积分 -// */ -// private Integer integration; -// /** -// * 成长值 -// */ -// private Integer growth; -// /** -// * 启用状态 -// */ -// private Integer status; -// /** -// * 注册时间 -// */ -// private Date createTime; -// -// private String socialUid; -// private String accessToken; -// private Long expiresIn; -// -//} diff --git a/gulimall-coupon/pom.xml b/gulimall-coupon/pom.xml index ea01519..9fbc362 100644 --- a/gulimall-coupon/pom.xml +++ b/gulimall-coupon/pom.xml @@ -8,7 +8,7 @@ 2.3.5.RELEASE - com.forth.gulimall + com.forth.coupon gulimall-coupon 0.0.1-SNAPSHOT gulimall-coupon diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/GulimallCouponApplication.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/GulimallCouponApplication.java index b19ce61..1476856 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/GulimallCouponApplication.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/GulimallCouponApplication.java @@ -1,12 +1,10 @@ package com.forth.gulimall.coupon; -import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; @EnableDiscoveryClient -@MapperScan("com.forth.gulimall.coupon.dao") @SpringBootApplication public class GulimallCouponApplication { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/CouponController.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/CouponController.java index d723e92..5cf11d9 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/CouponController.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/CouponController.java @@ -3,8 +3,9 @@ package com.forth.gulimall.coupon.controller; import java.util.Arrays; import java.util.Map; -//import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -21,23 +22,38 @@ import com.forth.common.utils.R; /** * 优惠券信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ +@RefreshScope @RestController @RequestMapping("coupon/coupon") public class CouponController { @Autowired private CouponService couponService; + @Value("${coupon.user.name}") + private String name; + @Value("${coupon.user.age}") + private Integer age; + + @RequestMapping("/test") + public R test(){ + return R.ok().put("name",name).put("age",age); + } + - @RequestMapping("/member/list") - public R membercoupon(){ - CouponEntity couponEntity = new CouponEntity(); + @RequestMapping("/member/list") + public R membercoupons(){ + CouponEntity couponEntity=new CouponEntity(); couponEntity.setCouponName("满100减10"); - return R.ok().put("coupons",Arrays.asList(couponEntity)); + return R.ok().put("coupons",Arrays.asList(couponEntity)); + } + + + /** * 列表 */ diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/CouponHistoryController.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/CouponHistoryController.java index aff008e..c78ba9a 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/CouponHistoryController.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/CouponHistoryController.java @@ -3,7 +3,6 @@ package com.forth.gulimall.coupon.controller; import java.util.Arrays; import java.util.Map; -//import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; @@ -21,9 +20,9 @@ import com.forth.common.utils.R; /** * 优惠券领取历史记录 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @RestController @RequestMapping("coupon/couponhistory") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/CouponSpuCategoryRelationController.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/CouponSpuCategoryRelationController.java index db23403..c02d569 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/CouponSpuCategoryRelationController.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/CouponSpuCategoryRelationController.java @@ -3,7 +3,6 @@ package com.forth.gulimall.coupon.controller; import java.util.Arrays; import java.util.Map; -//import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; @@ -21,9 +20,9 @@ import com.forth.common.utils.R; /** * 优惠券分类关联 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @RestController @RequestMapping("coupon/couponspucategoryrelation") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/CouponSpuRelationController.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/CouponSpuRelationController.java index 654c54c..3f12b60 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/CouponSpuRelationController.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/CouponSpuRelationController.java @@ -3,7 +3,6 @@ package com.forth.gulimall.coupon.controller; import java.util.Arrays; import java.util.Map; -//import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; @@ -21,9 +20,9 @@ import com.forth.common.utils.R; /** * 优惠券与产品关联 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:51 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @RestController @RequestMapping("coupon/couponspurelation") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/HomeAdvController.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/HomeAdvController.java index b0db7b9..5271e84 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/HomeAdvController.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/HomeAdvController.java @@ -3,7 +3,6 @@ package com.forth.gulimall.coupon.controller; import java.util.Arrays; import java.util.Map; -//import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; @@ -21,9 +20,9 @@ import com.forth.common.utils.R; /** * 首页轮播广告 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @RestController @RequestMapping("coupon/homeadv") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/HomeSubjectController.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/HomeSubjectController.java index ac797e2..0e5899a 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/HomeSubjectController.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/HomeSubjectController.java @@ -3,7 +3,6 @@ package com.forth.gulimall.coupon.controller; import java.util.Arrays; import java.util.Map; -//import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; @@ -21,9 +20,9 @@ import com.forth.common.utils.R; /** * 首页专题表【jd首页下面很多专题,每个专题链接新的页面,展示专题商品信息】 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @RestController @RequestMapping("coupon/homesubject") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/HomeSubjectSpuController.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/HomeSubjectSpuController.java index cc99980..ea1b93f 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/HomeSubjectSpuController.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/HomeSubjectSpuController.java @@ -3,7 +3,6 @@ package com.forth.gulimall.coupon.controller; import java.util.Arrays; import java.util.Map; -//import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; @@ -21,9 +20,9 @@ import com.forth.common.utils.R; /** * 专题商品 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @RestController @RequestMapping("coupon/homesubjectspu") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/MemberPriceController.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/MemberPriceController.java index ab427d3..1a7d9d1 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/MemberPriceController.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/MemberPriceController.java @@ -3,7 +3,6 @@ package com.forth.gulimall.coupon.controller; import java.util.Arrays; import java.util.Map; -//import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; @@ -21,9 +20,9 @@ import com.forth.common.utils.R; /** * 商品会员价格 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @RestController @RequestMapping("coupon/memberprice") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SeckillPromotionController.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SeckillPromotionController.java index 7a76e2e..7011912 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SeckillPromotionController.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SeckillPromotionController.java @@ -3,7 +3,6 @@ package com.forth.gulimall.coupon.controller; import java.util.Arrays; import java.util.Map; -//import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; @@ -21,9 +20,9 @@ import com.forth.common.utils.R; /** * 秒杀活动 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @RestController @RequestMapping("coupon/seckillpromotion") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SeckillSessionController.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SeckillSessionController.java index 0582bf2..7e7a16a 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SeckillSessionController.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SeckillSessionController.java @@ -1,15 +1,11 @@ package com.forth.gulimall.coupon.controller; import java.util.Arrays; +import java.util.List; import java.util.Map; -//import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import com.forth.gulimall.coupon.entity.SeckillSessionEntity; import com.forth.gulimall.coupon.service.SeckillSessionService; @@ -21,9 +17,9 @@ import com.forth.common.utils.R; /** * 秒杀活动场次 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @RestController @RequestMapping("coupon/seckillsession") @@ -31,6 +27,13 @@ public class SeckillSessionController { @Autowired private SeckillSessionService seckillSessionService; + @GetMapping("/lates3DaySession") + public R getLates3DaySession(){ + List sessions = seckillSessionService.getLates3DaySession(); + return R.ok().setData(sessions); + } + + /** * 列表 */ diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SeckillSkuNoticeController.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SeckillSkuNoticeController.java index aa507f6..a26d7c5 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SeckillSkuNoticeController.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SeckillSkuNoticeController.java @@ -3,7 +3,6 @@ package com.forth.gulimall.coupon.controller; import java.util.Arrays; import java.util.Map; -//import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; @@ -21,9 +20,9 @@ import com.forth.common.utils.R; /** * 秒杀商品通知订阅 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @RestController @RequestMapping("coupon/seckillskunotice") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SeckillSkuRelationController.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SeckillSkuRelationController.java index fc1d24b..0f8af63 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SeckillSkuRelationController.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SeckillSkuRelationController.java @@ -3,7 +3,6 @@ package com.forth.gulimall.coupon.controller; import java.util.Arrays; import java.util.Map; -//import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; @@ -21,9 +20,9 @@ import com.forth.common.utils.R; /** * 秒杀活动商品关联 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @RestController @RequestMapping("coupon/seckillskurelation") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SkuFullReductionController.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SkuFullReductionController.java index 9b480ad..26738fa 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SkuFullReductionController.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SkuFullReductionController.java @@ -3,7 +3,6 @@ package com.forth.gulimall.coupon.controller; import java.util.Arrays; import java.util.Map; -//import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; @@ -21,9 +20,9 @@ import com.forth.common.utils.R; /** * 商品满减信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @RestController @RequestMapping("coupon/skufullreduction") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SkuLadderController.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SkuLadderController.java index 4d17624..d48174a 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SkuLadderController.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SkuLadderController.java @@ -3,7 +3,6 @@ package com.forth.gulimall.coupon.controller; import java.util.Arrays; import java.util.Map; -//import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; @@ -21,9 +20,9 @@ import com.forth.common.utils.R; /** * 商品阶梯价格 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @RestController @RequestMapping("coupon/skuladder") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SpuBoundsController.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SpuBoundsController.java index d47402e..4fe140d 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SpuBoundsController.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/controller/SpuBoundsController.java @@ -3,7 +3,6 @@ package com.forth.gulimall.coupon.controller; import java.util.Arrays; import java.util.Map; -//import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; @@ -21,9 +20,9 @@ import com.forth.common.utils.R; /** * 商品spu积分设置 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @RestController @RequestMapping("coupon/spubounds") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/CouponDao.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/CouponDao.java index 93fba9b..138fcd1 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/CouponDao.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/CouponDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 优惠券信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Mapper public interface CouponDao extends BaseMapper { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/CouponHistoryDao.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/CouponHistoryDao.java index 6f0ef7c..84bae1d 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/CouponHistoryDao.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/CouponHistoryDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 优惠券领取历史记录 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Mapper public interface CouponHistoryDao extends BaseMapper { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/CouponSpuCategoryRelationDao.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/CouponSpuCategoryRelationDao.java index 8045f61..03be820 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/CouponSpuCategoryRelationDao.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/CouponSpuCategoryRelationDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 优惠券分类关联 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Mapper public interface CouponSpuCategoryRelationDao extends BaseMapper { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/CouponSpuRelationDao.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/CouponSpuRelationDao.java index ef1dd0e..e240b68 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/CouponSpuRelationDao.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/CouponSpuRelationDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 优惠券与产品关联 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:51 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Mapper public interface CouponSpuRelationDao extends BaseMapper { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/HomeAdvDao.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/HomeAdvDao.java index e264135..cc0a6a0 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/HomeAdvDao.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/HomeAdvDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 首页轮播广告 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Mapper public interface HomeAdvDao extends BaseMapper { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/HomeSubjectDao.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/HomeSubjectDao.java index 19ca2db..65cc6cc 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/HomeSubjectDao.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/HomeSubjectDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 首页专题表【jd首页下面很多专题,每个专题链接新的页面,展示专题商品信息】 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Mapper public interface HomeSubjectDao extends BaseMapper { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/HomeSubjectSpuDao.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/HomeSubjectSpuDao.java index efe2ed6..aac2a59 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/HomeSubjectSpuDao.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/HomeSubjectSpuDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 专题商品 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Mapper public interface HomeSubjectSpuDao extends BaseMapper { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/MemberPriceDao.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/MemberPriceDao.java index 09ff4e4..9e260e0 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/MemberPriceDao.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/MemberPriceDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 商品会员价格 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Mapper public interface MemberPriceDao extends BaseMapper { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SeckillPromotionDao.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SeckillPromotionDao.java index 953ea52..742a2dc 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SeckillPromotionDao.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SeckillPromotionDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 秒杀活动 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Mapper public interface SeckillPromotionDao extends BaseMapper { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SeckillSessionDao.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SeckillSessionDao.java index e0ed817..17b52f9 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SeckillSessionDao.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SeckillSessionDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 秒杀活动场次 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Mapper public interface SeckillSessionDao extends BaseMapper { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SeckillSkuNoticeDao.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SeckillSkuNoticeDao.java index 6de09d6..2dca7a5 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SeckillSkuNoticeDao.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SeckillSkuNoticeDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 秒杀商品通知订阅 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Mapper public interface SeckillSkuNoticeDao extends BaseMapper { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SeckillSkuRelationDao.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SeckillSkuRelationDao.java index e8faed1..f774c79 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SeckillSkuRelationDao.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SeckillSkuRelationDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 秒杀活动商品关联 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Mapper public interface SeckillSkuRelationDao extends BaseMapper { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SkuFullReductionDao.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SkuFullReductionDao.java index 15ad9a0..fa3e984 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SkuFullReductionDao.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SkuFullReductionDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 商品满减信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Mapper public interface SkuFullReductionDao extends BaseMapper { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SkuLadderDao.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SkuLadderDao.java index 0bea2c2..ec41571 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SkuLadderDao.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SkuLadderDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 商品阶梯价格 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Mapper public interface SkuLadderDao extends BaseMapper { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SpuBoundsDao.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SpuBoundsDao.java index 9ef61ff..adaf7ab 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SpuBoundsDao.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/dao/SpuBoundsDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 商品spu积分设置 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Mapper public interface SpuBoundsDao extends BaseMapper { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/CouponEntity.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/CouponEntity.java index 2dddfdf..c25d99e 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/CouponEntity.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/CouponEntity.java @@ -11,9 +11,9 @@ import lombok.Data; /** * 优惠券信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Data @TableName("sms_coupon") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/CouponHistoryEntity.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/CouponHistoryEntity.java index d4ce9b8..cc48b56 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/CouponHistoryEntity.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/CouponHistoryEntity.java @@ -10,9 +10,9 @@ import lombok.Data; /** * 优惠券领取历史记录 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Data @TableName("sms_coupon_history") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/CouponSpuCategoryRelationEntity.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/CouponSpuCategoryRelationEntity.java index 1f8606d..1d21ccf 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/CouponSpuCategoryRelationEntity.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/CouponSpuCategoryRelationEntity.java @@ -10,9 +10,9 @@ import lombok.Data; /** * 优惠券分类关联 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Data @TableName("sms_coupon_spu_category_relation") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/CouponSpuRelationEntity.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/CouponSpuRelationEntity.java index 4d097c0..8d14d17 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/CouponSpuRelationEntity.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/CouponSpuRelationEntity.java @@ -10,9 +10,9 @@ import lombok.Data; /** * 优惠券与产品关联 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:51 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Data @TableName("sms_coupon_spu_relation") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/HomeAdvEntity.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/HomeAdvEntity.java index 2b61bf7..a3801f9 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/HomeAdvEntity.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/HomeAdvEntity.java @@ -10,9 +10,9 @@ import lombok.Data; /** * 首页轮播广告 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Data @TableName("sms_home_adv") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/HomeSubjectEntity.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/HomeSubjectEntity.java index bf172cb..0081a6f 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/HomeSubjectEntity.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/HomeSubjectEntity.java @@ -10,9 +10,9 @@ import lombok.Data; /** * 首页专题表【jd首页下面很多专题,每个专题链接新的页面,展示专题商品信息】 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Data @TableName("sms_home_subject") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/HomeSubjectSpuEntity.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/HomeSubjectSpuEntity.java index 9736f0b..b588bc4 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/HomeSubjectSpuEntity.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/HomeSubjectSpuEntity.java @@ -10,9 +10,9 @@ import lombok.Data; /** * 专题商品 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Data @TableName("sms_home_subject_spu") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/MemberPriceEntity.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/MemberPriceEntity.java index 24c965a..4b64627 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/MemberPriceEntity.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/MemberPriceEntity.java @@ -11,9 +11,9 @@ import lombok.Data; /** * 商品会员价格 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Data @TableName("sms_member_price") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SeckillPromotionEntity.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SeckillPromotionEntity.java index 0defa64..3db6fc6 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SeckillPromotionEntity.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SeckillPromotionEntity.java @@ -10,9 +10,9 @@ import lombok.Data; /** * 秒杀活动 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Data @TableName("sms_seckill_promotion") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SeckillSessionEntity.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SeckillSessionEntity.java index 7267d05..067a7c3 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SeckillSessionEntity.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SeckillSessionEntity.java @@ -1,18 +1,21 @@ package com.forth.gulimall.coupon.entity; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.io.Serializable; import java.util.Date; +import java.util.List; + import lombok.Data; /** * 秒杀活动场次 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Data @TableName("sms_seckill_session") @@ -44,5 +47,6 @@ public class SeckillSessionEntity implements Serializable { * 创建时间 */ private Date createTime; - + @TableField(exist = false) + private List relationSkus; } diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SeckillSkuNoticeEntity.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SeckillSkuNoticeEntity.java index 5a5af19..da355c6 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SeckillSkuNoticeEntity.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SeckillSkuNoticeEntity.java @@ -10,9 +10,9 @@ import lombok.Data; /** * 秒杀商品通知订阅 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Data @TableName("sms_seckill_sku_notice") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SeckillSkuRelationEntity.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SeckillSkuRelationEntity.java index 58a82a1..0bc1f94 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SeckillSkuRelationEntity.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SeckillSkuRelationEntity.java @@ -11,9 +11,9 @@ import lombok.Data; /** * 秒杀活动商品关联 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Data @TableName("sms_seckill_sku_relation") @@ -40,15 +40,15 @@ public class SeckillSkuRelationEntity implements Serializable { /** * 秒杀价格 */ - private BigDecimal seckillPrice; + private Integer seckillPrice; /** * 秒杀总量 */ - private BigDecimal seckillCount; + private int seckillCount; /** * 每人限购数量 */ - private BigDecimal seckillLimit; + private int seckillLimit; /** * 排序 */ diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SkuFullReductionEntity.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SkuFullReductionEntity.java index dc51b39..2aca5e8 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SkuFullReductionEntity.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SkuFullReductionEntity.java @@ -11,9 +11,9 @@ import lombok.Data; /** * 商品满减信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Data @TableName("sms_sku_full_reduction") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SkuLadderEntity.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SkuLadderEntity.java index 9058347..94b6773 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SkuLadderEntity.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SkuLadderEntity.java @@ -11,9 +11,9 @@ import lombok.Data; /** * 商品阶梯价格 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Data @TableName("sms_sku_ladder") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SpuBoundsEntity.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SpuBoundsEntity.java index 1e2ebb9..80cb40b 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SpuBoundsEntity.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/entity/SpuBoundsEntity.java @@ -11,9 +11,9 @@ import lombok.Data; /** * 商品spu积分设置 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ @Data @TableName("sms_spu_bounds") diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/CouponHistoryService.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/CouponHistoryService.java index 53c710d..eb52881 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/CouponHistoryService.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/CouponHistoryService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 优惠券领取历史记录 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ public interface CouponHistoryService extends IService { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/CouponService.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/CouponService.java index edad5a2..41d7052 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/CouponService.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/CouponService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 优惠券信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ public interface CouponService extends IService { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/CouponSpuCategoryRelationService.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/CouponSpuCategoryRelationService.java index f654bc1..b0eacba 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/CouponSpuCategoryRelationService.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/CouponSpuCategoryRelationService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 优惠券分类关联 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ public interface CouponSpuCategoryRelationService extends IService { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/CouponSpuRelationService.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/CouponSpuRelationService.java index 43d46fc..bcd1bde 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/CouponSpuRelationService.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/CouponSpuRelationService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 优惠券与产品关联 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:51 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ public interface CouponSpuRelationService extends IService { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/HomeAdvService.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/HomeAdvService.java index e450522..5694095 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/HomeAdvService.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/HomeAdvService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 首页轮播广告 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ public interface HomeAdvService extends IService { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/HomeSubjectService.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/HomeSubjectService.java index f03e643..ae3b643 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/HomeSubjectService.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/HomeSubjectService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 首页专题表【jd首页下面很多专题,每个专题链接新的页面,展示专题商品信息】 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ public interface HomeSubjectService extends IService { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/HomeSubjectSpuService.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/HomeSubjectSpuService.java index c027768..409eb1d 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/HomeSubjectSpuService.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/HomeSubjectSpuService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 专题商品 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ public interface HomeSubjectSpuService extends IService { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/MemberPriceService.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/MemberPriceService.java index ecc73a9..7ab9c7d 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/MemberPriceService.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/MemberPriceService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 商品会员价格 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ public interface MemberPriceService extends IService { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SeckillPromotionService.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SeckillPromotionService.java index 678b0f9..f738842 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SeckillPromotionService.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SeckillPromotionService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 秒杀活动 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ public interface SeckillPromotionService extends IService { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SeckillSessionService.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SeckillSessionService.java index 50e2989..73248a3 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SeckillSessionService.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SeckillSessionService.java @@ -4,17 +4,20 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.forth.common.utils.PageUtils; import com.forth.gulimall.coupon.entity.SeckillSessionEntity; +import java.util.List; import java.util.Map; /** * 秒杀活动场次 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ public interface SeckillSessionService extends IService { PageUtils queryPage(Map params); + + List getLates3DaySession(); } diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SeckillSkuNoticeService.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SeckillSkuNoticeService.java index e007f51..a4f0e8d 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SeckillSkuNoticeService.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SeckillSkuNoticeService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 秒杀商品通知订阅 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ public interface SeckillSkuNoticeService extends IService { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SeckillSkuRelationService.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SeckillSkuRelationService.java index 366c7fb..0329782 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SeckillSkuRelationService.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SeckillSkuRelationService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 秒杀活动商品关联 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ public interface SeckillSkuRelationService extends IService { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SkuFullReductionService.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SkuFullReductionService.java index 24041ad..21f621d 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SkuFullReductionService.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SkuFullReductionService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 商品满减信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:49 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ public interface SkuFullReductionService extends IService { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SkuLadderService.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SkuLadderService.java index 36b5765..74abfa5 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SkuLadderService.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SkuLadderService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 商品阶梯价格 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ public interface SkuLadderService extends IService { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SpuBoundsService.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SpuBoundsService.java index 4c697ad..cbbc26b 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SpuBoundsService.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/SpuBoundsService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 商品spu积分设置 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 10:16:50 + * @author fourth-ChenAng + * @email 1982673145@qq.com + * @date 2020-11-11 10:11:00 */ public interface SpuBoundsService extends IService { diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/impl/SeckillSessionServiceImpl.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/impl/SeckillSessionServiceImpl.java index af0ba9f..d088a66 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/impl/SeckillSessionServiceImpl.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/impl/SeckillSessionServiceImpl.java @@ -1,7 +1,18 @@ package com.forth.gulimall.coupon.service.impl; +import com.forth.gulimall.coupon.entity.SeckillSkuRelationEntity; +import com.forth.gulimall.coupon.service.SeckillSkuRelationService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.format.DateTimeFormatter; +import java.util.List; import java.util.Map; +import java.util.stream.Collectors; + import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -16,6 +27,10 @@ import com.forth.gulimall.coupon.service.SeckillSessionService; @Service("seckillSessionService") public class SeckillSessionServiceImpl extends ServiceImpl implements SeckillSessionService { + @Autowired + SeckillSkuRelationService seckillSkuRelationService; + + @Override public PageUtils queryPage(Map params) { IPage page = this.page( @@ -26,4 +41,42 @@ public class SeckillSessionServiceImpl extends ServiceImpl getLates3DaySession() { +//计算最近三天的 +// Date date = new Date(); +// LocalDate now = LocalDate.now(); +// LocalDate plus = now.plus(Duration.ofDays(1)); +// LocalDate plus2 = now.plus(Duration.ofDays(2)); + List list = this.list(new QueryWrapper().between("start_time", startTime(), endTime())); + if(list!=null && list.size()>0){ + List collect = list.stream().map(session -> { + + Long id = session.getId(); + List relationEntities = seckillSkuRelationService.list(new QueryWrapper().eq("promotion_session_id", id)); + session.setRelationSkus(relationEntities); + return session; + }).collect(Collectors.toList()); + return collect; + } + return null; + + } + + private String startTime(){ + LocalDate now = LocalDate.now(); + LocalTime min = LocalTime.MIN; + LocalDateTime start = LocalDateTime.of(now, min); + String format = start.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + return format; + } + private String endTime(){ + LocalDate now = LocalDate.now(); + LocalDate plus2 = now.plusDays(2); + LocalTime max = LocalTime.MAX; + LocalDateTime end = LocalDateTime.of(plus2, max); + String format = end.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + return format; + } + } \ No newline at end of file diff --git a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/impl/SeckillSkuRelationServiceImpl.java b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/impl/SeckillSkuRelationServiceImpl.java index b1926df..5221e05 100644 --- a/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/impl/SeckillSkuRelationServiceImpl.java +++ b/gulimall-coupon/src/main/java/com/forth/gulimall/coupon/service/impl/SeckillSkuRelationServiceImpl.java @@ -1,5 +1,6 @@ package com.forth.gulimall.coupon.service.impl; +import com.alibaba.nacos.client.utils.StringUtils; import org.springframework.stereotype.Service; import java.util.Map; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -18,9 +19,14 @@ public class SeckillSkuRelationServiceImpl extends ServiceImpl params) { + QueryWrapper QueryWrapper = new QueryWrapper(); + String promotionSessionId = (String) params.get("promotionSessionId"); + if (!StringUtils.isEmpty(promotionSessionId)) { + QueryWrapper.eq("promotion_session_id",promotionSessionId); + } IPage page = this.page( new Query().getPage(params), - new QueryWrapper() + QueryWrapper ); return new PageUtils(page); diff --git a/gulimall-coupon/src/main/resources/application.yml b/gulimall-coupon/src/main/resources/application.yml index 673424c..092d288 100644 --- a/gulimall-coupon/src/main/resources/application.yml +++ b/gulimall-coupon/src/main/resources/application.yml @@ -1,21 +1,21 @@ -server: - port: 4005 spring: datasource: username: root password: root url: jdbc:mysql://39.97.249.66:3306/gulimall_sms - driver-class-name: com.mysql.cj.jdbc.Driver + driver-class-name: com.mysql.jdbc.Driver cloud: nacos: discovery: - server-addr: 39.97.249.66:8848 + server-addr: 127.0.0.1:8848 + jackson: + date-format: yyyy-MM-dd HH:mm:ss application: - name: coupon + name: gulimall-coupon mybatis-plus: mapper-locations: classpath:/mapper/**/*.xml global-config: db-config: - id-type: auto - - + id-type: AUTO +server: + port: 4005 \ No newline at end of file diff --git a/gulimall-coupon/src/main/resources/bootstrap.properties b/gulimall-coupon/src/main/resources/bootstrap.properties index 02adab5..4bf72a4 100644 --- a/gulimall-coupon/src/main/resources/bootstrap.properties +++ b/gulimall-coupon/src/main/resources/bootstrap.properties @@ -1,7 +1,16 @@ -spring.application.name=coupon -spring.cloud.nacos.config.server-addr=39.97.249.66:8848 -spring.cloud.nacos.config.namespace=70ae551e-e253-4abd-ba48-e7ec3c96f1ed - -spring.cloud.nacos.config.ext-config[0].data-id=coupon.yml -spring.cloud.nacos.config.ext-config[0].group=DEFAULT_GROUP -spring.cloud.nacos.config.ext-config[0].refresh=true \ No newline at end of file +spring.application.name=gulimall-coupon +spring.cloud.nacos.config.server-addr=127.0.0.1:8848 +spring.cloud.nacos.config.namespace=3b9fbaa4-ca84-46f4-894a-aec139c39313 +#spring.cloud.nacos.config.group=prod +# +#spring.cloud.nacos.config.ext-config[0].data-id=datasource.yml +#spring.cloud.nacos.config.ext-config[0].group=dev +#spring.cloud.nacos.config.ext-config[0].refresh=true +# +#spring.cloud.nacos.config.ext-config[1].data-id=mybatis.yml +#spring.cloud.nacos.config.ext-config[1].group=dev +#spring.cloud.nacos.config.ext-config[1].refresh=true +# +#spring.cloud.nacos.config.ext-config[2].data-id=other.yml +#spring.cloud.nacos.config.ext-config[2].group=dev +#spring.cloud.nacos.config.ext-config[2].refresh=true \ No newline at end of file diff --git a/gulimall-coupon/src/test/java/com/forth/gulimall/coupon/GulimallCouponApplicationTests.java b/gulimall-coupon/src/test/java/com/forth/gulimall/coupon/GulimallCouponApplicationTests.java index 1fef888..524ef42 100644 --- a/gulimall-coupon/src/test/java/com/forth/gulimall/coupon/GulimallCouponApplicationTests.java +++ b/gulimall-coupon/src/test/java/com/forth/gulimall/coupon/GulimallCouponApplicationTests.java @@ -1,23 +1,23 @@ package com.forth.gulimall.coupon; -import com.forth.gulimall.coupon.entity.CouponEntity; -import com.forth.gulimall.coupon.service.CouponService; import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.format.DateTimeFormatter; + @SpringBootTest class GulimallCouponApplicationTests { - @Autowired - CouponService couponService; - @Test void contextLoads() { - CouponEntity couponEntity = new CouponEntity(); - couponEntity.setCode("123456"); - couponService.save(couponEntity); - System.out.println("success"); + LocalDate now = LocalDate.now(); + LocalDate localDate = now.plusDays(2); + LocalDateTime of=LocalDateTime.of(localDate, LocalTime.MAX); + String format = of.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + System.out.println(format); } } diff --git a/gulimall-gateway/pom.xml b/gulimall-gateway/pom.xml index 5ad3121..cf2784e 100644 --- a/gulimall-gateway/pom.xml +++ b/gulimall-gateway/pom.xml @@ -8,29 +8,23 @@ 2.3.5.RELEASE - com.forth.gulimall + com.atguigu.gulimall gulimall-gateway 0.0.1-SNAPSHOT gulimall-gateway - 谷粒商城-网关路由 + API网关 1.8 - Hoxton.SR8 + Hoxton.SR9 - - com.alibaba.cloud - spring-cloud-starter-alibaba-nacos-discovery + com.forth.gulimall + gulimall-common + 0.0.1-SNAPSHOT - - - com.alibaba.cloud - spring-cloud-starter-alibaba-nacos-config - - org.springframework.cloud spring-cloud-starter-gateway @@ -52,14 +46,6 @@ pom import - - - com.alibaba.cloud - spring-cloud-alibaba-dependencies - 2.1.0.RELEASE - pom - import - diff --git a/gulimall-gateway/src/main/java/com/forth/gulimall/gateway/GulimallGatewayApplication.java b/gulimall-gateway/src/main/java/com/forth/gulimall/gateway/GulimallGatewayApplication.java deleted file mode 100644 index 874a551..0000000 --- a/gulimall-gateway/src/main/java/com/forth/gulimall/gateway/GulimallGatewayApplication.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.forth.gulimall.gateway; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; - -/** - * 1.开启服务注册发现(配置nacos注册中心地址) - * - */ -@EnableDiscoveryClient -@SpringBootApplication -public class GulimallGatewayApplication { - - public static void main(String[] args) { - SpringApplication.run(GulimallGatewayApplication.class, args); - } - -} diff --git a/gulimall-gateway/src/main/java/com/forth/gulimall/gateway/config/GulimallCorsConfiguration.java b/gulimall-gateway/src/main/java/com/forth/gulimall/gateway/config/GulimallCorsConfiguration.java deleted file mode 100644 index 197d464..0000000 --- a/gulimall-gateway/src/main/java/com/forth/gulimall/gateway/config/GulimallCorsConfiguration.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.forth.gulimall.gateway.config; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.cors.CorsConfiguration; -import org.springframework.web.cors.reactive.CorsConfigurationSource; -import org.springframework.web.cors.reactive.CorsWebFilter; -import org.springframework.web.cors.reactive.UrlBasedCorsConfigurationSource; -import org.springframework.web.server.ServerWebExchange; - -@Configuration -public class GulimallCorsConfiguration { - - @Bean - public CorsWebFilter corsWebFilter(){ - UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); - CorsConfiguration corsConfiguration = new CorsConfiguration(); - - //配置跨域 - corsConfiguration.addAllowedHeader("*"); - corsConfiguration.addAllowedMethod("*"); - corsConfiguration.addAllowedOrigin("*"); - //允许携带cookie跨域 - corsConfiguration.setAllowCredentials(true); - - source.registerCorsConfiguration("/**", corsConfiguration); - return new CorsWebFilter(source); - } -} diff --git a/gulimall-gateway/src/main/resources/application.yml b/gulimall-gateway/src/main/resources/application.yml index c0f0e3a..c5dd9d4 100644 --- a/gulimall-gateway/src/main/resources/application.yml +++ b/gulimall-gateway/src/main/resources/application.yml @@ -1,57 +1,50 @@ -server: - port: 88 - spring: - application: - name: gateway cloud: - nacos: - discovery: - server-addr: 39.97.249.66:8848 gateway: routes: - - id: qq_route - uri: https://www.qq.com - predicates: - - Query=url, qq - - - id: test_route - uri: https://www.baidu.com - predicates: - - Query=url, baidu - - - - id: gulimall_auth_route - uri: lb://gulimall-auth-server - predicates: - - Host=auth.gulimall.com - - id: gulimall_cart - uri: lb://gulimall-cart - predicates: - - Host=https://localhost:30000 - - id: product_route - uri: lb://gulimall-product - predicates: - - Path=/api/product/** - filters: - - RewritePath=/api/(?/?.*), /$\{segment} - - id: ware_route - uri: lb://gulimall-ware - predicates: - - Path=/api/ware/** - filters: - - RewritePath=/api/(?/?.*), /$\{segment} - - - id: admin_route - uri: lb://renren-fast - predicates: - - Path=/api/** - filters: - - RewritePath=/api/(?/?.*), /renren-fast/$\{segment} - - - - -# 前端项目,/api +# - id: qq_route +# uri: https://www.jd.com +# predicates: +# - Query=url,jd +# +# - id: test_route +# uri: https://www.qq.com +# predicates: +# - Query=url,qq +#秒杀 + - id: gulimall-coupon + uri: lb://gulimall-coupon + predicates: + - Path=/api/coupon/** + filters: + - RewritePath=/api/(?/?.*),/$\{segment} + + + +#商品服务 + - id: product_route + uri: lb://gulimall-product + predicates: + - Path=/api/product/** + filters: + - RewritePath=/api/(?/?.*),/$\{segment} + +#仓储 + - id: ware_route + uri: lb://gulimall-ware + predicates: + - Path=/api/ware/** + filters: + - RewritePath=/api/(?/?.*), /$\{segment} + + + +#前端项目 /api + - id: admin_route + uri: lb://renren-fast + predicates: + - Path=/api/** + filters: + - RewritePath=/api/(?/?.*), /renren-fast/$\{segment} diff --git a/gulimall-gateway/src/main/resources/bootstrap.properties b/gulimall-gateway/src/main/resources/bootstrap.properties index a14a8f7..3b7dbe2 100644 --- a/gulimall-gateway/src/main/resources/bootstrap.properties +++ b/gulimall-gateway/src/main/resources/bootstrap.properties @@ -1,7 +1,4 @@ -spring.application.name=gateway -spring.cloud.nacos.config.server-addr=39.97.249.66:8848 -spring.cloud.nacos.config.namespace=27b04c8e-0aa8-42d7-b8dd-0465c0743243 +spring.application.name=gulimall-coupon +spring.cloud.nacos.config.server-addr=127.0.0.1:8848 +spring.cloud.nacos.config.namespace=92eae236-89b8-4f72-b6e1-04ac9e6c59ae -spring.cloud.nacos.config.ext-config[0].data-id=gateway.yml -spring.cloud.nacos.config.ext-config[0].group=DEFAULT_GROUP -spring.cloud.nacos.config.ext-config[0].refresh=true \ No newline at end of file diff --git a/gulimall-gateway/src/test/java/com/forth/gulimall/gateway/GulimallGatewayApplicationTests.java b/gulimall-gateway/src/test/java/com/forth/gulimall/gateway/GulimallGatewayApplicationTests.java deleted file mode 100644 index cf4d0c7..0000000 --- a/gulimall-gateway/src/test/java/com/forth/gulimall/gateway/GulimallGatewayApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.forth.gulimall.gateway; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class GulimallGatewayApplicationTests { - - @Test - void contextLoads() { - } - -} diff --git a/gulimall-member/pom.xml b/gulimall-member/pom.xml index 0677a46..7628078 100644 --- a/gulimall-member/pom.xml +++ b/gulimall-member/pom.xml @@ -8,7 +8,7 @@ 2.3.5.RELEASE - com.forth.gulimall + com.forth.member gulimall-member 0.0.1-SNAPSHOT gulimall-member @@ -16,7 +16,7 @@ 1.8 - Hoxton.SR8 + Hoxton.SR9 diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/GulimallMemberApplication.java b/gulimall-member/src/main/java/com/forth/gulimall/member/GulimallMemberApplication.java index f835ed6..4d01a57 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/GulimallMemberApplication.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/GulimallMemberApplication.java @@ -1,20 +1,21 @@ package com.forth.gulimall.member; -import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.openfeign.EnableFeignClients; -import org.springframework.cloud.openfeign.FeignClient; +/** + * .想要远程调用别人的服务 + * 1.引入open-feign + * 编写一个借口 + * 声明接口每一个方法调用哪个远程服务的请求 + */ @EnableFeignClients(basePackages = "com.forth.gulimall.member.feign") @EnableDiscoveryClient -@MapperScan("com.forth.gulimall.member.dao") @SpringBootApplication public class GulimallMemberApplication { - - public static void main(String[] args) { - SpringApplication.run(GulimallMemberApplication.class, args); - } - + public static void main(String[] args) { + SpringApplication.run(GulimallMemberApplication.class,args); + } } diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/controller/GrowthChangeHistoryController.java b/gulimall-member/src/main/java/com/forth/gulimall/member/controller/GrowthChangeHistoryController.java index 535a2c9..249ad7e 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/controller/GrowthChangeHistoryController.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/controller/GrowthChangeHistoryController.java @@ -21,9 +21,9 @@ import com.forth.common.utils.R; /** * 成长值变化历史记录 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:56 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:42 */ @RestController @RequestMapping("member/growthchangehistory") diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/controller/IntegrationChangeHistoryController.java b/gulimall-member/src/main/java/com/forth/gulimall/member/controller/IntegrationChangeHistoryController.java index 61d5dc7..82facf6 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/controller/IntegrationChangeHistoryController.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/controller/IntegrationChangeHistoryController.java @@ -21,9 +21,9 @@ import com.forth.common.utils.R; /** * 积分变化历史记录 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:56 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:42 */ @RestController @RequestMapping("member/integrationchangehistory") diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberCollectSpuController.java b/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberCollectSpuController.java index 1b691de..72094d1 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberCollectSpuController.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberCollectSpuController.java @@ -21,9 +21,9 @@ import com.forth.common.utils.R; /** * 会员收藏的商品 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:55 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:41 */ @RestController @RequestMapping("member/membercollectspu") diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberCollectSubjectController.java b/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberCollectSubjectController.java index 4153e65..00499b1 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberCollectSubjectController.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberCollectSubjectController.java @@ -21,9 +21,9 @@ import com.forth.common.utils.R; /** * 会员收藏的专题活动 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:55 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:41 */ @RestController @RequestMapping("member/membercollectsubject") diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberController.java b/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberController.java index cfa5093..2d2b693 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberController.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberController.java @@ -4,15 +4,13 @@ import java.util.Arrays; import java.util.Map; //import org.apache.shiro.authz.annotation.RequiresPermissions; -import com.forth.common.exception.BizCodeEnume; -import com.forth.gulimall.member.exception.PhoneExistException; -import com.forth.gulimall.member.exception.UsernameExistException; import com.forth.gulimall.member.feign.CouponFeignService; -import com.forth.gulimall.member.vo.MemberLoginVo; -import com.forth.gulimall.member.vo.MemberRegistVo; -import com.forth.gulimall.member.vo.SocialUserVo; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; import com.forth.gulimall.member.entity.MemberEntity; import com.forth.gulimall.member.service.MemberService; @@ -20,89 +18,40 @@ import com.forth.common.utils.PageUtils; import com.forth.common.utils.R; + /** * 会员 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:56 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:42 */ @RestController @RequestMapping("member/member") public class MemberController { @Autowired private MemberService memberService; - @Autowired CouponFeignService couponFeignService; @RequestMapping("/coupons") - public R test() { - MemberEntity memberEntity = new MemberEntity(); - memberEntity.setNickname("张三"); + public R test(){ + MemberEntity memberEntity =new MemberEntity(); + memberEntity.setNickname("张三"); + R membercoupons =couponFeignService.membercoupons(); + return R.ok().put("member",memberEntity).put("coupons",membercoupons.get("coupons")); - R membercoupon = couponFeignService.membercoupon(); - return R.ok().put("member", memberEntity).put("coupons", membercoupon.get("coupons")); } - /** - * 社交登录 - * @param - * @return - */ - @PostMapping("/oauth/login") - public R oauthlogin(@RequestBody SocialUserVo svo) throws Exception { - MemberEntity m= memberService.login(svo); - System.out.println("----0+"+m); - - if(m!=null){ - return R.ok().setData(m); - }else { - return R.error(BizCodeEnume.LOGINACCT_PASSWORD_EXCEPTION.getCode(),BizCodeEnume.LOGINACCT_PASSWORD_EXCEPTION.getMsg()); - } - } - - /** - * 登录 - * @param vo 参数 - * @return - */ - @PostMapping("/login") - public R login(@RequestBody MemberLoginVo vo){ - MemberEntity m= memberService.login(vo); - System.out.println("----0+"+m); - - if(m!=null){ - return R.ok().setData(m); - }else { - return R.error(BizCodeEnume.LOGINACCT_PASSWORD_EXCEPTION.getCode(),BizCodeEnume.LOGINACCT_PASSWORD_EXCEPTION.getMsg()); - } - - } - - @PostMapping("/regist") - public R regist(@RequestBody MemberRegistVo vo) { - try { - - memberService.regist(vo); - }catch (PhoneExistException e){ - return R.error(15200,"手机号存在"); - }catch (UsernameExistException e){ - return R.error(15100,"用户名存在"); - } - - return R.ok(); - - } /** * 列表 */ @RequestMapping("/list") //@RequiresPermissions("member:member:list") - public R list(@RequestParam Map params) { + public R list(@RequestParam Map params){ PageUtils page = memberService.queryPage(params); return R.ok().put("page", page); @@ -114,8 +63,8 @@ public class MemberController { */ @RequestMapping("/info/{id}") //@RequiresPermissions("member:member:info") - public R info(@PathVariable("id") Long id) { - MemberEntity member = memberService.getById(id); + public R info(@PathVariable("id") Long id){ + MemberEntity member = memberService.getById(id); return R.ok().put("member", member); } @@ -125,8 +74,8 @@ public class MemberController { */ @RequestMapping("/save") //@RequiresPermissions("member:member:save") - public R save(@RequestBody MemberEntity member) { - memberService.save(member); + public R save(@RequestBody MemberEntity member){ + memberService.save(member); return R.ok(); } @@ -136,8 +85,8 @@ public class MemberController { */ @RequestMapping("/update") //@RequiresPermissions("member:member:update") - public R update(@RequestBody MemberEntity member) { - memberService.updateById(member); + public R update(@RequestBody MemberEntity member){ + memberService.updateById(member); return R.ok(); } @@ -147,8 +96,8 @@ public class MemberController { */ @RequestMapping("/delete") //@RequiresPermissions("member:member:delete") - public R delete(@RequestBody Long[] ids) { - memberService.removeByIds(Arrays.asList(ids)); + public R delete(@RequestBody Long[] ids){ + memberService.removeByIds(Arrays.asList(ids)); return R.ok(); } diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberLevelController.java b/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberLevelController.java index 8fcaf78..21787a0 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberLevelController.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberLevelController.java @@ -21,9 +21,9 @@ import com.forth.common.utils.R; /** * 会员等级 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:55 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:41 */ @RestController @RequestMapping("member/memberlevel") diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberLoginLogController.java b/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberLoginLogController.java index 3ed0ca3..290c10f 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberLoginLogController.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberLoginLogController.java @@ -21,9 +21,9 @@ import com.forth.common.utils.R; /** * 会员登录记录 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:55 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:41 */ @RestController @RequestMapping("member/memberloginlog") diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberReceiveAddressController.java b/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberReceiveAddressController.java index 5803d34..0dcff05 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberReceiveAddressController.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberReceiveAddressController.java @@ -1,13 +1,15 @@ package com.forth.gulimall.member.controller; import java.util.Arrays; -import java.util.List; import java.util.Map; //import org.apache.shiro.authz.annotation.RequiresPermissions; - import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; import com.forth.gulimall.member.entity.MemberReceiveAddressEntity; import com.forth.gulimall.member.service.MemberReceiveAddressService; @@ -19,9 +21,9 @@ import com.forth.common.utils.R; /** * 会员收货地址 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:55 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:42 */ @RestController @RequestMapping("member/memberreceiveaddress") @@ -29,11 +31,6 @@ public class MemberReceiveAddressController { @Autowired private MemberReceiveAddressService memberReceiveAddressService; - @GetMapping("/{memberId}/addresses") - public List getAddress(@PathVariable("memberId") Long memberId){ - List list= memberReceiveAddressService.getAddress(memberId); -return list; - } /** * 列表 */ diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberStatisticsInfoController.java b/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberStatisticsInfoController.java index b8e472a..33b217a 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberStatisticsInfoController.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/controller/MemberStatisticsInfoController.java @@ -21,9 +21,9 @@ import com.forth.common.utils.R; /** * 会员统计信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:56 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:42 */ @RestController @RequestMapping("member/memberstatisticsinfo") diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/dao/GrowthChangeHistoryDao.java b/gulimall-member/src/main/java/com/forth/gulimall/member/dao/GrowthChangeHistoryDao.java index 74b508c..58c3b7e 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/dao/GrowthChangeHistoryDao.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/dao/GrowthChangeHistoryDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 成长值变化历史记录 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:56 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:42 */ @Mapper public interface GrowthChangeHistoryDao extends BaseMapper { diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/dao/IntegrationChangeHistoryDao.java b/gulimall-member/src/main/java/com/forth/gulimall/member/dao/IntegrationChangeHistoryDao.java index 1420521..e1d970c 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/dao/IntegrationChangeHistoryDao.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/dao/IntegrationChangeHistoryDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 积分变化历史记录 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:56 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:42 */ @Mapper public interface IntegrationChangeHistoryDao extends BaseMapper { diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberCollectSpuDao.java b/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberCollectSpuDao.java index db098d8..df132be 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberCollectSpuDao.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberCollectSpuDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 会员收藏的商品 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:55 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:41 */ @Mapper public interface MemberCollectSpuDao extends BaseMapper { diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberCollectSubjectDao.java b/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberCollectSubjectDao.java index ce029ec..2bdf40f 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberCollectSubjectDao.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberCollectSubjectDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 会员收藏的专题活动 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:55 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:41 */ @Mapper public interface MemberCollectSubjectDao extends BaseMapper { diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberDao.java b/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberDao.java index 0939ee6..ecf037f 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberDao.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 会员 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:56 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:42 */ @Mapper public interface MemberDao extends BaseMapper { diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberLevelDao.java b/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberLevelDao.java index 2f7ba33..56197f2 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberLevelDao.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberLevelDao.java @@ -7,13 +7,11 @@ import org.apache.ibatis.annotations.Mapper; /** * 会员等级 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:55 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:41 */ @Mapper public interface MemberLevelDao extends BaseMapper { - - - MemberLevelEntity getDefaultLevel(); + } diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberLoginLogDao.java b/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberLoginLogDao.java index ad77f65..8208fef 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberLoginLogDao.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberLoginLogDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 会员登录记录 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:55 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:41 */ @Mapper public interface MemberLoginLogDao extends BaseMapper { diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberReceiveAddressDao.java b/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberReceiveAddressDao.java index 338731f..50a749c 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberReceiveAddressDao.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberReceiveAddressDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 会员收货地址 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:55 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:42 */ @Mapper public interface MemberReceiveAddressDao extends BaseMapper { diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberStatisticsInfoDao.java b/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberStatisticsInfoDao.java index 48ef757..3f7eae5 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberStatisticsInfoDao.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/dao/MemberStatisticsInfoDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 会员统计信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:56 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:42 */ @Mapper public interface MemberStatisticsInfoDao extends BaseMapper { diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/entity/GrowthChangeHistoryEntity.java b/gulimall-member/src/main/java/com/forth/gulimall/member/entity/GrowthChangeHistoryEntity.java index c8894e2..09d0b42 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/entity/GrowthChangeHistoryEntity.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/entity/GrowthChangeHistoryEntity.java @@ -10,9 +10,9 @@ import lombok.Data; /** * 成长值变化历史记录 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:56 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:42 */ @Data @TableName("ums_growth_change_history") diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/entity/IntegrationChangeHistoryEntity.java b/gulimall-member/src/main/java/com/forth/gulimall/member/entity/IntegrationChangeHistoryEntity.java index 04c9cea..18301ff 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/entity/IntegrationChangeHistoryEntity.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/entity/IntegrationChangeHistoryEntity.java @@ -10,9 +10,9 @@ import lombok.Data; /** * 积分变化历史记录 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:56 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:42 */ @Data @TableName("ums_integration_change_history") diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberCollectSpuEntity.java b/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberCollectSpuEntity.java index 6cfff75..00c9728 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberCollectSpuEntity.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberCollectSpuEntity.java @@ -10,9 +10,9 @@ import lombok.Data; /** * 会员收藏的商品 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:55 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:41 */ @Data @TableName("ums_member_collect_spu") diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberCollectSubjectEntity.java b/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberCollectSubjectEntity.java index 31ac0fe..bb1f4b4 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberCollectSubjectEntity.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberCollectSubjectEntity.java @@ -10,9 +10,9 @@ import lombok.Data; /** * 会员收藏的专题活动 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:55 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:41 */ @Data @TableName("ums_member_collect_subject") diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberEntity.java b/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberEntity.java index 9074780..9370559 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberEntity.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberEntity.java @@ -10,9 +10,9 @@ import lombok.Data; /** * 会员 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:56 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:42 */ @Data @TableName("ums_member") @@ -93,8 +93,4 @@ public class MemberEntity implements Serializable { */ private Date createTime; - private String socialUid; - private String accessToken; - private Long expiresIn; - } diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberLevelEntity.java b/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberLevelEntity.java index 8db3930..221b605 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberLevelEntity.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberLevelEntity.java @@ -11,9 +11,9 @@ import lombok.Data; /** * 会员等级 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:55 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:41 */ @Data @TableName("ums_member_level") diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberLoginLogEntity.java b/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberLoginLogEntity.java index 9e2e7b6..558dc95 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberLoginLogEntity.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberLoginLogEntity.java @@ -10,9 +10,9 @@ import lombok.Data; /** * 会员登录记录 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:55 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:41 */ @Data @TableName("ums_member_login_log") diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberReceiveAddressEntity.java b/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberReceiveAddressEntity.java index e4d6807..c2e35e1 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberReceiveAddressEntity.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberReceiveAddressEntity.java @@ -10,9 +10,9 @@ import lombok.Data; /** * 会员收货地址 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:55 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:42 */ @Data @TableName("ums_member_receive_address") diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberStatisticsInfoEntity.java b/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberStatisticsInfoEntity.java index 2bbebff..1586d87 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberStatisticsInfoEntity.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/entity/MemberStatisticsInfoEntity.java @@ -11,9 +11,9 @@ import lombok.Data; /** * 会员统计信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:56 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:42 */ @Data @TableName("ums_member_statistics_info") diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/exception/PhoneExistException.java b/gulimall-member/src/main/java/com/forth/gulimall/member/exception/PhoneExistException.java deleted file mode 100644 index c45a33f..0000000 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/exception/PhoneExistException.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.forth.gulimall.member.exception; - -public class PhoneExistException extends RuntimeException { - - public PhoneExistException(){ - super("手机号存在"); - } -} diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/exception/UsernameExistException.java b/gulimall-member/src/main/java/com/forth/gulimall/member/exception/UsernameExistException.java deleted file mode 100644 index 929e681..0000000 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/exception/UsernameExistException.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.forth.gulimall.member.exception; - -public class UsernameExistException extends RuntimeException{ - public UsernameExistException() { - super("用户名存在"); - } -} diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/feign/CouponFeignService.java b/gulimall-member/src/main/java/com/forth/gulimall/member/feign/CouponFeignService.java index b8b3815..4c33f8d 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/feign/CouponFeignService.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/feign/CouponFeignService.java @@ -4,9 +4,10 @@ import com.forth.common.utils.R; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.RequestMapping; -@FeignClient("coupon") +@FeignClient("gulimall-coupon") public interface CouponFeignService { @RequestMapping("coupon/coupon/member/list") - public R membercoupon(); + public R membercoupons(); + } diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/service/GrowthChangeHistoryService.java b/gulimall-member/src/main/java/com/forth/gulimall/member/service/GrowthChangeHistoryService.java index 7ec60aa..4256c1b 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/service/GrowthChangeHistoryService.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/service/GrowthChangeHistoryService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 成长值变化历史记录 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:56 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:42 */ public interface GrowthChangeHistoryService extends IService { diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/service/IntegrationChangeHistoryService.java b/gulimall-member/src/main/java/com/forth/gulimall/member/service/IntegrationChangeHistoryService.java index 96b78a0..92fb3b9 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/service/IntegrationChangeHistoryService.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/service/IntegrationChangeHistoryService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 积分变化历史记录 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:56 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:42 */ public interface IntegrationChangeHistoryService extends IService { diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberCollectSpuService.java b/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberCollectSpuService.java index 3d43ddc..3f23a91 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberCollectSpuService.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberCollectSpuService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 会员收藏的商品 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:55 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:41 */ public interface MemberCollectSpuService extends IService { diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberCollectSubjectService.java b/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberCollectSubjectService.java index 29158ac..d9fb80b 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberCollectSubjectService.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberCollectSubjectService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 会员收藏的专题活动 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:55 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:41 */ public interface MemberCollectSubjectService extends IService { diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberLevelService.java b/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberLevelService.java index ba695b4..a69675e 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberLevelService.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberLevelService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 会员等级 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:55 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:41 */ public interface MemberLevelService extends IService { diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberLoginLogService.java b/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberLoginLogService.java index c9feddd..9163594 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberLoginLogService.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberLoginLogService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 会员登录记录 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:55 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:41 */ public interface MemberLoginLogService extends IService { diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberReceiveAddressService.java b/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberReceiveAddressService.java index 5ad3e6a..501eae0 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberReceiveAddressService.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberReceiveAddressService.java @@ -4,20 +4,17 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.forth.common.utils.PageUtils; import com.forth.gulimall.member.entity.MemberReceiveAddressEntity; -import java.util.List; import java.util.Map; /** * 会员收货地址 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:55 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:42 */ public interface MemberReceiveAddressService extends IService { PageUtils queryPage(Map params); - - List getAddress(Long memberId); } diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberService.java b/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberService.java index b246cb7..66f107e 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberService.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberService.java @@ -3,32 +3,18 @@ package com.forth.gulimall.member.service; import com.baomidou.mybatisplus.extension.service.IService; import com.forth.common.utils.PageUtils; import com.forth.gulimall.member.entity.MemberEntity; -import com.forth.gulimall.member.exception.PhoneExistException; -import com.forth.gulimall.member.exception.UsernameExistException; -import com.forth.gulimall.member.vo.MemberLoginVo; -import com.forth.gulimall.member.vo.MemberRegistVo; -import com.forth.gulimall.member.vo.SocialUserVo; import java.util.Map; /** * 会员 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:56 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:42 */ public interface MemberService extends IService { PageUtils queryPage(Map params); - - void regist(MemberRegistVo vo); - - void checkPhoneUnique(String phone) throws PhoneExistException; - void checkUsernameUnique(String Username) throws UsernameExistException; - - MemberEntity login(MemberLoginVo vo); - - MemberEntity login(SocialUserVo svo) throws Exception; } diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberStatisticsInfoService.java b/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberStatisticsInfoService.java index 57ea678..31f3cbf 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberStatisticsInfoService.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/service/MemberStatisticsInfoService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 会员统计信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:30:56 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:00:42 */ public interface MemberStatisticsInfoService extends IService { diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/service/impl/MemberReceiveAddressServiceImpl.java b/gulimall-member/src/main/java/com/forth/gulimall/member/service/impl/MemberReceiveAddressServiceImpl.java index 71acce1..e5a424e 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/service/impl/MemberReceiveAddressServiceImpl.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/service/impl/MemberReceiveAddressServiceImpl.java @@ -1,8 +1,6 @@ package com.forth.gulimall.member.service.impl; import org.springframework.stereotype.Service; - -import java.util.List; import java.util.Map; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -28,10 +26,4 @@ public class MemberReceiveAddressServiceImpl extends ServiceImpl getAddress(Long memberId) { - return this.list(new QueryWrapper().eq("member_id", memberId)); - - } - } \ No newline at end of file diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/service/impl/MemberServiceImpl.java b/gulimall-member/src/main/java/com/forth/gulimall/member/service/impl/MemberServiceImpl.java index 832ee45..e09cf66 100644 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/service/impl/MemberServiceImpl.java +++ b/gulimall-member/src/main/java/com/forth/gulimall/member/service/impl/MemberServiceImpl.java @@ -1,24 +1,7 @@ package com.forth.gulimall.member.service.impl; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.forth.common.utils.HttpUtils; -import com.forth.gulimall.member.dao.MemberLevelDao; -import com.forth.gulimall.member.entity.MemberLevelEntity; -import com.forth.gulimall.member.exception.PhoneExistException; -import com.forth.gulimall.member.exception.UsernameExistException; -import com.forth.gulimall.member.vo.MemberLoginVo; -import com.forth.gulimall.member.vo.MemberRegistVo; -import com.forth.gulimall.member.vo.SocialUserVo; -import org.apache.http.HttpResponse; -import org.apache.http.util.EntityUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.stereotype.Service; - -import java.util.HashMap; import java.util.Map; - import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -33,9 +16,6 @@ import com.forth.gulimall.member.service.MemberService; @Service("memberService") public class MemberServiceImpl extends ServiceImpl implements MemberService { - @Autowired - MemberLevelDao memberLevelDao; - @Override public PageUtils queryPage(Map params) { IPage page = this.page( @@ -46,151 +26,4 @@ public class MemberServiceImpl extends ServiceImpl impl return new PageUtils(page); } - @Override - public void regist(MemberRegistVo vo) { - MemberDao baseMapper = this.baseMapper; - MemberEntity entity = new MemberEntity(); - MemberLevelEntity levelEntity = memberLevelDao.getDefaultLevel(); - //设置默认等级 - entity.setLevelId(levelEntity.getId()); - entity.setMobile(vo.getPhone()); - - BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); - String encode = passwordEncoder.encode(vo.getPassword()); - - entity.setPassword(encode); - //检查用户名和手机是否唯一 为了 - checkPhoneUnique(vo.getPhone()); - checkUsernameUnique(vo.getUserName()); - - - entity.setUsername(vo.getUserName()); - baseMapper.insert(entity); - } - - @Override - public void checkPhoneUnique(String phone) throws PhoneExistException { - MemberDao baseMapper = this.baseMapper; - Integer mobile = baseMapper.selectCount(new QueryWrapper().eq("mobile", phone)); - if (mobile > 0) { - throw new PhoneExistException(); - } - - - } - - @Override - public void checkUsernameUnique(String Username) throws UsernameExistException { - - Integer mobile = baseMapper.selectCount(new QueryWrapper().eq("username", Username)); - if (mobile > 0) { - throw new UsernameExistException(); - - } - - } - - @Override - public MemberEntity login(MemberLoginVo vo) { - MemberDao baseMapper = this.baseMapper; - String loginacct = vo.getLoginacct(); - String password = vo.getPassword(); - - //1,去数据库查询 - MemberEntity entity = baseMapper.selectOne(new QueryWrapper().eq("username", loginacct).or() - .eq("mobile", loginacct)); - // System.out.println("1,--------" + entity.toString()); - if (entity == null) { - //失败 - return null; - } else { - //获取密码 - String password1 = entity.getPassword(); - BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); - //密码是否匹配 - boolean matches = passwordEncoder.matches(password, password1); - //entity.get(); - if (matches) { - return entity; - } else { - return null; - } - } - - } - - @Override - public MemberEntity login(SocialUserVo svo) throws Exception { - - String uid = svo.getUid(); - MemberDao baseMapper = this.baseMapper; - MemberEntity memberEntity = baseMapper.selectOne(new QueryWrapper().eq("social_uid", uid)); - if (memberEntity != null) { - //用户 - System.out.println("登录"); - System.out.println("---11-----"); - MemberEntity update = new MemberEntity(); - update.setId(memberEntity.getId()); - update.setAccessToken(svo.getAccess_token()); - update.setExpiresIn(svo.getExpires_in()); - - baseMapper.updateById(update); - - memberEntity.setAccessToken(svo.getAccess_token()); - memberEntity.setExpiresIn(svo.getExpires_in()); - return memberEntity; - - } else { - //没有查到当前社交用户记录,就要我们注册一个 - System.out.println("注册"); - System.out.println("--------"); - MemberEntity mem = new MemberEntity(); - try { - System.out.println("--------"); - Map map2 = new HashMap<>(); - map2.put("Cookie", "JSESSIONID=C3EBCF908AC5BF68C3380F0612C2D943"); - map2.put("Cache-Control", "Jno-cache"); - map2.put("Postman-Token", ""); - - - Map map = new HashMap<>(); - map.put("access_token", svo.getAccess_token()); - map.put("uid", svo.getUid()); - System.out.println("map"+map); - //3,查询当前的社交账号的基本信息 - HttpResponse response = HttpUtils.doGet("https://api.weibo.com", "/2/users/show.json", "get", map2, map); - - System.out.println("状态码--------》"+response.getStatusLine().getStatusCode()); - if (response.getStatusLine().getStatusCode() == 200) { - //查询成功 - String json = EntityUtils.toString(response.getEntity()); - JSONObject jsonObject = JSON.parseObject(json); - - System.out.println("------------>>"+jsonObject); - //昵称 - String name = jsonObject.getString("name"); - //性别 - String sex = jsonObject.getString("gender"); - System.out.println("查询的数据---》》"+name+sex); - //... - mem.setUsername(name); - mem.setGender("m".equals(sex) ? 1 : 0); - //... - mem.setSocialUid(svo.getUid()); - mem.setAccessToken(svo.getAccess_token()); - mem.setExpiresIn(svo.getExpires_in()); - - } - }catch (Exception e){} - System.out.println("--------"); - mem.setSocialUid(svo.getUid()); - mem.setAccessToken(svo.getAccess_token()); - mem.setExpiresIn(svo.getExpires_in()); - baseMapper.insert(mem); - //登录或者祖册 - return mem; - } - - } - } \ No newline at end of file diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/vo/MemberLoginVo.java b/gulimall-member/src/main/java/com/forth/gulimall/member/vo/MemberLoginVo.java deleted file mode 100644 index c63b55f..0000000 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/vo/MemberLoginVo.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.forth.gulimall.member.vo; - -import lombok.Data; - -@Data -public class MemberLoginVo { - - - private String loginacct; - private String password; - - -} diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/vo/MemberRegistVo.java b/gulimall-member/src/main/java/com/forth/gulimall/member/vo/MemberRegistVo.java deleted file mode 100644 index f5383c7..0000000 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/vo/MemberRegistVo.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.forth.gulimall.member.vo; - -import lombok.Data; - -@Data -public class MemberRegistVo { - - - private String userName; - - private String password; - - private String phone; - -} diff --git a/gulimall-member/src/main/java/com/forth/gulimall/member/vo/SocialUserVo.java b/gulimall-member/src/main/java/com/forth/gulimall/member/vo/SocialUserVo.java deleted file mode 100644 index 94376d0..0000000 --- a/gulimall-member/src/main/java/com/forth/gulimall/member/vo/SocialUserVo.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.forth.gulimall.member.vo; - -import lombok.Data; - -@Data -public class SocialUserVo { - - private String access_token; - private String remind_in; - private long expires_in; - private String uid; - private String isRealName; -} diff --git a/gulimall-member/src/main/resources/application.yml b/gulimall-member/src/main/resources/application.yml index 8879c83..674c4bc 100644 --- a/gulimall-member/src/main/resources/application.yml +++ b/gulimall-member/src/main/resources/application.yml @@ -1,21 +1,19 @@ -server: - port: 4002 spring: datasource: username: root password: root url: jdbc:mysql://39.97.249.66:3306/gulimall_ums - driver-class-name: com.mysql.cj.jdbc.Driver + driver-class-name: com.mysql.jdbc.Driver cloud: nacos: discovery: - server-addr: 39.97.249.66:8848 + server-addr: 127.0.0.1:8848 application: - name: member + name: gulimall-member mybatis-plus: mapper-locations: classpath:/mapper/**/*.xml global-config: db-config: - id-type: auto - - + id-type: AUTO +server: + port: 4002 diff --git a/gulimall-member/src/main/resources/bootstrap.properties b/gulimall-member/src/main/resources/bootstrap.properties index d83138d..66411d9 100644 --- a/gulimall-member/src/main/resources/bootstrap.properties +++ b/gulimall-member/src/main/resources/bootstrap.properties @@ -1,7 +1,16 @@ spring.application.name=gulimall-member -spring.cloud.nacos.config.server-addr=39.97.249.66:8848 -spring.cloud.nacos.config.namespace=cce06c6b-e109-49ab-a81f-a1540f2359cd - -spring.cloud.nacos.config.ext-config[0].data-id=member.yml -spring.cloud.nacos.config.ext-config[0].group=DEFAULT_GROUP -spring.cloud.nacos.config.ext-config[0].refresh=true \ No newline at end of file +spring.cloud.nacos.config.server-addr=127.0.0.1:8848 +spring.cloud.nacos.config.namespace=f8740bee-2fcf-423e-a43b-5f0aefeec49c +#spring.cloud.nacos.config.group=prod +# +#spring.cloud.nacos.config.ext-config[0].data-id=datasource.yml +#spring.cloud.nacos.config.ext-config[0].group=dev +#spring.cloud.nacos.config.ext-config[0].refresh=true +# +#spring.cloud.nacos.config.ext-config[1].data-id=mybatis.yml +#spring.cloud.nacos.config.ext-config[1].group=dev +#spring.cloud.nacos.config.ext-config[1].refresh=true +# +#spring.cloud.nacos.config.ext-config[2].data-id=other.yml +#spring.cloud.nacos.config.ext-config[2].group=dev +#spring.cloud.nacos.config.ext-config[2].refresh=true \ No newline at end of file diff --git a/gulimall-member/src/main/resources/mapper/member/MemberLevelDao.xml b/gulimall-member/src/main/resources/mapper/member/MemberLevelDao.xml index 839086d..c839527 100644 --- a/gulimall-member/src/main/resources/mapper/member/MemberLevelDao.xml +++ b/gulimall-member/src/main/resources/mapper/member/MemberLevelDao.xml @@ -16,8 +16,6 @@ - + \ No newline at end of file diff --git a/gulimall-member/src/test/java/com/forth/gulimall/member/GulimallMemberApplicationTests.java b/gulimall-member/src/test/java/com/forth/gulimall/member/GulimallMemberApplicationTests.java deleted file mode 100644 index 8775a06..0000000 --- a/gulimall-member/src/test/java/com/forth/gulimall/member/GulimallMemberApplicationTests.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.forth.gulimall.member; - -import com.forth.gulimall.member.entity.MemberEntity; -import com.forth.gulimall.member.service.MemberService; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class GulimallMemberApplicationTests { - - @Autowired - MemberService memberService; - - @Test - void contextLoads() { - MemberEntity memberEntity = new MemberEntity(); - memberEntity.setCity("新乡"); - memberService.save(memberEntity); - System.out.println("success"); - } - -} diff --git a/gulimall-order/pom.xml b/gulimall-order/pom.xml index 847e497..eddbf76 100644 --- a/gulimall-order/pom.xml +++ b/gulimall-order/pom.xml @@ -16,7 +16,7 @@ 1.8 - Hoxton.SR8 + Hoxton.SR9 @@ -25,11 +25,6 @@ gulimall-common 0.0.1-SNAPSHOT - - com.forth.gulimall - gulimall-auth-server - 0.0.1-SNAPSHOT - org.springframework.boot spring-boot-starter-web @@ -50,38 +45,6 @@ - - org.springframework.boot - spring-boot-starter-aop - - - org.springframework.boot - spring-boot-starter-amqp - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - - org.springframework.boot - spring-boot-starter-data-redis - - - io.lettuce - lettuce-core - - - - - redis.clients - jedis - - - - org.springframework.session - spring-session-data-redis - diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/GulimallOrderApplication.java b/gulimall-order/src/main/java/com/forth/gulimall/order/GulimallOrderApplication.java index b47b2b8..949c83e 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/GulimallOrderApplication.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/GulimallOrderApplication.java @@ -1,17 +1,10 @@ package com.forth.gulimall.order; -import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -import org.springframework.cloud.openfeign.EnableFeignClients; -import org.springframework.context.annotation.EnableAspectJAutoProxy; -import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession; -//@EnableAspectJAutoProxy(exposeProxy = true) -@EnableRedisHttpSession + @EnableDiscoveryClient -@EnableFeignClients -@MapperScan("com.forth.gulimall.order.dao") @SpringBootApplication public class GulimallOrderApplication { diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/config/GuliFeginConfig.java b/gulimall-order/src/main/java/com/forth/gulimall/order/config/GuliFeginConfig.java deleted file mode 100644 index 5fd0e40..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/config/GuliFeginConfig.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.forth.gulimall.order.config; - -import feign.RequestInterceptor; -import feign.RequestTemplate; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.context.request.RequestAttributes; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -import javax.servlet.http.HttpServletRequest; - -@Configuration -public class GuliFeginConfig { - @Bean("requestInterceptor") - public RequestInterceptor requestInterceptor(){ - return new RequestInterceptor() { - @Override - public void apply(RequestTemplate requestTemplate) { - ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); -if (attributes!=null){ - System.out.println("requ线程的id---->>"+Thread.currentThread().getId()); - - HttpServletRequest request = attributes.getRequest(); - if(request!=null){ - String cookie = request.getHeader("Cookie"); - requestTemplate.header("Cookie",cookie); - } -} - - - - - System.out.println("----调用"); - } - }; - } -} diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/config/GulimallSessionConfig.java b/gulimall-order/src/main/java/com/forth/gulimall/order/config/GulimallSessionConfig.java deleted file mode 100644 index c32e50d..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/config/GulimallSessionConfig.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.forth.gulimall.order.config; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; -import org.springframework.data.redis.serializer.RedisSerializer; -import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession; -import org.springframework.session.web.http.CookieSerializer; -import org.springframework.session.web.http.DefaultCookieSerializer; - -@EnableRedisHttpSession -@Configuration -public class GulimallSessionConfig { - @Bean - public CookieSerializer cookieSerializer(){ - DefaultCookieSerializer cookieSerializer = new DefaultCookieSerializer(); - - cookieSerializer.setDomainName("localhost"); - cookieSerializer.setCookieName("GULISESSION"); - return cookieSerializer; - } - @Bean - public RedisSerializer springSessionDefaultCookieSerializer(){ - return new GenericJackson2JsonRedisSerializer(); - } -} diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/config/MyThreadConfig.java b/gulimall-order/src/main/java/com/forth/gulimall/order/config/MyThreadConfig.java deleted file mode 100644 index 794b8c7..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/config/MyThreadConfig.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.forth.gulimall.order.config; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import java.util.concurrent.Executors; -import java.util.concurrent.LinkedBlockingDeque; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -@Configuration -public class MyThreadConfig { - - @Bean - public ThreadPoolExecutor threadPoolExecutor(ThreadPoolConfigProperties pool){ - return new ThreadPoolExecutor(pool.getCoreSize(),pool.getMaxSize(),pool.getKeepAliveTime(), - TimeUnit.SECONDS,new LinkedBlockingDeque<>(100000), Executors.defaultThreadFactory(), - new ThreadPoolExecutor.AbortPolicy()); - } -} diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/config/OrderWebConfiguration.java b/gulimall-order/src/main/java/com/forth/gulimall/order/config/OrderWebConfiguration.java deleted file mode 100644 index 8fe0dc2..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/config/OrderWebConfiguration.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.forth.gulimall.order.config; - -import com.forth.gulimall.order.interceptor.LoginUserInterceptor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.InterceptorRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -@Configuration -public class OrderWebConfiguration implements WebMvcConfigurer { - @Autowired - LoginUserInterceptor interceptor; - - - @Override - public void addInterceptors(InterceptorRegistry registry) { - registry.addInterceptor(interceptor).addPathPatterns("/**"); - } -} diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/config/ThreadPoolConfigProperties.java b/gulimall-order/src/main/java/com/forth/gulimall/order/config/ThreadPoolConfigProperties.java deleted file mode 100644 index 0b376ac..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/config/ThreadPoolConfigProperties.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.forth.gulimall.order.config; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -@ConfigurationProperties(prefix = "gulimall.thread") -@Component -@Data -public class ThreadPoolConfigProperties { - - private Integer coreSize; - private Integer maxSize; - private Integer keepAliveTime; -} diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/constant/OrderConstant.java b/gulimall-order/src/main/java/com/forth/gulimall/order/constant/OrderConstant.java deleted file mode 100644 index a44ea1f..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/constant/OrderConstant.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.forth.gulimall.order.constant; - -public class OrderConstant { - public static final String USER_ORDER_TOKEN_PREFIX="order:token"; -} diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderController.java b/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderController.java index 0a32486..7f16565 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderController.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderController.java @@ -21,9 +21,9 @@ import com.forth.common.utils.R; /** * 订单 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:19 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @RestController @RequestMapping("order/order") diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderItemController.java b/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderItemController.java index f4fc822..854c474 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderItemController.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderItemController.java @@ -21,9 +21,9 @@ import com.forth.common.utils.R; /** * 订单项信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:19 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @RestController @RequestMapping("order/orderitem") diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderOperateHistoryController.java b/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderOperateHistoryController.java index f919cff..dbd530e 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderOperateHistoryController.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderOperateHistoryController.java @@ -21,9 +21,9 @@ import com.forth.common.utils.R; /** * 订单操作历史记录 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @RestController @RequestMapping("order/orderoperatehistory") diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderReturnApplyController.java b/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderReturnApplyController.java index 3fa15d4..24cc519 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderReturnApplyController.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderReturnApplyController.java @@ -21,9 +21,9 @@ import com.forth.common.utils.R; /** * 订单退货申请 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @RestController @RequestMapping("order/orderreturnapply") diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderReturnReasonController.java b/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderReturnReasonController.java index ea34175..0aa1574 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderReturnReasonController.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderReturnReasonController.java @@ -21,9 +21,9 @@ import com.forth.common.utils.R; /** * 退货原因 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @RestController @RequestMapping("order/orderreturnreason") diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderSettingController.java b/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderSettingController.java index e8adac7..fd1ab86 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderSettingController.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/controller/OrderSettingController.java @@ -21,9 +21,9 @@ import com.forth.common.utils.R; /** * 订单配置信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @RestController @RequestMapping("order/ordersetting") diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/controller/PaymentInfoController.java b/gulimall-order/src/main/java/com/forth/gulimall/order/controller/PaymentInfoController.java index d43676a..b18055d 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/controller/PaymentInfoController.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/controller/PaymentInfoController.java @@ -21,9 +21,9 @@ import com.forth.common.utils.R; /** * 支付信息表 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @RestController @RequestMapping("order/paymentinfo") diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/controller/RefundInfoController.java b/gulimall-order/src/main/java/com/forth/gulimall/order/controller/RefundInfoController.java index 4b03d50..608a152 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/controller/RefundInfoController.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/controller/RefundInfoController.java @@ -21,9 +21,9 @@ import com.forth.common.utils.R; /** * 退款信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @RestController @RequestMapping("order/refundinfo") diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderDao.java b/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderDao.java index 6b654cc..6c3c2f3 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderDao.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 订单 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:19 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @Mapper public interface OrderDao extends BaseMapper { diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderItemDao.java b/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderItemDao.java index 50d0321..bd74d99 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderItemDao.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderItemDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 订单项信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:19 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @Mapper public interface OrderItemDao extends BaseMapper { diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderOperateHistoryDao.java b/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderOperateHistoryDao.java index e2d0f45..0a79859 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderOperateHistoryDao.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderOperateHistoryDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 订单操作历史记录 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @Mapper public interface OrderOperateHistoryDao extends BaseMapper { diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderReturnApplyDao.java b/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderReturnApplyDao.java index 7f70d81..cbd61e8 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderReturnApplyDao.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderReturnApplyDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 订单退货申请 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @Mapper public interface OrderReturnApplyDao extends BaseMapper { diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderReturnReasonDao.java b/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderReturnReasonDao.java index a248fa1..f6b617d 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderReturnReasonDao.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderReturnReasonDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 退货原因 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @Mapper public interface OrderReturnReasonDao extends BaseMapper { diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderSettingDao.java b/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderSettingDao.java index c03e202..191e8e5 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderSettingDao.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/dao/OrderSettingDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 订单配置信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @Mapper public interface OrderSettingDao extends BaseMapper { diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/dao/PaymentInfoDao.java b/gulimall-order/src/main/java/com/forth/gulimall/order/dao/PaymentInfoDao.java index 9229a50..e07fb96 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/dao/PaymentInfoDao.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/dao/PaymentInfoDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 支付信息表 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @Mapper public interface PaymentInfoDao extends BaseMapper { diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/dao/RefundInfoDao.java b/gulimall-order/src/main/java/com/forth/gulimall/order/dao/RefundInfoDao.java index 27cc5ff..5d0e56a 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/dao/RefundInfoDao.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/dao/RefundInfoDao.java @@ -7,9 +7,9 @@ import org.apache.ibatis.annotations.Mapper; /** * 退款信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @Mapper public interface RefundInfoDao extends BaseMapper { diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderEntity.java b/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderEntity.java index 84d3247..4d54dbd 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderEntity.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderEntity.java @@ -11,9 +11,9 @@ import lombok.Data; /** * 订单 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:19 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @Data @TableName("oms_order") diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderItemEntity.java b/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderItemEntity.java index 29fc0fc..8b9c500 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderItemEntity.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderItemEntity.java @@ -11,9 +11,9 @@ import lombok.Data; /** * 订单项信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:19 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @Data @TableName("oms_order_item") diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderOperateHistoryEntity.java b/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderOperateHistoryEntity.java index e963eba..7453597 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderOperateHistoryEntity.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderOperateHistoryEntity.java @@ -10,9 +10,9 @@ import lombok.Data; /** * 订单操作历史记录 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @Data @TableName("oms_order_operate_history") diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderReturnApplyEntity.java b/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderReturnApplyEntity.java index f3af98d..282a1e0 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderReturnApplyEntity.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderReturnApplyEntity.java @@ -11,9 +11,9 @@ import lombok.Data; /** * 订单退货申请 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @Data @TableName("oms_order_return_apply") diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderReturnReasonEntity.java b/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderReturnReasonEntity.java index bf37ac0..7d9f9ae 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderReturnReasonEntity.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderReturnReasonEntity.java @@ -10,9 +10,9 @@ import lombok.Data; /** * 退货原因 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @Data @TableName("oms_order_return_reason") diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderSettingEntity.java b/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderSettingEntity.java index 4de168a..05c0b5b 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderSettingEntity.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/entity/OrderSettingEntity.java @@ -10,9 +10,9 @@ import lombok.Data; /** * 订单配置信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @Data @TableName("oms_order_setting") diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/entity/PaymentInfoEntity.java b/gulimall-order/src/main/java/com/forth/gulimall/order/entity/PaymentInfoEntity.java index ea6cc09..c875b1a 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/entity/PaymentInfoEntity.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/entity/PaymentInfoEntity.java @@ -11,9 +11,9 @@ import lombok.Data; /** * 支付信息表 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @Data @TableName("oms_payment_info") diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/entity/RefundInfoEntity.java b/gulimall-order/src/main/java/com/forth/gulimall/order/entity/RefundInfoEntity.java index ab20ee7..2b7af74 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/entity/RefundInfoEntity.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/entity/RefundInfoEntity.java @@ -11,9 +11,9 @@ import lombok.Data; /** * 退款信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ @Data @TableName("oms_refund_info") diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/enume/OrderStatusEnum.java b/gulimall-order/src/main/java/com/forth/gulimall/order/enume/OrderStatusEnum.java deleted file mode 100644 index 80e310d..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/enume/OrderStatusEnum.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.forth.gulimall.order.enume; - -public enum OrderStatusEnum { - CREATE_NEW(0,"待付款"), - PAYED(1,"已付款"), - SENDED(2,"已发货"), - RECIEVED(3,"已完成"), - CANCLED(4,"已取消"), - SERVICING(5,"售后中"), - SERVICED(6,"售后完成"); - private Integer code; - private String msg; - - OrderStatusEnum(Integer code, String msg) { - this.code = code; - this.msg = msg; - } - - public Integer getCode() { - return code; - } - - public String getMsg() { - return msg; - } -} diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/fegin/CartFeignService.java b/gulimall-order/src/main/java/com/forth/gulimall/order/fegin/CartFeignService.java deleted file mode 100644 index 71ab8a3..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/fegin/CartFeignService.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.forth.gulimall.order.fegin; - -import com.forth.gulimall.order.vo.OrderItemVo; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; - -import java.util.List; - -@FeignClient("gulimall-cart") -public interface CartFeignService { - - @GetMapping("/currentUserCartItems") - List getCurrentUserCartItems(); - -} diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/fegin/MemberFeignService.java b/gulimall-order/src/main/java/com/forth/gulimall/order/fegin/MemberFeignService.java deleted file mode 100644 index bbc0f09..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/fegin/MemberFeignService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.forth.gulimall.order.fegin; - -import com.forth.gulimall.order.vo.MemberAddressVo; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; - -import java.util.List; - -@FeignClient("member") -public interface MemberFeignService { -// @GetMapping("/member/memberreceiveaddress/{memberId}/addresses") -// List getAddress(@PathVariable("memberId") Long memberId); - @GetMapping("member/memberreceiveaddress/{memberId}/addresses") - public List getAddress(@PathVariable("memberId") Long memberId); -} diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/fegin/ProductFeignService.java b/gulimall-order/src/main/java/com/forth/gulimall/order/fegin/ProductFeignService.java deleted file mode 100644 index 9e0086d..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/fegin/ProductFeignService.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.forth.gulimall.order.fegin; - -import com.forth.common.utils.R; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; - -@FeignClient("product") -public interface ProductFeignService { - @GetMapping("/product/spuinfo/skuId/{id}") - R getSpuInfoBySkuId(@PathVariable("id") Long skuId); -} diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/fegin/WmsFeignService.java b/gulimall-order/src/main/java/com/forth/gulimall/order/fegin/WmsFeignService.java deleted file mode 100644 index 7601414..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/fegin/WmsFeignService.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.forth.gulimall.order.fegin; - -import com.forth.common.utils.R; -import com.forth.gulimall.order.vo.WareSkuLockVo; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; - -import java.util.List; - -@FeignClient("ware") -public interface WmsFeignService { - @PostMapping("/ware/waresku/hasstock") - R getSkuHasStock(@RequestBody List skuIds); - @PostMapping("/ware/waresku/lock/order") - R orderLockStock(@RequestBody WareSkuLockVo vo); -} diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/interceptor/LoginUserInterceptor.java b/gulimall-order/src/main/java/com/forth/gulimall/order/interceptor/LoginUserInterceptor.java deleted file mode 100644 index fda6895..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/interceptor/LoginUserInterceptor.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.forth.gulimall.order.interceptor; - - -import com.forth.common.constant.AuthServerConstant; -import com.forth.gulimall.gulimallauthserver.vo.MemberRespVo; -import org.springframework.stereotype.Component; -import org.springframework.web.servlet.HandlerInterceptor; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@Component -public class LoginUserInterceptor implements HandlerInterceptor { - - -public static ThreadLocal loginUser=new ThreadLocal<>(); - @Override - public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { - - MemberRespVo attribute = (MemberRespVo) request.getSession().getAttribute(AuthServerConstant.LOGIN_USER); - if (attribute != null) { - loginUser.set(attribute); - return true; - } else { - //没登陆 去登录 - request.getSession().setAttribute("msg","请先登录!"); - response.sendRedirect("http://localhost:20000"); - return false; - } - - } -} diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderItemService.java b/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderItemService.java index d41d5ba..88fcb9d 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderItemService.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderItemService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 订单项信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:19 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ public interface OrderItemService extends IService { diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderOperateHistoryService.java b/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderOperateHistoryService.java index a9e8d70..69c56e9 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderOperateHistoryService.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderOperateHistoryService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 订单操作历史记录 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ public interface OrderOperateHistoryService extends IService { diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderReturnApplyService.java b/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderReturnApplyService.java index 70e09ab..9ffa7ac 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderReturnApplyService.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderReturnApplyService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 订单退货申请 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ public interface OrderReturnApplyService extends IService { diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderReturnReasonService.java b/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderReturnReasonService.java index afb72ac..f8ed9be 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderReturnReasonService.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderReturnReasonService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 退货原因 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ public interface OrderReturnReasonService extends IService { diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderService.java b/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderService.java index 2003935..3fe07df 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderService.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderService.java @@ -3,37 +3,18 @@ package com.forth.gulimall.order.service; import com.baomidou.mybatisplus.extension.service.IService; import com.forth.common.utils.PageUtils; import com.forth.gulimall.order.entity.OrderEntity; -import com.forth.gulimall.order.vo.OrderConfirmVo; -import com.forth.gulimall.order.vo.OrderSubmitVo; -import com.forth.gulimall.order.vo.SubmitOrderResponseVo; import java.util.Map; -import java.util.concurrent.ExecutionException; /** * 订单 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:19 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ public interface OrderService extends IService { PageUtils queryPage(Map params); - - /** - * 订单确页 - * @return - * @throws ExecutionException - * @throws InterruptedException - */ - OrderConfirmVo confirmOrder() throws ExecutionException, InterruptedException; - - /** - * 下单 - * @param vo - * @return - */ - SubmitOrderResponseVo submitOrder(OrderSubmitVo vo); } diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderSettingService.java b/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderSettingService.java index 37dc348..261f6ce 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderSettingService.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/service/OrderSettingService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 订单配置信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ public interface OrderSettingService extends IService { diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/service/PaymentInfoService.java b/gulimall-order/src/main/java/com/forth/gulimall/order/service/PaymentInfoService.java index f8ce4b0..dcf67b7 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/service/PaymentInfoService.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/service/PaymentInfoService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 支付信息表 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ public interface PaymentInfoService extends IService { diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/service/RefundInfoService.java b/gulimall-order/src/main/java/com/forth/gulimall/order/service/RefundInfoService.java index 46d1f0c..bed3570 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/service/RefundInfoService.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/service/RefundInfoService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 退款信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:13:18 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:09:57 */ public interface RefundInfoService extends IService { diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/service/impl/OrderServiceImpl.java b/gulimall-order/src/main/java/com/forth/gulimall/order/service/impl/OrderServiceImpl.java index 76a8e3a..14bf2f6 100644 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/service/impl/OrderServiceImpl.java +++ b/gulimall-order/src/main/java/com/forth/gulimall/order/service/impl/OrderServiceImpl.java @@ -1,35 +1,7 @@ package com.forth.gulimall.order.service.impl; -import com.alibaba.fastjson.TypeReference; -import com.baomidou.mybatisplus.core.toolkit.IdWorker; -import com.forth.common.exception.NoStockException; -import com.forth.common.utils.R; -import com.forth.gulimall.gulimallauthserver.vo.MemberRespVo; -import com.forth.gulimall.order.constant.OrderConstant; -import com.forth.gulimall.order.dao.OrderItemDao; -import com.forth.gulimall.order.entity.OrderItemEntity; -import com.forth.gulimall.order.enume.OrderStatusEnum; -import com.forth.gulimall.order.fegin.CartFeignService; -import com.forth.gulimall.order.fegin.MemberFeignService; -import com.forth.gulimall.order.fegin.ProductFeignService; -import com.forth.gulimall.order.fegin.WmsFeignService; -import com.forth.gulimall.order.interceptor.LoginUserInterceptor; -import com.forth.gulimall.order.service.OrderItemService; -import com.forth.gulimall.order.to.OrderCreateTo; -import com.forth.gulimall.order.vo.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.data.redis.core.script.DefaultRedisScript; import org.springframework.stereotype.Service; - -import java.math.BigDecimal; -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; - +import java.util.Map; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -39,36 +11,11 @@ import com.forth.common.utils.Query; import com.forth.gulimall.order.dao.OrderDao; import com.forth.gulimall.order.entity.OrderEntity; import com.forth.gulimall.order.service.OrderService; -import org.springframework.transaction.annotation.Isolation; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.StringUtils; -import org.springframework.web.context.request.RequestAttributes; -import org.springframework.web.context.request.RequestContextHolder; -import sun.nio.ch.ThreadPool; @Service("orderService") public class OrderServiceImpl extends ServiceImpl implements OrderService { - private ThreadLocal confirmVoThreadLocal =new ThreadLocal<>(); - @Autowired - OrderItemService orderItemService; - @Autowired - MemberFeignService memberFeignService; - @Autowired - CartFeignService cartFeignService; - @Autowired - ProductFeignService productFeignService; - @Autowired - ThreadPoolExecutor executor; - - @Autowired - StringRedisTemplate redisTemplate; - - //库存的全程服务 - @Autowired - WmsFeignService wmsFeignService; - @Override public PageUtils queryPage(Map params) { IPage page = this.page( @@ -79,270 +26,4 @@ public class OrderServiceImpl extends ServiceImpl impleme return new PageUtils(page); } - @Override - public OrderConfirmVo confirmOrder() throws ExecutionException, InterruptedException { - OrderConfirmVo confirmVo = new OrderConfirmVo(); - MemberRespVo memberRespVo = LoginUserInterceptor.loginUser.get(); - System.out.println("zhu线程的id---->>" + Thread.currentThread().getId()); - - RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); - - //1,远程查询所有的收货地址 - CompletableFuture getAddressFuture = CompletableFuture.runAsync(() -> { - RequestContextHolder.setRequestAttributes(requestAttributes); - System.out.println("address线程的id---->>" + Thread.currentThread().getId()); - List address = memberFeignService.getAddress(memberRespVo.getId()); - confirmVo.setAddress(address); - }, executor); - - //2,购物车所选的购物项 - CompletableFuture getItemFuture = CompletableFuture.runAsync(() -> { - RequestContextHolder.setRequestAttributes(requestAttributes); - System.out.println("cart线程的id---->>" + Thread.currentThread().getId()); - List items = cartFeignService.getCurrentUserCartItems(); - confirmVo.setItems(items); - }, executor).thenRun(() -> { - List items = confirmVo.getItems(); - List collect = items.stream().map(item -> item.getSkuId()).collect(Collectors.toList()); - R hasStock = wmsFeignService.getSkuHasStock(collect); - List data = hasStock.getData(new TypeReference>() { - }); - if (data != null) { - Map map = data.stream().collect(Collectors.toMap(SkuStockVo::getSkuId, SkuStockVo::getHasStock)); - confirmVo.setStocks(map); - } - - }); - - //3,查询积分 - Integer integration = memberRespVo.getIntegration(); - confirmVo.setIntegration(integration); - //防重令牌 - String token = UUID.randomUUID().toString().replace("-", ""); - redisTemplate.opsForValue().set(OrderConstant.USER_ORDER_TOKEN_PREFIX + memberRespVo.getId().toString(), token, 30, TimeUnit.MINUTES); - confirmVo.setOrderToken(token); - - CompletableFuture.allOf(getAddressFuture, getItemFuture).get(); - return confirmVo; - } - - @Transactional - @Override - public SubmitOrderResponseVo submitOrder(OrderSubmitVo vo) { - - System.out.println("---->++++++++submitOrder"+vo); - confirmVoThreadLocal.set(vo); - SubmitOrderResponseVo response = new SubmitOrderResponseVo(); - MemberRespVo memberRespVo = LoginUserInterceptor.loginUser.get(); - response.setCode(0); - String redisToken = redisTemplate.opsForValue().get(OrderConstant.USER_ORDER_TOKEN_PREFIX + memberRespVo.getId()); - //1,验证令牌(对比和删除) - String script = "if redis.call('get', KEYS[1])==ARGV[1] then return redis.call('del', KEYS[1]) else return 0 end"; - String orderToken = vo.getOrderToken(); - Long result = redisTemplate.execute(new DefaultRedisScript(script, Long.class), Arrays.asList(OrderConstant.USER_ORDER_TOKEN_PREFIX + memberRespVo.getId()), orderToken); - if (result == 0L) { - //失败 - response.setCode(1); - return response; - } else { - //1,创建订单 - OrderCreateTo order = creatOrder(); - // 验证令牌成功 - //2,验价 - System.out.println("------------>价格"+order); - BigDecimal payAmount = order.getOrder().getPayAmount(); - BigDecimal payPrice = vo.getPayPrice(); - order.getOrder().setReceiverName(vo.getOrderAdder()); - if( Math.abs(payAmount.subtract(payPrice).doubleValue())<0.01){ - //金额对比 - //保存订单 - saveOrder(order); - //库存锁定 只要有问题 - WareSkuLockVo lockVo = new WareSkuLockVo(); - lockVo.setOrderSn(order.getOrder().getOrderSn()); - List locks = order.getOrderItems().stream().map(item -> { - OrderItemVo itemVo = new OrderItemVo(); - itemVo.setSkuId(item.getSkuId()); - itemVo.setCount(item.getSkuQuantity()); - itemVo.setTitle(item.getSkuName()); - return itemVo; - }).collect(Collectors.toList()); - lockVo.setLocks(locks); - R r = wmsFeignService.orderLockStock(lockVo); - if (r.getCode()==0){ - //成功 - response.setOrder(order.getOrder()); - //int i = 10/0; - return response; - }else { - //失败 - String msg=(String) r.get("msg"); - throw new NoStockException(msg); -// response.setCode(3); -// return response; - - } - //订单号 -// response.setCode(0); -// return response; - }else { - response.setCode(2); - return response; - } - //去下单 - - } -// if (orderToken != null && orderToken.equals(redisToken)) { -// //令牌通过 -// redisTemplate.delete(OrderConstant.USER_ORDER_TOKEN_PREFIX + memberRespVo.getId()); -// -// } else { -// return null; -// } - - } - - /** - * 保存订单数据 - * @param order - */ - private void saveOrder(OrderCreateTo order) { - OrderEntity orderEntity = order.getOrder(); - orderEntity.setModifyTime(new Date()); - this.save(orderEntity); - List orderItems = order.getOrderItems(); - orderItemService.saveBatch(orderItems); - } - - private OrderCreateTo creatOrder() { - System.out.println("---->++++++++creatOrder"); - OrderCreateTo orderCreateTo = new OrderCreateTo(); - //生产订单编号 - String orderSn = IdWorker.getTimeId(); - //创建订单号 - OrderEntity orderEntity = buildOrder(orderSn); - //获取所有订单项 - List itemEntities = buildOrderItems(orderSn); - System.out.println("订单项"+itemEntities); - //验价 - computePrice(orderEntity,itemEntities); - orderCreateTo.setOrder(orderEntity); - orderCreateTo.setOrderItems(itemEntities); - - System.out.println("----->"+orderCreateTo); - return orderCreateTo; - } - - private void computePrice(OrderEntity orderEntity, List itemEntities) { - System.out.println("---->++++++++computePrice"); - BigDecimal total = new BigDecimal("0.0"); - BigDecimal coupon = new BigDecimal("0.0"); - BigDecimal integration = new BigDecimal("0.0"); - BigDecimal promotion = new BigDecimal("0.0"); - BigDecimal gift = new BigDecimal("0.0"); - BigDecimal growth = new BigDecimal("0.0"); - //1,订单价格 - for (OrderItemEntity entity : itemEntities) { - coupon = coupon.add(entity.getCouponAmount()); - integration = integration.add(entity.getIntegrationAmount()); - promotion = promotion.add(entity.getPromotionAmount()); - total = total.add(entity.getRealAmount()); - gift = gift.add(new BigDecimal(entity.getGiftIntegration().toString())); - growth = growth.add(new BigDecimal(entity.getGiftGrowth().toString())); - - } - //订单相关 - orderEntity.setTotalAmount(total); - //运费 - BigDecimal loanAmount = new BigDecimal("10.00"); - orderEntity.setPayAmount(total.add(loanAmount)); - orderEntity.setPromotionAmount(promotion); - orderEntity.setIntegrationAmount(integration); - orderEntity.setCouponAmount(coupon); - //积分信息 - orderEntity.setIntegration(gift.intValue()); - orderEntity.setGrowth(growth.intValue()); - orderEntity.setDeleteStatus(0);//未删除 - - } - - private OrderEntity buildOrder(String timeId) { - System.out.println("------------>buildOrder"); - MemberRespVo resvo = LoginUserInterceptor.loginUser.get(); - OrderEntity entity = new OrderEntity(); - entity.setOrderSn(timeId); - entity.setMemberId(resvo.getId()); - OrderSubmitVo orderSubmitVo = confirmVoThreadLocal.get(); - //邮费 - BigDecimal loanAmount = new BigDecimal("10.00"); - entity.setFreightAmount(loanAmount); - //收货地址 - //设置订单状态 - entity.setStatus(OrderStatusEnum.CREATE_NEW.getCode()); - entity.setAutoConfirmDay(7); - System.out.println("buildOrder--?"+entity); - return entity; - } - - /** - * 构建所有订单项 - * @return - */ - private List buildOrderItems(String orderSn) { - System.out.println("------------>buildOrders"); - //获取订单项 - //确定每个购物项的价格 - List currentUserCartItems = cartFeignService.getCurrentUserCartItems(); - if (currentUserCartItems!=null&¤tUserCartItems.size()>0){ - List itemEntities = currentUserCartItems.stream().map(cartItem -> { - OrderItemEntity itemEntity = buildOrderItem(cartItem); - itemEntity.setOrderSn(orderSn); - System.out.println("itemEntity===>"+itemEntity); - return itemEntity; - }).collect(Collectors.toList()); - return itemEntities; - } -return null; - } - - /**每一个eturn - */ - private OrderItemEntity buildOrderItem(OrderItemVo cartItem) { - System.out.println("------------>buildOritem"); - OrderItemEntity itemEntity = new OrderItemEntity(); -//1, - Long skuId = cartItem.getSkuId(); - //商品SPU - R r = productFeignService.getSpuInfoBySkuId(skuId); - SpuInfoVo data = r.getData(new TypeReference() { - }); - itemEntity.setSpuId(data.getId()); - itemEntity.setSpuBrand(data.getBrandId().toString()); - itemEntity.setSpuName(data.getSpuName()); - itemEntity.setCategoryId(data.getCatalogId()); - - //商品的sku - itemEntity.setSkuId(cartItem.getSkuId()); - itemEntity.setSkuName(cartItem.getTitle()); - itemEntity.setSkuPic(cartItem.getImage()); - itemEntity.setSkuPrice(cartItem.getPrice()); - String skuAttr = StringUtils.collectionToDelimitedString(cartItem.getSkuAttr(), ";"); - itemEntity.setSkuAttrsVals(skuAttr); - itemEntity.setSkuQuantity(cartItem.getCount()); - //积分 - itemEntity.setGiftGrowth(cartItem.getPrice().multiply(new BigDecimal(cartItem.getCount().toString())).intValue()); - itemEntity.setGiftIntegration(cartItem.getPrice().multiply(new BigDecimal(cartItem.getCount().toString())).intValue()); - - //6价格信息 - itemEntity.setPromotionAmount(new BigDecimal("0.0")); - itemEntity.setCouponAmount(new BigDecimal("0.0")); - itemEntity.setIntegrationAmount(new BigDecimal("0.0")); - //实际金额 - BigDecimal orign = itemEntity.getSkuPrice().multiply(new BigDecimal(itemEntity.getSkuQuantity())); - BigDecimal subtract = orign.subtract(itemEntity.getCouponAmount()).subtract(itemEntity.getPromotionAmount()).subtract(itemEntity.getIntegrationAmount()); - itemEntity.setRealAmount(subtract); - - System.out.println("---->-"+itemEntity); - return itemEntity; - } } \ No newline at end of file diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/to/OrderCreateTo.java b/gulimall-order/src/main/java/com/forth/gulimall/order/to/OrderCreateTo.java deleted file mode 100644 index 65fd20c..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/to/OrderCreateTo.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.forth.gulimall.order.to; - -import com.forth.gulimall.order.entity.OrderEntity; -import com.forth.gulimall.order.entity.OrderItemEntity; -import lombok.Data; - -import java.math.BigDecimal; -import java.text.DecimalFormat; -import java.util.List; -@Data -public class OrderCreateTo { - private OrderEntity order; - private List orderItems; - private BigDecimal payPrice;// - private BigDecimal fare; // - - public void setFare(BigDecimal fare) { - BigDecimal loanAmount = new BigDecimal("10.00"); - - this.fare = loanAmount; - } -} diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/vo/MemberAddressVo.java b/gulimall-order/src/main/java/com/forth/gulimall/order/vo/MemberAddressVo.java deleted file mode 100644 index 233e75c..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/vo/MemberAddressVo.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.forth.gulimall.order.vo; - -import lombok.Data; - -@Data -public class MemberAddressVo { - private Long id; - /** - * member_id - */ - private Long memberId; - /** - * 收货人姓名 - */ - private String name; - /** - * 电话 - */ - private String phone; - /** - * 邮政编码 - */ - private String postCode; - /** - * 省份/直辖市 - */ - private String province; - /** - * 城市 - */ - private String city; - /** - * 区 - */ - private String region; - /** - * 详细地址(街道) - */ - private String detailAddress; - /** - * 省市区代码 - */ - private String areacode; - /** - * 是否默认 - */ - private Integer defaultStatus; -} diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/vo/MemberRespVo.java b/gulimall-order/src/main/java/com/forth/gulimall/order/vo/MemberRespVo.java deleted file mode 100644 index 4f8ea77..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/vo/MemberRespVo.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.forth.gulimall.order.vo; - -import lombok.Data; -import lombok.ToString; - -import java.io.Serializable; -import java.util.Date; - -@ToString -@Data -public class MemberRespVo implements Serializable { - /** - * id - */ - - private Long id; - /** - * 会员等级id - */ - private Long levelId; - /** - * 用户名 - */ - private String username; - /** - * 密码 - */ - private String password; - /** - * 昵称 - */ - private String nickname; - /** - * 手机号码 - */ - private String mobile; - /** - * 邮箱 - */ - private String email; - /** - * 头像 - */ - private String header; - /** - * 性别 - */ - private Integer gender; - /** - * 生日 - */ - private Date birth; - /** - * 所在城市 - */ - private String city; - /** - * 职业 - */ - private String job; - /** - * 个性签名 - */ - private String sign; - /** - * 用户来源 - */ - private Integer sourceType; - /** - * 积分 - */ - private Integer integration; - /** - * 成长值 - */ - private Integer growth; - /** - * 启用状态 - */ - private Integer status; - /** - * 注册时间 - */ - private Date createTime; - - private String socialUid; - private String accessToken; - private Long expiresIn; - -} diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/vo/OrderConfirmVo.java b/gulimall-order/src/main/java/com/forth/gulimall/order/vo/OrderConfirmVo.java deleted file mode 100644 index 643b929..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/vo/OrderConfirmVo.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.forth.gulimall.order.vo; - -import lombok.Data; -import lombok.Getter; -import lombok.Setter; - -import java.math.BigDecimal; -import java.util.List; -import java.util.Map; - -/** - * 订单确认页的需要的数据 - */ - -public class OrderConfirmVo { - //收货地址 - @Getter - @Setter - List address; - //s所有 选中项 - @Getter - @Setter - List items; - //优惠 - @Getter - @Setter - Integer integration; - //防止重复 - @Getter - @Setter - String orderToken; - //订单总额 - // BigDecimal total; - Integer count; - @Getter - @Setter - Map stocks; - public Integer getCount(){ - Integer i=0; - if (items != null) { - for (OrderItemVo item : items) { - i+=item.getCount(); - } - } - return i; - } - - public BigDecimal getTotal() { - BigDecimal sum = new BigDecimal("0"); - if (items != null) { - for (OrderItemVo item : items) { - BigDecimal multiply = item.getPrice().multiply(new BigDecimal(item.getCount().toString())); - sum = sum.add(multiply); - } - } - return sum; - } - //应付价格 - //BigDecimal payPrice; - - public BigDecimal getPayPrice() { - return getTotal(); - } -} diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/vo/OrderItemVo.java b/gulimall-order/src/main/java/com/forth/gulimall/order/vo/OrderItemVo.java deleted file mode 100644 index bc8ce06..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/vo/OrderItemVo.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.forth.gulimall.order.vo; - -import lombok.Data; - -import java.math.BigDecimal; -import java.util.List; -@Data -public class OrderItemVo { - - - private long skuId; - private String title; - private String image; - private List skuAttr; - private BigDecimal price; - private Integer count; - private BigDecimal totalPrice; - // private boolean hasStock; - private BigDecimal weight; - -} diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/vo/OrderSubmitVo.java b/gulimall-order/src/main/java/com/forth/gulimall/order/vo/OrderSubmitVo.java deleted file mode 100644 index dd073c1..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/vo/OrderSubmitVo.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.forth.gulimall.order.vo; - -import lombok.Data; - -import java.math.BigDecimal; - -/** - * 封装订单数据 - */ -@Data -public class OrderSubmitVo { -private Long addrId; -private Integer payType;//支付方式 -//无需提交商品,去购物车获取 - //优惠,发票 -private String orderToken;//防重 -private BigDecimal payPrice;//应付价格 -private String note;//订单备注 -private String orderAdder;//订单地址 - -} diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/vo/SkuStockVo.java b/gulimall-order/src/main/java/com/forth/gulimall/order/vo/SkuStockVo.java deleted file mode 100644 index b1bbc77..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/vo/SkuStockVo.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.forth.gulimall.order.vo; - -import lombok.Data; - -@Data -public class SkuStockVo { - private Long skuId; - private Boolean hasStock; -} diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/vo/SpuInfoVo.java b/gulimall-order/src/main/java/com/forth/gulimall/order/vo/SpuInfoVo.java deleted file mode 100644 index 5a3939b..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/vo/SpuInfoVo.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.forth.gulimall.order.vo; - -import com.baomidou.mybatisplus.annotation.TableId; -import lombok.Data; - -import java.math.BigDecimal; -import java.util.Date; - -@Data -public class SpuInfoVo { - - /** - * 商品id - */ - private Long id; - /** - * 商品名称 - */ - private String spuName; - /** - * 商品描述 - */ - private String spuDescription; - /** - * 所属分类id - */ - private Long catalogId; - /** - * 品牌id - */ - private Long brandId; - /** - * - */ - private BigDecimal weight; - /** - * 上架状态[0 - 下架,1 - 上架] - */ - private Integer publishStatus; - /** - * - */ - private Date createTime; - /** - * - */ - private Date updateTime; - -} diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/vo/SubmitOrderResponseVo.java b/gulimall-order/src/main/java/com/forth/gulimall/order/vo/SubmitOrderResponseVo.java deleted file mode 100644 index bbaa440..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/vo/SubmitOrderResponseVo.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.forth.gulimall.order.vo; - -import com.forth.gulimall.order.entity.OrderEntity; -import lombok.Data; - -@Data -public class SubmitOrderResponseVo { - - private OrderEntity order; - private Integer code; //状态码 - -} diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/vo/WareSkuLockVo.java b/gulimall-order/src/main/java/com/forth/gulimall/order/vo/WareSkuLockVo.java deleted file mode 100644 index 8cb6a7d..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/vo/WareSkuLockVo.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.forth.gulimall.order.vo; - -import lombok.Data; - -import java.util.List; -@Data -public class WareSkuLockVo { - private String orderSn; - private List locks;//需要锁住的库存信息 -} diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/web/HelloController.java b/gulimall-order/src/main/java/com/forth/gulimall/order/web/HelloController.java deleted file mode 100644 index b8b1cbb..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/web/HelloController.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.forth.gulimall.order.web; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; - -@Controller -public class HelloController { - - @GetMapping("/{page}.html") - public String ListPage(@PathVariable("page") String page){ - return page; - } -} diff --git a/gulimall-order/src/main/java/com/forth/gulimall/order/web/OrderWebController.java b/gulimall-order/src/main/java/com/forth/gulimall/order/web/OrderWebController.java deleted file mode 100644 index a2a6339..0000000 --- a/gulimall-order/src/main/java/com/forth/gulimall/order/web/OrderWebController.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.forth.gulimall.order.web; - -import com.forth.gulimall.order.service.OrderService; -import com.forth.gulimall.order.vo.OrderConfirmVo; -import com.forth.gulimall.order.vo.OrderSubmitVo; -import com.forth.gulimall.order.vo.SubmitOrderResponseVo; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.servlet.mvc.support.RedirectAttributes; - -import javax.servlet.http.HttpServletRequest; -import java.util.concurrent.ExecutionException; - -@Controller -public class OrderWebController { - - @Autowired - OrderService orderService; - - @GetMapping("/toTrade") - public String toTrade(Model model, HttpServletRequest request) throws ExecutionException, InterruptedException { - - OrderConfirmVo confirmVo= orderService.confirmOrder(); - model.addAttribute("orderConfirmData",confirmVo); - return "confirm"; - } - - /** - * 下单功能 - * @param vo - * @return - */ - @PostMapping("/submitOrder") - public String submitOrder(OrderSubmitVo vo, Model model, RedirectAttributes redirectAttributes){ - System.out.println("-OrderSubmitVo----"+vo); - SubmitOrderResponseVo responseVo= orderService.submitOrder(vo); - - //创建下单,验证令牌,价格,库存 - //下单成功来到支付 - //失败回到订单也确认信息 - System.out.println("----->>"+responseVo.getCode()); - - if (responseVo.getCode()==0){ - model.addAttribute("SubmitOrderResp",responseVo); - return "pay"; - }else{ - String msg="下单失败;"; - switch (responseVo.getCode()){ - case 1: msg +="订单信息过期,请刷新重新提交";break; - case 2: msg +="商品价格发生变化,请确认后再次提交";break; - case 3: msg +="库存锁定失败,商品库存不足";break; - - } - redirectAttributes.addFlashAttribute("msg",msg); - return "redirect:http://localhost:35000/toTrade"; - } - } - -} diff --git a/gulimall-order/src/main/resources/application.yml b/gulimall-order/src/main/resources/application.yml index d830767..c05c41e 100644 --- a/gulimall-order/src/main/resources/application.yml +++ b/gulimall-order/src/main/resources/application.yml @@ -1,24 +1,19 @@ server: - port: 35000 + port: 4003 spring: - thymeleaf: - cache: false datasource: username: root password: root url: jdbc:mysql://39.97.249.66:3306/gulimall_oms - driver-class-name: com.mysql.cj.jdbc.Driver + driver-class-name: com.mysql.jdbc.Driver cloud: nacos: discovery: server-addr: 127.0.0.1:8848 application: - name: order - redis: - host: 39.97.249.66 + name: gulimall-order mybatis-plus: mapper-locations: classpath:/mapper/**/*.xml global-config: db-config: - id-type: auto - + id-type: AUTO \ No newline at end of file diff --git a/gulimall-order/src/main/resources/bootstrap.properties b/gulimall-order/src/main/resources/bootstrap.properties deleted file mode 100644 index e0895fd..0000000 --- a/gulimall-order/src/main/resources/bootstrap.properties +++ /dev/null @@ -1,13 +0,0 @@ -spring.application.name=order - -spring.cloud.nacos.config.server-addr=39.97.249.66:8848 -spring.cloud.nacos.config.namespace=18411508-69c1-4c76-ae08-b934d53c8c82 - -spring.cloud.nacos.config.ext-config[0].data-id=order.yml -spring.cloud.nacos.config.ext-config[0].group=DEFAULT_GROUP -spring.cloud.nacos.config.ext-config[0].refresh=true - -spring.session.store-type=redis -gulimall.thread.core-size=20 -gulimall.thread.max-size=200 -gulimall.thread.keep-alive-time=10 \ No newline at end of file diff --git a/gulimall-order/src/main/resources/static/js/jquery-3.1.1.min.js b/gulimall-order/src/main/resources/static/js/jquery-3.1.1.min.js deleted file mode 100644 index 5f61386..0000000 --- a/gulimall-order/src/main/resources/static/js/jquery-3.1.1.min.js +++ /dev/null @@ -1,3242 +0,0 @@ -/*! jQuery v3.1.1 | (c) jQuery Foundation | jquery.org/license */ ! function(a, b) { - "use strict"; - "object" == typeof module && "object" == typeof module.exports ? module.exports = a.document ? b(a, !0) : function(a) { - if(!a.document) throw new Error("jQuery requires a window with a document"); - return b(a) - } : b(a) -}("undefined" != typeof window ? window : this, function(a, b) { - "use strict"; - var c = [], - d = a.document, - e = Object.getPrototypeOf, - f = c.slice, - g = c.concat, - h = c.push, - i = c.indexOf, - j = {}, - k = j.toString, - l = j.hasOwnProperty, - m = l.toString, - n = m.call(Object), - o = {}; - - function p(a, b) { - b = b || d; - var c = b.createElement("script"); - c.text = a, b.head.appendChild(c).parentNode.removeChild(c) - } - var q = "3.1.1", - r = function(a, b) { - return new r.fn.init(a, b) - }, - s = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, - t = /^-ms-/, - u = /-([a-z])/g, - v = function(a, b) { - return b.toUpperCase() - }; - r.fn = r.prototype = { - jquery: q, - constructor: r, - length: 0, - toArray: function() { - return f.call(this) - }, - get: function(a) { - return null == a ? f.call(this) : a < 0 ? this[a + this.length] : this[a] - }, - pushStack: function(a) { - var b = r.merge(this.constructor(), a); - return b.prevObject = this, b - }, - each: function(a) { - return r.each(this, a) - }, - map: function(a) { - return this.pushStack(r.map(this, function(b, c) { - return a.call(b, c, b) - })) - }, - slice: function() { - return this.pushStack(f.apply(this, arguments)) - }, - first: function() { - return this.eq(0) - }, - last: function() { - return this.eq(-1) - }, - eq: function(a) { - var b = this.length, - c = +a + (a < 0 ? b : 0); - return this.pushStack(c >= 0 && c < b ? [this[c]] : []) - }, - end: function() { - return this.prevObject || this.constructor() - }, - push: h, - sort: c.sort, - splice: c.splice - }, r.extend = r.fn.extend = function() { - var a, b, c, d, e, f, g = arguments[0] || {}, - h = 1, - i = arguments.length, - j = !1; - for("boolean" == typeof g && (j = g, g = arguments[h] || {}, h++), "object" == typeof g || r.isFunction(g) || (g = {}), h === i && (g = this, h--); h < i; h++) - if(null != (a = arguments[h])) - for(b in a) c = g[b], d = a[b], g !== d && (j && d && (r.isPlainObject(d) || (e = r.isArray(d))) ? (e ? (e = !1, f = c && r.isArray(c) ? c : []) : f = c && r.isPlainObject(c) ? c : {}, g[b] = r.extend(j, f, d)) : void 0 !== d && (g[b] = d)); - return g - }, r.extend({ - expando: "jQuery" + (q + Math.random()).replace(/\D/g, ""), - isReady: !0, - error: function(a) { - throw new Error(a) - }, - noop: function() {}, - isFunction: function(a) { - return "function" === r.type(a) - }, - isArray: Array.isArray, - isWindow: function(a) { - return null != a && a === a.window - }, - isNumeric: function(a) { - var b = r.type(a); - return("number" === b || "string" === b) && !isNaN(a - parseFloat(a)) - }, - isPlainObject: function(a) { - var b, c; - return !(!a || "[object Object]" !== k.call(a)) && (!(b = e(a)) || (c = l.call(b, "constructor") && b.constructor, "function" == typeof c && m.call(c) === n)) - }, - isEmptyObject: function(a) { - var b; - for(b in a) return !1; - return !0 - }, - type: function(a) { - return null == a ? a + "" : "object" == typeof a || "function" == typeof a ? j[k.call(a)] || "object" : typeof a - }, - globalEval: function(a) { - p(a) - }, - camelCase: function(a) { - return a.replace(t, "ms-").replace(u, v) - }, - nodeName: function(a, b) { - return a.nodeName && a.nodeName.toLowerCase() === b.toLowerCase() - }, - each: function(a, b) { - var c, d = 0; - if(w(a)) { - for(c = a.length; d < c; d++) - if(b.call(a[d], d, a[d]) === !1) break - } else - for(d in a) - if(b.call(a[d], d, a[d]) === !1) break; return a - }, - trim: function(a) { - return null == a ? "" : (a + "").replace(s, "") - }, - makeArray: function(a, b) { - var c = b || []; - return null != a && (w(Object(a)) ? r.merge(c, "string" == typeof a ? [a] : a) : h.call(c, a)), c - }, - inArray: function(a, b, c) { - return null == b ? -1 : i.call(b, a, c) - }, - merge: function(a, b) { - for(var c = +b.length, d = 0, e = a.length; d < c; d++) a[e++] = b[d]; - return a.length = e, a - }, - grep: function(a, b, c) { - for(var d, e = [], f = 0, g = a.length, h = !c; f < g; f++) d = !b(a[f], f), d !== h && e.push(a[f]); - return e - }, - map: function(a, b, c) { - var d, e, f = 0, - h = []; - if(w(a)) - for(d = a.length; f < d; f++) e = b(a[f], f, c), null != e && h.push(e); - else - for(f in a) e = b(a[f], f, c), null != e && h.push(e); - return g.apply([], h) - }, - guid: 1, - proxy: function(a, b) { - var c, d, e; - if("string" == typeof b && (c = a[b], b = a, a = c), r.isFunction(a)) return d = f.call(arguments, 2), e = function() { - return a.apply(b || this, d.concat(f.call(arguments))) - }, e.guid = a.guid = a.guid || r.guid++, e - }, - now: Date.now, - support: o - }), "function" == typeof Symbol && (r.fn[Symbol.iterator] = c[Symbol.iterator]), r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), function(a, b) { - j["[object " + b + "]"] = b.toLowerCase() - }); - - function w(a) { - var b = !!a && "length" in a && a.length, - c = r.type(a); - return "function" !== c && !r.isWindow(a) && ("array" === c || 0 === b || "number" == typeof b && b > 0 && b - 1 in a) - } - var x = function(a) { - var b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u = "sizzle" + 1 * new Date, - v = a.document, - w = 0, - x = 0, - y = ha(), - z = ha(), - A = ha(), - B = function(a, b) { - return a === b && (l = !0), 0 - }, - C = {}.hasOwnProperty, - D = [], - E = D.pop, - F = D.push, - G = D.push, - H = D.slice, - I = function(a, b) { - for(var c = 0, d = a.length; c < d; c++) - if(a[c] === b) return c; - return -1 - }, - J = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", - K = "[\\x20\\t\\r\\n\\f]", - L = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", - M = "\\[" + K + "*(" + L + ")(?:" + K + "*([*^$|!~]?=)" + K + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + L + "))|)" + K + "*\\]", - N = ":(" + L + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + M + ")*)|.*)\\)|)", - O = new RegExp(K + "+", "g"), - P = new RegExp("^" + K + "+|((?:^|[^\\\\])(?:\\\\.)*)" + K + "+$", "g"), - Q = new RegExp("^" + K + "*," + K + "*"), - R = new RegExp("^" + K + "*([>+~]|" + K + ")" + K + "*"), - S = new RegExp("=" + K + "*([^\\]'\"]*?)" + K + "*\\]", "g"), - T = new RegExp(N), - U = new RegExp("^" + L + "$"), - V = { - ID: new RegExp("^#(" + L + ")"), - CLASS: new RegExp("^\\.(" + L + ")"), - TAG: new RegExp("^(" + L + "|[*])"), - ATTR: new RegExp("^" + M), - PSEUDO: new RegExp("^" + N), - CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + K + "*(even|odd|(([+-]|)(\\d*)n|)" + K + "*(?:([+-]|)" + K + "*(\\d+)|))" + K + "*\\)|)", "i"), - bool: new RegExp("^(?:" + J + ")$", "i"), - needsContext: new RegExp("^" + K + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + K + "*((?:-\\d)?\\d*)" + K + "*\\)|)(?=[^-]|$)", "i") - }, - W = /^(?:input|select|textarea|button)$/i, - X = /^h\d$/i, - Y = /^[^{]+\{\s*\[native \w/, - Z = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - $ = /[+~]/, - _ = new RegExp("\\\\([\\da-f]{1,6}" + K + "?|(" + K + ")|.)", "ig"), - aa = function(a, b, c) { - var d = "0x" + b - 65536; - return d !== d || c ? b : d < 0 ? String.fromCharCode(d + 65536) : String.fromCharCode(d >> 10 | 55296, 1023 & d | 56320) - }, - ba = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, - ca = function(a, b) { - return b ? "\0" === a ? "\ufffd" : a.slice(0, -1) + "\\" + a.charCodeAt(a.length - 1).toString(16) + " " : "\\" + a - }, - da = function() { - m() - }, - ea = ta(function(a) { - return a.disabled === !0 && ("form" in a || "label" in a) - }, { - dir: "parentNode", - next: "legend" - }); - try { - G.apply(D = H.call(v.childNodes), v.childNodes), D[v.childNodes.length].nodeType - } catch(fa) { - G = { - apply: D.length ? function(a, b) { - F.apply(a, H.call(b)) - } : function(a, b) { - var c = a.length, - d = 0; - while(a[c++] = b[d++]); - a.length = c - 1 - } - } - } - - function ga(a, b, d, e) { - var f, h, j, k, l, o, r, s = b && b.ownerDocument, - w = b ? b.nodeType : 9; - if(d = d || [], "string" != typeof a || !a || 1 !== w && 9 !== w && 11 !== w) return d; - if(!e && ((b ? b.ownerDocument || b : v) !== n && m(b), b = b || n, p)) { - if(11 !== w && (l = Z.exec(a))) - if(f = l[1]) { - if(9 === w) { - if(!(j = b.getElementById(f))) return d; - if(j.id === f) return d.push(j), d - } else if(s && (j = s.getElementById(f)) && t(b, j) && j.id === f) return d.push(j), d - } else { - if(l[2]) return G.apply(d, b.getElementsByTagName(a)), d; - if((f = l[3]) && c.getElementsByClassName && b.getElementsByClassName) return G.apply(d, b.getElementsByClassName(f)), d - } - if(c.qsa && !A[a + " "] && (!q || !q.test(a))) { - if(1 !== w) s = b, r = a; - else if("object" !== b.nodeName.toLowerCase()) { - (k = b.getAttribute("id")) ? k = k.replace(ba, ca): b.setAttribute("id", k = u), o = g(a), h = o.length; - while(h--) o[h] = "#" + k + " " + sa(o[h]); - r = o.join(","), s = $.test(a) && qa(b.parentNode) || b - } - if(r) try { - return G.apply(d, s.querySelectorAll(r)), d - } catch(x) {} finally { - k === u && b.removeAttribute("id") - } - } - } - return i(a.replace(P, "$1"), b, d, e) - } - - function ha() { - var a = []; - - function b(c, e) { - return a.push(c + " ") > d.cacheLength && delete b[a.shift()], b[c + " "] = e - } - return b - } - - function ia(a) { - return a[u] = !0, a - } - - function ja(a) { - var b = n.createElement("fieldset"); - try { - return !!a(b) - } catch(c) { - return !1 - } finally { - b.parentNode && b.parentNode.removeChild(b), b = null - } - } - - function ka(a, b) { - var c = a.split("|"), - e = c.length; - while(e--) d.attrHandle[c[e]] = b - } - - function la(a, b) { - var c = b && a, - d = c && 1 === a.nodeType && 1 === b.nodeType && a.sourceIndex - b.sourceIndex; - if(d) return d; - if(c) - while(c = c.nextSibling) - if(c === b) return -1; - return a ? 1 : -1 - } - - function ma(a) { - return function(b) { - var c = b.nodeName.toLowerCase(); - return "input" === c && b.type === a - } - } - - function na(a) { - return function(b) { - var c = b.nodeName.toLowerCase(); - return("input" === c || "button" === c) && b.type === a - } - } - - function oa(a) { - return function(b) { - return "form" in b ? b.parentNode && b.disabled === !1 ? "label" in b ? "label" in b.parentNode ? b.parentNode.disabled === a : b.disabled === a : b.isDisabled === a || b.isDisabled !== !a && ea(b) === a : b.disabled === a : "label" in b && b.disabled === a - } - } - - function pa(a) { - return ia(function(b) { - return b = +b, ia(function(c, d) { - var e, f = a([], c.length, b), - g = f.length; - while(g--) c[e = f[g]] && (c[e] = !(d[e] = c[e])) - }) - }) - } - - function qa(a) { - return a && "undefined" != typeof a.getElementsByTagName && a - } - c = ga.support = {}, f = ga.isXML = function(a) { - var b = a && (a.ownerDocument || a).documentElement; - return !!b && "HTML" !== b.nodeName - }, m = ga.setDocument = function(a) { - var b, e, g = a ? a.ownerDocument || a : v; - return g !== n && 9 === g.nodeType && g.documentElement ? (n = g, o = n.documentElement, p = !f(n), v !== n && (e = n.defaultView) && e.top !== e && (e.addEventListener ? e.addEventListener("unload", da, !1) : e.attachEvent && e.attachEvent("onunload", da)), c.attributes = ja(function(a) { - return a.className = "i", !a.getAttribute("className") - }), c.getElementsByTagName = ja(function(a) { - return a.appendChild(n.createComment("")), !a.getElementsByTagName("*").length - }), c.getElementsByClassName = Y.test(n.getElementsByClassName), c.getById = ja(function(a) { - return o.appendChild(a).id = u, !n.getElementsByName || !n.getElementsByName(u).length - }), c.getById ? (d.filter.ID = function(a) { - var b = a.replace(_, aa); - return function(a) { - return a.getAttribute("id") === b - } - }, d.find.ID = function(a, b) { - if("undefined" != typeof b.getElementById && p) { - var c = b.getElementById(a); - return c ? [c] : [] - } - }) : (d.filter.ID = function(a) { - var b = a.replace(_, aa); - return function(a) { - var c = "undefined" != typeof a.getAttributeNode && a.getAttributeNode("id"); - return c && c.value === b - } - }, d.find.ID = function(a, b) { - if("undefined" != typeof b.getElementById && p) { - var c, d, e, f = b.getElementById(a); - if(f) { - if(c = f.getAttributeNode("id"), c && c.value === a) return [f]; - e = b.getElementsByName(a), d = 0; - while(f = e[d++]) - if(c = f.getAttributeNode("id"), c && c.value === a) return [f] - } - return [] - } - }), d.find.TAG = c.getElementsByTagName ? function(a, b) { - return "undefined" != typeof b.getElementsByTagName ? b.getElementsByTagName(a) : c.qsa ? b.querySelectorAll(a) : void 0 - } : function(a, b) { - var c, d = [], - e = 0, - f = b.getElementsByTagName(a); - if("*" === a) { - while(c = f[e++]) 1 === c.nodeType && d.push(c); - return d - } - return f - }, d.find.CLASS = c.getElementsByClassName && function(a, b) { - if("undefined" != typeof b.getElementsByClassName && p) return b.getElementsByClassName(a) - }, r = [], q = [], (c.qsa = Y.test(n.querySelectorAll)) && (ja(function(a) { - o.appendChild(a).innerHTML = "", a.querySelectorAll("[msallowcapture^='']").length && q.push("[*^$]=" + K + "*(?:''|\"\")"), a.querySelectorAll("[selected]").length || q.push("\\[" + K + "*(?:value|" + J + ")"), a.querySelectorAll("[id~=" + u + "-]").length || q.push("~="), a.querySelectorAll(":checked").length || q.push(":checked"), a.querySelectorAll("a#" + u + "+*").length || q.push(".#.+[+~]") - }), ja(function(a) { - a.innerHTML = ""; - var b = n.createElement("input"); - b.setAttribute("type", "hidden"), a.appendChild(b).setAttribute("name", "D"), a.querySelectorAll("[name=d]").length && q.push("name" + K + "*[*^$|!~]?="), 2 !== a.querySelectorAll(":enabled").length && q.push(":enabled", ":disabled"), o.appendChild(a).disabled = !0, 2 !== a.querySelectorAll(":disabled").length && q.push(":enabled", ":disabled"), a.querySelectorAll("*,:x"), q.push(",.*:") - })), (c.matchesSelector = Y.test(s = o.matches || o.webkitMatchesSelector || o.mozMatchesSelector || o.oMatchesSelector || o.msMatchesSelector)) && ja(function(a) { - c.disconnectedMatch = s.call(a, "*"), s.call(a, "[s!='']:x"), r.push("!=", N) - }), q = q.length && new RegExp(q.join("|")), r = r.length && new RegExp(r.join("|")), b = Y.test(o.compareDocumentPosition), t = b || Y.test(o.contains) ? function(a, b) { - var c = 9 === a.nodeType ? a.documentElement : a, - d = b && b.parentNode; - return a === d || !(!d || 1 !== d.nodeType || !(c.contains ? c.contains(d) : a.compareDocumentPosition && 16 & a.compareDocumentPosition(d))) - } : function(a, b) { - if(b) - while(b = b.parentNode) - if(b === a) return !0; - return !1 - }, B = b ? function(a, b) { - if(a === b) return l = !0, 0; - var d = !a.compareDocumentPosition - !b.compareDocumentPosition; - return d ? d : (d = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1, 1 & d || !c.sortDetached && b.compareDocumentPosition(a) === d ? a === n || a.ownerDocument === v && t(v, a) ? -1 : b === n || b.ownerDocument === v && t(v, b) ? 1 : k ? I(k, a) - I(k, b) : 0 : 4 & d ? -1 : 1) - } : function(a, b) { - if(a === b) return l = !0, 0; - var c, d = 0, - e = a.parentNode, - f = b.parentNode, - g = [a], - h = [b]; - if(!e || !f) return a === n ? -1 : b === n ? 1 : e ? -1 : f ? 1 : k ? I(k, a) - I(k, b) : 0; - if(e === f) return la(a, b); - c = a; - while(c = c.parentNode) g.unshift(c); - c = b; - while(c = c.parentNode) h.unshift(c); - while(g[d] === h[d]) d++; - return d ? la(g[d], h[d]) : g[d] === v ? -1 : h[d] === v ? 1 : 0 - }, n) : n - }, ga.matches = function(a, b) { - return ga(a, null, null, b) - }, ga.matchesSelector = function(a, b) { - if((a.ownerDocument || a) !== n && m(a), b = b.replace(S, "='$1']"), c.matchesSelector && p && !A[b + " "] && (!r || !r.test(b)) && (!q || !q.test(b))) try { - var d = s.call(a, b); - if(d || c.disconnectedMatch || a.document && 11 !== a.document.nodeType) return d - } catch(e) {} - return ga(b, n, null, [a]).length > 0 - }, ga.contains = function(a, b) { - return(a.ownerDocument || a) !== n && m(a), t(a, b) - }, ga.attr = function(a, b) { - (a.ownerDocument || a) !== n && m(a); - var e = d.attrHandle[b.toLowerCase()], - f = e && C.call(d.attrHandle, b.toLowerCase()) ? e(a, b, !p) : void 0; - return void 0 !== f ? f : c.attributes || !p ? a.getAttribute(b) : (f = a.getAttributeNode(b)) && f.specified ? f.value : null - }, ga.escape = function(a) { - return(a + "").replace(ba, ca) - }, ga.error = function(a) { - throw new Error("Syntax error, unrecognized expression: " + a) - }, ga.uniqueSort = function(a) { - var b, d = [], - e = 0, - f = 0; - if(l = !c.detectDuplicates, k = !c.sortStable && a.slice(0), a.sort(B), l) { - while(b = a[f++]) b === a[f] && (e = d.push(f)); - while(e--) a.splice(d[e], 1) - } - return k = null, a - }, e = ga.getText = function(a) { - var b, c = "", - d = 0, - f = a.nodeType; - if(f) { - if(1 === f || 9 === f || 11 === f) { - if("string" == typeof a.textContent) return a.textContent; - for(a = a.firstChild; a; a = a.nextSibling) c += e(a) - } else if(3 === f || 4 === f) return a.nodeValue - } else - while(b = a[d++]) c += e(b); - return c - }, d = ga.selectors = { - cacheLength: 50, - createPseudo: ia, - match: V, - attrHandle: {}, - find: {}, - relative: { - ">": { - dir: "parentNode", - first: !0 - }, - " ": { - dir: "parentNode" - }, - "+": { - dir: "previousSibling", - first: !0 - }, - "~": { - dir: "previousSibling" - } - }, - preFilter: { - ATTR: function(a) { - return a[1] = a[1].replace(_, aa), a[3] = (a[3] || a[4] || a[5] || "").replace(_, aa), "~=" === a[2] && (a[3] = " " + a[3] + " "), a.slice(0, 4) - }, - CHILD: function(a) { - return a[1] = a[1].toLowerCase(), "nth" === a[1].slice(0, 3) ? (a[3] || ga.error(a[0]), a[4] = +(a[4] ? a[5] + (a[6] || 1) : 2 * ("even" === a[3] || "odd" === a[3])), a[5] = +(a[7] + a[8] || "odd" === a[3])) : a[3] && ga.error(a[0]), a - }, - PSEUDO: function(a) { - var b, c = !a[6] && a[2]; - return V.CHILD.test(a[0]) ? null : (a[3] ? a[2] = a[4] || a[5] || "" : c && T.test(c) && (b = g(c, !0)) && (b = c.indexOf(")", c.length - b) - c.length) && (a[0] = a[0].slice(0, b), a[2] = c.slice(0, b)), a.slice(0, 3)) - } - }, - filter: { - TAG: function(a) { - var b = a.replace(_, aa).toLowerCase(); - return "*" === a ? function() { - return !0 - } : function(a) { - return a.nodeName && a.nodeName.toLowerCase() === b - } - }, - CLASS: function(a) { - var b = y[a + " "]; - return b || (b = new RegExp("(^|" + K + ")" + a + "(" + K + "|$)")) && y(a, function(a) { - return b.test("string" == typeof a.className && a.className || "undefined" != typeof a.getAttribute && a.getAttribute("class") || "") - }) - }, - ATTR: function(a, b, c) { - return function(d) { - var e = ga.attr(d, a); - return null == e ? "!=" === b : !b || (e += "", "=" === b ? e === c : "!=" === b ? e !== c : "^=" === b ? c && 0 === e.indexOf(c) : "*=" === b ? c && e.indexOf(c) > -1 : "$=" === b ? c && e.slice(-c.length) === c : "~=" === b ? (" " + e.replace(O, " ") + " ").indexOf(c) > -1 : "|=" === b && (e === c || e.slice(0, c.length + 1) === c + "-")) - } - }, - CHILD: function(a, b, c, d, e) { - var f = "nth" !== a.slice(0, 3), - g = "last" !== a.slice(-4), - h = "of-type" === b; - return 1 === d && 0 === e ? function(a) { - return !!a.parentNode - } : function(b, c, i) { - var j, k, l, m, n, o, p = f !== g ? "nextSibling" : "previousSibling", - q = b.parentNode, - r = h && b.nodeName.toLowerCase(), - s = !i && !h, - t = !1; - if(q) { - if(f) { - while(p) { - m = b; - while(m = m[p]) - if(h ? m.nodeName.toLowerCase() === r : 1 === m.nodeType) return !1; - o = p = "only" === a && !o && "nextSibling" - } - return !0 - } - if(o = [g ? q.firstChild : q.lastChild], g && s) { - m = q, l = m[u] || (m[u] = {}), k = l[m.uniqueID] || (l[m.uniqueID] = {}), j = k[a] || [], n = j[0] === w && j[1], t = n && j[2], m = n && q.childNodes[n]; - while(m = ++n && m && m[p] || (t = n = 0) || o.pop()) - if(1 === m.nodeType && ++t && m === b) { - k[a] = [w, n, t]; - break - } - } else if(s && (m = b, l = m[u] || (m[u] = {}), k = l[m.uniqueID] || (l[m.uniqueID] = {}), j = k[a] || [], n = j[0] === w && j[1], t = n), t === !1) - while(m = ++n && m && m[p] || (t = n = 0) || o.pop()) - if((h ? m.nodeName.toLowerCase() === r : 1 === m.nodeType) && ++t && (s && (l = m[u] || (m[u] = {}), k = l[m.uniqueID] || (l[m.uniqueID] = {}), k[a] = [w, t]), m === b)) break; - return t -= e, t === d || t % d === 0 && t / d >= 0 - } - } - }, - PSEUDO: function(a, b) { - var c, e = d.pseudos[a] || d.setFilters[a.toLowerCase()] || ga.error("unsupported pseudo: " + a); - return e[u] ? e(b) : e.length > 1 ? (c = [a, a, "", b], d.setFilters.hasOwnProperty(a.toLowerCase()) ? ia(function(a, c) { - var d, f = e(a, b), - g = f.length; - while(g--) d = I(a, f[g]), a[d] = !(c[d] = f[g]) - }) : function(a) { - return e(a, 0, c) - }) : e - } - }, - pseudos: { - not: ia(function(a) { - var b = [], - c = [], - d = h(a.replace(P, "$1")); - return d[u] ? ia(function(a, b, c, e) { - var f, g = d(a, null, e, []), - h = a.length; - while(h--)(f = g[h]) && (a[h] = !(b[h] = f)) - }) : function(a, e, f) { - return b[0] = a, d(b, null, f, c), b[0] = null, !c.pop() - } - }), - has: ia(function(a) { - return function(b) { - return ga(a, b).length > 0 - } - }), - contains: ia(function(a) { - return a = a.replace(_, aa), - function(b) { - return(b.textContent || b.innerText || e(b)).indexOf(a) > -1 - } - }), - lang: ia(function(a) { - return U.test(a || "") || ga.error("unsupported lang: " + a), a = a.replace(_, aa).toLowerCase(), - function(b) { - var c; - do - if(c = p ? b.lang : b.getAttribute("xml:lang") || b.getAttribute("lang")) return c = c.toLowerCase(), c === a || 0 === c.indexOf(a + "-"); - while((b = b.parentNode) && 1 === b.nodeType); - return !1 - } - }), - target: function(b) { - var c = a.location && a.location.hash; - return c && c.slice(1) === b.id - }, - root: function(a) { - return a === o - }, - focus: function(a) { - return a === n.activeElement && (!n.hasFocus || n.hasFocus()) && !!(a.type || a.href || ~a.tabIndex) - }, - enabled: oa(!1), - disabled: oa(!0), - checked: function(a) { - var b = a.nodeName.toLowerCase(); - return "input" === b && !!a.checked || "option" === b && !!a.selected - }, - selected: function(a) { - return a.parentNode && a.parentNode.selectedIndex, a.selected === !0 - }, - empty: function(a) { - for(a = a.firstChild; a; a = a.nextSibling) - if(a.nodeType < 6) return !1; - return !0 - }, - parent: function(a) { - return !d.pseudos.empty(a) - }, - header: function(a) { - return X.test(a.nodeName) - }, - input: function(a) { - return W.test(a.nodeName) - }, - button: function(a) { - var b = a.nodeName.toLowerCase(); - return "input" === b && "button" === a.type || "button" === b - }, - text: function(a) { - var b; - return "input" === a.nodeName.toLowerCase() && "text" === a.type && (null == (b = a.getAttribute("type")) || "text" === b.toLowerCase()) - }, - first: pa(function() { - return [0] - }), - last: pa(function(a, b) { - return [b - 1] - }), - eq: pa(function(a, b, c) { - return [c < 0 ? c + b : c] - }), - even: pa(function(a, b) { - for(var c = 0; c < b; c += 2) a.push(c); - return a - }), - odd: pa(function(a, b) { - for(var c = 1; c < b; c += 2) a.push(c); - return a - }), - lt: pa(function(a, b, c) { - for(var d = c < 0 ? c + b : c; --d >= 0;) a.push(d); - return a - }), - gt: pa(function(a, b, c) { - for(var d = c < 0 ? c + b : c; ++d < b;) a.push(d); - return a - }) - } - }, d.pseudos.nth = d.pseudos.eq; - for(b in { - radio: !0, - checkbox: !0, - file: !0, - password: !0, - image: !0 - }) d.pseudos[b] = ma(b); - for(b in { - submit: !0, - reset: !0 - }) d.pseudos[b] = na(b); - - function ra() {} - ra.prototype = d.filters = d.pseudos, d.setFilters = new ra, g = ga.tokenize = function(a, b) { - var c, e, f, g, h, i, j, k = z[a + " "]; - if(k) return b ? 0 : k.slice(0); - h = a, i = [], j = d.preFilter; - while(h) { - c && !(e = Q.exec(h)) || (e && (h = h.slice(e[0].length) || h), i.push(f = [])), c = !1, (e = R.exec(h)) && (c = e.shift(), f.push({ - value: c, - type: e[0].replace(P, " ") - }), h = h.slice(c.length)); - for(g in d.filter) !(e = V[g].exec(h)) || j[g] && !(e = j[g](e)) || (c = e.shift(), f.push({ - value: c, - type: g, - matches: e - }), h = h.slice(c.length)); - if(!c) break - } - return b ? h.length : h ? ga.error(a) : z(a, i).slice(0) - }; - - function sa(a) { - for(var b = 0, c = a.length, d = ""; b < c; b++) d += a[b].value; - return d - } - - function ta(a, b, c) { - var d = b.dir, - e = b.next, - f = e || d, - g = c && "parentNode" === f, - h = x++; - return b.first ? function(b, c, e) { - while(b = b[d]) - if(1 === b.nodeType || g) return a(b, c, e); - return !1 - } : function(b, c, i) { - var j, k, l, m = [w, h]; - if(i) { - while(b = b[d]) - if((1 === b.nodeType || g) && a(b, c, i)) return !0 - } else - while(b = b[d]) - if(1 === b.nodeType || g) - if(l = b[u] || (b[u] = {}), k = l[b.uniqueID] || (l[b.uniqueID] = {}), e && e === b.nodeName.toLowerCase()) b = b[d] || b; - else { - if((j = k[f]) && j[0] === w && j[1] === h) return m[2] = j[2]; - if(k[f] = m, m[2] = a(b, c, i)) return !0 - } return !1 - } - } - - function ua(a) { - return a.length > 1 ? function(b, c, d) { - var e = a.length; - while(e--) - if(!a[e](b, c, d)) return !1; - return !0 - } : a[0] - } - - function va(a, b, c) { - for(var d = 0, e = b.length; d < e; d++) ga(a, b[d], c); - return c - } - - function wa(a, b, c, d, e) { - for(var f, g = [], h = 0, i = a.length, j = null != b; h < i; h++)(f = a[h]) && (c && !c(f, d, e) || (g.push(f), j && b.push(h))); - return g - } - - function xa(a, b, c, d, e, f) { - return d && !d[u] && (d = xa(d)), e && !e[u] && (e = xa(e, f)), ia(function(f, g, h, i) { - var j, k, l, m = [], - n = [], - o = g.length, - p = f || va(b || "*", h.nodeType ? [h] : h, []), - q = !a || !f && b ? p : wa(p, m, a, h, i), - r = c ? e || (f ? a : o || d) ? [] : g : q; - if(c && c(q, r, h, i), d) { - j = wa(r, n), d(j, [], h, i), k = j.length; - while(k--)(l = j[k]) && (r[n[k]] = !(q[n[k]] = l)) - } - if(f) { - if(e || a) { - if(e) { - j = [], k = r.length; - while(k--)(l = r[k]) && j.push(q[k] = l); - e(null, r = [], j, i) - } - k = r.length; - while(k--)(l = r[k]) && (j = e ? I(f, l) : m[k]) > -1 && (f[j] = !(g[j] = l)) - } - } else r = wa(r === g ? r.splice(o, r.length) : r), e ? e(null, g, r, i) : G.apply(g, r) - }) - } - - function ya(a) { - for(var b, c, e, f = a.length, g = d.relative[a[0].type], h = g || d.relative[" "], i = g ? 1 : 0, k = ta(function(a) { - return a === b - }, h, !0), l = ta(function(a) { - return I(b, a) > -1 - }, h, !0), m = [function(a, c, d) { - var e = !g && (d || c !== j) || ((b = c).nodeType ? k(a, c, d) : l(a, c, d)); - return b = null, e - }]; i < f; i++) - if(c = d.relative[a[i].type]) m = [ta(ua(m), c)]; - else { - if(c = d.filter[a[i].type].apply(null, a[i].matches), c[u]) { - for(e = ++i; e < f; e++) - if(d.relative[a[e].type]) break; - return xa(i > 1 && ua(m), i > 1 && sa(a.slice(0, i - 1).concat({ - value: " " === a[i - 2].type ? "*" : "" - })).replace(P, "$1"), c, i < e && ya(a.slice(i, e)), e < f && ya(a = a.slice(e)), e < f && sa(a)) - } - m.push(c) - } - return ua(m) - } - - function za(a, b) { - var c = b.length > 0, - e = a.length > 0, - f = function(f, g, h, i, k) { - var l, o, q, r = 0, - s = "0", - t = f && [], - u = [], - v = j, - x = f || e && d.find.TAG("*", k), - y = w += null == v ? 1 : Math.random() || .1, - z = x.length; - for(k && (j = g === n || g || k); s !== z && null != (l = x[s]); s++) { - if(e && l) { - o = 0, g || l.ownerDocument === n || (m(l), h = !p); - while(q = a[o++]) - if(q(l, g || n, h)) { - i.push(l); - break - } - k && (w = y) - } - c && ((l = !q && l) && r--, f && t.push(l)) - } - if(r += s, c && s !== r) { - o = 0; - while(q = b[o++]) q(t, u, g, h); - if(f) { - if(r > 0) - while(s--) t[s] || u[s] || (u[s] = E.call(i)); - u = wa(u) - } - G.apply(i, u), k && !f && u.length > 0 && r + b.length > 1 && ga.uniqueSort(i) - } - return k && (w = y, j = v), t - }; - return c ? ia(f) : f - } - return h = ga.compile = function(a, b) { - var c, d = [], - e = [], - f = A[a + " "]; - if(!f) { - b || (b = g(a)), c = b.length; - while(c--) f = ya(b[c]), f[u] ? d.push(f) : e.push(f); - f = A(a, za(e, d)), f.selector = a - } - return f - }, i = ga.select = function(a, b, c, e) { - var f, i, j, k, l, m = "function" == typeof a && a, - n = !e && g(a = m.selector || a); - if(c = c || [], 1 === n.length) { - if(i = n[0] = n[0].slice(0), i.length > 2 && "ID" === (j = i[0]).type && 9 === b.nodeType && p && d.relative[i[1].type]) { - if(b = (d.find.ID(j.matches[0].replace(_, aa), b) || [])[0], !b) return c; - m && (b = b.parentNode), a = a.slice(i.shift().value.length) - } - f = V.needsContext.test(a) ? 0 : i.length; - while(f--) { - if(j = i[f], d.relative[k = j.type]) break; - if((l = d.find[k]) && (e = l(j.matches[0].replace(_, aa), $.test(i[0].type) && qa(b.parentNode) || b))) { - if(i.splice(f, 1), a = e.length && sa(i), !a) return G.apply(c, e), c; - break - } - } - } - return(m || h(a, n))(e, b, !p, c, !b || $.test(a) && qa(b.parentNode) || b), c - }, c.sortStable = u.split("").sort(B).join("") === u, c.detectDuplicates = !!l, m(), c.sortDetached = ja(function(a) { - return 1 & a.compareDocumentPosition(n.createElement("fieldset")) - }), ja(function(a) { - return a.innerHTML = "", "#" === a.firstChild.getAttribute("href") - }) || ka("type|href|height|width", function(a, b, c) { - if(!c) return a.getAttribute(b, "type" === b.toLowerCase() ? 1 : 2) - }), c.attributes && ja(function(a) { - return a.innerHTML = "", a.firstChild.setAttribute("value", ""), "" === a.firstChild.getAttribute("value") - }) || ka("value", function(a, b, c) { - if(!c && "input" === a.nodeName.toLowerCase()) return a.defaultValue - }), ja(function(a) { - return null == a.getAttribute("disabled") - }) || ka(J, function(a, b, c) { - var d; - if(!c) return a[b] === !0 ? b.toLowerCase() : (d = a.getAttributeNode(b)) && d.specified ? d.value : null - }), ga - }(a); - r.find = x, r.expr = x.selectors, r.expr[":"] = r.expr.pseudos, r.uniqueSort = r.unique = x.uniqueSort, r.text = x.getText, r.isXMLDoc = x.isXML, r.contains = x.contains, r.escapeSelector = x.escape; - var y = function(a, b, c) { - var d = [], - e = void 0 !== c; - while((a = a[b]) && 9 !== a.nodeType) - if(1 === a.nodeType) { - if(e && r(a).is(c)) break; - d.push(a) - } - return d - }, - z = function(a, b) { - for(var c = []; a; a = a.nextSibling) 1 === a.nodeType && a !== b && c.push(a); - return c - }, - A = r.expr.match.needsContext, - B = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i, - C = /^.[^:#\[\.,]*$/; - - function D(a, b, c) { - return r.isFunction(b) ? r.grep(a, function(a, d) { - return !!b.call(a, d, a) !== c - }) : b.nodeType ? r.grep(a, function(a) { - return a === b !== c - }) : "string" != typeof b ? r.grep(a, function(a) { - return i.call(b, a) > -1 !== c - }) : C.test(b) ? r.filter(b, a, c) : (b = r.filter(b, a), r.grep(a, function(a) { - return i.call(b, a) > -1 !== c && 1 === a.nodeType - })) - } - r.filter = function(a, b, c) { - var d = b[0]; - return c && (a = ":not(" + a + ")"), 1 === b.length && 1 === d.nodeType ? r.find.matchesSelector(d, a) ? [d] : [] : r.find.matches(a, r.grep(b, function(a) { - return 1 === a.nodeType - })) - }, r.fn.extend({ - find: function(a) { - var b, c, d = this.length, - e = this; - if("string" != typeof a) return this.pushStack(r(a).filter(function() { - for(b = 0; b < d; b++) - if(r.contains(e[b], this)) return !0 - })); - for(c = this.pushStack([]), b = 0; b < d; b++) r.find(a, e[b], c); - return d > 1 ? r.uniqueSort(c) : c - }, - filter: function(a) { - return this.pushStack(D(this, a || [], !1)) - }, - not: function(a) { - return this.pushStack(D(this, a || [], !0)) - }, - is: function(a) { - return !!D(this, "string" == typeof a && A.test(a) ? r(a) : a || [], !1).length - } - }); - var E, F = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, - G = r.fn.init = function(a, b, c) { - var e, f; - if(!a) return this; - if(c = c || E, "string" == typeof a) { - if(e = "<" === a[0] && ">" === a[a.length - 1] && a.length >= 3 ? [null, a, null] : F.exec(a), !e || !e[1] && b) return !b || b.jquery ? (b || c).find(a) : this.constructor(b).find(a); - if(e[1]) { - if(b = b instanceof r ? b[0] : b, r.merge(this, r.parseHTML(e[1], b && b.nodeType ? b.ownerDocument || b : d, !0)), B.test(e[1]) && r.isPlainObject(b)) - for(e in b) r.isFunction(this[e]) ? this[e](b[e]) : this.attr(e, b[e]); - return this - } - return f = d.getElementById(e[2]), f && (this[0] = f, this.length = 1), this - } - return a.nodeType ? (this[0] = a, this.length = 1, this) : r.isFunction(a) ? void 0 !== c.ready ? c.ready(a) : a(r) : r.makeArray(a, this) - }; - G.prototype = r.fn, E = r(d); - var H = /^(?:parents|prev(?:Until|All))/, - I = { - children: !0, - contents: !0, - next: !0, - prev: !0 - }; - r.fn.extend({ - has: function(a) { - var b = r(a, this), - c = b.length; - return this.filter(function() { - for(var a = 0; a < c; a++) - if(r.contains(this, b[a])) return !0 - }) - }, - closest: function(a, b) { - var c, d = 0, - e = this.length, - f = [], - g = "string" != typeof a && r(a); - if(!A.test(a)) - for(; d < e; d++) - for(c = this[d]; c && c !== b; c = c.parentNode) - if(c.nodeType < 11 && (g ? g.index(c) > -1 : 1 === c.nodeType && r.find.matchesSelector(c, a))) { - f.push(c); - break - } - return this.pushStack(f.length > 1 ? r.uniqueSort(f) : f) - }, - index: function(a) { - return a ? "string" == typeof a ? i.call(r(a), this[0]) : i.call(this, a.jquery ? a[0] : a) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1 - }, - add: function(a, b) { - return this.pushStack(r.uniqueSort(r.merge(this.get(), r(a, b)))) - }, - addBack: function(a) { - return this.add(null == a ? this.prevObject : this.prevObject.filter(a)) - } - }); - - function J(a, b) { - while((a = a[b]) && 1 !== a.nodeType); - return a - } - r.each({ - parent: function(a) { - var b = a.parentNode; - return b && 11 !== b.nodeType ? b : null - }, - parents: function(a) { - return y(a, "parentNode") - }, - parentsUntil: function(a, b, c) { - return y(a, "parentNode", c) - }, - next: function(a) { - return J(a, "nextSibling") - }, - prev: function(a) { - return J(a, "previousSibling") - }, - nextAll: function(a) { - return y(a, "nextSibling") - }, - prevAll: function(a) { - return y(a, "previousSibling") - }, - nextUntil: function(a, b, c) { - return y(a, "nextSibling", c) - }, - prevUntil: function(a, b, c) { - return y(a, "previousSibling", c) - }, - siblings: function(a) { - return z((a.parentNode || {}).firstChild, a) - }, - children: function(a) { - return z(a.firstChild) - }, - contents: function(a) { - return a.contentDocument || r.merge([], a.childNodes) - } - }, function(a, b) { - r.fn[a] = function(c, d) { - var e = r.map(this, b, c); - return "Until" !== a.slice(-5) && (d = c), d && "string" == typeof d && (e = r.filter(d, e)), this.length > 1 && (I[a] || r.uniqueSort(e), H.test(a) && e.reverse()), this.pushStack(e) - } - }); - var K = /[^\x20\t\r\n\f]+/g; - - function L(a) { - var b = {}; - return r.each(a.match(K) || [], function(a, c) { - b[c] = !0 - }), b - } - r.Callbacks = function(a) { - a = "string" == typeof a ? L(a) : r.extend({}, a); - var b, c, d, e, f = [], - g = [], - h = -1, - i = function() { - for(e = a.once, d = b = !0; g.length; h = -1) { - c = g.shift(); - while(++h < f.length) f[h].apply(c[0], c[1]) === !1 && a.stopOnFalse && (h = f.length, c = !1) - } - a.memory || (c = !1), b = !1, e && (f = c ? [] : "") - }, - j = { - add: function() { - return f && (c && !b && (h = f.length - 1, g.push(c)), function d(b) { - r.each(b, function(b, c) { - r.isFunction(c) ? a.unique && j.has(c) || f.push(c) : c && c.length && "string" !== r.type(c) && d(c) - }) - }(arguments), c && !b && i()), this - }, - remove: function() { - return r.each(arguments, function(a, b) { - var c; - while((c = r.inArray(b, f, c)) > -1) f.splice(c, 1), c <= h && h-- - }), this - }, - has: function(a) { - return a ? r.inArray(a, f) > -1 : f.length > 0 - }, - empty: function() { - return f && (f = []), this - }, - disable: function() { - return e = g = [], f = c = "", this - }, - disabled: function() { - return !f - }, - lock: function() { - return e = g = [], c || b || (f = c = ""), this - }, - locked: function() { - return !!e - }, - fireWith: function(a, c) { - return e || (c = c || [], c = [a, c.slice ? c.slice() : c], g.push(c), b || i()), this - }, - fire: function() { - return j.fireWith(this, arguments), this - }, - fired: function() { - return !!d - } - }; - return j - }; - - function M(a) { - return a - } - - function N(a) { - throw a - } - - function O(a, b, c) { - var d; - try { - a && r.isFunction(d = a.promise) ? d.call(a).done(b).fail(c) : a && r.isFunction(d = a.then) ? d.call(a, b, c) : b.call(void 0, a) - } catch(a) { - c.call(void 0, a) - } - } - r.extend({ - Deferred: function(b) { - var c = [ - ["notify", "progress", r.Callbacks("memory"), r.Callbacks("memory"), 2], - ["resolve", "done", r.Callbacks("once memory"), r.Callbacks("once memory"), 0, "resolved"], - ["reject", "fail", r.Callbacks("once memory"), r.Callbacks("once memory"), 1, "rejected"] - ], - d = "pending", - e = { - state: function() { - return d - }, - always: function() { - return f.done(arguments).fail(arguments), this - }, - "catch": function(a) { - return e.then(null, a) - }, - pipe: function() { - var a = arguments; - return r.Deferred(function(b) { - r.each(c, function(c, d) { - var e = r.isFunction(a[d[4]]) && a[d[4]]; - f[d[1]](function() { - var a = e && e.apply(this, arguments); - a && r.isFunction(a.promise) ? a.promise().progress(b.notify).done(b.resolve).fail(b.reject) : b[d[0] + "With"](this, e ? [a] : arguments) - }) - }), a = null - }).promise() - }, - then: function(b, d, e) { - var f = 0; - - function g(b, c, d, e) { - return function() { - var h = this, - i = arguments, - j = function() { - var a, j; - if(!(b < f)) { - if(a = d.apply(h, i), a === c.promise()) throw new TypeError("Thenable self-resolution"); - j = a && ("object" == typeof a || "function" == typeof a) && a.then, r.isFunction(j) ? e ? j.call(a, g(f, c, M, e), g(f, c, N, e)) : (f++, j.call(a, g(f, c, M, e), g(f, c, N, e), g(f, c, M, c.notifyWith))) : (d !== M && (h = void 0, i = [a]), (e || c.resolveWith)(h, i)) - } - }, - k = e ? j : function() { - try { - j() - } catch(a) { - r.Deferred.exceptionHook && r.Deferred.exceptionHook(a, k.stackTrace), b + 1 >= f && (d !== N && (h = void 0, i = [a]), c.rejectWith(h, i)) - } - }; - b ? k() : (r.Deferred.getStackHook && (k.stackTrace = r.Deferred.getStackHook()), a.setTimeout(k)) - } - } - return r.Deferred(function(a) { - c[0][3].add(g(0, a, r.isFunction(e) ? e : M, a.notifyWith)), c[1][3].add(g(0, a, r.isFunction(b) ? b : M)), c[2][3].add(g(0, a, r.isFunction(d) ? d : N)) - }).promise() - }, - promise: function(a) { - return null != a ? r.extend(a, e) : e - } - }, - f = {}; - return r.each(c, function(a, b) { - var g = b[2], - h = b[5]; - e[b[1]] = g.add, h && g.add(function() { - d = h - }, c[3 - a][2].disable, c[0][2].lock), g.add(b[3].fire), f[b[0]] = function() { - return f[b[0] + "With"](this === f ? void 0 : this, arguments), this - }, f[b[0] + "With"] = g.fireWith - }), e.promise(f), b && b.call(f, f), f - }, - when: function(a) { - var b = arguments.length, - c = b, - d = Array(c), - e = f.call(arguments), - g = r.Deferred(), - h = function(a) { - return function(c) { - d[a] = this, e[a] = arguments.length > 1 ? f.call(arguments) : c, --b || g.resolveWith(d, e) - } - }; - if(b <= 1 && (O(a, g.done(h(c)).resolve, g.reject), "pending" === g.state() || r.isFunction(e[c] && e[c].then))) return g.then(); - while(c--) O(e[c], h(c), g.reject); - return g.promise() - } - }); - var P = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; - r.Deferred.exceptionHook = function(b, c) { - a.console && a.console.warn && b && P.test(b.name) && a.console.warn("jQuery.Deferred exception: " + b.message, b.stack, c) - }, r.readyException = function(b) { - a.setTimeout(function() { - throw b - }) - }; - var Q = r.Deferred(); - r.fn.ready = function(a) { - return Q.then(a)["catch"](function(a) { - r.readyException(a) - }), this - }, r.extend({ - isReady: !1, - readyWait: 1, - holdReady: function(a) { - a ? r.readyWait++ : r.ready(!0) - }, - ready: function(a) { - (a === !0 ? --r.readyWait : r.isReady) || (r.isReady = !0, a !== !0 && --r.readyWait > 0 || Q.resolveWith(d, [r])) - } - }), r.ready.then = Q.then; - - function R() { - d.removeEventListener("DOMContentLoaded", R), - a.removeEventListener("load", R), r.ready() - } - "complete" === d.readyState || "loading" !== d.readyState && !d.documentElement.doScroll ? a.setTimeout(r.ready) : (d.addEventListener("DOMContentLoaded", R), a.addEventListener("load", R)); - var S = function(a, b, c, d, e, f, g) { - var h = 0, - i = a.length, - j = null == c; - if("object" === r.type(c)) { - e = !0; - for(h in c) S(a, b, h, c[h], !0, f, g) - } else if(void 0 !== d && (e = !0, r.isFunction(d) || (g = !0), j && (g ? (b.call(a, d), b = null) : (j = b, b = function(a, b, c) { - return j.call(r(a), c) - })), b)) - for(; h < i; h++) b(a[h], c, g ? d : d.call(a[h], h, b(a[h], c))); - return e ? a : j ? b.call(a) : i ? b(a[0], c) : f - }, - T = function(a) { - return 1 === a.nodeType || 9 === a.nodeType || !+a.nodeType - }; - - function U() { - this.expando = r.expando + U.uid++ - } - U.uid = 1, U.prototype = { - cache: function(a) { - var b = a[this.expando]; - return b || (b = {}, T(a) && (a.nodeType ? a[this.expando] = b : Object.defineProperty(a, this.expando, { - value: b, - configurable: !0 - }))), b - }, - set: function(a, b, c) { - var d, e = this.cache(a); - if("string" == typeof b) e[r.camelCase(b)] = c; - else - for(d in b) e[r.camelCase(d)] = b[d]; - return e - }, - get: function(a, b) { - return void 0 === b ? this.cache(a) : a[this.expando] && a[this.expando][r.camelCase(b)] - }, - access: function(a, b, c) { - return void 0 === b || b && "string" == typeof b && void 0 === c ? this.get(a, b) : (this.set(a, b, c), void 0 !== c ? c : b) - }, - remove: function(a, b) { - var c, d = a[this.expando]; - if(void 0 !== d) { - if(void 0 !== b) { - r.isArray(b) ? b = b.map(r.camelCase) : (b = r.camelCase(b), b = b in d ? [b] : b.match(K) || []), c = b.length; - while(c--) delete d[b[c]] - }(void 0 === b || r.isEmptyObject(d)) && (a.nodeType ? a[this.expando] = void 0 : delete a[this.expando]) - } - }, - hasData: function(a) { - var b = a[this.expando]; - return void 0 !== b && !r.isEmptyObject(b) - } - }; - var V = new U, - W = new U, - X = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - Y = /[A-Z]/g; - - function Z(a) { - return "true" === a || "false" !== a && ("null" === a ? null : a === +a + "" ? +a : X.test(a) ? JSON.parse(a) : a) - } - - function $(a, b, c) { - var d; - if(void 0 === c && 1 === a.nodeType) - if(d = "data-" + b.replace(Y, "-$&").toLowerCase(), c = a.getAttribute(d), "string" == typeof c) { - try { - c = Z(c) - } catch(e) {} - W.set(a, b, c) - } else c = void 0; - return c - } - r.extend({ - hasData: function(a) { - return W.hasData(a) || V.hasData(a) - }, - data: function(a, b, c) { - return W.access(a, b, c) - }, - removeData: function(a, b) { - W.remove(a, b) - }, - _data: function(a, b, c) { - return V.access(a, b, c) - }, - _removeData: function(a, b) { - V.remove(a, b) - } - }), r.fn.extend({ - data: function(a, b) { - var c, d, e, f = this[0], - g = f && f.attributes; - if(void 0 === a) { - if(this.length && (e = W.get(f), 1 === f.nodeType && !V.get(f, "hasDataAttrs"))) { - c = g.length; - while(c--) g[c] && (d = g[c].name, 0 === d.indexOf("data-") && (d = r.camelCase(d.slice(5)), $(f, d, e[d]))); - V.set(f, "hasDataAttrs", !0) - } - return e - } - return "object" == typeof a ? this.each(function() { - W.set(this, a) - }) : S(this, function(b) { - var c; - if(f && void 0 === b) { - if(c = W.get(f, a), void 0 !== c) return c; - if(c = $(f, a), void 0 !== c) return c - } else this.each(function() { - W.set(this, a, b) - }) - }, null, b, arguments.length > 1, null, !0) - }, - removeData: function(a) { - return this.each(function() { - W.remove(this, a) - }) - } - }), r.extend({ - queue: function(a, b, c) { - var d; - if(a) return b = (b || "fx") + "queue", d = V.get(a, b), c && (!d || r.isArray(c) ? d = V.access(a, b, r.makeArray(c)) : d.push(c)), d || [] - }, - dequeue: function(a, b) { - b = b || "fx"; - var c = r.queue(a, b), - d = c.length, - e = c.shift(), - f = r._queueHooks(a, b), - g = function() { - r.dequeue(a, b) - }; - "inprogress" === e && (e = c.shift(), d--), e && ("fx" === b && c.unshift("inprogress"), delete f.stop, e.call(a, g, f)), !d && f && f.empty.fire() - }, - _queueHooks: function(a, b) { - var c = b + "queueHooks"; - return V.get(a, c) || V.access(a, c, { - empty: r.Callbacks("once memory").add(function() { - V.remove(a, [b + "queue", c]) - }) - }) - } - }), r.fn.extend({ - queue: function(a, b) { - var c = 2; - return "string" != typeof a && (b = a, a = "fx", c--), arguments.length < c ? r.queue(this[0], a) : void 0 === b ? this : this.each(function() { - var c = r.queue(this, a, b); - r._queueHooks(this, a), "fx" === a && "inprogress" !== c[0] && r.dequeue(this, a) - }) - }, - dequeue: function(a) { - return this.each(function() { - r.dequeue(this, a) - }) - }, - clearQueue: function(a) { - return this.queue(a || "fx", []) - }, - promise: function(a, b) { - var c, d = 1, - e = r.Deferred(), - f = this, - g = this.length, - h = function() { - --d || e.resolveWith(f, [f]) - }; - "string" != typeof a && (b = a, a = void 0), a = a || "fx"; - while(g--) c = V.get(f[g], a + "queueHooks"), c && c.empty && (d++, c.empty.add(h)); - return h(), e.promise(b) - } - }); - var _ = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, - aa = new RegExp("^(?:([+-])=|)(" + _ + ")([a-z%]*)$", "i"), - ba = ["Top", "Right", "Bottom", "Left"], - ca = function(a, b) { - return a = b || a, "none" === a.style.display || "" === a.style.display && r.contains(a.ownerDocument, a) && "none" === r.css(a, "display") - }, - da = function(a, b, c, d) { - var e, f, g = {}; - for(f in b) g[f] = a.style[f], a.style[f] = b[f]; - e = c.apply(a, d || []); - for(f in b) a.style[f] = g[f]; - return e - }; - - function ea(a, b, c, d) { - var e, f = 1, - g = 20, - h = d ? function() { - return d.cur() - } : function() { - return r.css(a, b, "") - }, - i = h(), - j = c && c[3] || (r.cssNumber[b] ? "" : "px"), - k = (r.cssNumber[b] || "px" !== j && +i) && aa.exec(r.css(a, b)); - if(k && k[3] !== j) { - j = j || k[3], c = c || [], k = +i || 1; - do f = f || ".5", k /= f, r.style(a, b, k + j); while (f !== (f = h() / i) && 1 !== f && --g) - } - return c && (k = +k || +i || 0, e = c[1] ? k + (c[1] + 1) * c[2] : +c[2], d && (d.unit = j, d.start = k, d.end = e)), e - } - var fa = {}; - - function ga(a) { - var b, c = a.ownerDocument, - d = a.nodeName, - e = fa[d]; - return e ? e : (b = c.body.appendChild(c.createElement(d)), e = r.css(b, "display"), b.parentNode.removeChild(b), "none" === e && (e = "block"), fa[d] = e, e) - } - - function ha(a, b) { - for(var c, d, e = [], f = 0, g = a.length; f < g; f++) d = a[f], d.style && (c = d.style.display, b ? ("none" === c && (e[f] = V.get(d, "display") || null, e[f] || (d.style.display = "")), "" === d.style.display && ca(d) && (e[f] = ga(d))) : "none" !== c && (e[f] = "none", V.set(d, "display", c))); - for(f = 0; f < g; f++) null != e[f] && (a[f].style.display = e[f]); - return a - } - r.fn.extend({ - show: function() { - return ha(this, !0) - }, - hide: function() { - return ha(this) - }, - toggle: function(a) { - return "boolean" == typeof a ? a ? this.show() : this.hide() : this.each(function() { - ca(this) ? r(this).show() : r(this).hide() - }) - } - }); - var ia = /^(?:checkbox|radio)$/i, - ja = /<([a-z][^\/\0>\x20\t\r\n\f]+)/i, - ka = /^$|\/(?:java|ecma)script/i, - la = { - option: [1, ""], - thead: [1, "", "
    "], - col: [2, "", "
    "], - tr: [2, "", "
    "], - td: [3, "", "
    "], - _default: [0, "", ""] - }; - la.optgroup = la.option, la.tbody = la.tfoot = la.colgroup = la.caption = la.thead, la.th = la.td; - - function ma(a, b) { - var c; - return c = "undefined" != typeof a.getElementsByTagName ? a.getElementsByTagName(b || "*") : "undefined" != typeof a.querySelectorAll ? a.querySelectorAll(b || "*") : [], void 0 === b || b && r.nodeName(a, b) ? r.merge([a], c) : c - } - - function na(a, b) { - for(var c = 0, d = a.length; c < d; c++) V.set(a[c], "globalEval", !b || V.get(b[c], "globalEval")) - } - var oa = /<|&#?\w+;/; - - function pa(a, b, c, d, e) { - for(var f, g, h, i, j, k, l = b.createDocumentFragment(), m = [], n = 0, o = a.length; n < o; n++) - if(f = a[n], f || 0 === f) - if("object" === r.type(f)) r.merge(m, f.nodeType ? [f] : f); - else if(oa.test(f)) { - g = g || l.appendChild(b.createElement("div")), h = (ja.exec(f) || ["", ""])[1].toLowerCase(), i = la[h] || la._default, g.innerHTML = i[1] + r.htmlPrefilter(f) + i[2], k = i[0]; - while(k--) g = g.lastChild; - r.merge(m, g.childNodes), g = l.firstChild, g.textContent = "" - } else m.push(b.createTextNode(f)); - l.textContent = "", n = 0; - while(f = m[n++]) - if(d && r.inArray(f, d) > -1) e && e.push(f); - else if(j = r.contains(f.ownerDocument, f), g = ma(l.appendChild(f), "script"), j && na(g), c) { - k = 0; - while(f = g[k++]) ka.test(f.type || "") && c.push(f) - } - return l - }! function() { - var a = d.createDocumentFragment(), - b = a.appendChild(d.createElement("div")), - c = d.createElement("input"); - c.setAttribute("type", "radio"), c.setAttribute("checked", "checked"), c.setAttribute("name", "t"), b.appendChild(c), o.checkClone = b.cloneNode(!0).cloneNode(!0).lastChild.checked, b.innerHTML = "", o.noCloneChecked = !!b.cloneNode(!0).lastChild.defaultValue - }(); - var qa = d.documentElement, - ra = /^key/, - sa = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, - ta = /^([^.]*)(?:\.(.+)|)/; - - function ua() { - return !0 - } - - function va() { - return !1 - } - - function wa() { - try { - return d.activeElement - } catch(a) {} - } - - function xa(a, b, c, d, e, f) { - var g, h; - if("object" == typeof b) { - "string" != typeof c && (d = d || c, c = void 0); - for(h in b) xa(a, h, c, d, b[h], f); - return a - } - if(null == d && null == e ? (e = c, d = c = void 0) : null == e && ("string" == typeof c ? (e = d, d = void 0) : (e = d, d = c, c = void 0)), e === !1) e = va; - else if(!e) return a; - return 1 === f && (g = e, e = function(a) { - return r().off(a), g.apply(this, arguments) - }, e.guid = g.guid || (g.guid = r.guid++)), a.each(function() { - r.event.add(this, b, e, d, c) - }) - } - r.event = { - global: {}, - add: function(a, b, c, d, e) { - var f, g, h, i, j, k, l, m, n, o, p, q = V.get(a); - if(q) { - c.handler && (f = c, c = f.handler, e = f.selector), e && r.find.matchesSelector(qa, e), c.guid || (c.guid = r.guid++), (i = q.events) || (i = q.events = {}), (g = q.handle) || (g = q.handle = function(b) { - return "undefined" != typeof r && r.event.triggered !== b.type ? r.event.dispatch.apply(a, arguments) : void 0 - }), b = (b || "").match(K) || [""], j = b.length; - while(j--) h = ta.exec(b[j]) || [], n = p = h[1], o = (h[2] || "").split(".").sort(), n && (l = r.event.special[n] || {}, n = (e ? l.delegateType : l.bindType) || n, l = r.event.special[n] || {}, k = r.extend({ - type: n, - origType: p, - data: d, - handler: c, - guid: c.guid, - selector: e, - needsContext: e && r.expr.match.needsContext.test(e), - namespace: o.join(".") - }, f), (m = i[n]) || (m = i[n] = [], m.delegateCount = 0, l.setup && l.setup.call(a, d, o, g) !== !1 || a.addEventListener && a.addEventListener(n, g)), l.add && (l.add.call(a, k), k.handler.guid || (k.handler.guid = c.guid)), e ? m.splice(m.delegateCount++, 0, k) : m.push(k), r.event.global[n] = !0) - } - }, - remove: function(a, b, c, d, e) { - var f, g, h, i, j, k, l, m, n, o, p, q = V.hasData(a) && V.get(a); - if(q && (i = q.events)) { - b = (b || "").match(K) || [""], j = b.length; - while(j--) - if(h = ta.exec(b[j]) || [], n = p = h[1], o = (h[2] || "").split(".").sort(), n) { - l = r.event.special[n] || {}, n = (d ? l.delegateType : l.bindType) || n, m = i[n] || [], h = h[2] && new RegExp("(^|\\.)" + o.join("\\.(?:.*\\.|)") + "(\\.|$)"), g = f = m.length; - while(f--) k = m[f], !e && p !== k.origType || c && c.guid !== k.guid || h && !h.test(k.namespace) || d && d !== k.selector && ("**" !== d || !k.selector) || (m.splice(f, 1), k.selector && m.delegateCount--, l.remove && l.remove.call(a, k)); - g && !m.length && (l.teardown && l.teardown.call(a, o, q.handle) !== !1 || r.removeEvent(a, n, q.handle), delete i[n]) - } else - for(n in i) r.event.remove(a, n + b[j], c, d, !0); - r.isEmptyObject(i) && V.remove(a, "handle events") - } - }, - dispatch: function(a) { - var b = r.event.fix(a), - c, d, e, f, g, h, i = new Array(arguments.length), - j = (V.get(this, "events") || {})[b.type] || [], - k = r.event.special[b.type] || {}; - for(i[0] = b, c = 1; c < arguments.length; c++) i[c] = arguments[c]; - if(b.delegateTarget = this, !k.preDispatch || k.preDispatch.call(this, b) !== !1) { - h = r.event.handlers.call(this, b, j), c = 0; - while((f = h[c++]) && !b.isPropagationStopped()) { - b.currentTarget = f.elem, d = 0; - while((g = f.handlers[d++]) && !b.isImmediatePropagationStopped()) b.rnamespace && !b.rnamespace.test(g.namespace) || (b.handleObj = g, b.data = g.data, e = ((r.event.special[g.origType] || {}).handle || g.handler).apply(f.elem, i), void 0 !== e && (b.result = e) === !1 && (b.preventDefault(), b.stopPropagation())) - } - return k.postDispatch && k.postDispatch.call(this, b), b.result - } - }, - handlers: function(a, b) { - var c, d, e, f, g, h = [], - i = b.delegateCount, - j = a.target; - if(i && j.nodeType && !("click" === a.type && a.button >= 1)) - for(; j !== this; j = j.parentNode || this) - if(1 === j.nodeType && ("click" !== a.type || j.disabled !== !0)) { - for(f = [], g = {}, c = 0; c < i; c++) d = b[c], e = d.selector + " ", void 0 === g[e] && (g[e] = d.needsContext ? r(e, this).index(j) > -1 : r.find(e, this, null, [j]).length), g[e] && f.push(d); - f.length && h.push({ - elem: j, - handlers: f - }) - } - return j = this, i < b.length && h.push({ - elem: j, - handlers: b.slice(i) - }), h - }, - addProp: function(a, b) { - Object.defineProperty(r.Event.prototype, a, { - enumerable: !0, - configurable: !0, - get: r.isFunction(b) ? function() { - if(this.originalEvent) return b(this.originalEvent) - } : function() { - if(this.originalEvent) return this.originalEvent[a] - }, - set: function(b) { - Object.defineProperty(this, a, { - enumerable: !0, - configurable: !0, - writable: !0, - value: b - }) - } - }) - }, - fix: function(a) { - return a[r.expando] ? a : new r.Event(a) - }, - special: { - load: { - noBubble: !0 - }, - focus: { - trigger: function() { - if(this !== wa() && this.focus) return this.focus(), !1 - }, - delegateType: "focusin" - }, - blur: { - trigger: function() { - if(this === wa() && this.blur) return this.blur(), !1 - }, - delegateType: "focusout" - }, - click: { - trigger: function() { - if("checkbox" === this.type && this.click && r.nodeName(this, "input")) return this.click(), !1 - }, - _default: function(a) { - return r.nodeName(a.target, "a") - } - }, - beforeunload: { - postDispatch: function(a) { - void 0 !== a.result && a.originalEvent && (a.originalEvent.returnValue = a.result) - } - } - } - }, r.removeEvent = function(a, b, c) { - a.removeEventListener && a.removeEventListener(b, c) - }, r.Event = function(a, b) { - return this instanceof r.Event ? (a && a.type ? (this.originalEvent = a, this.type = a.type, this.isDefaultPrevented = a.defaultPrevented || void 0 === a.defaultPrevented && a.returnValue === !1 ? ua : va, this.target = a.target && 3 === a.target.nodeType ? a.target.parentNode : a.target, this.currentTarget = a.currentTarget, this.relatedTarget = a.relatedTarget) : this.type = a, b && r.extend(this, b), this.timeStamp = a && a.timeStamp || r.now(), void(this[r.expando] = !0)) : new r.Event(a, b) - }, r.Event.prototype = { - constructor: r.Event, - isDefaultPrevented: va, - isPropagationStopped: va, - isImmediatePropagationStopped: va, - isSimulated: !1, - preventDefault: function() { - var a = this.originalEvent; - this.isDefaultPrevented = ua, a && !this.isSimulated && a.preventDefault() - }, - stopPropagation: function() { - var a = this.originalEvent; - this.isPropagationStopped = ua, a && !this.isSimulated && a.stopPropagation() - }, - stopImmediatePropagation: function() { - var a = this.originalEvent; - this.isImmediatePropagationStopped = ua, a && !this.isSimulated && a.stopImmediatePropagation(), this.stopPropagation() - } - }, r.each({ - altKey: !0, - bubbles: !0, - cancelable: !0, - changedTouches: !0, - ctrlKey: !0, - detail: !0, - eventPhase: !0, - metaKey: !0, - pageX: !0, - pageY: !0, - shiftKey: !0, - view: !0, - "char": !0, - charCode: !0, - key: !0, - keyCode: !0, - button: !0, - buttons: !0, - clientX: !0, - clientY: !0, - offsetX: !0, - offsetY: !0, - pointerId: !0, - pointerType: !0, - screenX: !0, - screenY: !0, - targetTouches: !0, - toElement: !0, - touches: !0, - which: function(a) { - var b = a.button; - return null == a.which && ra.test(a.type) ? null != a.charCode ? a.charCode : a.keyCode : !a.which && void 0 !== b && sa.test(a.type) ? 1 & b ? 1 : 2 & b ? 3 : 4 & b ? 2 : 0 : a.which - } - }, r.event.addProp), r.each({ - mouseenter: "mouseover", - mouseleave: "mouseout", - pointerenter: "pointerover", - pointerleave: "pointerout" - }, function(a, b) { - r.event.special[a] = { - delegateType: b, - bindType: b, - handle: function(a) { - var c, d = this, - e = a.relatedTarget, - f = a.handleObj; - return e && (e === d || r.contains(d, e)) || (a.type = f.origType, c = f.handler.apply(this, arguments), a.type = b), c - } - } - }), r.fn.extend({ - on: function(a, b, c, d) { - return xa(this, a, b, c, d) - }, - one: function(a, b, c, d) { - return xa(this, a, b, c, d, 1) - }, - off: function(a, b, c) { - var d, e; - if(a && a.preventDefault && a.handleObj) return d = a.handleObj, r(a.delegateTarget).off(d.namespace ? d.origType + "." + d.namespace : d.origType, d.selector, d.handler), this; - if("object" == typeof a) { - for(e in a) this.off(e, b, a[e]); - return this - } - return b !== !1 && "function" != typeof b || (c = b, b = void 0), c === !1 && (c = va), this.each(function() { - r.event.remove(this, a, c, b) - }) - } - }); - var ya = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, - za = /\s*$/g; - - function Da(a, b) { - return r.nodeName(a, "table") && r.nodeName(11 !== b.nodeType ? b : b.firstChild, "tr") ? a.getElementsByTagName("tbody")[0] || a : a - } - - function Ea(a) { - return a.type = (null !== a.getAttribute("type")) + "/" + a.type, a - } - - function Fa(a) { - var b = Ba.exec(a.type); - return b ? a.type = b[1] : a.removeAttribute("type"), a - } - - function Ga(a, b) { - var c, d, e, f, g, h, i, j; - if(1 === b.nodeType) { - if(V.hasData(a) && (f = V.access(a), g = V.set(b, f), j = f.events)) { - delete g.handle, g.events = {}; - for(e in j) - for(c = 0, d = j[e].length; c < d; c++) r.event.add(b, e, j[e][c]) - } - W.hasData(a) && (h = W.access(a), i = r.extend({}, h), W.set(b, i)) - } - } - - function Ha(a, b) { - var c = b.nodeName.toLowerCase(); - "input" === c && ia.test(a.type) ? b.checked = a.checked : "input" !== c && "textarea" !== c || (b.defaultValue = a.defaultValue) - } - - function Ia(a, b, c, d) { - b = g.apply([], b); - var e, f, h, i, j, k, l = 0, - m = a.length, - n = m - 1, - q = b[0], - s = r.isFunction(q); - if(s || m > 1 && "string" == typeof q && !o.checkClone && Aa.test(q)) return a.each(function(e) { - var f = a.eq(e); - s && (b[0] = q.call(this, e, f.html())), Ia(f, b, c, d) - }); - if(m && (e = pa(b, a[0].ownerDocument, !1, a, d), f = e.firstChild, 1 === e.childNodes.length && (e = f), f || d)) { - for(h = r.map(ma(e, "script"), Ea), i = h.length; l < m; l++) j = e, l !== n && (j = r.clone(j, !0, !0), i && r.merge(h, ma(j, "script"))), c.call(a[l], j, l); - if(i) - for(k = h[h.length - 1].ownerDocument, r.map(h, Fa), l = 0; l < i; l++) j = h[l], ka.test(j.type || "") && !V.access(j, "globalEval") && r.contains(k, j) && (j.src ? r._evalUrl && r._evalUrl(j.src) : p(j.textContent.replace(Ca, ""), k)) - } - return a - } - - function Ja(a, b, c) { - for(var d, e = b ? r.filter(b, a) : a, f = 0; null != (d = e[f]); f++) c || 1 !== d.nodeType || r.cleanData(ma(d)), d.parentNode && (c && r.contains(d.ownerDocument, d) && na(ma(d, "script")), d.parentNode.removeChild(d)); - return a - } - r.extend({ - htmlPrefilter: function(a) { - return a.replace(ya, "<$1>") - }, - clone: function(a, b, c) { - var d, e, f, g, h = a.cloneNode(!0), - i = r.contains(a.ownerDocument, a); - if(!(o.noCloneChecked || 1 !== a.nodeType && 11 !== a.nodeType || r.isXMLDoc(a))) - for(g = ma(h), f = ma(a), d = 0, e = f.length; d < e; d++) Ha(f[d], g[d]); - if(b) - if(c) - for(f = f || ma(a), g = g || ma(h), d = 0, e = f.length; d < e; d++) Ga(f[d], g[d]); - else Ga(a, h); - return g = ma(h, "script"), g.length > 0 && na(g, !i && ma(a, "script")), h - }, - cleanData: function(a) { - for(var b, c, d, e = r.event.special, f = 0; void 0 !== (c = a[f]); f++) - if(T(c)) { - if(b = c[V.expando]) { - if(b.events) - for(d in b.events) e[d] ? r.event.remove(c, d) : r.removeEvent(c, d, b.handle); - c[V.expando] = void 0 - } - c[W.expando] && (c[W.expando] = void 0) - } - } - }), r.fn.extend({ - detach: function(a) { - return Ja(this, a, !0) - }, - remove: function(a) { - return Ja(this, a) - }, - text: function(a) { - return S(this, function(a) { - return void 0 === a ? r.text(this) : this.empty().each(function() { - 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || (this.textContent = a) - }) - }, null, a, arguments.length) - }, - append: function() { - return Ia(this, arguments, function(a) { - if(1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { - var b = Da(this, a); - b.appendChild(a) - } - }) - }, - prepend: function() { - return Ia(this, arguments, function(a) { - if(1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { - var b = Da(this, a); - b.insertBefore(a, b.firstChild) - } - }) - }, - before: function() { - return Ia(this, arguments, function(a) { - this.parentNode && this.parentNode.insertBefore(a, this) - }) - }, - after: function() { - return Ia(this, arguments, function(a) { - this.parentNode && this.parentNode.insertBefore(a, this.nextSibling) - }) - }, - empty: function() { - for(var a, b = 0; null != (a = this[b]); b++) 1 === a.nodeType && (r.cleanData(ma(a, !1)), a.textContent = ""); - return this - }, - clone: function(a, b) { - return a = null != a && a, b = null == b ? a : b, this.map(function() { - return r.clone(this, a, b) - }) - }, - html: function(a) { - return S(this, function(a) { - var b = this[0] || {}, - c = 0, - d = this.length; - if(void 0 === a && 1 === b.nodeType) return b.innerHTML; - if("string" == typeof a && !za.test(a) && !la[(ja.exec(a) || ["", ""])[1].toLowerCase()]) { - a = r.htmlPrefilter(a); - try { - for(; c < d; c++) b = this[c] || {}, 1 === b.nodeType && (r.cleanData(ma(b, !1)), b.innerHTML = a); - b = 0 - } catch(e) {} - } - b && this.empty().append(a) - }, null, a, arguments.length) - }, - replaceWith: function() { - var a = []; - return Ia(this, arguments, function(b) { - var c = this.parentNode; - r.inArray(this, a) < 0 && (r.cleanData(ma(this)), c && c.replaceChild(b, this)) - }, a) - } - }), r.each({ - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" - }, function(a, b) { - r.fn[a] = function(a) { - for(var c, d = [], e = r(a), f = e.length - 1, g = 0; g <= f; g++) c = g === f ? this : this.clone(!0), r(e[g])[b](c), h.apply(d, c.get()); - return this.pushStack(d) - } - }); - var Ka = /^margin/, - La = new RegExp("^(" + _ + ")(?!px)[a-z%]+$", "i"), - Ma = function(b) { - var c = b.ownerDocument.defaultView; - return c && c.opener || (c = a), c.getComputedStyle(b) - }; - ! function() { - function b() { - if(i) { - i.style.cssText = "box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%", i.innerHTML = "", qa.appendChild(h); - var b = a.getComputedStyle(i); - c = "1%" !== b.top, g = "2px" === b.marginLeft, e = "4px" === b.width, i.style.marginRight = "50%", f = "4px" === b.marginRight, qa.removeChild(h), i = null - } - } - var c, e, f, g, h = d.createElement("div"), - i = d.createElement("div"); - i.style && (i.style.backgroundClip = "content-box", i.cloneNode(!0).style.backgroundClip = "", o.clearCloneStyle = "content-box" === i.style.backgroundClip, h.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute", h.appendChild(i), r.extend(o, { - pixelPosition: function() { - return b(), c - }, - boxSizingReliable: function() { - return b(), e - }, - pixelMarginRight: function() { - return b(), f - }, - reliableMarginLeft: function() { - return b(), g - } - })) - }(); - - function Na(a, b, c) { - var d, e, f, g, h = a.style; - return c = c || Ma(a), c && (g = c.getPropertyValue(b) || c[b], "" !== g || r.contains(a.ownerDocument, a) || (g = r.style(a, b)), !o.pixelMarginRight() && La.test(g) && Ka.test(b) && (d = h.width, e = h.minWidth, f = h.maxWidth, h.minWidth = h.maxWidth = h.width = g, g = c.width, h.width = d, h.minWidth = e, h.maxWidth = f)), void 0 !== g ? g + "" : g - } - - function Oa(a, b) { - return { - get: function() { - return a() ? void delete this.get : (this.get = b).apply(this, arguments) - } - } - } - var Pa = /^(none|table(?!-c[ea]).+)/, - Qa = { - position: "absolute", - visibility: "hidden", - display: "block" - }, - Ra = { - letterSpacing: "0", - fontWeight: "400" - }, - Sa = ["Webkit", "Moz", "ms"], - Ta = d.createElement("div").style; - - function Ua(a) { - if(a in Ta) return a; - var b = a[0].toUpperCase() + a.slice(1), - c = Sa.length; - while(c--) - if(a = Sa[c] + b, a in Ta) return a - } - - function Va(a, b, c) { - var d = aa.exec(b); - return d ? Math.max(0, d[2] - (c || 0)) + (d[3] || "px") : b - } - - function Wa(a, b, c, d, e) { - var f, g = 0; - for(f = c === (d ? "border" : "content") ? 4 : "width" === b ? 1 : 0; f < 4; f += 2) "margin" === c && (g += r.css(a, c + ba[f], !0, e)), d ? ("content" === c && (g -= r.css(a, "padding" + ba[f], !0, e)), "margin" !== c && (g -= r.css(a, "border" + ba[f] + "Width", !0, e))) : (g += r.css(a, "padding" + ba[f], !0, e), "padding" !== c && (g += r.css(a, "border" + ba[f] + "Width", !0, e))); - return g - } - - function Xa(a, b, c) { - var d, e = !0, - f = Ma(a), - g = "border-box" === r.css(a, "boxSizing", !1, f); - if(a.getClientRects().length && (d = a.getBoundingClientRect()[b]), d <= 0 || null == d) { - if(d = Na(a, b, f), (d < 0 || null == d) && (d = a.style[b]), La.test(d)) return d; - e = g && (o.boxSizingReliable() || d === a.style[b]), d = parseFloat(d) || 0 - } - return d + Wa(a, b, c || (g ? "border" : "content"), e, f) + "px" - } - r.extend({ - cssHooks: { - opacity: { - get: function(a, b) { - if(b) { - var c = Na(a, "opacity"); - return "" === c ? "1" : c - } - } - } - }, - cssNumber: { - animationIterationCount: !0, - columnCount: !0, - fillOpacity: !0, - flexGrow: !0, - flexShrink: !0, - fontWeight: !0, - lineHeight: !0, - opacity: !0, - order: !0, - orphans: !0, - widows: !0, - zIndex: !0, - zoom: !0 - }, - cssProps: { - "float": "cssFloat" - }, - style: function(a, b, c, d) { - if(a && 3 !== a.nodeType && 8 !== a.nodeType && a.style) { - var e, f, g, h = r.camelCase(b), - i = a.style; - return b = r.cssProps[h] || (r.cssProps[h] = Ua(h) || h), g = r.cssHooks[b] || r.cssHooks[h], void 0 === c ? g && "get" in g && void 0 !== (e = g.get(a, !1, d)) ? e : i[b] : (f = typeof c, "string" === f && (e = aa.exec(c)) && e[1] && (c = ea(a, b, e), f = "number"), null != c && c === c && ("number" === f && (c += e && e[3] || (r.cssNumber[h] ? "" : "px")), o.clearCloneStyle || "" !== c || 0 !== b.indexOf("background") || (i[b] = "inherit"), g && "set" in g && void 0 === (c = g.set(a, c, d)) || (i[b] = c)), void 0) - } - }, - css: function(a, b, c, d) { - var e, f, g, h = r.camelCase(b); - return b = r.cssProps[h] || (r.cssProps[h] = Ua(h) || h), g = r.cssHooks[b] || r.cssHooks[h], g && "get" in g && (e = g.get(a, !0, c)), void 0 === e && (e = Na(a, b, d)), "normal" === e && b in Ra && (e = Ra[b]), "" === c || c ? (f = parseFloat(e), c === !0 || isFinite(f) ? f || 0 : e) : e - } - }), r.each(["height", "width"], function(a, b) { - r.cssHooks[b] = { - get: function(a, c, d) { - if(c) return !Pa.test(r.css(a, "display")) || a.getClientRects().length && a.getBoundingClientRect().width ? Xa(a, b, d) : da(a, Qa, function() { - return Xa(a, b, d) - }) - }, - set: function(a, c, d) { - var e, f = d && Ma(a), - g = d && Wa(a, b, d, "border-box" === r.css(a, "boxSizing", !1, f), f); - return g && (e = aa.exec(c)) && "px" !== (e[3] || "px") && (a.style[b] = c, c = r.css(a, b)), Va(a, c, g) - } - } - }), r.cssHooks.marginLeft = Oa(o.reliableMarginLeft, function(a, b) { - if(b) return(parseFloat(Na(a, "marginLeft")) || a.getBoundingClientRect().left - da(a, { - marginLeft: 0 - }, function() { - return a.getBoundingClientRect().left - })) + "px" - }), r.each({ - margin: "", - padding: "", - border: "Width" - }, function(a, b) { - r.cssHooks[a + b] = { - expand: function(c) { - for(var d = 0, e = {}, f = "string" == typeof c ? c.split(" ") : [c]; d < 4; d++) e[a + ba[d] + b] = f[d] || f[d - 2] || f[0]; - return e - } - }, Ka.test(a) || (r.cssHooks[a + b].set = Va) - }), r.fn.extend({ - css: function(a, b) { - return S(this, function(a, b, c) { - var d, e, f = {}, - g = 0; - if(r.isArray(b)) { - for(d = Ma(a), e = b.length; g < e; g++) f[b[g]] = r.css(a, b[g], !1, d); - return f - } - return void 0 !== c ? r.style(a, b, c) : r.css(a, b) - }, a, b, arguments.length > 1) - } - }); - - function Ya(a, b, c, d, e) { - return new Ya.prototype.init(a, b, c, d, e) - } - r.Tween = Ya, Ya.prototype = { - constructor: Ya, - init: function(a, b, c, d, e, f) { - this.elem = a, this.prop = c, this.easing = e || r.easing._default, this.options = b, this.start = this.now = this.cur(), this.end = d, this.unit = f || (r.cssNumber[c] ? "" : "px") - }, - cur: function() { - var a = Ya.propHooks[this.prop]; - return a && a.get ? a.get(this) : Ya.propHooks._default.get(this) - }, - run: function(a) { - var b, c = Ya.propHooks[this.prop]; - return this.options.duration ? this.pos = b = r.easing[this.easing](a, this.options.duration * a, 0, 1, this.options.duration) : this.pos = b = a, this.now = (this.end - this.start) * b + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), c && c.set ? c.set(this) : Ya.propHooks._default.set(this), this - } - }, Ya.prototype.init.prototype = Ya.prototype, Ya.propHooks = { - _default: { - get: function(a) { - var b; - return 1 !== a.elem.nodeType || null != a.elem[a.prop] && null == a.elem.style[a.prop] ? a.elem[a.prop] : (b = r.css(a.elem, a.prop, ""), b && "auto" !== b ? b : 0) - }, - set: function(a) { - r.fx.step[a.prop] ? r.fx.step[a.prop](a) : 1 !== a.elem.nodeType || null == a.elem.style[r.cssProps[a.prop]] && !r.cssHooks[a.prop] ? a.elem[a.prop] = a.now : r.style(a.elem, a.prop, a.now + a.unit) - } - } - }, Ya.propHooks.scrollTop = Ya.propHooks.scrollLeft = { - set: function(a) { - a.elem.nodeType && a.elem.parentNode && (a.elem[a.prop] = a.now) - } - }, r.easing = { - linear: function(a) { - return a - }, - swing: function(a) { - return .5 - Math.cos(a * Math.PI) / 2 - }, - _default: "swing" - }, r.fx = Ya.prototype.init, r.fx.step = {}; - var Za, $a, _a = /^(?:toggle|show|hide)$/, - ab = /queueHooks$/; - - function bb() { - $a && (a.requestAnimationFrame(bb), r.fx.tick()) - } - - function cb() { - return a.setTimeout(function() { - Za = void 0 - }), Za = r.now() - } - - function db(a, b) { - var c, d = 0, - e = { - height: a - }; - for(b = b ? 1 : 0; d < 4; d += 2 - b) c = ba[d], e["margin" + c] = e["padding" + c] = a; - return b && (e.opacity = e.width = a), e - } - - function eb(a, b, c) { - for(var d, e = (hb.tweeners[b] || []).concat(hb.tweeners["*"]), f = 0, g = e.length; f < g; f++) - if(d = e[f].call(c, b, a)) return d - } - - function fb(a, b, c) { - var d, e, f, g, h, i, j, k, l = "width" in b || "height" in b, - m = this, - n = {}, - o = a.style, - p = a.nodeType && ca(a), - q = V.get(a, "fxshow"); - c.queue || (g = r._queueHooks(a, "fx"), null == g.unqueued && (g.unqueued = 0, h = g.empty.fire, g.empty.fire = function() { - g.unqueued || h() - }), g.unqueued++, m.always(function() { - m.always(function() { - g.unqueued--, r.queue(a, "fx").length || g.empty.fire() - }) - })); - for(d in b) - if(e = b[d], _a.test(e)) { - if(delete b[d], f = f || "toggle" === e, e === (p ? "hide" : "show")) { - if("show" !== e || !q || void 0 === q[d]) continue; - p = !0 - } - n[d] = q && q[d] || r.style(a, d) - } - if(i = !r.isEmptyObject(b), i || !r.isEmptyObject(n)) { - l && 1 === a.nodeType && (c.overflow = [o.overflow, o.overflowX, o.overflowY], j = q && q.display, null == j && (j = V.get(a, "display")), k = r.css(a, "display"), "none" === k && (j ? k = j : (ha([a], !0), j = a.style.display || j, k = r.css(a, "display"), ha([a]))), ("inline" === k || "inline-block" === k && null != j) && "none" === r.css(a, "float") && (i || (m.done(function() { - o.display = j - }), null == j && (k = o.display, j = "none" === k ? "" : k)), o.display = "inline-block")), c.overflow && (o.overflow = "hidden", m.always(function() { - o.overflow = c.overflow[0], o.overflowX = c.overflow[1], o.overflowY = c.overflow[2] - })), i = !1; - for(d in n) i || (q ? "hidden" in q && (p = q.hidden) : q = V.access(a, "fxshow", { - display: j - }), f && (q.hidden = !p), p && ha([a], !0), m.done(function() { - p || ha([a]), V.remove(a, "fxshow"); - for(d in n) r.style(a, d, n[d]) - })), i = eb(p ? q[d] : 0, d, m), d in q || (q[d] = i.start, p && (i.end = i.start, i.start = 0)) - } - } - - function gb(a, b) { - var c, d, e, f, g; - for(c in a) - if(d = r.camelCase(c), e = b[d], f = a[c], r.isArray(f) && (e = f[1], f = a[c] = f[0]), c !== d && (a[d] = f, delete a[c]), g = r.cssHooks[d], g && "expand" in g) { - f = g.expand(f), delete a[d]; - for(c in f) c in a || (a[c] = f[c], b[c] = e) - } else b[d] = e - } - - function hb(a, b, c) { - var d, e, f = 0, - g = hb.prefilters.length, - h = r.Deferred().always(function() { - delete i.elem - }), - i = function() { - if(e) return !1; - for(var b = Za || cb(), c = Math.max(0, j.startTime + j.duration - b), d = c / j.duration || 0, f = 1 - d, g = 0, i = j.tweens.length; g < i; g++) j.tweens[g].run(f); - return h.notifyWith(a, [j, f, c]), f < 1 && i ? c : (h.resolveWith(a, [j]), !1) - }, - j = h.promise({ - elem: a, - props: r.extend({}, b), - opts: r.extend(!0, { - specialEasing: {}, - easing: r.easing._default - }, c), - originalProperties: b, - originalOptions: c, - startTime: Za || cb(), - duration: c.duration, - tweens: [], - createTween: function(b, c) { - var d = r.Tween(a, j.opts, b, c, j.opts.specialEasing[b] || j.opts.easing); - return j.tweens.push(d), d - }, - stop: function(b) { - var c = 0, - d = b ? j.tweens.length : 0; - if(e) return this; - for(e = !0; c < d; c++) j.tweens[c].run(1); - return b ? (h.notifyWith(a, [j, 1, 0]), h.resolveWith(a, [j, b])) : h.rejectWith(a, [j, b]), this - } - }), - k = j.props; - for(gb(k, j.opts.specialEasing); f < g; f++) - if(d = hb.prefilters[f].call(j, a, k, j.opts)) return r.isFunction(d.stop) && (r._queueHooks(j.elem, j.opts.queue).stop = r.proxy(d.stop, d)), d; - return r.map(k, eb, j), r.isFunction(j.opts.start) && j.opts.start.call(a, j), r.fx.timer(r.extend(i, { - elem: a, - anim: j, - queue: j.opts.queue - })), j.progress(j.opts.progress).done(j.opts.done, j.opts.complete).fail(j.opts.fail).always(j.opts.always) - } - r.Animation = r.extend(hb, { - tweeners: { - "*": [function(a, b) { - var c = this.createTween(a, b); - return ea(c.elem, a, aa.exec(b), c), c - }] - }, - tweener: function(a, b) { - r.isFunction(a) ? (b = a, a = ["*"]) : a = a.match(K); - for(var c, d = 0, e = a.length; d < e; d++) c = a[d], hb.tweeners[c] = hb.tweeners[c] || [], hb.tweeners[c].unshift(b) - }, - prefilters: [fb], - prefilter: function(a, b) { - b ? hb.prefilters.unshift(a) : hb.prefilters.push(a) - } - }), r.speed = function(a, b, c) { - var e = a && "object" == typeof a ? r.extend({}, a) : { - complete: c || !c && b || r.isFunction(a) && a, - duration: a, - easing: c && b || b && !r.isFunction(b) && b - }; - return r.fx.off || d.hidden ? e.duration = 0 : "number" != typeof e.duration && (e.duration in r.fx.speeds ? e.duration = r.fx.speeds[e.duration] : e.duration = r.fx.speeds._default), null != e.queue && e.queue !== !0 || (e.queue = "fx"), e.old = e.complete, e.complete = function() { - r.isFunction(e.old) && e.old.call(this), e.queue && r.dequeue(this, e.queue) - }, e - }, r.fn.extend({ - fadeTo: function(a, b, c, d) { - return this.filter(ca).css("opacity", 0).show().end().animate({ - opacity: b - }, a, c, d) - }, - animate: function(a, b, c, d) { - var e = r.isEmptyObject(a), - f = r.speed(b, c, d), - g = function() { - var b = hb(this, r.extend({}, a), f); - (e || V.get(this, "finish")) && b.stop(!0) - }; - return g.finish = g, e || f.queue === !1 ? this.each(g) : this.queue(f.queue, g) - }, - stop: function(a, b, c) { - var d = function(a) { - var b = a.stop; - delete a.stop, b(c) - }; - return "string" != typeof a && (c = b, b = a, a = void 0), b && a !== !1 && this.queue(a || "fx", []), this.each(function() { - var b = !0, - e = null != a && a + "queueHooks", - f = r.timers, - g = V.get(this); - if(e) g[e] && g[e].stop && d(g[e]); - else - for(e in g) g[e] && g[e].stop && ab.test(e) && d(g[e]); - for(e = f.length; e--;) f[e].elem !== this || null != a && f[e].queue !== a || (f[e].anim.stop(c), b = !1, f.splice(e, 1)); - !b && c || r.dequeue(this, a) - }) - }, - finish: function(a) { - return a !== !1 && (a = a || "fx"), this.each(function() { - var b, c = V.get(this), - d = c[a + "queue"], - e = c[a + "queueHooks"], - f = r.timers, - g = d ? d.length : 0; - for(c.finish = !0, r.queue(this, a, []), e && e.stop && e.stop.call(this, !0), b = f.length; b--;) f[b].elem === this && f[b].queue === a && (f[b].anim.stop(!0), f.splice(b, 1)); - for(b = 0; b < g; b++) d[b] && d[b].finish && d[b].finish.call(this); - delete c.finish - }) - } - }), r.each(["toggle", "show", "hide"], function(a, b) { - var c = r.fn[b]; - r.fn[b] = function(a, d, e) { - return null == a || "boolean" == typeof a ? c.apply(this, arguments) : this.animate(db(b, !0), a, d, e) - } - }), r.each({ - slideDown: db("show"), - slideUp: db("hide"), - slideToggle: db("toggle"), - fadeIn: { - opacity: "show" - }, - fadeOut: { - opacity: "hide" - }, - fadeToggle: { - opacity: "toggle" - } - }, function(a, b) { - r.fn[a] = function(a, c, d) { - return this.animate(b, a, c, d) - } - }), r.timers = [], r.fx.tick = function() { - var a, b = 0, - c = r.timers; - for(Za = r.now(); b < c.length; b++) a = c[b], a() || c[b] !== a || c.splice(b--, 1); - c.length || r.fx.stop(), Za = void 0 - }, r.fx.timer = function(a) { - r.timers.push(a), a() ? r.fx.start() : r.timers.pop() - }, r.fx.interval = 13, r.fx.start = function() { - $a || ($a = a.requestAnimationFrame ? a.requestAnimationFrame(bb) : a.setInterval(r.fx.tick, r.fx.interval)) - }, r.fx.stop = function() { - a.cancelAnimationFrame ? a.cancelAnimationFrame($a) : a.clearInterval($a), $a = null - }, r.fx.speeds = { - slow: 600, - fast: 200, - _default: 400 - }, r.fn.delay = function(b, c) { - return b = r.fx ? r.fx.speeds[b] || b : b, c = c || "fx", this.queue(c, function(c, d) { - var e = a.setTimeout(c, b); - d.stop = function() { - a.clearTimeout(e) - } - }) - }, - function() { - var a = d.createElement("input"), - b = d.createElement("select"), - c = b.appendChild(d.createElement("option")); - a.type = "checkbox", o.checkOn = "" !== a.value, o.optSelected = c.selected, a = d.createElement("input"), a.value = "t", a.type = "radio", o.radioValue = "t" === a.value - }(); - var ib, jb = r.expr.attrHandle; - r.fn.extend({ - attr: function(a, b) { - return S(this, r.attr, a, b, arguments.length > 1) - }, - removeAttr: function(a) { - return this.each(function() { - r.removeAttr(this, a) - }) - } - }), r.extend({ - attr: function(a, b, c) { - var d, e, f = a.nodeType; - if(3 !== f && 8 !== f && 2 !== f) return "undefined" == typeof a.getAttribute ? r.prop(a, b, c) : (1 === f && r.isXMLDoc(a) || (e = r.attrHooks[b.toLowerCase()] || (r.expr.match.bool.test(b) ? ib : void 0)), - void 0 !== c ? null === c ? void r.removeAttr(a, b) : e && "set" in e && void 0 !== (d = e.set(a, c, b)) ? d : (a.setAttribute(b, c + ""), c) : e && "get" in e && null !== (d = e.get(a, b)) ? d : (d = r.find.attr(a, b), null == d ? void 0 : d)) - }, - attrHooks: { - type: { - set: function(a, b) { - if(!o.radioValue && "radio" === b && r.nodeName(a, "input")) { - var c = a.value; - return a.setAttribute("type", b), c && (a.value = c), b - } - } - } - }, - removeAttr: function(a, b) { - var c, d = 0, - e = b && b.match(K); - if(e && 1 === a.nodeType) - while(c = e[d++]) a.removeAttribute(c) - } - }), ib = { - set: function(a, b, c) { - return b === !1 ? r.removeAttr(a, c) : a.setAttribute(c, c), c - } - }, r.each(r.expr.match.bool.source.match(/\w+/g), function(a, b) { - var c = jb[b] || r.find.attr; - jb[b] = function(a, b, d) { - var e, f, g = b.toLowerCase(); - return d || (f = jb[g], jb[g] = e, e = null != c(a, b, d) ? g : null, jb[g] = f), e - } - }); - var kb = /^(?:input|select|textarea|button)$/i, - lb = /^(?:a|area)$/i; - r.fn.extend({ - prop: function(a, b) { - return S(this, r.prop, a, b, arguments.length > 1) - }, - removeProp: function(a) { - return this.each(function() { - delete this[r.propFix[a] || a] - }) - } - }), r.extend({ - prop: function(a, b, c) { - var d, e, f = a.nodeType; - if(3 !== f && 8 !== f && 2 !== f) return 1 === f && r.isXMLDoc(a) || (b = r.propFix[b] || b, e = r.propHooks[b]), void 0 !== c ? e && "set" in e && void 0 !== (d = e.set(a, c, b)) ? d : a[b] = c : e && "get" in e && null !== (d = e.get(a, b)) ? d : a[b] - }, - propHooks: { - tabIndex: { - get: function(a) { - var b = r.find.attr(a, "tabindex"); - return b ? parseInt(b, 10) : kb.test(a.nodeName) || lb.test(a.nodeName) && a.href ? 0 : -1 - } - } - }, - propFix: { - "for": "htmlFor", - "class": "className" - } - }), o.optSelected || (r.propHooks.selected = { - get: function(a) { - var b = a.parentNode; - return b && b.parentNode && b.parentNode.selectedIndex, null - }, - set: function(a) { - var b = a.parentNode; - b && (b.selectedIndex, b.parentNode && b.parentNode.selectedIndex) - } - }), r.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function() { - r.propFix[this.toLowerCase()] = this - }); - - function mb(a) { - var b = a.match(K) || []; - return b.join(" ") - } - - function nb(a) { - return a.getAttribute && a.getAttribute("class") || "" - } - r.fn.extend({ - addClass: function(a) { - var b, c, d, e, f, g, h, i = 0; - if(r.isFunction(a)) return this.each(function(b) { - r(this).addClass(a.call(this, b, nb(this))) - }); - if("string" == typeof a && a) { - b = a.match(K) || []; - while(c = this[i++]) - if(e = nb(c), d = 1 === c.nodeType && " " + mb(e) + " ") { - g = 0; - while(f = b[g++]) d.indexOf(" " + f + " ") < 0 && (d += f + " "); - h = mb(d), e !== h && c.setAttribute("class", h) - } - } - return this - }, - removeClass: function(a) { - var b, c, d, e, f, g, h, i = 0; - if(r.isFunction(a)) return this.each(function(b) { - r(this).removeClass(a.call(this, b, nb(this))) - }); - if(!arguments.length) return this.attr("class", ""); - if("string" == typeof a && a) { - b = a.match(K) || []; - while(c = this[i++]) - if(e = nb(c), d = 1 === c.nodeType && " " + mb(e) + " ") { - g = 0; - while(f = b[g++]) - while(d.indexOf(" " + f + " ") > -1) d = d.replace(" " + f + " ", " "); - h = mb(d), e !== h && c.setAttribute("class", h) - } - } - return this - }, - toggleClass: function(a, b) { - var c = typeof a; - return "boolean" == typeof b && "string" === c ? b ? this.addClass(a) : this.removeClass(a) : r.isFunction(a) ? this.each(function(c) { - r(this).toggleClass(a.call(this, c, nb(this), b), b) - }) : this.each(function() { - var b, d, e, f; - if("string" === c) { - d = 0, e = r(this), f = a.match(K) || []; - while(b = f[d++]) e.hasClass(b) ? e.removeClass(b) : e.addClass(b) - } else void 0 !== a && "boolean" !== c || (b = nb(this), b && V.set(this, "__className__", b), this.setAttribute && this.setAttribute("class", b || a === !1 ? "" : V.get(this, "__className__") || "")) - }) - }, - hasClass: function(a) { - var b, c, d = 0; - b = " " + a + " "; - while(c = this[d++]) - if(1 === c.nodeType && (" " + mb(nb(c)) + " ").indexOf(b) > -1) return !0; - return !1 - } - }); - var ob = /\r/g; - r.fn.extend({ - val: function(a) { - var b, c, d, e = this[0]; { - if(arguments.length) return d = r.isFunction(a), this.each(function(c) { - var e; - 1 === this.nodeType && (e = d ? a.call(this, c, r(this).val()) : a, null == e ? e = "" : "number" == typeof e ? e += "" : r.isArray(e) && (e = r.map(e, function(a) { - return null == a ? "" : a + "" - })), b = r.valHooks[this.type] || r.valHooks[this.nodeName.toLowerCase()], b && "set" in b && void 0 !== b.set(this, e, "value") || (this.value = e)) - }); - if(e) return b = r.valHooks[e.type] || r.valHooks[e.nodeName.toLowerCase()], b && "get" in b && void 0 !== (c = b.get(e, "value")) ? c : (c = e.value, "string" == typeof c ? c.replace(ob, "") : null == c ? "" : c) - } - } - }), r.extend({ - valHooks: { - option: { - get: function(a) { - var b = r.find.attr(a, "value"); - return null != b ? b : mb(r.text(a)) - } - }, - select: { - get: function(a) { - var b, c, d, e = a.options, - f = a.selectedIndex, - g = "select-one" === a.type, - h = g ? null : [], - i = g ? f + 1 : e.length; - for(d = f < 0 ? i : g ? f : 0; d < i; d++) - if(c = e[d], (c.selected || d === f) && !c.disabled && (!c.parentNode.disabled || !r.nodeName(c.parentNode, "optgroup"))) { - if(b = r(c).val(), g) return b; - h.push(b) - } - return h - }, - set: function(a, b) { - var c, d, e = a.options, - f = r.makeArray(b), - g = e.length; - while(g--) d = e[g], (d.selected = r.inArray(r.valHooks.option.get(d), f) > -1) && (c = !0); - return c || (a.selectedIndex = -1), f - } - } - } - }), r.each(["radio", "checkbox"], function() { - r.valHooks[this] = { - set: function(a, b) { - if(r.isArray(b)) return a.checked = r.inArray(r(a).val(), b) > -1 - } - }, o.checkOn || (r.valHooks[this].get = function(a) { - return null === a.getAttribute("value") ? "on" : a.value - }) - }); - var pb = /^(?:focusinfocus|focusoutblur)$/; - r.extend(r.event, { - trigger: function(b, c, e, f) { - var g, h, i, j, k, m, n, o = [e || d], - p = l.call(b, "type") ? b.type : b, - q = l.call(b, "namespace") ? b.namespace.split(".") : []; - if(h = i = e = e || d, 3 !== e.nodeType && 8 !== e.nodeType && !pb.test(p + r.event.triggered) && (p.indexOf(".") > -1 && (q = p.split("."), p = q.shift(), q.sort()), k = p.indexOf(":") < 0 && "on" + p, b = b[r.expando] ? b : new r.Event(p, "object" == typeof b && b), b.isTrigger = f ? 2 : 3, b.namespace = q.join("."), b.rnamespace = b.namespace ? new RegExp("(^|\\.)" + q.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, b.result = void 0, b.target || (b.target = e), c = null == c ? [b] : r.makeArray(c, [b]), n = r.event.special[p] || {}, f || !n.trigger || n.trigger.apply(e, c) !== !1)) { - if(!f && !n.noBubble && !r.isWindow(e)) { - for(j = n.delegateType || p, pb.test(j + p) || (h = h.parentNode); h; h = h.parentNode) o.push(h), i = h; - i === (e.ownerDocument || d) && o.push(i.defaultView || i.parentWindow || a) - } - g = 0; - while((h = o[g++]) && !b.isPropagationStopped()) b.type = g > 1 ? j : n.bindType || p, m = (V.get(h, "events") || {})[b.type] && V.get(h, "handle"), m && m.apply(h, c), m = k && h[k], m && m.apply && T(h) && (b.result = m.apply(h, c), b.result === !1 && b.preventDefault()); - return b.type = p, f || b.isDefaultPrevented() || n._default && n._default.apply(o.pop(), c) !== !1 || !T(e) || k && r.isFunction(e[p]) && !r.isWindow(e) && (i = e[k], i && (e[k] = null), r.event.triggered = p, e[p](), r.event.triggered = void 0, i && (e[k] = i)), b.result - } - }, - simulate: function(a, b, c) { - var d = r.extend(new r.Event, c, { - type: a, - isSimulated: !0 - }); - r.event.trigger(d, null, b) - } - }), r.fn.extend({ - trigger: function(a, b) { - return this.each(function() { - r.event.trigger(a, b, this) - }) - }, - triggerHandler: function(a, b) { - var c = this[0]; - if(c) return r.event.trigger(a, b, c, !0) - } - }), r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "), function(a, b) { - r.fn[b] = function(a, c) { - return arguments.length > 0 ? this.on(b, null, a, c) : this.trigger(b) - } - }), r.fn.extend({ - hover: function(a, b) { - return this.mouseenter(a).mouseleave(b || a) - } - }), o.focusin = "onfocusin" in a, o.focusin || r.each({ - focus: "focusin", - blur: "focusout" - }, function(a, b) { - var c = function(a) { - r.event.simulate(b, a.target, r.event.fix(a)) - }; - r.event.special[b] = { - setup: function() { - var d = this.ownerDocument || this, - e = V.access(d, b); - e || d.addEventListener(a, c, !0), V.access(d, b, (e || 0) + 1) - }, - teardown: function() { - var d = this.ownerDocument || this, - e = V.access(d, b) - 1; - e ? V.access(d, b, e) : (d.removeEventListener(a, c, !0), V.remove(d, b)) - } - } - }); - var qb = a.location, - rb = r.now(), - sb = /\?/; - r.parseXML = function(b) { - var c; - if(!b || "string" != typeof b) return null; - try { - c = (new a.DOMParser).parseFromString(b, "text/xml") - } catch(d) { - c = void 0 - } - return c && !c.getElementsByTagName("parsererror").length || r.error("Invalid XML: " + b), c - }; - var tb = /\[\]$/, - ub = /\r?\n/g, - vb = /^(?:submit|button|image|reset|file)$/i, - wb = /^(?:input|select|textarea|keygen)/i; - - function xb(a, b, c, d) { - var e; - if(r.isArray(b)) r.each(b, function(b, e) { - c || tb.test(a) ? d(a, e) : xb(a + "[" + ("object" == typeof e && null != e ? b : "") + "]", e, c, d) - }); - else if(c || "object" !== r.type(b)) d(a, b); - else - for(e in b) xb(a + "[" + e + "]", b[e], c, d) - } - r.param = function(a, b) { - var c, d = [], - e = function(a, b) { - var c = r.isFunction(b) ? b() : b; - d[d.length] = encodeURIComponent(a) + "=" + encodeURIComponent(null == c ? "" : c) - }; - if(r.isArray(a) || a.jquery && !r.isPlainObject(a)) r.each(a, function() { - e(this.name, this.value) - }); - else - for(c in a) xb(c, a[c], b, e); - return d.join("&") - }, r.fn.extend({ - serialize: function() { - return r.param(this.serializeArray()) - }, - serializeArray: function() { - return this.map(function() { - var a = r.prop(this, "elements"); - return a ? r.makeArray(a) : this - }).filter(function() { - var a = this.type; - return this.name && !r(this).is(":disabled") && wb.test(this.nodeName) && !vb.test(a) && (this.checked || !ia.test(a)) - }).map(function(a, b) { - var c = r(this).val(); - return null == c ? null : r.isArray(c) ? r.map(c, function(a) { - return { - name: b.name, - value: a.replace(ub, "\r\n") - } - }) : { - name: b.name, - value: c.replace(ub, "\r\n") - } - }).get() - } - }); - var yb = /%20/g, - zb = /#.*$/, - Ab = /([?&])_=[^&]*/, - Bb = /^(.*?):[ \t]*([^\r\n]*)$/gm, - Cb = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, - Db = /^(?:GET|HEAD)$/, - Eb = /^\/\//, - Fb = {}, - Gb = {}, - Hb = "*/".concat("*"), - Ib = d.createElement("a"); - Ib.href = qb.href; - - function Jb(a) { - return function(b, c) { - "string" != typeof b && (c = b, b = "*"); - var d, e = 0, - f = b.toLowerCase().match(K) || []; - if(r.isFunction(c)) - while(d = f[e++]) "+" === d[0] ? (d = d.slice(1) || "*", (a[d] = a[d] || []).unshift(c)) : (a[d] = a[d] || []).push(c) - } - } - - function Kb(a, b, c, d) { - var e = {}, - f = a === Gb; - - function g(h) { - var i; - return e[h] = !0, r.each(a[h] || [], function(a, h) { - var j = h(b, c, d); - return "string" != typeof j || f || e[j] ? f ? !(i = j) : void 0 : (b.dataTypes.unshift(j), g(j), !1) - }), i - } - return g(b.dataTypes[0]) || !e["*"] && g("*") - } - - function Lb(a, b) { - var c, d, e = r.ajaxSettings.flatOptions || {}; - for(c in b) void 0 !== b[c] && ((e[c] ? a : d || (d = {}))[c] = b[c]); - return d && r.extend(!0, a, d), a - } - - function Mb(a, b, c) { - var d, e, f, g, h = a.contents, - i = a.dataTypes; - while("*" === i[0]) i.shift(), void 0 === d && (d = a.mimeType || b.getResponseHeader("Content-Type")); - if(d) - for(e in h) - if(h[e] && h[e].test(d)) { - i.unshift(e); - break - } - if(i[0] in c) f = i[0]; - else { - for(e in c) { - if(!i[0] || a.converters[e + " " + i[0]]) { - f = e; - break - } - g || (g = e) - } - f = f || g - } - if(f) return f !== i[0] && i.unshift(f), c[f] - } - - function Nb(a, b, c, d) { - var e, f, g, h, i, j = {}, - k = a.dataTypes.slice(); - if(k[1]) - for(g in a.converters) j[g.toLowerCase()] = a.converters[g]; - f = k.shift(); - while(f) - if(a.responseFields[f] && (c[a.responseFields[f]] = b), !i && d && a.dataFilter && (b = a.dataFilter(b, a.dataType)), i = f, f = k.shift()) - if("*" === f) f = i; - else if("*" !== i && i !== f) { - if(g = j[i + " " + f] || j["* " + f], !g) - for(e in j) - if(h = e.split(" "), h[1] === f && (g = j[i + " " + h[0]] || j["* " + h[0]])) { - g === !0 ? g = j[e] : j[e] !== !0 && (f = h[0], k.unshift(h[1])); - break - } - if(g !== !0) - if(g && a["throws"]) b = g(b); - else try { - b = g(b) - } catch(l) { - return { - state: "parsererror", - error: g ? l : "No conversion from " + i + " to " + f - } - } - } - return { - state: "success", - data: b - } - } - r.extend({ - active: 0, - lastModified: {}, - etag: {}, - ajaxSettings: { - url: qb.href, - type: "GET", - isLocal: Cb.test(qb.protocol), - global: !0, - processData: !0, - async: !0, - contentType: "application/x-www-form-urlencoded; charset=UTF-8", - accepts: { - "*": Hb, - text: "text/plain", - html: "text/html", - xml: "application/xml, text/xml", - json: "application/json, text/javascript" - }, - contents: { - xml: /\bxml\b/, - html: /\bhtml/, - json: /\bjson\b/ - }, - responseFields: { - xml: "responseXML", - text: "responseText", - json: "responseJSON" - }, - converters: { - "* text": String, - "text html": !0, - "text json": JSON.parse, - "text xml": r.parseXML - }, - flatOptions: { - url: !0, - context: !0 - } - }, - ajaxSetup: function(a, b) { - return b ? Lb(Lb(a, r.ajaxSettings), b) : Lb(r.ajaxSettings, a) - }, - ajaxPrefilter: Jb(Fb), - ajaxTransport: Jb(Gb), - ajax: function(b, c) { - "object" == typeof b && (c = b, b = void 0), c = c || {}; - var e, f, g, h, i, j, k, l, m, n, o = r.ajaxSetup({}, c), - p = o.context || o, - q = o.context && (p.nodeType || p.jquery) ? r(p) : r.event, - s = r.Deferred(), - t = r.Callbacks("once memory"), - u = o.statusCode || {}, - v = {}, - w = {}, - x = "canceled", - y = { - readyState: 0, - getResponseHeader: function(a) { - var b; - if(k) { - if(!h) { - h = {}; - while(b = Bb.exec(g)) h[b[1].toLowerCase()] = b[2] - } - b = h[a.toLowerCase()] - } - return null == b ? null : b - }, - getAllResponseHeaders: function() { - return k ? g : null - }, - setRequestHeader: function(a, b) { - return null == k && (a = w[a.toLowerCase()] = w[a.toLowerCase()] || a, v[a] = b), this - }, - overrideMimeType: function(a) { - return null == k && (o.mimeType = a), this - }, - statusCode: function(a) { - var b; - if(a) - if(k) y.always(a[y.status]); - else - for(b in a) u[b] = [u[b], a[b]]; - return this - }, - abort: function(a) { - var b = a || x; - return e && e.abort(b), A(0, b), this - } - }; - if(s.promise(y), o.url = ((b || o.url || qb.href) + "").replace(Eb, qb.protocol + "//"), o.type = c.method || c.type || o.method || o.type, o.dataTypes = (o.dataType || "*").toLowerCase().match(K) || [""], null == o.crossDomain) { - j = d.createElement("a"); - try { - j.href = o.url, j.href = j.href, o.crossDomain = Ib.protocol + "//" + Ib.host != j.protocol + "//" + j.host - } catch(z) { - o.crossDomain = !0 - } - } - if(o.data && o.processData && "string" != typeof o.data && (o.data = r.param(o.data, o.traditional)), Kb(Fb, o, c, y), k) return y; - l = r.event && o.global, l && 0 === r.active++ && r.event.trigger("ajaxStart"), o.type = o.type.toUpperCase(), o.hasContent = !Db.test(o.type), f = o.url.replace(zb, ""), o.hasContent ? o.data && o.processData && 0 === (o.contentType || "").indexOf("application/x-www-form-urlencoded") && (o.data = o.data.replace(yb, "+")) : (n = o.url.slice(f.length), o.data && (f += (sb.test(f) ? "&" : "?") + o.data, delete o.data), o.cache === !1 && (f = f.replace(Ab, "$1"), n = (sb.test(f) ? "&" : "?") + "_=" + rb++ + n), o.url = f + n), o.ifModified && (r.lastModified[f] && y.setRequestHeader("If-Modified-Since", r.lastModified[f]), r.etag[f] && y.setRequestHeader("If-None-Match", r.etag[f])), (o.data && o.hasContent && o.contentType !== !1 || c.contentType) && y.setRequestHeader("Content-Type", o.contentType), y.setRequestHeader("Accept", o.dataTypes[0] && o.accepts[o.dataTypes[0]] ? o.accepts[o.dataTypes[0]] + ("*" !== o.dataTypes[0] ? ", " + Hb + "; q=0.01" : "") : o.accepts["*"]); - for(m in o.headers) y.setRequestHeader(m, o.headers[m]); - if(o.beforeSend && (o.beforeSend.call(p, y, o) === !1 || k)) return y.abort(); - if(x = "abort", t.add(o.complete), y.done(o.success), y.fail(o.error), e = Kb(Gb, o, c, y)) { - if(y.readyState = 1, l && q.trigger("ajaxSend", [y, o]), k) return y; - o.async && o.timeout > 0 && (i = a.setTimeout(function() { - y.abort("timeout") - }, o.timeout)); - try { - k = !1, e.send(v, A) - } catch(z) { - if(k) throw z; - A(-1, z) - } - } else A(-1, "No Transport"); - - function A(b, c, d, h) { - var j, m, n, v, w, x = c; - k || (k = !0, i && a.clearTimeout(i), e = void 0, g = h || "", y.readyState = b > 0 ? 4 : 0, j = b >= 200 && b < 300 || 304 === b, d && (v = Mb(o, y, d)), v = Nb(o, v, y, j), j ? (o.ifModified && (w = y.getResponseHeader("Last-Modified"), w && (r.lastModified[f] = w), w = y.getResponseHeader("etag"), w && (r.etag[f] = w)), 204 === b || "HEAD" === o.type ? x = "nocontent" : 304 === b ? x = "notmodified" : (x = v.state, m = v.data, n = v.error, j = !n)) : (n = x, !b && x || (x = "error", b < 0 && (b = 0))), y.status = b, y.statusText = (c || x) + "", j ? s.resolveWith(p, [m, x, y]) : s.rejectWith(p, [y, x, n]), y.statusCode(u), u = void 0, l && q.trigger(j ? "ajaxSuccess" : "ajaxError", [y, o, j ? m : n]), t.fireWith(p, [y, x]), l && (q.trigger("ajaxComplete", [y, o]), --r.active || r.event.trigger("ajaxStop"))) - } - return y - }, - getJSON: function(a, b, c) { - return r.get(a, b, c, "json") - }, - getScript: function(a, b) { - return r.get(a, void 0, b, "script") - } - }), r.each(["get", "post"], function(a, b) { - r[b] = function(a, c, d, e) { - return r.isFunction(c) && (e = e || d, d = c, c = void 0), r.ajax(r.extend({ - url: a, - type: b, - dataType: e, - data: c, - success: d - }, r.isPlainObject(a) && a)) - } - }), r._evalUrl = function(a) { - return r.ajax({ - url: a, - type: "GET", - dataType: "script", - cache: !0, - async: !1, - global: !1, - "throws": !0 - }) - }, r.fn.extend({ - wrapAll: function(a) { - var b; - return this[0] && (r.isFunction(a) && (a = a.call(this[0])), b = r(a, this[0].ownerDocument).eq(0).clone(!0), this[0].parentNode && b.insertBefore(this[0]), b.map(function() { - var a = this; - while(a.firstElementChild) a = a.firstElementChild; - return a - }).append(this)), this - }, - wrapInner: function(a) { - return r.isFunction(a) ? this.each(function(b) { - r(this).wrapInner(a.call(this, b)) - }) : this.each(function() { - var b = r(this), - c = b.contents(); - c.length ? c.wrapAll(a) : b.append(a) - }) - }, - wrap: function(a) { - var b = r.isFunction(a); - return this.each(function(c) { - r(this).wrapAll(b ? a.call(this, c) : a) - }) - }, - unwrap: function(a) { - return this.parent(a).not("body").each(function() { - r(this).replaceWith(this.childNodes) - }), this - } - }), r.expr.pseudos.hidden = function(a) { - return !r.expr.pseudos.visible(a) - }, r.expr.pseudos.visible = function(a) { - return !!(a.offsetWidth || a.offsetHeight || a.getClientRects().length) - }, r.ajaxSettings.xhr = function() { - try { - return new a.XMLHttpRequest - } catch(b) {} - }; - var Ob = { - 0: 200, - 1223: 204 - }, - Pb = r.ajaxSettings.xhr(); - o.cors = !!Pb && "withCredentials" in Pb, o.ajax = Pb = !!Pb, r.ajaxTransport(function(b) { - var c, d; - if(o.cors || Pb && !b.crossDomain) return { - send: function(e, f) { - var g, h = b.xhr(); - if(h.open(b.type, b.url, b.async, b.username, b.password), b.xhrFields) - for(g in b.xhrFields) h[g] = b.xhrFields[g]; - b.mimeType && h.overrideMimeType && h.overrideMimeType(b.mimeType), b.crossDomain || e["X-Requested-With"] || (e["X-Requested-With"] = "XMLHttpRequest"); - for(g in e) h.setRequestHeader(g, e[g]); - c = function(a) { - return function() { - c && (c = d = h.onload = h.onerror = h.onabort = h.onreadystatechange = null, "abort" === a ? h.abort() : "error" === a ? "number" != typeof h.status ? f(0, "error") : f(h.status, h.statusText) : f(Ob[h.status] || h.status, h.statusText, "text" !== (h.responseType || "text") || "string" != typeof h.responseText ? { - binary: h.response - } : { - text: h.responseText - }, h.getAllResponseHeaders())) - } - }, h.onload = c(), d = h.onerror = c("error"), void 0 !== h.onabort ? h.onabort = d : h.onreadystatechange = function() { - 4 === h.readyState && a.setTimeout(function() { - c && d() - }) - }, c = c("abort"); - try { - h.send(b.hasContent && b.data || null) - } catch(i) { - if(c) throw i - } - }, - abort: function() { - c && c() - } - } - }), r.ajaxPrefilter(function(a) { - a.crossDomain && (a.contents.script = !1) - }), r.ajaxSetup({ - accepts: { - script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" - }, - contents: { - script: /\b(?:java|ecma)script\b/ - }, - converters: { - "text script": function(a) { - return r.globalEval(a), a - } - } - }), r.ajaxPrefilter("script", function(a) { - void 0 === a.cache && (a.cache = !1), a.crossDomain && (a.type = "GET") - }), r.ajaxTransport("script", function(a) { - if(a.crossDomain) { - var b, c; - return { - send: function(e, f) { - b = r(" - - - - - - - -
    -
    - - -
    -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - 结算页 - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    填写并核对订单信息

    -
    - -
    - 收货人信息 - 新增收货地址 -
    - -
    - - [[${addr.name}]]

    [[${addr.name}]] [[${addr.province}]] [[${addr.detailAddress}]] [[${addr.phone}]]

    -
    -

    更多地址︾

    -
    - - -
    -

    谷粒学院自提

    -

    省运费·无续重·随时取

    -

    详情

    -
    - - - - - - -
    - - -

    支付方式

    - -
    -

    货到付款

    -

    在线支付

    -
    -
    - -

    送货清单

    -
    -
    -
    配送方式 对应商品
    -
    - 谷粒学院快递 -
    -

    - 标 准 达 : - 预计 12月16日[今天] 15:00-19:00 送达 - 修改 -

    -
    - - 京准达 标准达 - 配送服务全面升级 -
    -
    -

    - 退换无忧: - - - 自签收后7天内退货,15天内换 ¥ 0.50
    - 货,可享1次上门取件服务 ﹀ -
    - -

    - - 京准达运费大促(限自营中小件) -
    - -

    -

    总重量 :0.095kg

    -
    -
    -
    商家:谷粒学院自营
    -
    已购满20.00元,再加49.90元,可返回购物车领取赠品
    - -
    - -
    -

    [[${item.title}]] ¥[[${#numbers.formatDecimal(item.price,1,2)}]] x[[${item.count}]] [[${orderConfirmData.stocks[item.skuId]?"有货":"无货"}]]

    -

    0.095kg

    -

    支持7天无理由退货

    -
    -
    - -
    -

    退换无忧 ¥ 0.00

    -
    - -
    -
    -
    -

    发票信息

    -
    开企业抬头发票须填写纳税人识别号,以免影响报销
    -
      -
    • 电子普通发票
    • -
    • 个人
    • -
    • 商品明细
    • -
    • - 修改 -
    • -
    -
    -

    使用优惠/礼品卡/抵用 ^

    -
      -
    • 优惠卡
    • -
    • 礼品卡
    • -
    • 京豆
    • -
    • 余额
    • -
    • 领奖码
    • -
    -
    - - 优惠组合推荐 -
    -
    -
    -
    -

    - [[${orderConfirmData.count}]] - 件商品,总商品金额: - ¥[[${#numbers.formatDecimal(orderConfirmData.total,1,2)}]] -

    -

    - 返现: - -¥0.00 -

    -

    - 运费:¥ -   -

    -

    - 服务费: -   ¥0.00 -

    -

    - 退换无忧: -   ¥0.00 -

    - -
    - -
    -

    应付总额:

    -

    收件人:

    -
    -
    - - - - - -
    -
    -
    - -
    -
    - - - - -
    - -
    - -
    -

    - 京公网安备 11000002000088号| - 京ICP证070359号| - 互联网药品信息服务资格证编号(京)-经营性-2014-0008 | - 新出发京零 字第大120007号 -

    -

    - 互联网出版许可证编号新出网证(京)字150号| - 出版物经营许可证| - 网络文化经营许可证京网文 | - [2014]2148-348号 | - 违法和不良信息举报电话 | - :4006561155 -

    -

    - Copyright © 2004-2017 谷粒学院gulimall.com 版权所有| - 消费者维权热线:4006067733 经营证照| -

    -

    - 谷粒学院旗下网站:谷粒学院支付| - 谷粒学院云 -

    -

    - - - - - - -

    -
    - - - - \ No newline at end of file diff --git a/gulimall-order/src/main/resources/templates/detail.html b/gulimall-order/src/main/resources/templates/detail.html deleted file mode 100644 index e5ee2fc..0000000 --- a/gulimall-order/src/main/resources/templates/detail.html +++ /dev/null @@ -1,1234 +0,0 @@ - - - - - - - - - - - - -
    - - -
    -
    - - -
    -
    - - - -
    -
    -
    - 安全提醒:为了您的财产安全,不要点击陌生链接、不要向陌生人转账或透漏银行卡和验证码信息,谨防诈骗! -
    -
    -
    - -
    -
    -
    - -
    -
    订单号:70716422916
    -

    等待付款

    - - 剩余4时51分 - -
    - 打印订单 - 取消订单 -
    - -
    - - -
    -
    - -
    - 该订单会为您保留6.0小时(从下单之日算起),6.0小时之后如果还未付款,系统将自动取消该订单。 -
    -
    - - -
    -
    -
      -
    • 等待付款
    • -
    • -
    • -
    • -
    -
    -
    -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    -
    -
    -
      -
    • -

      提交订单

      -

      -
    • -
    • -

      付款成功

      -

      -
    • -
    • -

      商品出库

      -

      -
    • -
    • -

      等待收货

      -

      -
    • -
    • -

      完成

      -

      -
    • - -
    -
    -
    - -
    - 完成订单可能获得: - 京豆 - 优惠券 -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    -
    - - - 送货方式:普通快递 - -
    -
    -
    -
      -
    • 2017-12-26/周二09:39:49您提交了订单,请等待系统确认
    • -
    -
    -
    - -
    -
      -
    • -
      -
      -

      收货人信息 -

      -
      -
      -
      - 收货人: -
      - 张亚飞 -
      -
      -
      - 地址: -
      - 北京昌平区六环以内北京吉利大学学生公寓-马池口镇吉利大学 -
      -
      -
      - 手机号码: -
      - 147****4726 -
      -
      - -
      -
      -
    • -
    • -
      -
      -

      配送信息

      -
      -
      - -
      - - 配送方式: - -
      - 普通快递 -
      -
      - -
      - - 运费: - -
      - - ¥12.00 - -
      -
      - -
      - - 送货日期: - -
      - 2018-01-01 -
      -
      -
      - - 配送时间: - -
      - 18:00-20:00京准达
      -
      - -
      -
      -
    • -
    • -
      -
      -

      付款信息

      -
      -
      -
      - - 付款方式: - -
      - 在线支付 -
      -
      - -
      - - 商品总额: - -
      - - ¥21.80 - -
      -
      - -
      - - 应支付金额: - -
      - - ¥33.80 - -
      -
      - -
      - - 运费金额: - -
      - - ¥12.00 - -
      -
      - -
      - - -
      - 更多 -
      - - - -
      -
    • -
    • -
      -
      -

      发票信息

      -
      -
      - -
      - - 发票类型: - -
      - 电子普通发票 -
      -
      -
      - - 发票抬头: - -
      - 个人 -
      -
      - -
      - - 发票内容: - -
      - 商品明细 -
      -
      - - -
      -
      - -
      -
      -
    • -
    -
    - -
    谷粒商城
    - -
    - - - - - - - - - - - - - - - - - -
    商品商品编号谷粒商城价商品数量京豆操作
    - - 1778772¥10.9020
    -
    -
    -
    -

    商品总额:

    -

    返  现:

    -

    运  费:

    -

    应付总额:

    -
    -
    -

    ¥21.80

    -

    -¥0.00

    -

    ¥12.00

    -

    ¥33.80

    -
    -
    -
    -
    - -
    -
    -
    猜你喜欢
    -
    - 1 - 2 - 3 -
    -
    - -
    -
      -
    • -
        -
      • - -

        展卉 泰国进口龙眼 1kg 新鲜水果

        -

        ¥19.90

        -

        -
      • -
      • - -

        xuenair 手机膜 适用于oppo r9高清膜 R9软膜保护膜普通膜 R9高清软膜

        -

        ¥9.90

        -

        -
      • -
      • - -

        关键 全屏覆盖膜高清手机保护软贴膜 适用于OPPOR9/m/R9tm/R9/R9CM 全屏3D高清热弯软膜-PET热弯膜

        -

        ¥23.90

        -

        -
      • -
      • - -

        铭卡 3D曲面全覆盖膜全屏高清软膜全贴合不翘边手机保护贴膜无白边 适用于OPPO R9 全包软膜1盒3片装-OPPO R9Plus

        -

        ¥19.90

        -

        -
      • -
      • - -

        金龙鱼 食用油 非转基因 压榨 一级 纯正玉米油4L

        -

        ¥59.90

        -

        -
      • -
      - -
    • -
    • -
        -
      • - -

        维达(Vinda) 卷纸 蓝色经典3层140g卫生纸*27卷(整箱销售)

        -

        ¥21.90

        -

        -
      • -
      • - -

        花王(Merries)纸尿裤 XL44片 加大号尿不湿(12-20kg)(日本原装进口)

        -

        ¥9.90

        -

        -
      • -
      • - -

        小米(MI)小米手环2 智能运动 心率监测 来电提醒 久坐提醒 LED显示屏 时间显示 防水计步器 无感腕带

        -

        ¥23.90

        -

        -
      • -
      • - -

        德芙Dove巧克力分享碗装 丝滑牛奶巧克力糖果巧克力休闲零食252g

        -

        ¥19.90

        -

        -
      • -
      • - -

        Ferrero Rocher费列罗榛果威化糖果巧克力礼盒16粒200g

        -

        ¥59.90

        -

        -
      • -
      - -
    • -
    • -
        -
      • - -

        Ferrero Rocher费列罗榛果威化糖果巧克力礼盒48粒600g

        -

        ¥19.90

        -

        -
      • -
      • - -

        花王 (Merries) 妙而舒 纸尿裤 大号 L54片 尿不湿(9-14千克) (日本官方直采)

        -

        ¥19.90

        -

        -
      • -
      • - -

        关键 全屏覆盖膜高清手机保护软贴膜 适用于OPPOR9/m/R9tm/R9/R9CM 全屏3D高清热弯软膜-PET热弯膜

        -

        ¥213.90

        -

        -
      • -
      • - -

        荣耀8 4GB+64GB 全网通4G手机 魅海蓝

        -

        ¥19.90

        -

        -
      • -
      • - -

        Ferrero Rocher费列罗榛果威化糖果巧克力礼盒8粒心形装100g

        -

        ¥39.90

        -

        -
      • -
      -
    • -
    -
    -
    - - -
    - - - -
    - - - - -
    - -
    - - - - - - - - \ No newline at end of file diff --git a/gulimall-order/src/main/resources/templates/list.html b/gulimall-order/src/main/resources/templates/list.html deleted file mode 100644 index 8022672..0000000 --- a/gulimall-order/src/main/resources/templates/list.html +++ /dev/null @@ -1,944 +0,0 @@ - - - - - - - - 谷粒商城订单 - - - - - - -
    -
    -
    -
      -
      订单中心
      -
    • 我的订单
    • -
    • 我的活动
    • -
    • 评价晒单
    • -
    • 我的常购商品
    • -
    • 购物助手
    • -
    -
      -
      关注中心
      -
    • 关注的商品
    • -
    • 关注的店铺
    • -
    • 关注的专辑
    • -
    • 收藏的内容
    • -
    • 关注的活动
    • -
    • 浏览历史
    • -
    -
      -
      资产中心
      -
    • 小金库
    • -
    • 谷粒商城白条
    • -
    • 领货码
    • -
    • 余额
    • -
    • 优惠券
    • -
    • 礼品卡
    • -
    • 京豆
    • -
    • 谷粒商城钢镚
    • -
    -
      -
      特色业务
      -
    • 我的营业厅
    • -
    • 谷粒商城通信
    • -
    • 定期购
    • -
    • 我的回收单
    • -
    • 节能补贴
    • -
    • 医药服务
    • -
    • 流量加油站
    • -
    • 黄金托管
    • -
    • 视频教育订单
    • -
    • 海外房产预约
    • -
    • 我的全球购
    • -
    • 装修服务
    • -
    -
      -
      客户服务
      -
    • 返修退换货
    • -
    • 价格保护
    • -
    • 意见建议
    • -
    • 我的问答
    • -
    • 购买咨询
    • -
    • 交易纠纷
    • -
    • 谷粒商城维修
    • -
    • 上门预约服务
    • -
    • 我的发票
    • -
    • 举报中心
    • -
    -
      -
      设置
      -
    • 个人信息
    • -
    • 收货地址
    • -
    • -
    -
    -
    -
    -

    我的订单

    -
    - - -
    -
    -
      -
    • -
        -
      1. 全部订单
      2. -
      3. 待付款
      4. -
      5. 待收货
      6. -
      7. 待评价
      8. -
        -
      -
    • -
    • 我的常购商品
    • -
    • 好货清仓
    • -
    • - 订单回收站 -
      - -
      -
    • -
      -
    - -
    -
    -
      -
      -
    • 近三个月订单 -
        -
      1. 近三个月订单
      2. -
      3. 今年内订单
      4. -
      5. 今年内订单
      6. -
      7. 2016年订单
      8. -
      9. 2015年订单
      10. -
      11. 2014年订单
      12. -
      13. 2014年以前订单
      14. -
      -
    • -
    • 订单详情
    • -
      -
      - -
    • 收货人
    • -
    • 金额
    • -
    • 全部状态 -
        -
      1. 全部状态
      2. -
      3. 等待付款
      4. -
      5. 等待收货
      6. -
      7. 已完成
      8. -
      9. 已取消
      10. -
      -
    • -
    • 操作
    • -
      -
    -
    - - - - - - - - - - - -
    - 2017-12-09 20:50:10 - 订单号: 70207298274 - 慕熙威尔官方旗舰店 - -
    - -
    -

    MUXIWEIERPU皮手套男冬季加绒保暖户外骑
    - 车开车触摸屏全指防寒全指手套 黑色 均码

    -
    找搭配
    -
    -
    x1
    -
    -
    张三 -

    总额 ¥26.00

    -
    -

    在线支付

    -
    -
      -
    • 等待收货
    • -
    • 跟踪 -
      -
      - 普通快递 运单号:390085324974 -
      -
      -
        -
      • - [北京市] 在北京昌平区南口公司进行签收扫描,快件已被拍照(您 - 的快件已签收,感谢您使用韵达快递)签收 -
      • -
      • - [北京市] 在北京昌平区南口公司进行签收扫描,快件已被拍照(您 - 的快件已签收,感谢您使用韵达快递)签收 -
      • -
      • - [北京昌平区南口公司] 在北京昌平区南口公司进行派件扫描 -
      • -
      • - [北京市] 在北京昌平区南口公司进行派件扫描;派送业务员:业务员;联系电话:17319268636 -
      • -
      -
      -
      -
    • -
    • 订单详情
    • -
    -
    - -

    取消订单

    -

    催单

    -
    - - - - - - - - - - - - - -
    - 2017-12-09 20:50:10 - 订单号: 70207298274 - 慕熙威尔官方旗舰店 - -
    - -
    -

    QOOVI 半入耳式手机耳机OPPOR11 R9s A57
    - 华为VIVOx9小米通话耳塞 一键线控C07

    -
    找搭配
    -
    -
    x1
    -
    -
    张三 -

    总额 ¥26.00

    -
    -

    在线支付

    -
    -
      -
    • 等待收货
    • -
    • 跟踪 -
      -
      - 普通快递 运单号:390085324974 -
      -
      -
        -
      • - [北京市] 在北京昌平区南口公司进行签收扫描,快件已被拍照(您 - 的快件已签收,感谢您使用韵达快递)签收 -
      • -
      • - [北京市] 在北京昌平区南口公司进行签收扫描,快件已被拍照(您 - 的快件已签收,感谢您使用韵达快递)签收 -
      • -
      • - [北京昌平区南口公司] 在北京昌平区南口公司进行派件扫描 -
      • -
      • - [北京市] 在北京昌平区南口公司进行派件扫描;派送业务员:业务员;联系电话:17319268636 -
      • -
      -
      -
      -
    • -
    • 订单详情
    • -
    -
    - -

    取消订单

    -

    催单

    -
    - - - - - - - - - - - - - - - -
    - 2017-12-09 20:50:10 - 订单号: 70207298274 - 慕熙威尔官方旗舰店 - -
    - -
    -

    欧维沃加绒棉鞋男士休闲鞋男鞋子潮流男生韩
    - 版加厚保暖学生板鞋 黑色 42

    -
    找搭配
    -
    -
    x1
    -
    -
    张三 -

    总额 ¥26.00

    -
    -

    在线支付

    -
    -
      -
    • 等待收货
    • -
    • 跟踪 -
      -
      - 普通快递 运单号:390085324974 -
      -
      -
        -
      • - [北京市] 在北京昌平区南口公司进行签收扫描,快件已被拍照(您 - 的快件已签收,感谢您使用韵达快递)签收 -
      • -
      • - [北京市] 在北京昌平区南口公司进行签收扫描,快件已被拍照(您 - 的快件已签收,感谢您使用韵达快递)签收 -
      • -
      • - [北京昌平区南口公司] 在北京昌平区南口公司进行派件扫描 -
      • -
      • - [北京市] 在北京昌平区南口公司进行派件扫描;派送业务员:业务员;联系电话:17319268636 -
      • -
      -
      -
      -
    • -
    • 订单详情
    • -
    -
    - -

    取消订单

    -

    催单

    -
    - - - - - - - - - - - - - -
    - 2017-12-09 20:50:10 - 订单号: 70207298274 - 慕熙威尔官方旗舰店 - -
    - -
    -

    永日(yongri) 电动剃须刀男士电动刮胡刀
    - 剃胡刀便携式三刀头电须刀充电智能胡须刀

    -
    找搭配
    -
    -
    x1
    -
    -
    张三 -

    总额 ¥26.00

    -
    -

    在线支付

    -
    -
      -
    • 等待收货
    • -
    • 跟踪 -
      -
      - 普通快递 运单号:390085324974 -
      -
      -
        -
      • - [北京市] 在北京昌平区南口公司进行签收扫描,快件已被拍照(您 - 的快件已签收,感谢您使用韵达快递)签收 -
      • -
      • - [北京市] 在北京昌平区南口公司进行签收扫描,快件已被拍照(您 - 的快件已签收,感谢您使用韵达快递)签收 -
      • -
      • - [北京昌平区南口公司] 在北京昌平区南口公司进行派件扫描 -
      • -
      • - [北京市] 在北京昌平区南口公司进行派件扫描;派送业务员:业务员;联系电话:17319268636 -
      • -
      -
      -
      -
    • -
    • 订单详情
    • -
    -
    - -

    取消订单

    -

    催单

    -
    - - - - - - - - - - - - - - - -
    - 2017-12-09 20:50:10 - 订单号: 70207298274 - 慕熙威尔官方旗舰店 - -
    - -
    -

    ISIDO oppo r9s手机壳R9sk/r9splus保护套防
    - 摔磨砂全包硬壳男女款 R9s【黑】蝙蝠侠

    -
    找搭配
    -
    -
    x1
    -
    -
    张三 -

    总额 ¥26.00

    -
    -

    在线支付

    -
    -
      -
    • 等待收货
    • -
    • 跟踪 -
      -
      - 普通快递 运单号:390085324974 -
      -
      -
        -
      • - [北京市] 在北京昌平区南口公司进行签收扫描,快件已被拍照(您 - 的快件已签收,感谢您使用韵达快递)签收 -
      • -
      • - [北京市] 在北京昌平区南口公司进行签收扫描,快件已被拍照(您 - 的快件已签收,感谢您使用韵达快递)签收 -
      • -
      • - [北京昌平区南口公司] 在北京昌平区南口公司进行派件扫描 -
      • -
      • - [北京市] 在北京昌平区南口公司进行派件扫描;派送业务员:业务员;联系电话:17319268636 -
      • -
      -
      -
      -
    • -
    • 订单详情
    • -
    -
    - -

    取消订单

    -

    催单

    -
    - -
    -
    - - 1 - -
    -
    -
    -
    - -
    -
    -
    买什么
    -
    查看更多商品专辑
    -
    -
    -
    -
    -
    -
    最适合冬季的茶
    -

    不入魔不成仙

    -
    -
    -
    -
    - - -
    32
    -
    -
    -
    -
    -
      -
    • 关注 5
    • -
    • 赞 5
    • -
      -
    -
    -
    -
    -
    -
    用新奇搞怪献给那些有趣的灵魂
    -

    小太阳骥少

    -
    -
    -
    -
    - - -
    17
    -
    -
    -
    -
    -
      -
    • 关注 5
    • -
    • 赞 5
    • -
      -
    -
    -
    -
    -
    -
    流感来了,如何做好防护?
    -

    gulimall-guliyuan

    -
    -
    -
    -
    - - -
    23
    -
    -
    -
    -
    -
      -
    • 关注 2
    • -
    • 赞 5
    • -
      -
    -
    -
    -
    -
    -
    流感来了,如何做好防护?
    -

    gulimall-guliyuan

    -
    -
    -
    -
    - - -
    23
    -
    -
    -
    -
    -
      -
    • 关注 4
    • -
    • 赞 11
    • -
      -
    -
    -
    -
    -
    -
    - -
    -
    -
    猜你喜欢
    -
      -
    1. 1
    2. -
    3. 2
    4. -
    5. 3
    6. -
      -
    -
    -
    -
      -
    • -
      -
      -
      -
      花王 (Merries) 妙而舒 纸尿裤
      -
      大号 L54片 尿不湿(9-14千克)
      -

      ¥83.90

      - (已有363668人评价) -
      -
      -
      -
      -
      -
      三只松鼠 肉干肉脯 休闲零食
      -
      猪肉脯自然片150g/袋子
      -

      ¥26.90

      - (已有448374人评价) -
      -
      -
      -
      -
      -
      满减不止5折三只松鼠_小贱牛
      -
      板筋120gx1袋休闲零食特产
      -

      ¥22.80

      - (已有169149人评价) -
      -
      -
      -
      -
      - - -
      良品铺子鸭脖子 甜辣味真空小包装
      -
      香辣卤味零食休闲小吃熟食190g
      -

      ¥21.90

      - (已有208040人评价) -
      -
      -
      -
      -
      -
      欧莱雅(LOREAL)男士控油
      -
      (男士洗面奶 收缩毛孔 去黑头)
      -

      ¥39.00

      - (已有604670人评价) -
      -
      -
      -
    • -
    • -
      -
      -
      -
      花王 (Merries) 妙而舒 纸尿裤
      -
      大号 L54片 尿不湿(9-14千克)
      -

      ¥83.90

      - (已有363668人评价) -
      -
      -
      -
      -
      -
      三只松鼠 肉干肉脯 休闲零食
      -
      猪肉脯自然片150g/袋子
      -

      ¥26.90

      - (已有448374人评价) -
      -
      -
      -
      -
      -
      满减不止5折三只松鼠_小贱牛
      -
      板筋120gx1袋休闲零食特产
      -

      ¥22.80

      - (已有169149人评价) -
      -
      -
      -
      -
      - - -
      良品铺子鸭脖子 甜辣味真空小包装
      -
      香辣卤味零食休闲小吃熟食190g
      -

      ¥21.90

      - (已有208040人评价) -
      -
      -
      -
      -
      -
      欧莱雅(LOREAL)男士控油
      -
      (男士洗面奶 收缩毛孔 去黑头)
      -

      ¥39.00

      - (已有604670人评价) -
      -
      -
      -
    • -
    • -
      -
      -
      -
      花王 (Merries) 妙而舒 纸尿裤
      -
      大号 L54片 尿不湿(9-14千克)
      -

      ¥83.90

      - (已有363668人评价) -
      -
      -
      -
      -
      -
      三只松鼠 肉干肉脯 休闲零食
      -
      猪肉脯自然片150g/袋子
      -

      ¥26.90

      - (已有448374人评价) -
      -
      -
      -
    • -
    -
    - - -
    -
    -
    - - - - -
    - -
    -
      -
    • -
        -
        -
      1. 宽带
      2. -
      3. 我的旅行订单
      4. -
      5. 夺宝箱
      6. -
      7. 我的定期送
      8. -
      9. 我的竞拍保证金
      10. -
      11. 谷粒商城白条
      12. -
      13. 谷粒商城回收
      14. -
      15. 装机大师
      16. -
      17. 黄金托管业务
      18. -
      -
    • -
    • -
    • -
    -
    -
    - - - - - diff --git a/gulimall-order/src/main/resources/templates/pay.html b/gulimall-order/src/main/resources/templates/pay.html deleted file mode 100644 index 87c1eca..0000000 --- a/gulimall-order/src/main/resources/templates/pay.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - - - - -
    -
    - 收银台 - -
    -
    -
    -
    -
    - 订单提交成功,请尽快付款!订单号:[[${SubmitOrderResp.order.orderSn}]] - 应付金额[[${#numbers.formatDecimal(SubmitOrderResp.order.payAmount,1,2)}]] -
    -
    - 推荐使用 - 扫码支付请您在24小时内完成支付,否则订单会被自动取消(库存紧订单请参见详情页时限) - 订单详细 -
    -
    -
    -
    -

    -
    -
      -
    • 打白条
    • -
    • - 可用额度 7275.38元 - 白条还款日 2018-01-27 - 优惠随机立减(最高10元) -
    • -
    • 支付28.90
    • -
    -
      -
    1. -

      不分期

      -

      0服务费

      -
    2. -
    3. -

      3期

      -

      9.48元/期

      -
    4. -
    5. -

      6期

      -

      4.94元/期

      -
    6. -
    7. -

      12期

      -

      2.35元/期

      -
    8. -
    9. -

      24期

      -

      1.44元/期

      -
    10. -
    -
    -
    -
      -
    • - - 谷粒学院小金库 - - 未开通小金库 -
    • -
    • - - 招商银行 - - 信用卡(4337) - 优惠单单减最高99元 -
    • -
    • - - -
    • -
    • -

      请输入6位数字支付密码

      - 忘记支付密码? -
    • -
    • - -
    • -
    -
    -
    - -
    -

    - Copyright @2004-2017 谷粒学院gulimall.com 版权所有 - - - -

    -
    -
    - - - diff --git a/gulimall-order/src/test/java/com/forth/gulimall/order/GulimallOrderApplicationTests.java b/gulimall-order/src/test/java/com/forth/gulimall/order/GulimallOrderApplicationTests.java index a607241..85743ed 100644 --- a/gulimall-order/src/test/java/com/forth/gulimall/order/GulimallOrderApplicationTests.java +++ b/gulimall-order/src/test/java/com/forth/gulimall/order/GulimallOrderApplicationTests.java @@ -1,25 +1,13 @@ package com.forth.gulimall.order; -import com.forth.gulimall.order.entity.OrderEntity; -import com.forth.gulimall.order.service.OrderService; import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import java.util.Date; - @SpringBootTest class GulimallOrderApplicationTests { - @Autowired - OrderService orderService; - @Test void contextLoads() { - OrderEntity orderEntity = new OrderEntity(); - orderEntity.setCreateTime(new Date()); - orderService.save(orderEntity); - System.out.println("success"); } } diff --git a/gulimall-product/pom.xml b/gulimall-product/pom.xml index 6d0e5ed..b8f4732 100644 --- a/gulimall-product/pom.xml +++ b/gulimall-product/pom.xml @@ -33,23 +33,6 @@ org.springframework.cloud spring-cloud-starter-openfeign - - - - - - - - - - - - - - - - - org.springframework.boot @@ -62,8 +45,15 @@ - - + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-devtools + true + diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/GulimallProductApplication.java b/gulimall-product/src/main/java/com/forth/gulimall/product/GulimallProductApplication.java index 90549c2..db56848 100644 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/GulimallProductApplication.java +++ b/gulimall-product/src/main/java/com/forth/gulimall/product/GulimallProductApplication.java @@ -4,13 +4,12 @@ import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; -//import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession; +import org.springframework.cloud.openfeign.EnableFeignClients; -//整合redis 作为session -//@EnableRedisHttpSession -@EnableDiscoveryClient @MapperScan("com.forth.gulimall.product.dao") +@EnableDiscoveryClient @SpringBootApplication +@EnableFeignClients(basePackages = "com.forth.gulimall.product.feign") public class GulimallProductApplication { public static void main(String[] args) { SpringApplication.run(GulimallProductApplication.class,args); diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/config/GulimallSessionConfig.java b/gulimall-product/src/main/java/com/forth/gulimall/product/config/GulimallSessionConfig.java deleted file mode 100644 index 8877141..0000000 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/config/GulimallSessionConfig.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.forth.gulimall.product.config; - -//import org.springframework.context.annotation.Bean; -//import org.springframework.context.annotation.Configuration; -//import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; -//import org.springframework.data.redis.serializer.RedisSerializer; -//import org.springframework.session.web.http.CookieSerializer; -//import org.springframework.session.web.http.DefaultCookieSerializer; -// -//@Configuration -//public class GulimallSessionConfig { -// @Bean -// public CookieSerializer cookieSerializer(){ -// DefaultCookieSerializer cookieSerializer = new DefaultCookieSerializer(); -// -// cookieSerializer.setDomainName("localhost"); -// cookieSerializer.setCookieName("GULISESSION"); -// return cookieSerializer; -// } -// public RedisSerializer springSessionDefaultCookieSerializer(){ -// return new GenericJackson2JsonRedisSerializer(); -// } -//} diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/AttrAttrgroupRelationController.java b/gulimall-product/src/main/java/com/forth/gulimall/product/controller/AttrAttrgroupRelationController.java deleted file mode 100644 index d0c2cea..0000000 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/AttrAttrgroupRelationController.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.forth.gulimall.product.controller; - -import java.util.Arrays; -import java.util.Map; - -//import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import com.forth.gulimall.product.entity.AttrAttrgroupRelationEntity; -import com.forth.gulimall.product.service.AttrAttrgroupRelationService; -import com.forth.common.utils.PageUtils; -import com.forth.common.utils.R; - - - -/** - * 属性&属性分组关联 - * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-11 09:34:17 - */ -@RestController -@RequestMapping("product/attrattrgrouprelation") -public class AttrAttrgroupRelationController { - @Autowired - private AttrAttrgroupRelationService attrAttrgroupRelationService; - - /** - * 列表 - */ - @RequestMapping("/list") - //@RequiresPermissions("product:attrattrgrouprelation:list") - public R list(@RequestParam Map params){ - PageUtils page = attrAttrgroupRelationService.queryPage(params); - - return R.ok().put("page", page); - } - - - /** - * 信息 - */ - @RequestMapping("/info/{id}") - //@RequiresPermissions("product:attrattrgrouprelation:info") - public R info(@PathVariable("id") Long id){ - AttrAttrgroupRelationEntity attrAttrgroupRelation = attrAttrgroupRelationService.getById(id); - - return R.ok().put("attrAttrgroupRelation", attrAttrgroupRelation); - } - - /** - * 保存 - */ - @RequestMapping("/save") - //@RequiresPermissions("product:attrattrgrouprelation:save") - public R save(@RequestBody AttrAttrgroupRelationEntity attrAttrgroupRelation){ - attrAttrgroupRelationService.save(attrAttrgroupRelation); - - return R.ok(); - } - - /** - * 修改 - */ - @RequestMapping("/update") - //@RequiresPermissions("product:attrattrgrouprelation:update") - public R update(@RequestBody AttrAttrgroupRelationEntity attrAttrgroupRelation){ - attrAttrgroupRelationService.updateById(attrAttrgroupRelation); - - return R.ok(); - } - - /** - * 删除 - */ - @RequestMapping("/delete") - //@RequiresPermissions("product:attrattrgrouprelation:delete") - public R delete(@RequestBody Long[] ids){ - attrAttrgroupRelationService.removeByIds(Arrays.asList(ids)); - - return R.ok(); - } - -} diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/AttrController.java b/gulimall-product/src/main/java/com/forth/gulimall/product/controller/AttrController.java deleted file mode 100644 index 13b6a11..0000000 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/AttrController.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.forth.gulimall.product.controller; - -import java.util.Arrays; -import java.util.Map; - -//import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import com.forth.gulimall.product.entity.AttrEntity; -import com.forth.gulimall.product.service.AttrService; -import com.forth.common.utils.PageUtils; -import com.forth.common.utils.R; - - - -/** - * 商品属性 - * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-11 09:34:16 - */ -@RestController -@RequestMapping("product/attr") -public class AttrController { - @Autowired - private AttrService attrService; - - /** - * 列表 - */ - @RequestMapping("/list") - //@RequiresPermissions("product:attr:list") - public R list(@RequestParam Map params){ - PageUtils page = attrService.queryPage(params); - - return R.ok().put("page", page); - } - - - /** - * 信息 - */ - @RequestMapping("/info/{attrId}") - //@RequiresPermissions("product:attr:info") - public R info(@PathVariable("attrId") Long attrId){ - AttrEntity attr = attrService.getById(attrId); - - return R.ok().put("attr", attr); - } - - /** - * 保存 - */ - @RequestMapping("/save") - //@RequiresPermissions("product:attr:save") - public R save(@RequestBody AttrEntity attr){ - attrService.save(attr); - - return R.ok(); - } - - /** - * 修改 - */ - @RequestMapping("/update") - //@RequiresPermissions("product:attr:update") - public R update(@RequestBody AttrEntity attr){ - attrService.updateById(attr); - - return R.ok(); - } - - /** - * 删除 - */ - @RequestMapping("/delete") - //@RequiresPermissions("product:attr:delete") - public R delete(@RequestBody Long[] attrIds){ - attrService.removeByIds(Arrays.asList(attrIds)); - - return R.ok(); - } - -} diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/AttrGroupController.java b/gulimall-product/src/main/java/com/forth/gulimall/product/controller/AttrGroupController.java deleted file mode 100644 index 517483d..0000000 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/AttrGroupController.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.forth.gulimall.product.controller; - -import java.util.Arrays; -import java.util.Map; - -//import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import com.forth.gulimall.product.entity.AttrGroupEntity; -import com.forth.gulimall.product.service.AttrGroupService; -import com.forth.common.utils.PageUtils; -import com.forth.common.utils.R; - - - -/** - * 属性分组 - * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-11 09:34:16 - */ -@RestController -@RequestMapping("product/attrgroup") -public class AttrGroupController { - @Autowired - private AttrGroupService attrGroupService; - - /** - * 列表 - */ - @RequestMapping("/list") - //@RequiresPermissions("product:attrgroup:list") - public R list(@RequestParam Map params){ - PageUtils page = attrGroupService.queryPage(params); - - return R.ok().put("page", page); - } - - - /** - * 信息 - */ - @RequestMapping("/info/{attrGroupId}") - //@RequiresPermissions("product:attrgroup:info") - public R info(@PathVariable("attrGroupId") Long attrGroupId){ - AttrGroupEntity attrGroup = attrGroupService.getById(attrGroupId); - - return R.ok().put("attrGroup", attrGroup); - } - - /** - * 保存 - */ - @RequestMapping("/save") - //@RequiresPermissions("product:attrgroup:save") - public R save(@RequestBody AttrGroupEntity attrGroup){ - attrGroupService.save(attrGroup); - - return R.ok(); - } - - /** - * 修改 - */ - @RequestMapping("/update") - //@RequiresPermissions("product:attrgroup:update") - public R update(@RequestBody AttrGroupEntity attrGroup){ - attrGroupService.updateById(attrGroup); - - return R.ok(); - } - - /** - * 删除 - */ - @RequestMapping("/delete") - //@RequiresPermissions("product:attrgroup:delete") - public R delete(@RequestBody Long[] attrGroupIds){ - attrGroupService.removeByIds(Arrays.asList(attrGroupIds)); - - return R.ok(); - } - -} diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/BrandController.java b/gulimall-product/src/main/java/com/forth/gulimall/product/controller/BrandController.java deleted file mode 100644 index 00efac6..0000000 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/BrandController.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.forth.gulimall.product.controller; - -import java.util.Arrays; -import java.util.Map; - -//import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import com.forth.gulimall.product.entity.BrandEntity; -import com.forth.gulimall.product.service.BrandService; -import com.forth.common.utils.PageUtils; -import com.forth.common.utils.R; - - - -/** - * 品牌 - * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-11 09:34:16 - */ -@RestController -@RequestMapping("product/brand") -public class BrandController { - @Autowired - private BrandService brandService; - - /** - * 列表 - */ - @RequestMapping("/list") - //@RequiresPermissions("product:brand:list") - public R list(@RequestParam Map params){ - PageUtils page = brandService.queryPage(params); - - return R.ok().put("page", page); - } - - - /** - * 信息 - */ - @RequestMapping("/info/{brandId}") - //@RequiresPermissions("product:brand:info") - public R info(@PathVariable("brandId") Long brandId){ - BrandEntity brand = brandService.getById(brandId); - - return R.ok().put("brand", brand); - } - - /** - * 保存 - */ - @RequestMapping("/save") - //@RequiresPermissions("product:brand:save") - public R save(@RequestBody BrandEntity brand){ - brandService.save(brand); - - return R.ok(); - } - - /** - * 修改 - */ - @RequestMapping("/update") - //@RequiresPermissions("product:brand:update") - public R update(@RequestBody BrandEntity brand){ - brandService.updateById(brand); - - return R.ok(); - } - - /** - * 删除 - */ - @RequestMapping("/delete") - //@RequiresPermissions("product:brand:delete") - public R delete(@RequestBody Long[] brandIds){ - brandService.removeByIds(Arrays.asList(brandIds)); - - return R.ok(); - } - -} diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/CategoryBrandRelationController.java b/gulimall-product/src/main/java/com/forth/gulimall/product/controller/CategoryBrandRelationController.java deleted file mode 100644 index 6f9bb2b..0000000 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/CategoryBrandRelationController.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.forth.gulimall.product.controller; - -import java.util.Arrays; -import java.util.Map; - -//import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import com.forth.gulimall.product.entity.CategoryBrandRelationEntity; -import com.forth.gulimall.product.service.CategoryBrandRelationService; -import com.forth.common.utils.PageUtils; -import com.forth.common.utils.R; - - - -/** - * 品牌分类关联 - * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-11 09:34:16 - */ -@RestController -@RequestMapping("product/categorybrandrelation") -public class CategoryBrandRelationController { - @Autowired - private CategoryBrandRelationService categoryBrandRelationService; - - /** - * 列表 - */ - @RequestMapping("/list") - //@RequiresPermissions("product:categorybrandrelation:list") - public R list(@RequestParam Map params){ - PageUtils page = categoryBrandRelationService.queryPage(params); - - return R.ok().put("page", page); - } - - - /** - * 信息 - */ - @RequestMapping("/info/{id}") - //@RequiresPermissions("product:categorybrandrelation:info") - public R info(@PathVariable("id") Long id){ - CategoryBrandRelationEntity categoryBrandRelation = categoryBrandRelationService.getById(id); - - return R.ok().put("categoryBrandRelation", categoryBrandRelation); - } - - /** - * 保存 - */ - @RequestMapping("/save") - //@RequiresPermissions("product:categorybrandrelation:save") - public R save(@RequestBody CategoryBrandRelationEntity categoryBrandRelation){ - categoryBrandRelationService.save(categoryBrandRelation); - - return R.ok(); - } - - /** - * 修改 - */ - @RequestMapping("/update") - //@RequiresPermissions("product:categorybrandrelation:update") - public R update(@RequestBody CategoryBrandRelationEntity categoryBrandRelation){ - categoryBrandRelationService.updateById(categoryBrandRelation); - - return R.ok(); - } - - /** - * 删除 - */ - @RequestMapping("/delete") - //@RequiresPermissions("product:categorybrandrelation:delete") - public R delete(@RequestBody Long[] ids){ - categoryBrandRelationService.removeByIds(Arrays.asList(ids)); - - return R.ok(); - } - -} diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/CategoryController.java b/gulimall-product/src/main/java/com/forth/gulimall/product/controller/CategoryController.java deleted file mode 100644 index 45d27bd..0000000 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/CategoryController.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.forth.gulimall.product.controller; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -//import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import com.forth.gulimall.product.entity.CategoryEntity; -import com.forth.gulimall.product.service.CategoryService; -import com.forth.common.utils.PageUtils; -import com.forth.common.utils.R; - - - -/** - * 商品三级分类 - * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-11 09:34:16 - */ -@RestController -@RequestMapping("product/category") -public class CategoryController { - @Autowired - private CategoryService categoryService; - - /** - * 查出所有分类以及子分类,以树形结构组装起来 - */ - @RequestMapping("/list/tree") - //@RequiresPermissions("product:category:list") - public R list(){ - - List entities = categoryService.listWithTree(); - return R.ok().put("data", entities); - } - - - /** - * 信息 - */ - @RequestMapping("/info/{catId}") - //@RequiresPermissions("product:category:info") - public R info(@PathVariable("catId") Long catId){ - CategoryEntity category = categoryService.getById(catId); - - return R.ok().put("category", category); - } - - /** - * 保存 - */ - @RequestMapping("/save") - //@RequiresPermissions("product:category:save") - public R save(@RequestBody CategoryEntity category){ - categoryService.save(category); - - return R.ok(); - } - - /** - * 修改 - */ - @RequestMapping("/update") - //@RequiresPermissions("product:category:update") - public R update(@RequestBody CategoryEntity category){ - categoryService.updateById(category); - - return R.ok(); - } - - /** - * 删除 - */ - @RequestMapping("/delete") - //@RequiresPermissions("product:category:delete") - public R delete(@RequestBody Long[] catIds){ - categoryService.removeByIds(Arrays.asList(catIds)); - - return R.ok(); - } - -} diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/CommentReplayController.java b/gulimall-product/src/main/java/com/forth/gulimall/product/controller/CommentReplayController.java deleted file mode 100644 index 38cfe65..0000000 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/CommentReplayController.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.forth.gulimall.product.controller; - -import java.util.Arrays; -import java.util.Map; - -//import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import com.forth.gulimall.product.entity.CommentReplayEntity; -import com.forth.gulimall.product.service.CommentReplayService; -import com.forth.common.utils.PageUtils; -import com.forth.common.utils.R; - - - -/** - * 商品评价回复关系 - * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-11 09:34:16 - */ -@RestController -@RequestMapping("product/commentreplay") -public class CommentReplayController { - @Autowired - private CommentReplayService commentReplayService; - - /** - * 列表 - */ - @RequestMapping("/list") - //@RequiresPermissions("product:commentreplay:list") - public R list(@RequestParam Map params){ - PageUtils page = commentReplayService.queryPage(params); - - return R.ok().put("page", page); - } - - - /** - * 信息 - */ - @RequestMapping("/info/{id}") - //@RequiresPermissions("product:commentreplay:info") - public R info(@PathVariable("id") Long id){ - CommentReplayEntity commentReplay = commentReplayService.getById(id); - - return R.ok().put("commentReplay", commentReplay); - } - - /** - * 保存 - */ - @RequestMapping("/save") - //@RequiresPermissions("product:commentreplay:save") - public R save(@RequestBody CommentReplayEntity commentReplay){ - commentReplayService.save(commentReplay); - - return R.ok(); - } - - /** - * 修改 - */ - @RequestMapping("/update") - //@RequiresPermissions("product:commentreplay:update") - public R update(@RequestBody CommentReplayEntity commentReplay){ - commentReplayService.updateById(commentReplay); - - return R.ok(); - } - - /** - * 删除 - */ - @RequestMapping("/delete") - //@RequiresPermissions("product:commentreplay:delete") - public R delete(@RequestBody Long[] ids){ - commentReplayService.removeByIds(Arrays.asList(ids)); - - return R.ok(); - } - -} diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/ProductAttrValueController.java b/gulimall-product/src/main/java/com/forth/gulimall/product/controller/ProductAttrValueController.java deleted file mode 100644 index b8ea10d..0000000 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/ProductAttrValueController.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.forth.gulimall.product.controller; - -import java.util.Arrays; -import java.util.Map; - -//import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import com.forth.gulimall.product.entity.ProductAttrValueEntity; -import com.forth.gulimall.product.service.ProductAttrValueService; -import com.forth.common.utils.PageUtils; -import com.forth.common.utils.R; - - - -/** - * spu属性值 - * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-11 09:34:16 - */ -@RestController -@RequestMapping("product/productattrvalue") -public class ProductAttrValueController { - @Autowired - private ProductAttrValueService productAttrValueService; - - /** - * 列表 - */ - @RequestMapping("/list") - //@RequiresPermissions("product:productattrvalue:list") - public R list(@RequestParam Map params){ - PageUtils page = productAttrValueService.queryPage(params); - - return R.ok().put("page", page); - } - - - /** - * 信息 - */ - @RequestMapping("/info/{id}") - //@RequiresPermissions("product:productattrvalue:info") - public R info(@PathVariable("id") Long id){ - ProductAttrValueEntity productAttrValue = productAttrValueService.getById(id); - - return R.ok().put("productAttrValue", productAttrValue); - } - - /** - * 保存 - */ - @RequestMapping("/save") - //@RequiresPermissions("product:productattrvalue:save") - public R save(@RequestBody ProductAttrValueEntity productAttrValue){ - productAttrValueService.save(productAttrValue); - - return R.ok(); - } - - /** - * 修改 - */ - @RequestMapping("/update") - //@RequiresPermissions("product:productattrvalue:update") - public R update(@RequestBody ProductAttrValueEntity productAttrValue){ - productAttrValueService.updateById(productAttrValue); - - return R.ok(); - } - - /** - * 删除 - */ - @RequestMapping("/delete") - //@RequiresPermissions("product:productattrvalue:delete") - public R delete(@RequestBody Long[] ids){ - productAttrValueService.removeByIds(Arrays.asList(ids)); - - return R.ok(); - } - -} diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/SkuImagesController.java b/gulimall-product/src/main/java/com/forth/gulimall/product/controller/SkuImagesController.java deleted file mode 100644 index af5148f..0000000 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/SkuImagesController.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.forth.gulimall.product.controller; - -import java.util.Arrays; -import java.util.Map; - -//import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import com.forth.gulimall.product.entity.SkuImagesEntity; -import com.forth.gulimall.product.service.SkuImagesService; -import com.forth.common.utils.PageUtils; -import com.forth.common.utils.R; - - - -/** - * sku图片 - * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-11 09:34:16 - */ -@RestController -@RequestMapping("product/skuimages") -public class SkuImagesController { - @Autowired - private SkuImagesService skuImagesService; - - /** - * 列表 - */ - @RequestMapping("/list") - //@RequiresPermissions("product:skuimages:list") - public R list(@RequestParam Map params){ - PageUtils page = skuImagesService.queryPage(params); - - return R.ok().put("page", page); - } - - - /** - * 信息 - */ - @RequestMapping("/info/{id}") - //@RequiresPermissions("product:skuimages:info") - public R info(@PathVariable("id") Long id){ - SkuImagesEntity skuImages = skuImagesService.getById(id); - - return R.ok().put("skuImages", skuImages); - } - - /** - * 保存 - */ - @RequestMapping("/save") - //@RequiresPermissions("product:skuimages:save") - public R save(@RequestBody SkuImagesEntity skuImages){ - skuImagesService.save(skuImages); - - return R.ok(); - } - - /** - * 修改 - */ - @RequestMapping("/update") - //@RequiresPermissions("product:skuimages:update") - public R update(@RequestBody SkuImagesEntity skuImages){ - skuImagesService.updateById(skuImages); - - return R.ok(); - } - - /** - * 删除 - */ - @RequestMapping("/delete") - //@RequiresPermissions("product:skuimages:delete") - public R delete(@RequestBody Long[] ids){ - skuImagesService.removeByIds(Arrays.asList(ids)); - - return R.ok(); - } - -} diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/SkuInfoController.java b/gulimall-product/src/main/java/com/forth/gulimall/product/controller/SkuInfoController.java deleted file mode 100644 index 7e6101f..0000000 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/SkuInfoController.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.forth.gulimall.product.controller; - -import java.math.BigDecimal; -import java.util.Arrays; -import java.util.Map; - -//import org.apache.shiro.authz.annotation.RequiresPermissions; -import com.forth.gulimall.product.entity.SpuInfoEntity; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import com.forth.gulimall.product.entity.SkuInfoEntity; -import com.forth.gulimall.product.service.SkuInfoService; -import com.forth.common.utils.PageUtils; -import com.forth.common.utils.R; - - - -/** - * sku信息 - * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-11 09:34:16 - */ -@RestController -@RequestMapping("product/skuinfo") -public class SkuInfoController { - @Autowired - private SkuInfoService skuInfoService; - - - @GetMapping("/{skuId}/price") - public BigDecimal getPrice(@PathVariable("skuId") Long skuId) { - SkuInfoEntity byId = skuInfoService.getById(skuId); - return byId.getPrice(); - } - - - /** - * 列表 - */ - @RequestMapping("/list") - //@RequiresPermissions("product:skuinfo:list") - public R list(@RequestParam Map params){ - PageUtils page = skuInfoService.queryPage(params); - - return R.ok().put("page", page); - } - - - /** - * 信息 - */ - @RequestMapping("/info/{skuId}") - //@RequiresPermissions("product:skuinfo:info") - public R info(@PathVariable("skuId") Long skuId){ - SkuInfoEntity skuInfo = skuInfoService.getById(skuId); - - return R.ok().put("skuInfo", skuInfo); - } - - /** - * 保存 - */ - @RequestMapping("/save") - //@RequiresPermissions("product:skuinfo:save") - public R save(@RequestBody SkuInfoEntity skuInfo){ - skuInfoService.save(skuInfo); - - return R.ok(); - } - - /** - * 修改 - */ - @RequestMapping("/update") - //@RequiresPermissions("product:skuinfo:update") - public R update(@RequestBody SkuInfoEntity skuInfo){ - skuInfoService.updateById(skuInfo); - - return R.ok(); - } - - /** - * 删除 - */ - @RequestMapping("/delete") - //@RequiresPermissions("product:skuinfo:delete") - public R delete(@RequestBody Long[] skuIds){ - skuInfoService.removeByIds(Arrays.asList(skuIds)); - - return R.ok(); - } - -} diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/SkuSaleAttrValueController.java b/gulimall-product/src/main/java/com/forth/gulimall/product/controller/SkuSaleAttrValueController.java deleted file mode 100644 index 158c6a1..0000000 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/SkuSaleAttrValueController.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.forth.gulimall.product.controller; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -//import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import com.forth.gulimall.product.entity.SkuSaleAttrValueEntity; -import com.forth.gulimall.product.service.SkuSaleAttrValueService; -import com.forth.common.utils.PageUtils; -import com.forth.common.utils.R; - - - -/** - * sku销售属性&值 - * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-11 09:34:16 - */ -@RestController -@RequestMapping("product/skusaleattrvalue") -public class SkuSaleAttrValueController { - @Autowired - private SkuSaleAttrValueService skuSaleAttrValueService; - - - @GetMapping("/stringlist/{skuId}") - public List getSkuSaleAttrValue(@PathVariable("skuId") Long skuId){ - return skuSaleAttrValueService.getSkuSaleAttrValueAsStringList(skuId); - - } - /** - * 列表 - */ - @RequestMapping("/list") - //@RequiresPermissions("product:skusaleattrvalue:list") - public R list(@RequestParam Map params){ - PageUtils page = skuSaleAttrValueService.queryPage(params); - - return R.ok().put("page", page); - } - - - /** - * 信息 - */ - @RequestMapping("/info/{id}") - //@RequiresPermissions("product:skusaleattrvalue:info") - public R info(@PathVariable("id") Long id){ - SkuSaleAttrValueEntity skuSaleAttrValue = skuSaleAttrValueService.getById(id); - - return R.ok().put("skuSaleAttrValue", skuSaleAttrValue); - } - - /** - * 保存 - */ - @RequestMapping("/save") - //@RequiresPermissions("product:skusaleattrvalue:save") - public R save(@RequestBody SkuSaleAttrValueEntity skuSaleAttrValue){ - skuSaleAttrValueService.save(skuSaleAttrValue); - - return R.ok(); - } - - /** - * 修改 - */ - @RequestMapping("/update") - //@RequiresPermissions("product:skusaleattrvalue:update") - public R update(@RequestBody SkuSaleAttrValueEntity skuSaleAttrValue){ - skuSaleAttrValueService.updateById(skuSaleAttrValue); - - return R.ok(); - } - - /** - * 删除 - */ - @RequestMapping("/delete") - //@RequiresPermissions("product:skusaleattrvalue:delete") - public R delete(@RequestBody Long[] ids){ - skuSaleAttrValueService.removeByIds(Arrays.asList(ids)); - - return R.ok(); - } - -} diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/SpuCommentController.java b/gulimall-product/src/main/java/com/forth/gulimall/product/controller/SpuCommentController.java deleted file mode 100644 index 8ea41a5..0000000 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/SpuCommentController.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.forth.gulimall.product.controller; - -import java.util.Arrays; -import java.util.Map; - -//import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import com.forth.gulimall.product.entity.SpuCommentEntity; -import com.forth.gulimall.product.service.SpuCommentService; -import com.forth.common.utils.PageUtils; -import com.forth.common.utils.R; - - - -/** - * 商品评价 - * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-11 09:34:16 - */ -@RestController -@RequestMapping("product/spucomment") -public class SpuCommentController { - @Autowired - private SpuCommentService spuCommentService; - - /** - * 列表 - */ - @RequestMapping("/list") - //@RequiresPermissions("product:spucomment:list") - public R list(@RequestParam Map params){ - PageUtils page = spuCommentService.queryPage(params); - - return R.ok().put("page", page); - } - - - /** - * 信息 - */ - @RequestMapping("/info/{id}") - //@RequiresPermissions("product:spucomment:info") - public R info(@PathVariable("id") Long id){ - SpuCommentEntity spuComment = spuCommentService.getById(id); - - return R.ok().put("spuComment", spuComment); - } - - /** - * 保存 - */ - @RequestMapping("/save") - //@RequiresPermissions("product:spucomment:save") - public R save(@RequestBody SpuCommentEntity spuComment){ - spuCommentService.save(spuComment); - - return R.ok(); - } - - /** - * 修改 - */ - @RequestMapping("/update") - //@RequiresPermissions("product:spucomment:update") - public R update(@RequestBody SpuCommentEntity spuComment){ - spuCommentService.updateById(spuComment); - - return R.ok(); - } - - /** - * 删除 - */ - @RequestMapping("/delete") - //@RequiresPermissions("product:spucomment:delete") - public R delete(@RequestBody Long[] ids){ - spuCommentService.removeByIds(Arrays.asList(ids)); - - return R.ok(); - } - -} diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/SpuImagesController.java b/gulimall-product/src/main/java/com/forth/gulimall/product/controller/SpuImagesController.java deleted file mode 100644 index d0c3394..0000000 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/SpuImagesController.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.forth.gulimall.product.controller; - -import java.util.Arrays; -import java.util.Map; - -//import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import com.forth.gulimall.product.entity.SpuImagesEntity; -import com.forth.gulimall.product.service.SpuImagesService; -import com.forth.common.utils.PageUtils; -import com.forth.common.utils.R; - - - -/** - * spu图片 - * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-11 09:34:16 - */ -@RestController -@RequestMapping("product/spuimages") -public class SpuImagesController { - @Autowired - private SpuImagesService spuImagesService; - - /** - * 列表 - */ - @RequestMapping("/list") - //@RequiresPermissions("product:spuimages:list") - public R list(@RequestParam Map params){ - PageUtils page = spuImagesService.queryPage(params); - - return R.ok().put("page", page); - } - - - /** - * 信息 - */ - @RequestMapping("/info/{id}") - //@RequiresPermissions("product:spuimages:info") - public R info(@PathVariable("id") Long id){ - SpuImagesEntity spuImages = spuImagesService.getById(id); - - return R.ok().put("spuImages", spuImages); - } - - /** - * 保存 - */ - @RequestMapping("/save") - //@RequiresPermissions("product:spuimages:save") - public R save(@RequestBody SpuImagesEntity spuImages){ - spuImagesService.save(spuImages); - - return R.ok(); - } - - /** - * 修改 - */ - @RequestMapping("/update") - //@RequiresPermissions("product:spuimages:update") - public R update(@RequestBody SpuImagesEntity spuImages){ - spuImagesService.updateById(spuImages); - - return R.ok(); - } - - /** - * 删除 - */ - @RequestMapping("/delete") - //@RequiresPermissions("product:spuimages:delete") - public R delete(@RequestBody Long[] ids){ - spuImagesService.removeByIds(Arrays.asList(ids)); - - return R.ok(); - } - -} diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/SpuInfoController.java b/gulimall-product/src/main/java/com/forth/gulimall/product/controller/SpuInfoController.java deleted file mode 100644 index c97a42d..0000000 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/SpuInfoController.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.forth.gulimall.product.controller; - -import java.util.Arrays; -import java.util.Map; - -//import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import com.forth.gulimall.product.entity.SpuInfoEntity; -import com.forth.gulimall.product.service.SpuInfoService; -import com.forth.common.utils.PageUtils; -import com.forth.common.utils.R; - - - -/** - * spu信息 - * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-11 09:34:16 - */ -@RestController -@RequestMapping("product/spuinfo") -public class SpuInfoController { - @Autowired - private SpuInfoService spuInfoService; - - @GetMapping("/skuId/{id}") - public R getSpuInfoBySkuId(@PathVariable("id") Long skuId){ - SpuInfoEntity entity= spuInfoService.getSpuInfoBySkuId(skuId); - return R.ok().setData(entity); - } - /** - * 列表 - */ - @RequestMapping("/list") - //@RequiresPermissions("product:spuinfo:list") - public R list(@RequestParam Map params){ - PageUtils page = spuInfoService.queryPage(params); - - return R.ok().put("page", page); - } - - - /** - * 信息 - */ - @RequestMapping("/info/{id}") - //@RequiresPermissions("product:spuinfo:info") - public R info(@PathVariable("id") Long id){ - SpuInfoEntity spuInfo = spuInfoService.getById(id); - - return R.ok().put("spuInfo", spuInfo); - } - - /** - * 保存 - */ - @RequestMapping("/save") - //@RequiresPermissions("product:spuinfo:save") - public R save(@RequestBody SpuInfoEntity spuInfo){ - spuInfoService.save(spuInfo); - - return R.ok(); - } - - /** - * 修改 - */ - @RequestMapping("/update") - //@RequiresPermissions("product:spuinfo:update") - public R update(@RequestBody SpuInfoEntity spuInfo){ - spuInfoService.updateById(spuInfo); - - return R.ok(); - } - - /** - * 删除 - */ - @RequestMapping("/delete") - //@RequiresPermissions("product:spuinfo:delete") - public R delete(@RequestBody Long[] ids){ - spuInfoService.removeByIds(Arrays.asList(ids)); - - return R.ok(); - } - -} diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/SpuInfoDescController.java b/gulimall-product/src/main/java/com/forth/gulimall/product/controller/SpuInfoDescController.java deleted file mode 100644 index 776a7e7..0000000 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/controller/SpuInfoDescController.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.forth.gulimall.product.controller; - -import java.util.Arrays; -import java.util.Map; - -//import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import com.forth.gulimall.product.entity.SpuInfoDescEntity; -import com.forth.gulimall.product.service.SpuInfoDescService; -import com.forth.common.utils.PageUtils; -import com.forth.common.utils.R; - - - -/** - * spu信息介绍 - * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-11 09:34:16 - */ -@RestController -@RequestMapping("product/spuinfodesc") -public class SpuInfoDescController { - @Autowired - private SpuInfoDescService spuInfoDescService; - - /** - * 列表 - */ - @RequestMapping("/list") - //@RequiresPermissions("product:spuinfodesc:list") - public R list(@RequestParam Map params){ - PageUtils page = spuInfoDescService.queryPage(params); - - return R.ok().put("page", page); - } - - - /** - * 信息 - */ - @RequestMapping("/info/{spuId}") - //@RequiresPermissions("product:spuinfodesc:info") - public R info(@PathVariable("spuId") Long spuId){ - SpuInfoDescEntity spuInfoDesc = spuInfoDescService.getById(spuId); - - return R.ok().put("spuInfoDesc", spuInfoDesc); - } - - /** - * 保存 - */ - @RequestMapping("/save") - //@RequiresPermissions("product:spuinfodesc:save") - public R save(@RequestBody SpuInfoDescEntity spuInfoDesc){ - spuInfoDescService.save(spuInfoDesc); - - return R.ok(); - } - - /** - * 修改 - */ - @RequestMapping("/update") - //@RequiresPermissions("product:spuinfodesc:update") - public R update(@RequestBody SpuInfoDescEntity spuInfoDesc){ - spuInfoDescService.updateById(spuInfoDesc); - - return R.ok(); - } - - /** - * 删除 - */ - @RequestMapping("/delete") - //@RequiresPermissions("product:spuinfodesc:delete") - public R delete(@RequestBody Long[] spuIds){ - spuInfoDescService.removeByIds(Arrays.asList(spuIds)); - - return R.ok(); - } - -} diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/dao/SkuSaleAttrValueDao.java b/gulimall-product/src/main/java/com/forth/gulimall/product/dao/SkuSaleAttrValueDao.java index d926017..d715b2c 100644 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/dao/SkuSaleAttrValueDao.java +++ b/gulimall-product/src/main/java/com/forth/gulimall/product/dao/SkuSaleAttrValueDao.java @@ -3,9 +3,6 @@ package com.forth.gulimall.product.dao; import com.forth.gulimall.product.entity.SkuSaleAttrValueEntity; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; /** * sku销售属性&值 @@ -16,6 +13,5 @@ import java.util.List; */ @Mapper public interface SkuSaleAttrValueDao extends BaseMapper { - - List getSkuSaleAttrValueAsStringList(@Param("skuId") Long skuId); + } diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/entity/CategoryEntity.java b/gulimall-product/src/main/java/com/forth/gulimall/product/entity/CategoryEntity.java index 409c43c..2219b39 100644 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/entity/CategoryEntity.java +++ b/gulimall-product/src/main/java/com/forth/gulimall/product/entity/CategoryEntity.java @@ -2,6 +2,7 @@ package com.forth.gulimall.product.entity; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; import java.io.Serializable; @@ -42,6 +43,7 @@ public class CategoryEntity implements Serializable { /** * 是否显示[0-不显示,1显示] */ + @TableLogic(value = "1",delval = "0") private Integer showStatus; /** * 排序 @@ -60,7 +62,7 @@ public class CategoryEntity implements Serializable { */ private Integer productCount; - @TableField(exist = false) + @TableField(exist = false) private List children; } diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/service/CategoryService.java b/gulimall-product/src/main/java/com/forth/gulimall/product/service/CategoryService.java index 93d8a47..0bcbb38 100644 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/service/CategoryService.java +++ b/gulimall-product/src/main/java/com/forth/gulimall/product/service/CategoryService.java @@ -3,6 +3,7 @@ package com.forth.gulimall.product.service; import com.baomidou.mybatisplus.extension.service.IService; import com.forth.common.utils.PageUtils; import com.forth.gulimall.product.entity.CategoryEntity; +import com.forth.gulimall.product.vo.Catelog2Vo; import java.util.List; import java.util.Map; @@ -19,5 +20,12 @@ public interface CategoryService extends IService { PageUtils queryPage(Map params); List listWithTree(); + + void removeMenuByIds(List asList); + + + List getLevel1Categorys(); + + Map> getCatalogJson(); } diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/service/SkuInfoService.java b/gulimall-product/src/main/java/com/forth/gulimall/product/service/SkuInfoService.java index 66013fe..9812daf 100644 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/service/SkuInfoService.java +++ b/gulimall-product/src/main/java/com/forth/gulimall/product/service/SkuInfoService.java @@ -3,7 +3,6 @@ package com.forth.gulimall.product.service; import com.baomidou.mybatisplus.extension.service.IService; import com.forth.common.utils.PageUtils; import com.forth.gulimall.product.entity.SkuInfoEntity; -import com.forth.gulimall.product.entity.SpuInfoEntity; import java.util.Map; @@ -17,9 +16,5 @@ import java.util.Map; public interface SkuInfoService extends IService { PageUtils queryPage(Map params); - - - - } diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/service/SkuSaleAttrValueService.java b/gulimall-product/src/main/java/com/forth/gulimall/product/service/SkuSaleAttrValueService.java index 6d39b5e..22f6319 100644 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/service/SkuSaleAttrValueService.java +++ b/gulimall-product/src/main/java/com/forth/gulimall/product/service/SkuSaleAttrValueService.java @@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.forth.common.utils.PageUtils; import com.forth.gulimall.product.entity.SkuSaleAttrValueEntity; -import java.util.List; import java.util.Map; /** @@ -17,7 +16,5 @@ import java.util.Map; public interface SkuSaleAttrValueService extends IService { PageUtils queryPage(Map params); - - List getSkuSaleAttrValueAsStringList(Long skuId); } diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/service/SpuInfoService.java b/gulimall-product/src/main/java/com/forth/gulimall/product/service/SpuInfoService.java index d3ea7da..e3b5f21 100644 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/service/SpuInfoService.java +++ b/gulimall-product/src/main/java/com/forth/gulimall/product/service/SpuInfoService.java @@ -16,7 +16,5 @@ import java.util.Map; public interface SpuInfoService extends IService { PageUtils queryPage(Map params); - - SpuInfoEntity getSpuInfoBySkuId(Long skuId); } diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/service/impl/CategoryServiceImpl.java b/gulimall-product/src/main/java/com/forth/gulimall/product/service/impl/CategoryServiceImpl.java index d0f123d..2b91a91 100644 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/service/impl/CategoryServiceImpl.java +++ b/gulimall-product/src/main/java/com/forth/gulimall/product/service/impl/CategoryServiceImpl.java @@ -1,5 +1,6 @@ package com.forth.gulimall.product.service.impl; +import com.forth.gulimall.product.vo.Catelog2Vo; import org.springframework.stereotype.Service; import java.util.List; @@ -34,10 +35,11 @@ public class CategoryServiceImpl extends ServiceImpl listWithTree() { //1、查出所有分类 List entities = baseMapper.selectList(null); - //2、组装成父子的树形结构 - //2.1找到所有一级分类 + + //组装成父子的树形结构 + //找到所有的一级分类 List level1Menus = entities.stream().filter(categoryEntity -> - categoryEntity.getParentCid() == 0 + categoryEntity.getParentCid() == 0 ).map((menu)->{ menu.setChildren(getChildrens(menu,entities)); return menu; @@ -46,26 +48,76 @@ public class CategoryServiceImpl extends ServiceImpl getChildrens(CategoryEntity root, List all){ + @Override + public void removeMenuByIds(List asList) { + //TODO 检查当前删除的菜单,是否被别动地方引用 +//逻辑删除 + + baseMapper.deleteBatchIds(asList); + } + + @Override + public List getLevel1Categorys() { + List categoryEntity = baseMapper.selectList(new QueryWrapper().eq("parent_cid", 0)); + + return categoryEntity; + } + + //递归查找所有菜单的子菜单 + private List getChildrens(CategoryEntity root,List all){ + List children = all.stream().filter(categoryEntity -> { return categoryEntity.getParentCid() == root.getCatId(); }).map(categoryEntity -> { - //1、找到子菜单 + //找到子菜单 categoryEntity.setChildren(getChildrens(categoryEntity,all)); return categoryEntity; - }).sorted((menu1,menu2) -> { - //2、菜单排序 + }).sorted((menu1,menu2)->{ + //菜单的排序 return (menu1.getSort()==null?0:menu1.getSort()) - (menu2.getSort()==null?0:menu2.getSort()); }).collect(Collectors.toList()); + return children; } + + + @Override + public Map> getCatalogJson() { + //1、查出所有一级分类 + List level1Categorys = getLevel1Categorys(); + //2、封装数据 + Map> parent_cid = level1Categorys.stream().collect(Collectors.toMap(k -> k.getCatId().toString(), v -> { + //1、每一个的一级分类,查到这个一级分类的二级分类 + List categoryEntities = baseMapper.selectList(new QueryWrapper().eq("parent_cid", v.getCatId())); + //2、封装上面的结果 + List catelog2Vos = null; + if (categoryEntities != null) { + catelog2Vos = categoryEntities.stream().map(l2 -> { + Catelog2Vo catelog2Vo = new Catelog2Vo(v.getCatId().toString(), null, l2.getCatId().toString(), l2.getName()); + //1、找当前二级分类的三级分类封装成vo + List level3Catelog = baseMapper.selectList(new QueryWrapper().eq("parent_cid", l2.getCatId())); + if (level3Catelog != null) { + List collect = level3Catelog.stream().map(l3 -> { + //2、封装成指定格式 + Catelog2Vo.Catelog3Vo catelog3Vo = new Catelog2Vo.Catelog3Vo(l2.getCatId().toString(), l3.getCatId().toString(), l3.getName()); + return catelog3Vo; + }).collect(Collectors.toList()); + catelog2Vo.setCatalog3List(collect); + } + return catelog2Vo; + }).collect(Collectors.toList()); + } + return catelog2Vos; + })); + return parent_cid; + } + + + + } \ No newline at end of file diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/service/impl/SkuInfoServiceImpl.java b/gulimall-product/src/main/java/com/forth/gulimall/product/service/impl/SkuInfoServiceImpl.java index 8760465..c5f33ca 100644 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/service/impl/SkuInfoServiceImpl.java +++ b/gulimall-product/src/main/java/com/forth/gulimall/product/service/impl/SkuInfoServiceImpl.java @@ -1,7 +1,5 @@ package com.forth.gulimall.product.service.impl; -import com.forth.gulimall.product.entity.SpuInfoEntity; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Map; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -18,9 +16,6 @@ import com.forth.gulimall.product.service.SkuInfoService; @Service("skuInfoService") public class SkuInfoServiceImpl extends ServiceImpl implements SkuInfoService { - - - @Override public PageUtils queryPage(Map params) { IPage page = this.page( @@ -31,6 +26,4 @@ public class SkuInfoServiceImpl extends ServiceImpl i return new PageUtils(page); } - - } \ No newline at end of file diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/service/impl/SkuSaleAttrValueServiceImpl.java b/gulimall-product/src/main/java/com/forth/gulimall/product/service/impl/SkuSaleAttrValueServiceImpl.java index 050ce52..464c0c9 100644 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/service/impl/SkuSaleAttrValueServiceImpl.java +++ b/gulimall-product/src/main/java/com/forth/gulimall/product/service/impl/SkuSaleAttrValueServiceImpl.java @@ -1,9 +1,6 @@ package com.forth.gulimall.product.service.impl; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; - -import java.util.List; import java.util.Map; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -19,9 +16,6 @@ import com.forth.gulimall.product.service.SkuSaleAttrValueService; @Service("skuSaleAttrValueService") public class SkuSaleAttrValueServiceImpl extends ServiceImpl implements SkuSaleAttrValueService { - @Autowired - SkuSaleAttrValueDao saleAttrValueDao; - @Override public PageUtils queryPage(Map params) { IPage page = this.page( @@ -32,11 +26,4 @@ public class SkuSaleAttrValueServiceImpl extends ServiceImpl getSkuSaleAttrValueAsStringList(Long skuId) { - SkuSaleAttrValueDao dao = this.baseMapper; - - return dao.getSkuSaleAttrValueAsStringList(skuId); - } - } \ No newline at end of file diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/service/impl/SpuInfoServiceImpl.java b/gulimall-product/src/main/java/com/forth/gulimall/product/service/impl/SpuInfoServiceImpl.java index f5d02d0..fa86433 100644 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/service/impl/SpuInfoServiceImpl.java +++ b/gulimall-product/src/main/java/com/forth/gulimall/product/service/impl/SpuInfoServiceImpl.java @@ -1,8 +1,5 @@ package com.forth.gulimall.product.service.impl; -import com.forth.gulimall.product.entity.SkuInfoEntity; -import com.forth.gulimall.product.service.SkuInfoService; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Map; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -19,8 +16,6 @@ import com.forth.gulimall.product.service.SpuInfoService; @Service("spuInfoService") public class SpuInfoServiceImpl extends ServiceImpl implements SpuInfoService { - @Autowired - SkuInfoService skuInfoService; @Override public PageUtils queryPage(Map params) { IPage page = this.page( @@ -31,13 +26,4 @@ public class SpuInfoServiceImpl extends ServiceImpl i return new PageUtils(page); } - @Override - public SpuInfoEntity getSpuInfoBySkuId(Long skuId) { - SkuInfoEntity byId = skuInfoService.getById(skuId); - Long spuId = byId.getSpuId(); - SpuInfoEntity spuInfoEntity = getById(spuId); - - return spuInfoEntity; - } - } \ No newline at end of file diff --git a/gulimall-product/src/main/java/com/forth/gulimall/product/vo/MemberRespVo.java b/gulimall-product/src/main/java/com/forth/gulimall/product/vo/MemberRespVo.java deleted file mode 100644 index f89980b..0000000 --- a/gulimall-product/src/main/java/com/forth/gulimall/product/vo/MemberRespVo.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.forth.gulimall.product.vo; - -import lombok.Data; -import lombok.ToString; - -import java.io.Serializable; -import java.util.Date; -@ToString -@Data -public class MemberRespVo implements Serializable { - /** - * id - */ - - private Long id; - /** - * 会员等级id - */ - private Long levelId; - /** - * 用户名 - */ - private String username; - /** - * 密码 - */ - private String password; - /** - * 昵称 - */ - private String nickname; - /** - * 手机号码 - */ - private String mobile; - /** - * 邮箱 - */ - private String email; - /** - * 头像 - */ - private String header; - /** - * 性别 - */ - private Integer gender; - /** - * 生日 - */ - private Date birth; - /** - * 所在城市 - */ - private String city; - /** - * 职业 - */ - private String job; - /** - * 个性签名 - */ - private String sign; - /** - * 用户来源 - */ - private Integer sourceType; - /** - * 积分 - */ - private Integer integration; - /** - * 成长值 - */ - private Integer growth; - /** - * 启用状态 - */ - private Integer status; - /** - * 注册时间 - */ - private Date createTime; - - private String socialUid; - private String accessToken; - private Long expiresIn; - -} diff --git a/gulimall-product/src/main/resources/application.yml b/gulimall-product/src/main/resources/application.yml index 8c6095b..f61b654 100644 --- a/gulimall-product/src/main/resources/application.yml +++ b/gulimall-product/src/main/resources/application.yml @@ -1,5 +1,3 @@ -server: - port: 4001 spring: datasource: username: root @@ -9,14 +7,24 @@ spring: cloud: nacos: discovery: - server-addr: 39.97.249.66:8848 + server-addr: 127.0.0.1:8848 + jackson: + date-format: yyyy-MM-dd HH:mm:ss + thymeleaf: + cache: false application: - name: product + name: gulimall-product mybatis-plus: mapper-locations: classpath:/mapper/**/*.xml global-config: db-config: id-type: auto - + logic-delete-value: 1 + logic-not-delete-value: 0 +server: + port: 4001 +logging: + level: + com.forth.gulimall: debug diff --git a/gulimall-product/src/main/resources/bootstrap.properties b/gulimall-product/src/main/resources/bootstrap.properties index 8304fa3..1dcd127 100644 --- a/gulimall-product/src/main/resources/bootstrap.properties +++ b/gulimall-product/src/main/resources/bootstrap.properties @@ -1,7 +1,3 @@ -spring.application.name=product -spring.cloud.nacos.config.server-addr=39.97.249.66:8848 -spring.cloud.nacos.config.namespace=e5522ef7-a5b8-49c1-8e1c-19577f5f72fc - -spring.cloud.nacos.config.ext-config[0].data-id=product.yml -spring.cloud.nacos.config.ext-config[0].group=DEFAULT_GROUP -spring.cloud.nacos.config.ext-config[0].refresh=true \ No newline at end of file +spring.application.name=gulimall-product +spring.cloud.nacos.config.server-addr=127.0.0.1:8848 +spring.cloud.nacos.config.namespace=f3603ab6-e509-4a68-99d7-017b5c5b9d4b \ No newline at end of file diff --git a/gulimall-product/src/main/resources/mapper/product/AttrAttrgroupRelationDao.xml b/gulimall-product/src/main/resources/mapper/product/AttrAttrgroupRelationDao.xml index 3933979..7050b59 100644 --- a/gulimall-product/src/main/resources/mapper/product/AttrAttrgroupRelationDao.xml +++ b/gulimall-product/src/main/resources/mapper/product/AttrAttrgroupRelationDao.xml @@ -11,5 +11,11 @@ + + DELETE FROM `pms_attr_attrgroup_relation` WHERE + + (attr_id=#{item.attrId} AND attr_group_id=#{item.attrGroupId}) + + \ No newline at end of file diff --git a/gulimall-product/src/main/resources/mapper/product/CategoryBrandRelationDao.xml b/gulimall-product/src/main/resources/mapper/product/CategoryBrandRelationDao.xml index 0276760..b79cda6 100644 --- a/gulimall-product/src/main/resources/mapper/product/CategoryBrandRelationDao.xml +++ b/gulimall-product/src/main/resources/mapper/product/CategoryBrandRelationDao.xml @@ -11,6 +11,8 @@ - + + UPDATE `pms_category_brand_relation` SET catelog_name=#{name} WHERE catelog_id=#{catId} + \ No newline at end of file diff --git a/gulimall-product/src/main/resources/mapper/product/SkuSaleAttrValueDao.xml b/gulimall-product/src/main/resources/mapper/product/SkuSaleAttrValueDao.xml index c873a06..15d0cbd 100644 --- a/gulimall-product/src/main/resources/mapper/product/SkuSaleAttrValueDao.xml +++ b/gulimall-product/src/main/resources/mapper/product/SkuSaleAttrValueDao.xml @@ -13,8 +13,5 @@ - \ No newline at end of file diff --git a/gulimall-product/src/main/resources/src/views/modules/product/attr-add-or-update.vue b/gulimall-product/src/main/resources/src/views/modules/product/attr-add-or-update.vue deleted file mode 100644 index 1ffc169..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/attr-add-or-update.vue +++ /dev/null @@ -1,147 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/attr.vue b/gulimall-product/src/main/resources/src/views/modules/product/attr.vue deleted file mode 100644 index 02985cd..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/attr.vue +++ /dev/null @@ -1,205 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/attrattrgrouprelation-add-or-update.vue b/gulimall-product/src/main/resources/src/views/modules/product/attrattrgrouprelation-add-or-update.vue deleted file mode 100644 index 86c84a9..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/attrattrgrouprelation-add-or-update.vue +++ /dev/null @@ -1,102 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/attrattrgrouprelation.vue b/gulimall-product/src/main/resources/src/views/modules/product/attrattrgrouprelation.vue deleted file mode 100644 index 0abfcb9..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/attrattrgrouprelation.vue +++ /dev/null @@ -1,175 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/attrgroup-add-or-update.vue b/gulimall-product/src/main/resources/src/views/modules/product/attrgroup-add-or-update.vue deleted file mode 100644 index 167949d..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/attrgroup-add-or-update.vue +++ /dev/null @@ -1,120 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/attrgroup.vue b/gulimall-product/src/main/resources/src/views/modules/product/attrgroup.vue deleted file mode 100644 index ad7efd0..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/attrgroup.vue +++ /dev/null @@ -1,187 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/brand-add-or-update.vue b/gulimall-product/src/main/resources/src/views/modules/product/brand-add-or-update.vue deleted file mode 100644 index 164b4b8..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/brand-add-or-update.vue +++ /dev/null @@ -1,129 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/brand.vue b/gulimall-product/src/main/resources/src/views/modules/product/brand.vue deleted file mode 100644 index 92d617a..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/brand.vue +++ /dev/null @@ -1,193 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/category-add-or-update.vue b/gulimall-product/src/main/resources/src/views/modules/product/category-add-or-update.vue deleted file mode 100644 index feaa861..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/category-add-or-update.vue +++ /dev/null @@ -1,147 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/category.vue b/gulimall-product/src/main/resources/src/views/modules/product/category.vue deleted file mode 100644 index b5e06b1..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/category.vue +++ /dev/null @@ -1,205 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/categorybrandrelation-add-or-update.vue b/gulimall-product/src/main/resources/src/views/modules/product/categorybrandrelation-add-or-update.vue deleted file mode 100644 index e73668c..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/categorybrandrelation-add-or-update.vue +++ /dev/null @@ -1,111 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/categorybrandrelation.vue b/gulimall-product/src/main/resources/src/views/modules/product/categorybrandrelation.vue deleted file mode 100644 index 66e9f8d..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/categorybrandrelation.vue +++ /dev/null @@ -1,181 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/commentreplay-add-or-update.vue b/gulimall-product/src/main/resources/src/views/modules/product/commentreplay-add-or-update.vue deleted file mode 100644 index 14545c8..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/commentreplay-add-or-update.vue +++ /dev/null @@ -1,93 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/commentreplay.vue b/gulimall-product/src/main/resources/src/views/modules/product/commentreplay.vue deleted file mode 100644 index 857bbf3..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/commentreplay.vue +++ /dev/null @@ -1,169 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/productattrvalue-add-or-update.vue b/gulimall-product/src/main/resources/src/views/modules/product/productattrvalue-add-or-update.vue deleted file mode 100644 index 188d51b..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/productattrvalue-add-or-update.vue +++ /dev/null @@ -1,129 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/productattrvalue.vue b/gulimall-product/src/main/resources/src/views/modules/product/productattrvalue.vue deleted file mode 100644 index e6e0630..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/productattrvalue.vue +++ /dev/null @@ -1,193 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/skuimages-add-or-update.vue b/gulimall-product/src/main/resources/src/views/modules/product/skuimages-add-or-update.vue deleted file mode 100644 index e9b8d4f..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/skuimages-add-or-update.vue +++ /dev/null @@ -1,111 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/skuimages.vue b/gulimall-product/src/main/resources/src/views/modules/product/skuimages.vue deleted file mode 100644 index 7a13ec7..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/skuimages.vue +++ /dev/null @@ -1,181 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/skuinfo-add-or-update.vue b/gulimall-product/src/main/resources/src/views/modules/product/skuinfo-add-or-update.vue deleted file mode 100644 index 0638c0b..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/skuinfo-add-or-update.vue +++ /dev/null @@ -1,165 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/skuinfo.vue b/gulimall-product/src/main/resources/src/views/modules/product/skuinfo.vue deleted file mode 100644 index 717e6c1..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/skuinfo.vue +++ /dev/null @@ -1,217 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/skusaleattrvalue-add-or-update.vue b/gulimall-product/src/main/resources/src/views/modules/product/skusaleattrvalue-add-or-update.vue deleted file mode 100644 index 4c5176f..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/skusaleattrvalue-add-or-update.vue +++ /dev/null @@ -1,120 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/skusaleattrvalue.vue b/gulimall-product/src/main/resources/src/views/modules/product/skusaleattrvalue.vue deleted file mode 100644 index bbd2f1c..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/skusaleattrvalue.vue +++ /dev/null @@ -1,187 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/spucomment-add-or-update.vue b/gulimall-product/src/main/resources/src/views/modules/product/spucomment-add-or-update.vue deleted file mode 100644 index b101074..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/spucomment-add-or-update.vue +++ /dev/null @@ -1,210 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/spucomment.vue b/gulimall-product/src/main/resources/src/views/modules/product/spucomment.vue deleted file mode 100644 index 577a6e8..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/spucomment.vue +++ /dev/null @@ -1,247 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/spuimages-add-or-update.vue b/gulimall-product/src/main/resources/src/views/modules/product/spuimages-add-or-update.vue deleted file mode 100644 index f25e52a..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/spuimages-add-or-update.vue +++ /dev/null @@ -1,120 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/spuimages.vue b/gulimall-product/src/main/resources/src/views/modules/product/spuimages.vue deleted file mode 100644 index 1465f67..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/spuimages.vue +++ /dev/null @@ -1,187 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/spuinfo-add-or-update.vue b/gulimall-product/src/main/resources/src/views/modules/product/spuinfo-add-or-update.vue deleted file mode 100644 index 7ddc8ae..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/spuinfo-add-or-update.vue +++ /dev/null @@ -1,147 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/spuinfo.vue b/gulimall-product/src/main/resources/src/views/modules/product/spuinfo.vue deleted file mode 100644 index 82bfa00..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/spuinfo.vue +++ /dev/null @@ -1,205 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/spuinfodesc-add-or-update.vue b/gulimall-product/src/main/resources/src/views/modules/product/spuinfodesc-add-or-update.vue deleted file mode 100644 index 017975c..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/spuinfodesc-add-or-update.vue +++ /dev/null @@ -1,84 +0,0 @@ - - - diff --git a/gulimall-product/src/main/resources/src/views/modules/product/spuinfodesc.vue b/gulimall-product/src/main/resources/src/views/modules/product/spuinfodesc.vue deleted file mode 100644 index c33bb11..0000000 --- a/gulimall-product/src/main/resources/src/views/modules/product/spuinfodesc.vue +++ /dev/null @@ -1,163 +0,0 @@ - - - diff --git a/gulimall-product/src/test/java/com/forth/gulimall/product/GulimallProductApplicationTests.java b/gulimall-product/src/test/java/com/forth/gulimall/product/GulimallProductApplicationTests.java index 9f5bb5a..963184f 100644 --- a/gulimall-product/src/test/java/com/forth/gulimall/product/GulimallProductApplicationTests.java +++ b/gulimall-product/src/test/java/com/forth/gulimall/product/GulimallProductApplicationTests.java @@ -1,55 +1,23 @@ -//package com.forth.gulimall.product; -// -//import com.aliyun.oss.OSS; -//import com.aliyun.oss.OSSClient; -//import com.aliyun.oss.OSSClientBuilder; -//import com.forth.gulimall.product.entity.BrandEntity; -//import com.forth.gulimall.product.service.BrandService; -//import org.junit.jupiter.api.Test; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.boot.test.context.SpringBootTest; -// -//import java.io.FileInputStream; -//import java.io.FileNotFoundException; -//import java.io.InputStream; -// -//@SpringBootTest -//class GulimallProductApplicationTests { -// -// @Autowired -// BrandService brandService; -// -// @Autowired -// OSSClient ossClient; -// -// @Test -// public void testUpdate() throws FileNotFoundException { -//// // Endpoint以杭州为例,其它Region请按实际情况填写。 -//// String endpoint = "oss-cn-beijing.aliyuncs.com"; -////// 云账号AccessKey有所有API访问权限,建议遵循阿里云安全最佳实践,创建并使用RAM子账号进行API访问或日常运维,请登录 https://ram.console.aliyun.com 创建。 -//// String accessKeyId = "LTAI4GDX99wA75oVsdzZygVW"; -//// String accessKeySecret = "7hxQWldF6jHl4Y45vsifIV7qawbj7e"; -// -//// 创建OSSClient实例。 -// // ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret); -// -//// 上传文件流。 name //文件地址 !!!!注意收费 -// InputStream inputStream = new FileInputStream("C:\\Users\\Administrator\\Pictures\\22.png"); -// ossClient.putObject("gulimall-hjp", "<22.png>", inputStream); -// -//// 关闭OSSClient。 -// ossClient.shutdown(); -// System.out.println("上传完毕。。。"); -// } -// -// -// -// @Test -// void contextLoads() { -// BrandEntity brandEntity = new BrandEntity(); -// brandEntity.setName("华为"); -// brandService.save(brandEntity); -// System.out.println("保存成功"); -// } -// -//} +package com.forth.gulimall.product; + +import com.forth.gulimall.product.entity.BrandEntity; +import com.forth.gulimall.product.service.BrandService; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class GulimallProductApplicationTests { + + @Autowired + BrandService brandService; + + @Test + void contextLoads() { + BrandEntity brandEntity = new BrandEntity(); + brandEntity.setName("华为"); + brandService.save(brandEntity); + System.out.println("保存成功"); + } + +} diff --git a/gulimall-third-party/pom.xml b/gulimall-third-party/pom.xml deleted file mode 100644 index 3f37fc3..0000000 --- a/gulimall-third-party/pom.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - 2.3.5.RELEASE - - - com.forth.gulimall - gulimall-third-party - 0.0.1-SNAPSHOT - gulimall-third-party - 第三服务 - - - 1.8 - Hoxton.SR8 - - - - - com.forth.gulimall - gulimall-common - 0.0.1-SNAPSHOT - - - com.baomidou - mybatis-plus-boot-starter - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.cloud - spring-cloud-starter-openfeign - - - - com.alibaba.cloud - spring-cloud-starter-alicloud-oss - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.junit.vintage - junit-vintage-engine - - - - - - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - com.alibaba.cloud - spring-cloud-alibaba-dependencies - 2.1.0.RELEASE - pom - import - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - - - diff --git a/gulimall-third-party/src/main/java/com/forth/gulimall/thirdparty/GulimallThirdPartyApplication.java b/gulimall-third-party/src/main/java/com/forth/gulimall/thirdparty/GulimallThirdPartyApplication.java deleted file mode 100644 index b57b6ea..0000000 --- a/gulimall-third-party/src/main/java/com/forth/gulimall/thirdparty/GulimallThirdPartyApplication.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.forth.gulimall.thirdparty; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; - -@EnableDiscoveryClient -@SpringBootApplication -public class GulimallThirdPartyApplication { - - public static void main(String[] args) { - SpringApplication.run(GulimallThirdPartyApplication.class, args); - } - -} diff --git a/gulimall-third-party/src/main/java/com/forth/gulimall/thirdparty/component/SmsComponent.java b/gulimall-third-party/src/main/java/com/forth/gulimall/thirdparty/component/SmsComponent.java deleted file mode 100644 index 04b3df3..0000000 --- a/gulimall-third-party/src/main/java/com/forth/gulimall/thirdparty/component/SmsComponent.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.forth.gulimall.thirdparty.component; - -import com.forth.gulimall.thirdparty.utils.HttpUtils; -import lombok.Data; -import org.apache.http.HttpResponse; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -import java.util.HashMap; -import java.util.Map; - -@ConfigurationProperties(prefix = "spring.cloud.alicloud.sms") -@Data -@Component -public class SmsComponent { - - private String host; - private String path; - private String templateId; - private String appcode; - - public void SendSmsCode(String phone ,String code){ -// String host = "https://aliapi.market.alicloudapi.com"; -// String path = "/smsApi/verifyCode/send"; - String method = "POST"; - String appcode = "0995740d4ffe4f64bd63dcea04160b07"; - Map headers = new HashMap(); - //最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105 - headers.put("Authorization", "APPCODE " + appcode); - Map querys = new HashMap(); - querys.put("phone", phone); - querys.put("templateId", templateId); - querys.put("variables", code); - Map bodys = new HashMap(); - - - try { - /** - * 重要提示如下: - * HttpUtils请从 - * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/src/main/java/com/aliyun/api/gateway/demo/util/HttpUtils.java - * 下载 - * - * 相应的依赖请参照 - * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/pom.xml - */ - HttpResponse response = HttpUtils.doPost(host, path, method, headers, querys, bodys); - System.out.println(response.toString()); - //获取response的body - //System.out.println(EntityUtils.toString(response.getEntity())); - } catch (Exception e) { - e.printStackTrace(); - }} - } - diff --git a/gulimall-third-party/src/main/java/com/forth/gulimall/thirdparty/controller/OssController.java b/gulimall-third-party/src/main/java/com/forth/gulimall/thirdparty/controller/OssController.java deleted file mode 100644 index 58c45f0..0000000 --- a/gulimall-third-party/src/main/java/com/forth/gulimall/thirdparty/controller/OssController.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.forth.gulimall.thirdparty.controller; - -import com.aliyun.oss.OSS; -import com.aliyun.oss.common.utils.BinaryUtil; -import com.aliyun.oss.model.MatchMode; -import com.aliyun.oss.model.PolicyConditions; - -import com.forth.common.utils.R; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.LinkedHashMap; -import java.util.Map; - -@RestController -public class OssController { - - @Autowired - OSS ossClient; - - @Value("${spring.cloud.alicloud.oss.endpoint}") - private String endpoint; - @Value("${spring.cloud.alicloud.oss.bucket}") - private String bucket; - - @Value("${spring.cloud.alicloud.access-key}") - private String accessId; - - - @RequestMapping("/oss/policy") - public R policy() { - - - - //https://gulimall-hello.oss-cn-beijing.aliyuncs.com/hahaha.jpg - - String host = "https://" + bucket + "." + endpoint; // host的格式为 bucketname.endpoint - // callbackUrl为 上传回调服务器的URL,请将下面的IP和Port配置为您自己的真实信息。 -// String callbackUrl = "http://88.88.88.88:8888"; - String format = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); - String dir = format + "/"; // 用户上传文件时指定的前缀。 - - Map respMap = null; - try { - long expireTime = 30; - long expireEndTime = System.currentTimeMillis() + expireTime * 1000; - Date expiration = new Date(expireEndTime); - PolicyConditions policyConds = new PolicyConditions(); - policyConds.addConditionItem(PolicyConditions.COND_CONTENT_LENGTH_RANGE, 0, 1048576000); - policyConds.addConditionItem(MatchMode.StartWith, PolicyConditions.COND_KEY, dir); - - String postPolicy = ossClient.generatePostPolicy(expiration, policyConds); - byte[] binaryData = postPolicy.getBytes("utf-8"); - String encodedPolicy = BinaryUtil.toBase64String(binaryData); - String postSignature = ossClient.calculatePostSignature(postPolicy); - - respMap = new LinkedHashMap(); - respMap.put("accessid", accessId); - respMap.put("policy", encodedPolicy); - respMap.put("signature", postSignature); - respMap.put("dir", dir); - respMap.put("host", host); - respMap.put("expire", String.valueOf(expireEndTime / 1000)); - // respMap.put("expire", formatISO8601Date(expiration)); - - - } catch (Exception e) { - // Assert.fail(e.getMessage()); - System.out.println(e.getMessage()); - } - - return R.ok().put("data",respMap); - } -} diff --git a/gulimall-third-party/src/main/java/com/forth/gulimall/thirdparty/controller/SmsSendController.java b/gulimall-third-party/src/main/java/com/forth/gulimall/thirdparty/controller/SmsSendController.java deleted file mode 100644 index 410a8eb..0000000 --- a/gulimall-third-party/src/main/java/com/forth/gulimall/thirdparty/controller/SmsSendController.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.forth.gulimall.thirdparty.controller; - -import com.forth.common.utils.R; -import com.forth.gulimall.thirdparty.component.SmsComponent; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping("/sms") -public class SmsSendController { - - @Autowired - SmsComponent smsComponent; - /** - * 提供给别的服务进行调用 - * @param phone - * @param code - * @return - */ - @GetMapping("/sendcode") - public R sendCode(@RequestParam("phone") String phone, @RequestParam("code")String code){ -smsComponent.SendSmsCode(phone,code); -return R.ok(); - } -} diff --git a/gulimall-third-party/src/main/java/com/forth/gulimall/thirdparty/utils/HttpUtils.java b/gulimall-third-party/src/main/java/com/forth/gulimall/thirdparty/utils/HttpUtils.java deleted file mode 100644 index 16b3621..0000000 --- a/gulimall-third-party/src/main/java/com/forth/gulimall/thirdparty/utils/HttpUtils.java +++ /dev/null @@ -1,315 +0,0 @@ -package com.forth.gulimall.thirdparty.utils; - -import org.apache.commons.lang.StringUtils; -import org.apache.http.HttpResponse; -import org.apache.http.NameValuePair; -import org.apache.http.client.HttpClient; -import org.apache.http.client.entity.UrlEncodedFormEntity; -import org.apache.http.client.methods.HttpDelete; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.methods.HttpPut; -import org.apache.http.conn.ClientConnectionManager; -import org.apache.http.conn.scheme.Scheme; -import org.apache.http.conn.scheme.SchemeRegistry; -import org.apache.http.conn.ssl.SSLSocketFactory; -import org.apache.http.entity.ByteArrayEntity; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.message.BasicNameValuePair; - -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManager; -import javax.net.ssl.X509TrustManager; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.security.KeyManagementException; -import java.security.NoSuchAlgorithmException; -import java.security.cert.X509Certificate; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -public class HttpUtils { - - /** - * get - * - * @param host - * @param path - * @param method - * @param headers - * @param querys - * @return - * @throws Exception - */ - public static HttpResponse doGet(String host, String path, String method, - Map headers, - Map querys) - throws Exception { - HttpClient httpClient = wrapClient(host); - - HttpGet request = new HttpGet(buildUrl(host, path, querys)); - for (Map.Entry e : headers.entrySet()) { - request.addHeader(e.getKey(), e.getValue()); - } - - return httpClient.execute(request); - } - - /** - * post form - * - * @param host - * @param path - * @param method - * @param headers - * @param querys - * @param bodys - * @return - * @throws Exception - */ - public static HttpResponse doPost(String host, String path, String method, - Map headers, - Map querys, - Map bodys) - throws Exception { - HttpClient httpClient = wrapClient(host); - - HttpPost request = new HttpPost(buildUrl(host, path, querys)); - for (Map.Entry e : headers.entrySet()) { - request.addHeader(e.getKey(), e.getValue()); - } - - if (bodys != null) { - List nameValuePairList = new ArrayList(); - - for (String key : bodys.keySet()) { - nameValuePairList.add(new BasicNameValuePair(key, bodys.get(key))); - } - UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nameValuePairList, "utf-8"); - formEntity.setContentType("application/x-www-form-urlencoded; charset=UTF-8"); - request.setEntity(formEntity); - } - - return httpClient.execute(request); - } - - /** - * Post String - * - * @param host - * @param path - * @param method - * @param headers - * @param querys - * @param body - * @return - * @throws Exception - */ - public static HttpResponse doPost(String host, String path, String method, - Map headers, - Map querys, - String body) - throws Exception { - HttpClient httpClient = wrapClient(host); - - HttpPost request = new HttpPost(buildUrl(host, path, querys)); - for (Map.Entry e : headers.entrySet()) { - request.addHeader(e.getKey(), e.getValue()); - } - - if (StringUtils.isNotBlank(body)) { - request.setEntity(new StringEntity(body, "utf-8")); - } - - return httpClient.execute(request); - } - - /** - * Post stream - * - * @param host - * @param path - * @param method - * @param headers - * @param querys - * @param body - * @return - * @throws Exception - */ - public static HttpResponse doPost(String host, String path, String method, - Map headers, - Map querys, - byte[] body) - throws Exception { - HttpClient httpClient = wrapClient(host); - - HttpPost request = new HttpPost(buildUrl(host, path, querys)); - for (Map.Entry e : headers.entrySet()) { - request.addHeader(e.getKey(), e.getValue()); - } - - if (body != null) { - request.setEntity(new ByteArrayEntity(body)); - } - - return httpClient.execute(request); - } - - /** - * Put String - * - * @param host - * @param path - * @param method - * @param headers - * @param querys - * @param body - * @return - * @throws Exception - */ - public static HttpResponse doPut(String host, String path, String method, - Map headers, - Map querys, - String body) - throws Exception { - HttpClient httpClient = wrapClient(host); - - HttpPut request = new HttpPut(buildUrl(host, path, querys)); - for (Map.Entry e : headers.entrySet()) { - request.addHeader(e.getKey(), e.getValue()); - } - - if (StringUtils.isNotBlank(body)) { - request.setEntity(new StringEntity(body, "utf-8")); - } - - return httpClient.execute(request); - } - - /** - * Put stream - * - * @param host - * @param path - * @param method - * @param headers - * @param querys - * @param body - * @return - * @throws Exception - */ - public static HttpResponse doPut(String host, String path, String method, - Map headers, - Map querys, - byte[] body) - throws Exception { - HttpClient httpClient = wrapClient(host); - - HttpPut request = new HttpPut(buildUrl(host, path, querys)); - for (Map.Entry e : headers.entrySet()) { - request.addHeader(e.getKey(), e.getValue()); - } - - if (body != null) { - request.setEntity(new ByteArrayEntity(body)); - } - - return httpClient.execute(request); - } - - /** - * Delete - * - * @param host - * @param path - * @param method - * @param headers - * @param querys - * @return - * @throws Exception - */ - public static HttpResponse doDelete(String host, String path, String method, - Map headers, - Map querys) - throws Exception { - HttpClient httpClient = wrapClient(host); - - HttpDelete request = new HttpDelete(buildUrl(host, path, querys)); - for (Map.Entry e : headers.entrySet()) { - request.addHeader(e.getKey(), e.getValue()); - } - - return httpClient.execute(request); - } - - private static String buildUrl(String host, String path, Map querys) throws UnsupportedEncodingException { - StringBuilder sbUrl = new StringBuilder(); - sbUrl.append(host); - if (!StringUtils.isBlank(path)) { - sbUrl.append(path); - } - if (null != querys) { - StringBuilder sbQuery = new StringBuilder(); - for (Map.Entry query : querys.entrySet()) { - if (0 < sbQuery.length()) { - sbQuery.append("&"); - } - if (StringUtils.isBlank(query.getKey()) && !StringUtils.isBlank(query.getValue())) { - sbQuery.append(query.getValue()); - } - if (!StringUtils.isBlank(query.getKey())) { - sbQuery.append(query.getKey()); - if (!StringUtils.isBlank(query.getValue())) { - sbQuery.append("="); - sbQuery.append(URLEncoder.encode(query.getValue(), "utf-8")); - } - } - } - if (0 < sbQuery.length()) { - sbUrl.append("?").append(sbQuery); - } - } - - return sbUrl.toString(); - } - - private static HttpClient wrapClient(String host) { - HttpClient httpClient = new DefaultHttpClient(); - if (host.startsWith("https://")) { - sslClient(httpClient); - } - - return httpClient; - } - - private static void sslClient(HttpClient httpClient) { - try { - SSLContext ctx = SSLContext.getInstance("TLS"); - X509TrustManager tm = new X509TrustManager() { - public X509Certificate[] getAcceptedIssuers() { - return null; - } - - public void checkClientTrusted(X509Certificate[] xcs, String str) { - - } - - public void checkServerTrusted(X509Certificate[] xcs, String str) { - - } - }; - ctx.init(null, new TrustManager[]{tm}, null); - SSLSocketFactory ssf = new SSLSocketFactory(ctx); - ssf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); - ClientConnectionManager ccm = httpClient.getConnectionManager(); - SchemeRegistry registry = ccm.getSchemeRegistry(); - registry.register(new Scheme("https", 443, ssf)); - } catch (KeyManagementException ex) { - throw new RuntimeException(ex); - } catch (NoSuchAlgorithmException ex) { - throw new RuntimeException(ex); - } - } -} \ No newline at end of file diff --git a/gulimall-third-party/src/main/resources/application.properties b/gulimall-third-party/src/main/resources/application.properties deleted file mode 100644 index 8b13789..0000000 --- a/gulimall-third-party/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ - diff --git a/gulimall-third-party/src/main/resources/application.yml b/gulimall-third-party/src/main/resources/application.yml deleted file mode 100644 index 5edc5eb..0000000 --- a/gulimall-third-party/src/main/resources/application.yml +++ /dev/null @@ -1,20 +0,0 @@ -server: - port: 25000 - -spring: - cloud: - nacos: - discovery: - server-addr: 127.0.0.1:8848 - alicloud: - sms: - host: https://aliapi.market.alicloudapi.com - path: /smsApi/verifyCode/send - templateId: 540 - appCode: 0995740d4ffe4f64bd63dcea04160b07 - application: - name: gulimall-third-party - - - - diff --git a/gulimall-third-party/src/main/resources/bootstrap.properties b/gulimall-third-party/src/main/resources/bootstrap.properties deleted file mode 100644 index a7d1f6b..0000000 --- a/gulimall-third-party/src/main/resources/bootstrap.properties +++ /dev/null @@ -1,10 +0,0 @@ -spring.application.name=gulimall-third-party -spring.cloud.nacos.config.server-addr=39.97.249.66:8848 -spring.cloud.nacos.config.namespace=f49416b3-252e-4ab9-96f5-d411ea2cf8b9 -#ļ -spring.cloud.nacos.config.ext-config[0].data-id=oss.yml -# ļڷ //Ĭ -spring.cloud.nacos.config.ext-config[0].group=DEFAULT_GROUP -#Ƿ̬ˢ -spring.cloud.nacos.config.ext-config[0].refresh=true - diff --git a/gulimall-third-party/src/test/java/com/forth/gulimall/thirdparty/GulimallThirdPartyApplicationTests.java b/gulimall-third-party/src/test/java/com/forth/gulimall/thirdparty/GulimallThirdPartyApplicationTests.java deleted file mode 100644 index dddebb1..0000000 --- a/gulimall-third-party/src/test/java/com/forth/gulimall/thirdparty/GulimallThirdPartyApplicationTests.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.forth.gulimall.thirdparty; - -import com.forth.gulimall.thirdparty.component.SmsComponent; -import com.forth.gulimall.thirdparty.utils.HttpUtils; -import org.apache.http.HttpResponse; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -@SpringBootTest -class GulimallThirdPartyApplicationTests { - - @Test - void contextLoads() { - String code = UUID.randomUUID().toString().substring(0, 5); - System.out.println(code); - } - - @Autowired - SmsComponent smsComponent; - - @Test - public void testSendCode() { - smsComponent.SendSmsCode("17634362804", "789456"); - } - - @Test - public void sendSms() { - String host = "https://aliapi.market.alicloudapi.com"; - String path = "/smsApi/verifyCode/send"; - String method = "POST"; - String appcode = "0995740d4ffe4f64bd63dcea04160b07"; - Map headers = new HashMap(); - //最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105 - headers.put("Authorization", "APPCODE " + appcode); - Map querys = new HashMap(); - querys.put("phone", "17634362804"); - querys.put("templateId", "540"); - querys.put("variables", "1234"); - Map bodys = new HashMap(); - - - try { - /** - * 重要提示如下: - * HttpUtils请从 - * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/src/main/java/com/aliyun/api/gateway/demo/util/HttpUtils.java - * 下载 - * - * 相应的依赖请参照 - * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/pom.xml - */ - HttpResponse response = HttpUtils.doPost(host, path, method, headers, querys, bodys); - System.out.println(response.toString()); - //获取response的body - //System.out.println(EntityUtils.toString(response.getEntity())); - } catch (Exception e) { - e.printStackTrace(); - } - } -} - diff --git a/gulimall-ware/pom.xml b/gulimall-ware/pom.xml index 8490084..a5c6da1 100644 --- a/gulimall-ware/pom.xml +++ b/gulimall-ware/pom.xml @@ -12,11 +12,11 @@ gulimall-ware 0.0.1-SNAPSHOT gulimall-ware - 谷粒商城-仓储服务 + 谷粒商城-存储服务 1.8 - Hoxton.SR8 + Hoxton.SR9 @@ -45,6 +45,10 @@ + + jakarta.validation + jakarta.validation-api + diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/GulimallWareApplication.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/GulimallWareApplication.java index ca897ad..10e7904 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/GulimallWareApplication.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/GulimallWareApplication.java @@ -4,7 +4,9 @@ import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; +@EnableFeignClients @EnableDiscoveryClient @MapperScan("com.forth.gulimall.ware.dao") @SpringBootApplication diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/PurchaseController.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/PurchaseController.java index 202eddd..d00cd08 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/PurchaseController.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/PurchaseController.java @@ -1,29 +1,26 @@ package com.forth.gulimall.ware.controller; -import java.util.Arrays; -import java.util.Map; - -//import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import com.forth.gulimall.ware.entity.PurchaseEntity; -import com.forth.gulimall.ware.service.PurchaseService; import com.forth.common.utils.PageUtils; import com.forth.common.utils.R; +import com.forth.gulimall.ware.entity.PurchaseEntity; +import com.forth.gulimall.ware.service.PurchaseService; +import com.forth.gulimall.ware.vo.MergeVo; +import com.forth.gulimall.ware.vo.PurchaseDoneVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Map; /** * 采购信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ @RestController @RequestMapping("ware/purchase") @@ -31,6 +28,52 @@ public class PurchaseController { @Autowired private PurchaseService purchaseService; + /** + * 完成采购单 + * /ware/purchase/done + */ + ///ware/purchase/done + @PostMapping("/done") + public R finish(@RequestBody PurchaseDoneVo doneVo){ + + purchaseService.done(doneVo); + + return R.ok(); + } + + /** + * 领取采购单 + * /ware/purchase/received + */ + @PostMapping("/received") + public R received(@RequestBody List ids){ + purchaseService.received(ids); + return R.ok(); + } + + /** + * 合并采购需求 + * /ware/purchase/merge + */ + @PostMapping("/merge") + public R merge(@RequestBody MergeVo mergeVo){ + purchaseService.mergePurchase(mergeVo); + return R.ok(); + } + /** + * 未领取采购单 + * /ware/purchase/unreceive/list + * @param params + * @return + */ + @RequestMapping("/unreceive/list") + //@RequiresPermissions("ware:purchase:list") + public R unreceivelist(@RequestParam Map params){ + PageUtils page = purchaseService.queryPageUnreceivePurchase(params); + + return R.ok().put("page", page); + } + /** * 列表 */ @@ -60,6 +103,9 @@ public class PurchaseController { @RequestMapping("/save") //@RequiresPermissions("ware:purchase:save") public R save(@RequestBody PurchaseEntity purchase){ + //给一个默认值 + purchase.setUpdateTime(new Date()); + purchase.setCreateTime(new Date()); purchaseService.save(purchase); return R.ok(); diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/PurchaseDetailController.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/PurchaseDetailController.java index e917beb..e9423e0 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/PurchaseDetailController.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/PurchaseDetailController.java @@ -1,29 +1,22 @@ package com.forth.gulimall.ware.controller; -import java.util.Arrays; -import java.util.Map; - -//import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import com.forth.gulimall.ware.entity.PurchaseDetailEntity; -import com.forth.gulimall.ware.service.PurchaseDetailService; import com.forth.common.utils.PageUtils; import com.forth.common.utils.R; +import com.forth.gulimall.ware.entity.PurchaseDetailEntity; +import com.forth.gulimall.ware.service.PurchaseDetailService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import java.util.Arrays; +import java.util.Map; /** * * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ @RestController @RequestMapping("ware/purchasedetail") diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/UndoLogController.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/UndoLogController.java index e52e05c..b5825eb 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/UndoLogController.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/UndoLogController.java @@ -1,29 +1,22 @@ package com.forth.gulimall.ware.controller; -import java.util.Arrays; -import java.util.Map; - -//import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import com.forth.gulimall.ware.entity.UndoLogEntity; -import com.forth.gulimall.ware.service.UndoLogService; import com.forth.common.utils.PageUtils; import com.forth.common.utils.R; +import com.forth.gulimall.ware.entity.UndoLogEntity; +import com.forth.gulimall.ware.service.UndoLogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import java.util.Arrays; +import java.util.Map; /** * * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ @RestController @RequestMapping("ware/undolog") diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/WareInfoController.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/WareInfoController.java index b12dbbd..7d50a8b 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/WareInfoController.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/WareInfoController.java @@ -1,27 +1,22 @@ package com.forth.gulimall.ware.controller; -import java.math.BigDecimal; -import java.util.Arrays; -import java.util.Map; - -//import org.apache.shiro.authz.annotation.RequiresPermissions; -import com.forth.gulimall.ware.vo.FareVo; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import com.forth.gulimall.ware.entity.WareInfoEntity; -import com.forth.gulimall.ware.service.WareInfoService; import com.forth.common.utils.PageUtils; import com.forth.common.utils.R; +import com.forth.gulimall.ware.entity.WareInfoEntity; +import com.forth.gulimall.ware.service.WareInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import java.util.Arrays; +import java.util.Map; /** * 仓库信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ @RestController @RequestMapping("ware/wareinfo") @@ -29,13 +24,6 @@ public class WareInfoController { @Autowired private WareInfoService wareInfoService; - - @GetMapping("/fare") - public R getFare(@RequestParam("addrId") Long addrId){ - FareVo fare = wareInfoService.getFare(addrId); - - return R.ok().setData(fare); - } /** * 列表 */ diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/WareOrderTaskController.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/WareOrderTaskController.java index 90614a1..bef3bca 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/WareOrderTaskController.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/WareOrderTaskController.java @@ -1,29 +1,22 @@ package com.forth.gulimall.ware.controller; -import java.util.Arrays; -import java.util.Map; - -//import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import com.forth.gulimall.ware.entity.WareOrderTaskEntity; -import com.forth.gulimall.ware.service.WareOrderTaskService; import com.forth.common.utils.PageUtils; import com.forth.common.utils.R; +import com.forth.gulimall.ware.entity.WareOrderTaskEntity; +import com.forth.gulimall.ware.service.WareOrderTaskService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import java.util.Arrays; +import java.util.Map; /** * 库存工作单 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ @RestController @RequestMapping("ware/wareordertask") diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/WareOrderTaskDetailController.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/WareOrderTaskDetailController.java index e9271df..289229c 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/WareOrderTaskDetailController.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/WareOrderTaskDetailController.java @@ -1,29 +1,22 @@ package com.forth.gulimall.ware.controller; -import java.util.Arrays; -import java.util.Map; - -//import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import com.forth.gulimall.ware.entity.WareOrderTaskDetailEntity; -import com.forth.gulimall.ware.service.WareOrderTaskDetailService; import com.forth.common.utils.PageUtils; import com.forth.common.utils.R; +import com.forth.gulimall.ware.entity.WareOrderTaskDetailEntity; +import com.forth.gulimall.ware.service.WareOrderTaskDetailService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import java.util.Arrays; +import java.util.Map; /** * 库存工作单 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ @RestController @RequestMapping("ware/wareordertaskdetail") diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/WareSkuController.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/WareSkuController.java index aac1d7c..bdf667e 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/WareSkuController.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/controller/WareSkuController.java @@ -1,30 +1,22 @@ package com.forth.gulimall.ware.controller; -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -//import org.apache.shiro.authz.annotation.RequiresPermissions; -import com.forth.common.exception.BizCodeEnume; -import com.forth.common.exception.NoStockException; -import com.forth.gulimall.ware.vo.SkuHasStockVo; -import com.forth.gulimall.ware.vo.WareSkuLockVo; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import com.forth.gulimall.ware.entity.WareSkuEntity; -import com.forth.gulimall.ware.service.WareSkuService; import com.forth.common.utils.PageUtils; import com.forth.common.utils.R; +import com.forth.gulimall.ware.entity.WareSkuEntity; +import com.forth.gulimall.ware.service.WareSkuService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import java.util.Arrays; +import java.util.Map; /** * 商品库存 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:04 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ @RestController @RequestMapping("ware/waresku") @@ -32,28 +24,6 @@ public class WareSkuController { @Autowired private WareSkuService wareSkuService; - @PostMapping("/lock/order") - public R orderLockStock(@RequestBody WareSkuLockVo vo) { - try { - Boolean stock = wareSkuService.orderLockStock(vo); - System.out.println("是否****?"+stock); - return R.ok(); - } catch (NoStockException e){ - return R.error(BizCodeEnume.NO_STOCK_EXCEPTION.getCode(),BizCodeEnume.NO_STOCK_EXCEPTION.getMsg()); - } - } - - //查询sku是否有库存 - @PostMapping("/hasstock") - public R getSkuHasStock(@RequestBody List skuIds){ - - List vos = wareSkuService.getSkuHasStock(skuIds); - - return R.ok().setData(vos); - } - - - /** * 列表 */ diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/PurchaseDao.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/PurchaseDao.java index 5875cb9..7b9729c 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/PurchaseDao.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/PurchaseDao.java @@ -1,15 +1,15 @@ package com.forth.gulimall.ware.dao; -import com.forth.gulimall.ware.entity.PurchaseEntity; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.forth.gulimall.ware.entity.PurchaseEntity; import org.apache.ibatis.annotations.Mapper; /** * 采购信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ @Mapper public interface PurchaseDao extends BaseMapper { diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/PurchaseDetailDao.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/PurchaseDetailDao.java index 062d5d5..3297af4 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/PurchaseDetailDao.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/PurchaseDetailDao.java @@ -1,15 +1,15 @@ package com.forth.gulimall.ware.dao; -import com.forth.gulimall.ware.entity.PurchaseDetailEntity; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.forth.gulimall.ware.entity.PurchaseDetailEntity; import org.apache.ibatis.annotations.Mapper; /** * * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ @Mapper public interface PurchaseDetailDao extends BaseMapper { diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/UndoLogDao.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/UndoLogDao.java index 5cac502..f010121 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/UndoLogDao.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/UndoLogDao.java @@ -1,15 +1,15 @@ package com.forth.gulimall.ware.dao; -import com.forth.gulimall.ware.entity.UndoLogEntity; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.forth.gulimall.ware.entity.UndoLogEntity; import org.apache.ibatis.annotations.Mapper; /** * * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ @Mapper public interface UndoLogDao extends BaseMapper { diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/WareInfoDao.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/WareInfoDao.java index db85603..66f4eb8 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/WareInfoDao.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/WareInfoDao.java @@ -1,15 +1,15 @@ package com.forth.gulimall.ware.dao; -import com.forth.gulimall.ware.entity.WareInfoEntity; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.forth.gulimall.ware.entity.WareInfoEntity; import org.apache.ibatis.annotations.Mapper; /** * 仓库信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ @Mapper public interface WareInfoDao extends BaseMapper { diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/WareOrderTaskDao.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/WareOrderTaskDao.java index f36187e..ce5bf27 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/WareOrderTaskDao.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/WareOrderTaskDao.java @@ -1,15 +1,15 @@ package com.forth.gulimall.ware.dao; -import com.forth.gulimall.ware.entity.WareOrderTaskEntity; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.forth.gulimall.ware.entity.WareOrderTaskEntity; import org.apache.ibatis.annotations.Mapper; /** * 库存工作单 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ @Mapper public interface WareOrderTaskDao extends BaseMapper { diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/WareOrderTaskDetailDao.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/WareOrderTaskDetailDao.java index 4ce2c88..1e879dc 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/WareOrderTaskDetailDao.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/WareOrderTaskDetailDao.java @@ -1,15 +1,15 @@ package com.forth.gulimall.ware.dao; -import com.forth.gulimall.ware.entity.WareOrderTaskDetailEntity; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.forth.gulimall.ware.entity.WareOrderTaskDetailEntity; import org.apache.ibatis.annotations.Mapper; /** * 库存工作单 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ @Mapper public interface WareOrderTaskDetailDao extends BaseMapper { diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/WareSkuDao.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/WareSkuDao.java index 02ff129..df8200c 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/WareSkuDao.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/dao/WareSkuDao.java @@ -1,26 +1,19 @@ package com.forth.gulimall.ware.dao; -import com.forth.gulimall.ware.entity.WareSkuEntity; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.forth.gulimall.ware.entity.WareSkuEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import java.util.List; /** * 商品库存 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:04 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ - @Mapper public interface WareSkuDao extends BaseMapper { - Long getSkuStock(Long skuId); - - List listWareHasSkuStock(@Param("skuId")Long skuId); - - Long lockSkuStock(@Param("skuId") Long skuId,@Param("wareId") Long wareId,@Param("num") Integer num); + void addStock(@Param("skuId") Long skuId, @Param("wareId")Long wareId, @Param("skuNum")Integer skuNum); } - diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/PurchaseDetailEntity.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/PurchaseDetailEntity.java index e338274..edd0973 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/PurchaseDetailEntity.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/PurchaseDetailEntity.java @@ -2,18 +2,17 @@ package com.forth.gulimall.ware.entity; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; -import java.math.BigDecimal; import java.io.Serializable; -import java.util.Date; -import lombok.Data; +import java.math.BigDecimal; /** * * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ @Data @TableName("wms_purchase_detail") diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/PurchaseEntity.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/PurchaseEntity.java index b85574d..5acfad6 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/PurchaseEntity.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/PurchaseEntity.java @@ -2,18 +2,18 @@ package com.forth.gulimall.ware.entity; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; -import java.math.BigDecimal; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; -import lombok.Data; /** * 采购信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ @Data @TableName("wms_purchase") diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/UndoLogEntity.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/UndoLogEntity.java index 1cc82ef..54e4607 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/UndoLogEntity.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/UndoLogEntity.java @@ -2,17 +2,17 @@ package com.forth.gulimall.ware.entity; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; import java.io.Serializable; import java.util.Date; -import lombok.Data; /** * * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ @Data @TableName("undo_log") @@ -39,7 +39,7 @@ public class UndoLogEntity implements Serializable { /** * Longblob */ - private Byte[] rollbackInfo; + private byte[] rollbackInfo; /** * */ diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/WareInfoEntity.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/WareInfoEntity.java index 5b40eae..330fd03 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/WareInfoEntity.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/WareInfoEntity.java @@ -2,17 +2,16 @@ package com.forth.gulimall.ware.entity; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; import java.io.Serializable; -import java.util.Date; -import lombok.Data; /** * 仓库信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ @Data @TableName("wms_ware_info") diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/WareOrderTaskDetailEntity.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/WareOrderTaskDetailEntity.java index f0a3905..9bf08b7 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/WareOrderTaskDetailEntity.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/WareOrderTaskDetailEntity.java @@ -2,17 +2,16 @@ package com.forth.gulimall.ware.entity; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; import java.io.Serializable; -import java.util.Date; -import lombok.Data; /** * 库存工作单 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ @Data @TableName("wms_ware_order_task_detail") diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/WareOrderTaskEntity.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/WareOrderTaskEntity.java index 691d3eb..06ac815 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/WareOrderTaskEntity.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/WareOrderTaskEntity.java @@ -2,17 +2,17 @@ package com.forth.gulimall.ware.entity; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; import java.io.Serializable; import java.util.Date; -import lombok.Data; /** * 库存工作单 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ @Data @TableName("wms_ware_order_task") diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/WareSkuEntity.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/WareSkuEntity.java index a3122d5..38d4f17 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/WareSkuEntity.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/entity/WareSkuEntity.java @@ -2,17 +2,16 @@ package com.forth.gulimall.ware.entity; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; import java.io.Serializable; -import java.util.Date; -import lombok.Data; /** * 商品库存 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:04 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ @Data @TableName("wms_ware_sku") diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/feign/MemberFeignService.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/feign/MemberFeignService.java deleted file mode 100644 index f5efbdf..0000000 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/feign/MemberFeignService.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.forth.gulimall.ware.feign; - -import com.forth.common.utils.R; -import org.springframework.cloud.openfeign.FeignClient; - -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -@FeignClient("ware") -public interface MemberFeignService { - @RequestMapping("/member/memberreceiveaddress/info/{id}") - R info(@PathVariable("id") Long id); -} - diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/PurchaseDetailService.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/PurchaseDetailService.java index 6931554..3162b98 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/PurchaseDetailService.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/PurchaseDetailService.java @@ -4,17 +4,20 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.forth.common.utils.PageUtils; import com.forth.gulimall.ware.entity.PurchaseDetailEntity; +import java.util.List; import java.util.Map; /** * * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ public interface PurchaseDetailService extends IService { PageUtils queryPage(Map params); + + List listDetailByPurchaseId(Long id); } diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/PurchaseService.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/PurchaseService.java index cfff641..788f434 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/PurchaseService.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/PurchaseService.java @@ -3,18 +3,29 @@ package com.forth.gulimall.ware.service; import com.baomidou.mybatisplus.extension.service.IService; import com.forth.common.utils.PageUtils; import com.forth.gulimall.ware.entity.PurchaseEntity; +import com.forth.gulimall.ware.vo.MergeVo; +import com.forth.gulimall.ware.vo.PurchaseDoneVo; +import java.util.List; import java.util.Map; /** * 采购信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ public interface PurchaseService extends IService { PageUtils queryPage(Map params); + //未领取采购单 + PageUtils queryPageUnreceivePurchase(Map params); + //合并采购需求 + void mergePurchase(MergeVo mergeVo); + //领取采购单 + void received(List ids); + //完成采购单 + void done(PurchaseDoneVo doneVo); } diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/UndoLogService.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/UndoLogService.java index 6958c14..154f59a 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/UndoLogService.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/UndoLogService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ public interface UndoLogService extends IService { diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/WareInfoService.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/WareInfoService.java index 8732ae1..934fcd6 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/WareInfoService.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/WareInfoService.java @@ -3,28 +3,18 @@ package com.forth.gulimall.ware.service; import com.baomidou.mybatisplus.extension.service.IService; import com.forth.common.utils.PageUtils; import com.forth.gulimall.ware.entity.WareInfoEntity; -import com.forth.gulimall.ware.vo.FareVo; -import java.math.BigDecimal; import java.util.Map; /** * 仓库信息 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ public interface WareInfoService extends IService { PageUtils queryPage(Map params); - - /** - * 根据收货地址计算运费 - * @param addrId - * @return - */ - FareVo getFare(Long addrId); - } diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/WareOrderTaskDetailService.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/WareOrderTaskDetailService.java index e2d5913..5d57a0d 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/WareOrderTaskDetailService.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/WareOrderTaskDetailService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 库存工作单 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ public interface WareOrderTaskDetailService extends IService { diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/WareOrderTaskService.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/WareOrderTaskService.java index ad33ed3..b22e5d5 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/WareOrderTaskService.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/WareOrderTaskService.java @@ -9,9 +9,9 @@ import java.util.Map; /** * 库存工作单 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:05 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ public interface WareOrderTaskService extends IService { diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/WareSkuService.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/WareSkuService.java index 271b553..6d1f138 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/WareSkuService.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/WareSkuService.java @@ -3,25 +3,20 @@ package com.forth.gulimall.ware.service; import com.baomidou.mybatisplus.extension.service.IService; import com.forth.common.utils.PageUtils; import com.forth.gulimall.ware.entity.WareSkuEntity; -import com.forth.gulimall.ware.vo.SkuHasStockVo; -import com.forth.gulimall.ware.vo.WareSkuLockVo; -import java.util.List; import java.util.Map; /** * 商品库存 * - * @author fourth-miaowei - * @email 2608957980@qq.com - * @date 2020-11-12 09:55:04 + * @author chenang + * @email chenang@gmail.com + * @date 2020-11-11 21:16:45 */ public interface WareSkuService extends IService { PageUtils queryPage(Map params); - List getSkuHasStock(List skuIds); - - Boolean orderLockStock(WareSkuLockVo vo); + void addStock(Long skuId, Long wareId, Integer skuNum); } diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/PurchaseDetailServiceImpl.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/PurchaseDetailServiceImpl.java index 98450b2..73804c2 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/PurchaseDetailServiceImpl.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/PurchaseDetailServiceImpl.java @@ -1,29 +1,60 @@ package com.forth.gulimall.ware.service.impl; -import org.springframework.stereotype.Service; -import java.util.Map; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.forth.common.utils.PageUtils; import com.forth.common.utils.Query; - import com.forth.gulimall.ware.dao.PurchaseDetailDao; import com.forth.gulimall.ware.entity.PurchaseDetailEntity; import com.forth.gulimall.ware.service.PurchaseDetailService; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; +import java.util.List; +import java.util.Map; +//采购需求 @Service("purchaseDetailService") public class PurchaseDetailServiceImpl extends ServiceImpl implements PurchaseDetailService { @Override public PageUtils queryPage(Map params) { + /** + * status: 0//状态 + * wareId: 1//仓库id + */ + QueryWrapper queryWrapper = new QueryWrapper(); + //模糊检索 + String key = (String) params.get("key"); + if (!StringUtils.isEmpty(key)){ + //purchase_id sku_id + queryWrapper.and(w->{ + w.eq("purchase_id",key).or().eq("sku_id",key); + }); + } + String status = (String) params.get("status"); + if (!StringUtils.isEmpty(status)){ + //status + queryWrapper.eq("status",status); + } + String wareId = (String) params.get("wareId"); + if (!StringUtils.isEmpty(wareId)){ + //wareId 仓库id + queryWrapper. eq("wareId",wareId); + } IPage page = this.page( new Query().getPage(params), - new QueryWrapper() + queryWrapper ); return new PageUtils(page); } + @Override + public List listDetailByPurchaseId(Long id) { + List purchaseId = this.list(new QueryWrapper().eq("purchase_id", id)); + return purchaseId; + } + } \ No newline at end of file diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/PurchaseServiceImpl.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/PurchaseServiceImpl.java index 45b3424..6db9175 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/PurchaseServiceImpl.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/PurchaseServiceImpl.java @@ -1,21 +1,40 @@ package com.forth.gulimall.ware.service.impl; -import org.springframework.stereotype.Service; -import java.util.Map; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.forth.common.constant.WareConstant; import com.forth.common.utils.PageUtils; import com.forth.common.utils.Query; - import com.forth.gulimall.ware.dao.PurchaseDao; +import com.forth.gulimall.ware.entity.PurchaseDetailEntity; import com.forth.gulimall.ware.entity.PurchaseEntity; +import com.forth.gulimall.ware.service.PurchaseDetailService; import com.forth.gulimall.ware.service.PurchaseService; +import com.forth.gulimall.ware.service.WareSkuService; +import com.forth.gulimall.ware.vo.MergeVo; +import com.forth.gulimall.ware.vo.PurchaseDoneVo; +import com.forth.gulimall.ware.vo.PurchaseItemDoneVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; @Service("purchaseService") public class PurchaseServiceImpl extends ServiceImpl implements PurchaseService { + @Autowired + PurchaseDetailService detailService; + + @Autowired + WareSkuService wareSkuService; + @Override public PageUtils queryPage(Map params) { IPage page = this.page( @@ -26,4 +45,123 @@ public class PurchaseServiceImpl extends ServiceImpl params) { + IPage page = this.page( + new Query().getPage(params), + new QueryWrapper().eq("status",0) + .or().eq("status",1) + ); + + return new PageUtils(page); + } + + @Transactional + @Override + public void mergePurchase(MergeVo mergeVo) { + Long purchaseId = mergeVo.getPurchaseId(); + if(purchaseId == null){ + //1、新建一个 + PurchaseEntity purchaseEntity = new PurchaseEntity(); + //默认采购单的状态 + purchaseEntity.setStatus(0); + purchaseEntity.setCreateTime(new Date()); + purchaseEntity.setUpdateTime(new Date()); + this.save(purchaseEntity); + purchaseId = purchaseEntity.getId(); + } + //TODO 确认采购单状态是0,1才可以合并 + + List items = mergeVo.getItems(); + Long finalPurchaseId = purchaseId; + List collect = items.stream().map(i -> { + PurchaseDetailEntity detailEntity = new PurchaseDetailEntity(); + detailEntity.setId(i); + detailEntity.setPurchaseId(finalPurchaseId); + detailEntity.setStatus(WareConstant.PurchaseDetailStatusEnum.ASSIGNED.getCode()); + return detailEntity; + }).collect(Collectors.toList()); + + // 更新采购需求 + detailService.updateBatchById(collect); + // 更新采购单的时间字段 + PurchaseEntity purchaseEntity = new PurchaseEntity(); + purchaseEntity.setId(purchaseId); + purchaseEntity.setUpdateTime(new Date()); + this.updateById(purchaseEntity); + } + + @Override + public void received(List ids) { + //1、确认当前采购单是新建或者已分配状态 + List collect = ids.stream().map(id -> { + PurchaseEntity byId = this.getById(id); + return byId; + }).filter(item -> { + if (item.getStatus() == WareConstant.PurchaseStatusEnum.CREATED.getCode() || + item.getStatus() == WareConstant.PurchaseStatusEnum.ASSIGNED.getCode()){ + return true; + } + return false; + }).map(item->{ + //设置状态 + item.setStatus(WareConstant.PurchaseStatusEnum.RECEIVE.getCode()); + //修改时间 + item.setUpdateTime(new Date()); + return item; + }).collect(Collectors.toList()); + //2、改变采购单的状态 + //直接调用 + this.updateBatchById(collect); + //3、改变采购单项的状态 + collect.forEach((item)->{ + List entities = detailService.listDetailByPurchaseId(item.getId()); + //按照主键进行批量更新 + List detailEntities = entities.stream().map(entity -> { + //只更新状态 + PurchaseDetailEntity entity1 = new PurchaseDetailEntity(); + entity1.setId(entity.getId()); + entity1.setStatus(WareConstant.PurchaseDetailStatusEnum.BUYING.getCode()); + return entity1; + }).collect(Collectors.toList()); + detailService.updateBatchById(detailEntities); + }); + } + + @Transactional + @Override + public void done(PurchaseDoneVo doneVo) { + + Long id = doneVo.getId(); + //2、改变采购项的状态 + Boolean flag = true; + List items = doneVo.getItems(); + List updates = new ArrayList<>(); + for (PurchaseItemDoneVo item : items) { + PurchaseDetailEntity detailEntity = new PurchaseDetailEntity(); + if (item.getStatus() == WareConstant.PurchaseDetailStatusEnum.HASERROR.getCode()){ + flag = false; + detailEntity.setStatus(item.getStatus());//失败 + }else{ + detailEntity.setStatus(WareConstant.PurchaseDetailStatusEnum.FINISH.getCode());//成功 + //3、将成功采购的进行入库 + PurchaseDetailEntity entity = detailService.getById(item.getItemId()); + // 要把哪个商品 放到哪个仓库添加几个数量 + wareSkuService.addStock(entity.getSkuId(),entity.getWareId(),entity.getSkuNum()); + } + detailEntity.setId(item.getItemId()); + updates.add(detailEntity); + } + detailService.updateBatchById(updates); + + //1、改变采购单状态 + PurchaseEntity purchaseEntity = new PurchaseEntity(); + purchaseEntity.setId(id); + purchaseEntity.setStatus(flag?WareConstant.PurchaseStatusEnum.FINISH.getCode():WareConstant.PurchaseStatusEnum.HASERROR.getCode()); + purchaseEntity.setUpdateTime(new Date()); + this.updateById(purchaseEntity); + + + } } \ No newline at end of file diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/UndoLogServiceImpl.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/UndoLogServiceImpl.java index e688d7c..be25517 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/UndoLogServiceImpl.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/UndoLogServiceImpl.java @@ -1,16 +1,16 @@ package com.forth.gulimall.ware.service.impl; -import org.springframework.stereotype.Service; -import java.util.Map; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.forth.common.utils.PageUtils; import com.forth.common.utils.Query; - import com.forth.gulimall.ware.dao.UndoLogDao; import com.forth.gulimall.ware.entity.UndoLogEntity; import com.forth.gulimall.ware.service.UndoLogService; +import org.springframework.stereotype.Service; + +import java.util.Map; @Service("undoLogService") diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/WareInfoServiceImpl.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/WareInfoServiceImpl.java index 5240625..fd04cb9 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/WareInfoServiceImpl.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/WareInfoServiceImpl.java @@ -1,60 +1,40 @@ package com.forth.gulimall.ware.service.impl; -import com.forth.gulimall.ware.feign.MemberFeignService; -import com.forth.gulimall.ware.vo.FareVo; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Map; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.forth.common.utils.PageUtils; import com.forth.common.utils.Query; - import com.forth.gulimall.ware.dao.WareInfoDao; import com.forth.gulimall.ware.entity.WareInfoEntity; import com.forth.gulimall.ware.service.WareInfoService; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.util.Map; @Service("wareInfoService") public class WareInfoServiceImpl extends ServiceImpl implements WareInfoService { -// @Autowired -// MemberFeignService memberFeignService; - @Override public PageUtils queryPage(Map params) { + + QueryWrapper wareInfoEntityQueryWrapper = new QueryWrapper(); + //模糊检索 + String key = (String) params.get("key"); + if (!StringUtils.isEmpty(key)){ + wareInfoEntityQueryWrapper.eq("id",key).or() + .like("name",key) + .or().like("address",key) + .or().like("areacode",key); + } IPage page = this.page( new Query().getPage(params), - new QueryWrapper() + wareInfoEntityQueryWrapper ); return new PageUtils(page); } - @Override - public FareVo getFare(Long addrId) { - FareVo fareVo =new FareVo(); - if (addrId != null) { - System.out.println("------->>>" + addrId); - //R r = memberFeignService.info(addrId); - // MemberAddressVo data = r.getData("memberReceiveAddress", new TypeReference() { - // }); -// if (data != null) { -// String phone = data.getPhone(); -// String substring = phone.substring(phone.length() - 1, phone.length()); -// BigDecimal bigDecimal = new BigDecimal(substring); -// fareVo.setAddress(data); -// fareVo.setFare(bigDecimal); -// -// return fareVo; -// } - } - - - return null; - } - } \ No newline at end of file diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/WareOrderTaskDetailServiceImpl.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/WareOrderTaskDetailServiceImpl.java index d638f49..627e265 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/WareOrderTaskDetailServiceImpl.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/WareOrderTaskDetailServiceImpl.java @@ -1,16 +1,16 @@ package com.forth.gulimall.ware.service.impl; -import org.springframework.stereotype.Service; -import java.util.Map; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.forth.common.utils.PageUtils; import com.forth.common.utils.Query; - import com.forth.gulimall.ware.dao.WareOrderTaskDetailDao; import com.forth.gulimall.ware.entity.WareOrderTaskDetailEntity; import com.forth.gulimall.ware.service.WareOrderTaskDetailService; +import org.springframework.stereotype.Service; + +import java.util.Map; @Service("wareOrderTaskDetailService") diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/WareOrderTaskServiceImpl.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/WareOrderTaskServiceImpl.java index b50a8f3..bd11085 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/WareOrderTaskServiceImpl.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/WareOrderTaskServiceImpl.java @@ -1,16 +1,16 @@ package com.forth.gulimall.ware.service.impl; -import org.springframework.stereotype.Service; -import java.util.Map; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.forth.common.utils.PageUtils; import com.forth.common.utils.Query; - import com.forth.gulimall.ware.dao.WareOrderTaskDao; import com.forth.gulimall.ware.entity.WareOrderTaskEntity; import com.forth.gulimall.ware.service.WareOrderTaskService; +import org.springframework.stereotype.Service; + +import java.util.Map; @Service("wareOrderTaskService") diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/WareSkuServiceImpl.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/WareSkuServiceImpl.java index d8ba7a8..02c5065 100644 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/WareSkuServiceImpl.java +++ b/gulimall-ware/src/main/java/com/forth/gulimall/ware/service/impl/WareSkuServiceImpl.java @@ -1,119 +1,84 @@ package com.forth.gulimall.ware.service.impl; -import com.forth.common.exception.NoStockException; -import com.forth.gulimall.ware.vo.OrderItemVo; -import com.forth.gulimall.ware.vo.SkuHasStockVo; -import com.forth.gulimall.ware.vo.WareSkuLockVo; -import lombok.Data; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.forth.common.utils.PageUtils; import com.forth.common.utils.Query; - +import com.forth.common.utils.R; import com.forth.gulimall.ware.dao.WareSkuDao; import com.forth.gulimall.ware.entity.WareSkuEntity; +import com.forth.gulimall.ware.feign.ProductFeignService; import com.forth.gulimall.ware.service.WareSkuService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.StringUtils; + +import java.util.List; +import java.util.Map; @Service("wareSkuService") public class WareSkuServiceImpl extends ServiceImpl implements WareSkuService { + @Autowired - private WareSkuDao wareSkuDao; + WareSkuDao wareSkuDao; + @Autowired(required = false) + ProductFeignService productFeignService; @Override public PageUtils queryPage(Map params) { + /** + * skuId: 1 + * wareId: 2 + */ + QueryWrapper queryWrapper = new QueryWrapper<>(); + String skuId = (String) params.get("skuId"); + if (!StringUtils.isEmpty(skuId)) { + queryWrapper.eq("sku_id", skuId); + } + //仓库id + String wareId = (String) params.get("wareId"); + if (!StringUtils.isEmpty(wareId)) { + queryWrapper.eq("ware_id", wareId); + } IPage page = this.page( new Query().getPage(params), - new QueryWrapper() + queryWrapper ); return new PageUtils(page); } - @Override - public List getSkuHasStock(List skuIds) { - List collect = skuIds.stream().map(skuId -> { - SkuHasStockVo vo = new SkuHasStockVo(); - - //查询当前sku的总库存量 - //select sum(stock-stock_locked) from wms_ware_sku where sku_id = 1 - Long count = baseMapper.getSkuStock(skuId); - - vo.setSkuId(skuId); - vo.setHasStock(count == null ? false : count > 0); - return vo; - }).collect(Collectors.toList()); - return collect; - - } - - /**(rollbackFor = NoStockException.class) - * 锁定库存 - * @param vo - * @return - */ @Transactional @Override - public Boolean orderLockStock(WareSkuLockVo vo) { - SkuWareHasStock stock = new SkuWareHasStock(); - List locks = vo.getLocks(); - List collect = locks.stream().map(item -> { - long skuId = item.getSkuId(); - List wareIds = wareSkuDao.listWareHasSkuStock(skuId); - stock.setSkuId(skuId); - stock.setWareId(wareIds); - stock.setNum(item.getCount()); - return stock; - }).collect(Collectors.toList()); - //锁定库存 - Boolean allLock=true; - //2.锁定库存 - for(SkuWareHasStock hasStock:collect){ - Boolean skuStocked=true; - Long skuId=hasStock.getSkuId(); - List wareIds = hasStock.getWareId(); - - if(wareIds==null||wareIds.size()==0){ - //没有仓库有库存 - throw new NoStockException(skuId); - } - for(Long wareId:wareIds){ - System.out.println("skuId+++++++"+skuId); - System.out.println("wareId+++++++"+wareId); - System.out.println("hasStock.getNum()+++++++"+hasStock.getNum()); - //成功返回1,失败0 - Long count= wareSkuDao.lockSkuStock(skuId,wareId,hasStock.getNum()); - System.out.println("Count++++"+count); - if(count==1){ - skuStocked=true; - break; - }else { - + public void addStock(Long skuId, Long wareId, Integer skuNum) { + //1、判断如果还没有这个库存记录就新增,如果有了就更新 + List entities = wareSkuDao.selectList(new QueryWrapper().eq("sku_id", skuId).eq("ware_id", wareId)); + if (entities == null || entities.size() == 0) { + WareSkuEntity skuEntity = new WareSkuEntity(); + skuEntity.setSkuId(skuId); + skuEntity.setStock(skuNum); + skuEntity.setWareId(wareId); + skuEntity.setStockLocked(0); + //TODO远程查询sku的名字,如果失败,整个事务无需回滚 + //1、自己catch异常 + //TODO还可以用什么办法让异常出现以后不回滚?高级 + try { + R info = productFeignService.info(skuId); + Map data = (Map) info.get("skuInfo"); + + if (info.getCode() == 0) { + skuEntity.setSkuName((String) data.get("skuName")); } + } catch (Exception e) { + //如果有异常不用管,继续往下执行 } - if(skuStocked==false){ - //都没锁 - throw new NoStockException(skuId); - - } + wareSkuDao.insert(skuEntity); + } else { + wareSkuDao.addStock(skuId, wareId, skuNum); } - - return true; - } - @Data - class SkuWareHasStock{ - private Long skuId; - private Integer num; - private List wareId; } -} +} \ No newline at end of file diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/FareVo.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/FareVo.java deleted file mode 100644 index 8cd4961..0000000 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/FareVo.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.forth.gulimall.ware.vo; - -import lombok.Data; - -import java.math.BigDecimal; -@Data -public class FareVo { - private MemberAddressVo address; - private BigDecimal fare; -} diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/LockStockResult.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/LockStockResult.java deleted file mode 100644 index c200ccb..0000000 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/LockStockResult.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.forth.gulimall.ware.vo; - -import lombok.Data; - -@Data -public class LockStockResult { -private Long skuId; -private Integer num; -private Boolean locked; - -} diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/MemberAddressVo.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/MemberAddressVo.java deleted file mode 100644 index 889c7c0..0000000 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/MemberAddressVo.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.forth.gulimall.ware.vo; - -import lombok.Data; - -@Data -public class MemberAddressVo { - private Long id; - /** - * member_id - */ - private Long memberId; - /** - * 收货人姓名 - */ - private String name; - /** - * 电话 - */ - private String phone; - /** - * 邮政编码 - */ - private String postCode; - /** - * 省份/直辖市 - */ - private String province; - /** - * 城市 - */ - private String city; - /** - * 区 - */ - private String region; - /** - * 详细地址(街道) - */ - private String detailAddress; - /** - * 省市区代码 - */ - private String areacode; - /** - * 是否默认 - */ - private Integer defaultStatus; -} diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/OrderItemVo.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/OrderItemVo.java deleted file mode 100644 index 2d5248a..0000000 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/OrderItemVo.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.forth.gulimall.ware.vo; - -import lombok.Data; - -import java.math.BigDecimal; -import java.util.List; - -@Data -public class OrderItemVo { - - - private long skuId; - private String title; - private String image; - private List skuAttr; - private BigDecimal price; - private Integer count; - private BigDecimal totalPrice; - // private boolean hasStock; - private BigDecimal weight; - -} diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/SkuHasStockVo.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/SkuHasStockVo.java deleted file mode 100644 index c62dffa..0000000 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/SkuHasStockVo.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.forth.gulimall.ware.vo; - -import lombok.Data; - -@Data -public class SkuHasStockVo { - private Long skuId; - private Boolean hasStock; -} diff --git a/gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/WareSkuLockVo.java b/gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/WareSkuLockVo.java deleted file mode 100644 index ad5b09a..0000000 --- a/gulimall-ware/src/main/java/com/forth/gulimall/ware/vo/WareSkuLockVo.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.forth.gulimall.ware.vo; - -import lombok.Data; - -import java.util.List; - -@Data -public class WareSkuLockVo { - private String orderSn; - private List locks;//需要锁住的库存信息 -} diff --git a/gulimall-ware/src/main/resources/application.yml b/gulimall-ware/src/main/resources/application.yml index 2a99b0d..ec3a34b 100644 --- a/gulimall-ware/src/main/resources/application.yml +++ b/gulimall-ware/src/main/resources/application.yml @@ -5,17 +5,25 @@ spring: username: root password: root url: jdbc:mysql://39.97.249.66:3306/gulimall_wms - driver-class-name: com.mysql.cj.jdbc.Driver + driver-class-name: com.mysql.jdbc.Driver cloud: nacos: discovery: server-addr: 127.0.0.1:8848 application: - name: ware + name: gulimall-ware + + jackson: + date-format: yyyy-MM-dd HH:mm-ss + + + mybatis-plus: mapper-locations: classpath:/mapper/**/*.xml global-config: db-config: - id-type: auto - + id-type: AUTO +logging: + level: + com.atguigu: debug \ No newline at end of file diff --git a/gulimall-ware/src/main/resources/bootstrap.properties b/gulimall-ware/src/main/resources/bootstrap.properties deleted file mode 100644 index e8a980a..0000000 --- a/gulimall-ware/src/main/resources/bootstrap.properties +++ /dev/null @@ -1,7 +0,0 @@ -spring.application.name=ware -spring.cloud.nacos.config.server-addr=39.97.249.66:8848 -spring.cloud.nacos.config.namespace=7ed877f2-914f-4d63-b035-424368efb2c0 - -spring.cloud.nacos.config.ext-config[0].data-id=ware.yml -spring.cloud.nacos.config.ext-config[0].group=DEFAULT_GROUP -spring.cloud.nacos.config.ext-config[0].refresh=true diff --git a/gulimall-ware/src/main/resources/mapper/ware/WareSkuDao.xml b/gulimall-ware/src/main/resources/mapper/ware/WareSkuDao.xml index 3e02d85..e8a88cc 100644 --- a/gulimall-ware/src/main/resources/mapper/ware/WareSkuDao.xml +++ b/gulimall-ware/src/main/resources/mapper/ware/WareSkuDao.xml @@ -12,14 +12,7 @@ - - - - UPDATE `wms_ware_sku` set stock_locked=stock_locked+#{num} - where sku_id=#{skuId} and ware_id=#{wareId} and stock-stock_locked>=#{num} + + UPDATE `wms_ware_sku` SET stock=stock+#{skuNum} WHERE sku_id=#{skuId} AND ware_id=#{wareId} \ No newline at end of file diff --git a/gulimall-ware/src/test/java/com/forth/gulimall/ware/GulimallWareApplicationTests.java b/gulimall-ware/src/test/java/com/forth/gulimall/ware/GulimallWareApplicationTests.java index ded3acd..7eb6eb7 100644 --- a/gulimall-ware/src/test/java/com/forth/gulimall/ware/GulimallWareApplicationTests.java +++ b/gulimall-ware/src/test/java/com/forth/gulimall/ware/GulimallWareApplicationTests.java @@ -1,23 +1,13 @@ package com.forth.gulimall.ware; -import com.forth.gulimall.ware.entity.WareInfoEntity; -import com.forth.gulimall.ware.service.WareInfoService; import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class GulimallWareApplicationTests { - @Autowired - WareInfoService wareInfoService; - @Test void contextLoads() { - WareInfoEntity wareInfoEntity = new WareInfoEntity(); - wareInfoEntity.setName("测试"); - wareInfoService.save(wareInfoEntity); - System.out.println("success"); } } diff --git a/pom.xml b/pom.xml index 560fd6d..e162695 100644 --- a/pom.xml +++ b/pom.xml @@ -24,10 +24,7 @@ renren-fast renren-generator gulimall-common - gulimall-gateway - gulimall-auth-server - gulimall-third-party - gulimall-cart + gulimall-seckill diff --git a/renren-fast/pom.xml b/renren-fast/pom.xml index 336d8ca..b5671f4 100644 --- a/renren-fast/pom.xml +++ b/renren-fast/pom.xml @@ -51,12 +51,16 @@ + + com.google.code.gson + gson + 2.8.5 + com.forth.gulimall gulimall-common 0.0.1-SNAPSHOT - org.springframework.boot spring-boot-starter-test diff --git a/renren-fast/src/main/resources/application.yml b/renren-fast/src/main/resources/application.yml index 98b588d..393fa43 100644 --- a/renren-fast/src/main/resources/application.yml +++ b/renren-fast/src/main/resources/application.yml @@ -42,7 +42,7 @@ spring: cloud: nacos: discovery: - server-addr: 39.97.249.66:8848 + server-addr: 127.0.0.1:8848 # resources: # add-mappings: false @@ -79,4 +79,4 @@ renren: secret: f4e2e52034348f86b67cde581c0f9eb5[www.renren.io] # token有效时长,7天,单位秒 expire: 604800 - header: token \ No newline at end of file + header: token diff --git a/renren-generator/src/main/resources/application.yml b/renren-generator/src/main/resources/application.yml index 6e01f4a..2514971 100644 --- a/renren-generator/src/main/resources/application.yml +++ b/renren-generator/src/main/resources/application.yml @@ -7,7 +7,7 @@ spring: type: com.alibaba.druid.pool.DruidDataSource #MySQL配置 driverClassName: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://39.97.249.66:3306/gulimall_sms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai + url: jdbc:mysql://39.97.249.66:3306/gulimall_wms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai username: root password: root #oracle配置 diff --git a/renren-generator/src/main/resources/generator.properties b/renren-generator/src/main/resources/generator.properties index 5fcc1ae..755afbc 100644 --- a/renren-generator/src/main/resources/generator.properties +++ b/renren-generator/src/main/resources/generator.properties @@ -1,17 +1,17 @@ #\u4EE3\u7801\u751F\u6210\u5668\uFF0C\u914D\u7F6E\u4FE1\u606F mainPath=com.forth -#\u5305\u540D +# package=com.forth.gulimall -moduleName=coupon -#\u4F5C\u8005 -author=fourth-miaowei +moduleName=ware +# +author=chenang #Email -email=2608957980@qq.com -#\u8868\u524D\u7F00(\u7C7B\u540D\u4E0D\u4F1A\u5305\u542B\u8868\u524D\u7F00) -tablePrefix=sms_ +email=chenang@gmail.com +#ǰ׺ +tablePrefix=wms_ -#\u7C7B\u578B\u8F6C\u6362\uFF0C\u914D\u7F6E\u4FE1\u606F +#תϢ tinyint=Integer smallint=Integer mediumint=Integer -- Gitee