diff --git a/归档/promotion-service-project/pom.xml b/归档/promotion-service-project/pom.xml deleted file mode 100644 index 7d36ed95e..000000000 --- a/归档/promotion-service-project/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - onemall - cn.iocoder.mall - 1.0-SNAPSHOT - - 4.0.0 - - promotion-service-project - pom - - promotion-service-api - promotion-service-app - - - - - - - cn.iocoder.mall - mall-dependencies - 1.0-SNAPSHOT - pom - import - - - - cn.iocoder.mall - common-framework - 1.0-SNAPSHOT - - - - - cn.iocoder.mall - promotion-service-api - 1.0-SNAPSHOT - - - - \ No newline at end of file diff --git a/归档/promotion-service-project/promotion-service-api/pom.xml b/归档/promotion-service-project/promotion-service-api/pom.xml deleted file mode 100644 index 404f45568..000000000 --- a/归档/promotion-service-project/promotion-service-api/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - promotion-service-project - cn.iocoder.mall - 1.0-SNAPSHOT - - 4.0.0 - - promotion-service-api - - - - - cn.iocoder.mall - common-framework - 1.0-SNAPSHOT - - - - - org.mapstruct - mapstruct - - - org.mapstruct - mapstruct-jdk8 - - - - org.projectlombok - lombok - - - - javax.validation - validation-api - - - - org.hibernate - hibernate-validator - true - - - org.springframework.cloud - spring-cloud-openfeign-core - RELEASE - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - - diff --git a/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/enums/coupon/card/CouponCardTakeTypeEnum.java b/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/enums/coupon/card/CouponCardTakeTypeEnum.java deleted file mode 100644 index d254af4b5..000000000 --- a/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/enums/coupon/card/CouponCardTakeTypeEnum.java +++ /dev/null @@ -1,44 +0,0 @@ -package cn.iocoder.mall.promotion.api.enums.coupon.card; - -import cn.iocoder.common.framework.core.IntArrayValuable; - -import java.util.Arrays; - -/** - * 优惠劵领取方式 - */ -public enum CouponCardTakeTypeEnum implements IntArrayValuable { - - BY_USER(1, "用户主动领取"), - BY_ADMIN(2, "已使用"), - ; - - public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CouponCardTakeTypeEnum::getValue).toArray(); - - /** - * 值 - */ - private final Integer value; - /** - * 名字 - */ - private final String name; - - CouponCardTakeTypeEnum(Integer value, String name) { - this.value = value; - this.name = name; - } - - public Integer getValue() { - return value; - } - - public String getName() { - return name; - } - - @Override - public int[] array() { - return ARRAYS; - } -} diff --git a/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/coupon/CouponTemplateFeign.java b/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/coupon/CouponTemplateFeign.java deleted file mode 100644 index 50a4955a9..000000000 --- a/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/coupon/CouponTemplateFeign.java +++ /dev/null @@ -1,39 +0,0 @@ -package cn.iocoder.mall.promotion.api.rpc.coupon; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.promotion.api.rpc.coupon.dto.template.*; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestParam; - -/** - * Title: - * Description: - * - * @author zhuyang - * @version 1.0 2021/10/9 - */ -@FeignClient("promotion-service") -public interface CouponTemplateFeign { - // ========== 通用逻辑 ========= - - @GetMapping("/coupon/template/getCouponTemplate") - public CommonResult getCouponTemplate(@RequestParam("couponTemplateId") Integer couponTemplateId); - - @PostMapping("/coupon/template/pageCouponTemplate") - public CommonResult> pageCouponTemplate(@RequestBody CouponTemplatePageReqDTO pageDTO); - - @PostMapping("/coupon/template/updateCouponTemplateStatus") - public CommonResult updateCouponTemplateStatus(@RequestBody CouponCardTemplateUpdateStatusReqDTO updateStatusReqDTO) ; - - // ========== 优惠劵模板 ========== - - @PostMapping("/coupon/template/createCouponCardTemplate") - public CommonResult createCouponCardTemplate(@RequestBody CouponCardTemplateCreateReqDTO createDTO) ; - - @PostMapping("/coupon/template/updateCouponCardTemplate") - public CommonResult updateCouponCardTemplate(@RequestBody CouponCardTemplateUpdateReqDTO updateDTO) ; -} diff --git a/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/coupon/dto/card/CouponCardPageReqDTO.java b/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/coupon/dto/card/CouponCardPageReqDTO.java deleted file mode 100644 index 4dcf5a23c..000000000 --- a/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/coupon/dto/card/CouponCardPageReqDTO.java +++ /dev/null @@ -1,25 +0,0 @@ -package cn.iocoder.mall.promotion.api.rpc.coupon.dto.card; - -import cn.iocoder.common.framework.vo.PageParam; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - * 优惠劵分页 DTO - */ -@Data -@EqualsAndHashCode(callSuper = true) -@Accessors(chain = true) -public class CouponCardPageReqDTO extends PageParam { - - /** - * 用户编号 - */ - private Integer userId; - /** - * 状态 - */ - private Integer status; - -} diff --git a/归档/promotion-service-project/promotion-service-app/pom.xml b/归档/promotion-service-project/promotion-service-app/pom.xml deleted file mode 100644 index 2542b5202..000000000 --- a/归档/promotion-service-project/promotion-service-app/pom.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - - promotion-service-project - cn.iocoder.mall - 1.0-SNAPSHOT - - 4.0.0 - - promotion-service-app - - - - - cn.iocoder.mall - mall-spring-boot-starter-dubbo - - - - - cn.iocoder.mall - system-service-api - ${project.version} - - - - - cn.iocoder.mall - product-service-api - 1.0-SNAPSHOT - - - - - cn.iocoder.mall - promotion-service-api - - - - - org.springframework.boot - spring-boot-starter-web - - - - - com.alibaba.cloud - spring-cloud-starter-alibaba-nacos-discovery - - - - - mysql - mysql-connector-java - - - - com.alibaba - druid-spring-boot-starter - - - - cn.iocoder.mall - mall-spring-boot-starter-mybatis - - - - - org.springframework.boot - spring-boot-starter-actuator - - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - org.springframework.boot - spring-boot-starter-validation - - - - org.projectlombok - lombok - - - - org.mapstruct - mapstruct - - - org.mapstruct - mapstruct-jdk8 - - - - org.aspectj - aspectjweaver - 1.9.6 - - - org.springframework.cloud - spring-cloud-starter-openfeign - - - - - - ${project.artifactId} - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - diff --git a/归档/promotion-service-project/promotion-service-app/src/main/java/cn/iocoder/mall/promotionservice/manager/coupon/CouponCardManager.java b/归档/promotion-service-project/promotion-service-app/src/main/java/cn/iocoder/mall/promotionservice/manager/coupon/CouponCardManager.java deleted file mode 100644 index 75cd6c122..000000000 --- a/归档/promotion-service-project/promotion-service-app/src/main/java/cn/iocoder/mall/promotionservice/manager/coupon/CouponCardManager.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.iocoder.mall.promotionservice.manager.coupon; - -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.promotion.api.rpc.coupon.dto.card.*; -import cn.iocoder.mall.promotionservice.service.coupon.CouponCardService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.validation.annotation.Validated; - -import java.util.List; - -@Service -@Validated -public class CouponCardManager { - - @Autowired - private CouponCardService couponCardService; - - public PageResult pageCouponCard(CouponCardPageReqDTO pageReqDTO) { - return couponCardService.pageCouponCard(pageReqDTO); - } - - public Integer createCouponCard(CouponCardCreateReqDTO createReqDTO) { - return couponCardService.createCouponCard(createReqDTO.getUserId(), createReqDTO.getCouponTemplateId()); - } - - public Boolean useCouponCard(CouponCardUseReqDTO useReqDTO) { - couponCardService.useCouponCard(useReqDTO.getUserId(), useReqDTO.getCouponCardId()); - return true; - } - - public Boolean cancelUseCouponCard(CouponCardCancelUseReqDTO cancelUseReqDTO) { - couponCardService.cancelUseCouponCard(cancelUseReqDTO.getUserId(), cancelUseReqDTO.getCouponCardId()); - return true; - } - - public List listAvailableCouponCards(CouponCardAvailableListReqDTO listReqDTO) { - return couponCardService.listAvailableCouponCards(listReqDTO); - } - -} diff --git a/归档/promotion-service-project/promotion-service-app/src/main/java/cn/iocoder/mall/promotionservice/manager/coupon/CouponTemplateManager.java b/归档/promotion-service-project/promotion-service-app/src/main/java/cn/iocoder/mall/promotionservice/manager/coupon/CouponTemplateManager.java deleted file mode 100644 index e10ecd494..000000000 --- a/归档/promotion-service-project/promotion-service-app/src/main/java/cn/iocoder/mall/promotionservice/manager/coupon/CouponTemplateManager.java +++ /dev/null @@ -1,43 +0,0 @@ -package cn.iocoder.mall.promotionservice.manager.coupon; - -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.promotion.api.rpc.coupon.dto.template.*; -import cn.iocoder.mall.promotionservice.service.coupon.CouponTemplateService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * 优惠劵(码)模板 Manager - */ -@Service -public class CouponTemplateManager { - - @Autowired - private CouponTemplateService couponTemplateService; - - // ========== 通用逻辑 ========= - - public CouponTemplateRespDTO getCouponTemplate(Integer couponTemplateId) { - return couponTemplateService.getCouponTemplate(couponTemplateId); - } - - public PageResult pageCouponTemplate(CouponTemplatePageReqDTO pageDTO) { - return couponTemplateService.pageCouponTemplate(pageDTO); - } - - public void updateCouponTemplateStatus(CouponCardTemplateUpdateStatusReqDTO updateStatusReqDTO) { - couponTemplateService.updateCouponTemplateStatus(updateStatusReqDTO.getId(), updateStatusReqDTO.getStatus()); - } - - // ========== 优惠劵模板 ========== - - public Integer createCouponCardTemplate(CouponCardTemplateCreateReqDTO createDTO) { - return couponTemplateService.createCouponCardTemplate(createDTO); - } - - - public void updateCouponCardTemplate(CouponCardTemplateUpdateReqDTO updateDTO) { - couponTemplateService.updateCouponCardTemplate(updateDTO); - } - -} diff --git a/归档/promotion-service-project/promotion-service-app/src/test/java/cn/iocoder/mall/promotionservice/dal/mysql/mapper/activity/PromotionActivityMapperTest.java b/归档/promotion-service-project/promotion-service-app/src/test/java/cn/iocoder/mall/promotionservice/dal/mysql/mapper/activity/PromotionActivityMapperTest.java deleted file mode 100644 index 3a5596b0d..000000000 --- a/归档/promotion-service-project/promotion-service-app/src/test/java/cn/iocoder/mall/promotionservice/dal/mysql/mapper/activity/PromotionActivityMapperTest.java +++ /dev/null @@ -1,28 +0,0 @@ -package cn.iocoder.mall.promotionservice.dal.mysql.mapper.activity; - -import cn.iocoder.mall.promotion.api.enums.activity.PromotionActivityStatusEnum; -import cn.iocoder.mall.promotionservice.dal.mysql.dataobject.activity.PromotionActivityDO; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -import java.util.Collections; -import java.util.List; - -@RunWith(SpringJUnit4ClassRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) -public class PromotionActivityMapperTest { - - @Autowired - private PromotionActivityMapper promotionActivityMapper; - - @Test - public void testSelectListByStatus() { - List result = promotionActivityMapper.selectListByStatus( - Collections.singleton(PromotionActivityStatusEnum.RUN.getValue())); - System.out.println(result.size()); - } - -} diff --git a/归档/promotion-service-project/promotion-service-app/src/test/java/cn/iocoder/mall/promotionservice/manager/package-info.java b/归档/promotion-service-project/promotion-service-app/src/test/java/cn/iocoder/mall/promotionservice/manager/package-info.java deleted file mode 100644 index d21a6c1f3..000000000 --- a/归档/promotion-service-project/promotion-service-app/src/test/java/cn/iocoder/mall/promotionservice/manager/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package cn.iocoder.mall.promotionservice.manager; diff --git a/归档/promotion-service-project/promotion-service-app/src/test/java/cn/iocoder/mall/promotionservice/manager/price/PriceManagerTest.java b/归档/promotion-service-project/promotion-service-app/src/test/java/cn/iocoder/mall/promotionservice/manager/price/PriceManagerTest.java deleted file mode 100644 index 614dd6a77..000000000 --- a/归档/promotion-service-project/promotion-service-app/src/test/java/cn/iocoder/mall/promotionservice/manager/price/PriceManagerTest.java +++ /dev/null @@ -1,30 +0,0 @@ -package cn.iocoder.mall.promotionservice.manager.price; - -import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcReqDTO; -import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcRespDTO; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -import java.util.Arrays; - -@RunWith(SpringJUnit4ClassRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) -public class PriceManagerTest { - - @Autowired - private PriceManager priceManager; - - @Test - public void testCalcProductPrice() { - PriceProductCalcReqDTO calcReqDTO = new PriceProductCalcReqDTO(); - PriceProductCalcReqDTO.Item item01 = new PriceProductCalcReqDTO.Item(33, 2, true); // 满足满减送的商品 - PriceProductCalcReqDTO.Item item02 = new PriceProductCalcReqDTO.Item(34, 2, true); // 满足限时折扣的商品 - calcReqDTO.setItems(Arrays.asList(item01, item02)); - PriceProductCalcRespDTO calcRespDTO = priceManager.calcProductPrice(calcReqDTO); - System.out.println(calcRespDTO); - } - -}