diff --git a/xdclass-common/src/main/java/net/jieyuu/enums/ClientType.java b/xdclass-common/src/main/java/net/jieyuu/enums/ClientType.java new file mode 100644 index 0000000..f8b7d29 --- /dev/null +++ b/xdclass-common/src/main/java/net/jieyuu/enums/ClientType.java @@ -0,0 +1,22 @@ +package net.jieyuu.enums; + +/** + * 客户端枚举类 + */ +public enum ClientType { + + /** + * 原生应用 + */ + APP, + + /** + * 电脑端 + */ + PC, + + /** + * 网页 + */ + H5 +} \ No newline at end of file diff --git a/xdclass-common/src/main/java/net/jieyuu/enums/ProductOrderPayTypeEnum.java b/xdclass-common/src/main/java/net/jieyuu/enums/ProductOrderPayTypeEnum.java new file mode 100644 index 0000000..18e52ed --- /dev/null +++ b/xdclass-common/src/main/java/net/jieyuu/enums/ProductOrderPayTypeEnum.java @@ -0,0 +1,20 @@ +package net.jieyuu.enums; + +public enum ProductOrderPayTypeEnum { + + /** + * 微信支付 + */ + WECHAT, + + /** + * 支付支付 + */ + ALIPAY, + + /** + * 银行卡支付 + */ + BANK; + +} \ No newline at end of file diff --git a/xdclass-common/src/main/java/net/jieyuu/enums/ProductOrderStateEnum.java b/xdclass-common/src/main/java/net/jieyuu/enums/ProductOrderStateEnum.java new file mode 100644 index 0000000..02b8274 --- /dev/null +++ b/xdclass-common/src/main/java/net/jieyuu/enums/ProductOrderStateEnum.java @@ -0,0 +1,21 @@ +package net.jieyuu.enums; + +public enum ProductOrderStateEnum { + + /** + * 未支付订单 + */ + NEW, + + + /** + * 已经支付订单 + */ + PAY, + + /** + * 超时取消订单 + */ + CANCEL; + +} \ No newline at end of file diff --git a/xdclass-common/src/main/java/net/jieyuu/enums/ProductOrderTypeEnum.java b/xdclass-common/src/main/java/net/jieyuu/enums/ProductOrderTypeEnum.java new file mode 100644 index 0000000..92a9d8a --- /dev/null +++ b/xdclass-common/src/main/java/net/jieyuu/enums/ProductOrderTypeEnum.java @@ -0,0 +1,16 @@ +package net.jieyuu.enums; + +public enum ProductOrderTypeEnum { + + /** + * 普通订单 + */ + DAILY, + + + /** + * 促销订单 + */ + PROMOTION; + +} \ No newline at end of file diff --git a/xdclass-order-service/src/main/java/net/jieyuu/OrderApplication.java b/xdclass-order-service/src/main/java/net/jieyuu/OrderApplication.java new file mode 100644 index 0000000..022a6a6 --- /dev/null +++ b/xdclass-order-service/src/main/java/net/jieyuu/OrderApplication.java @@ -0,0 +1,15 @@ +package net.jieyuu; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +@SpringBootApplication +@EnableTransactionManagement +@MapperScan("net.jieyuu.mapper") +public class OrderApplication { + public static void main(String[] args) { + SpringApplication.run(OrderApplication.class, args); + } +} diff --git a/xdclass-order-service/src/main/java/net/jieyuu/config/InterceptorConfig.java b/xdclass-order-service/src/main/java/net/jieyuu/config/InterceptorConfig.java new file mode 100644 index 0000000..3220ee7 --- /dev/null +++ b/xdclass-order-service/src/main/java/net/jieyuu/config/InterceptorConfig.java @@ -0,0 +1,25 @@ +package net.jieyuu.config; + + +import lombok.extern.slf4j.Slf4j; +import net.jieyuu.interceptor.LoginInterceptor; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +@Slf4j +public class InterceptorConfig implements WebMvcConfigurer { + + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry + .addInterceptor(new LoginInterceptor()) + //拦截的路径 + .addPathPatterns("/api/order/*/**") + //放行的路径 + .excludePathPatterns("api/callback/*/**","api/v1/order/*/query_state"); + + WebMvcConfigurer.super.addInterceptors(registry); + } +} diff --git a/xdclass-order-service/src/main/java/net/jieyuu/controller/ProductOrderController.java b/xdclass-order-service/src/main/java/net/jieyuu/controller/ProductOrderController.java index 26fd653..20612bf 100644 --- a/xdclass-order-service/src/main/java/net/jieyuu/controller/ProductOrderController.java +++ b/xdclass-order-service/src/main/java/net/jieyuu/controller/ProductOrderController.java @@ -1,6 +1,7 @@ package net.jieyuu.controller; +import io.swagger.annotations.Api; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.RestController; * @author jieyuu * @since 2024-08-17 */ +@Api("订单模块") @RestController @RequestMapping("/api/order/v1/") public class ProductOrderController { diff --git a/xdclass-order-service/src/main/java/net/jieyuu/service/ProductOrderService.java b/xdclass-order-service/src/main/java/net/jieyuu/service/ProductOrderService.java new file mode 100644 index 0000000..cdab559 --- /dev/null +++ b/xdclass-order-service/src/main/java/net/jieyuu/service/ProductOrderService.java @@ -0,0 +1,16 @@ +package net.jieyuu.service; + +import net.jieyuu.model.ProductOrderDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *
+ * 服务类 + *
+ * + * @author jieyuu + * @since 2024-08-17 + */ +public interface ProductOrderService extends IService+ * 服务实现类 + *
+ * + * @author jieyuu + * @since 2024-08-17 + */ +@Service +public class ProductOrderServiceImpl extends ServiceImpl