订单服务服务基本脚手架
This commit is contained in:
parent
4c56a4b51c
commit
8d0f1d9f4b
@ -0,0 +1,22 @@
|
|||||||
|
package net.jieyuu.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户端枚举类
|
||||||
|
*/
|
||||||
|
public enum ClientType {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 原生应用
|
||||||
|
*/
|
||||||
|
APP,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电脑端
|
||||||
|
*/
|
||||||
|
PC,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网页
|
||||||
|
*/
|
||||||
|
H5
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package net.jieyuu.enums;
|
||||||
|
|
||||||
|
public enum ProductOrderPayTypeEnum {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信支付
|
||||||
|
*/
|
||||||
|
WECHAT,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付支付
|
||||||
|
*/
|
||||||
|
ALIPAY,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 银行卡支付
|
||||||
|
*/
|
||||||
|
BANK;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package net.jieyuu.enums;
|
||||||
|
|
||||||
|
public enum ProductOrderStateEnum {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未支付订单
|
||||||
|
*/
|
||||||
|
NEW,
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已经支付订单
|
||||||
|
*/
|
||||||
|
PAY,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 超时取消订单
|
||||||
|
*/
|
||||||
|
CANCEL;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package net.jieyuu.enums;
|
||||||
|
|
||||||
|
public enum ProductOrderTypeEnum {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普通订单
|
||||||
|
*/
|
||||||
|
DAILY,
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 促销订单
|
||||||
|
*/
|
||||||
|
PROMOTION;
|
||||||
|
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
package net.jieyuu.controller;
|
package net.jieyuu.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
* @author jieyuu
|
* @author jieyuu
|
||||||
* @since 2024-08-17
|
* @since 2024-08-17
|
||||||
*/
|
*/
|
||||||
|
@Api("订单模块")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/order/v1/")
|
@RequestMapping("/api/order/v1/")
|
||||||
public class ProductOrderController {
|
public class ProductOrderController {
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
package net.jieyuu.service;
|
||||||
|
|
||||||
|
import net.jieyuu.model.ProductOrderDO;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author jieyuu
|
||||||
|
* @since 2024-08-17
|
||||||
|
*/
|
||||||
|
public interface ProductOrderService extends IService<ProductOrderDO> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package net.jieyuu.service.impl;
|
||||||
|
|
||||||
|
import net.jieyuu.model.ProductOrderDO;
|
||||||
|
import net.jieyuu.mapper.ProductOrderMapper;
|
||||||
|
import net.jieyuu.service.ProductOrderService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author jieyuu
|
||||||
|
* @since 2024-08-17
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ProductOrderServiceImpl extends ServiceImpl<ProductOrderMapper, ProductOrderDO> implements ProductOrderService {
|
||||||
|
|
||||||
|
}
|
29
xdclass-order-service/src/main/resources/application.yml
Normal file
29
xdclass-order-service/src/main/resources/application.yml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
server:
|
||||||
|
port: 9004
|
||||||
|
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: xdclass_order-service
|
||||||
|
|
||||||
|
#数据库配置
|
||||||
|
datasource:
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
url: jdbc:mysql://134.175.219.253:3306/xdclass_order?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||||
|
username: root
|
||||||
|
password: 59ae8683c59fead903132a8d440bd7d9fd4936529d1d6f45f9d41111d7537bdd
|
||||||
|
redis:
|
||||||
|
host: 134.175.219.253
|
||||||
|
password: 123456
|
||||||
|
port: 8000
|
||||||
|
|
||||||
|
#配置plus打印sql日志
|
||||||
|
mybatis-plus:
|
||||||
|
configuration:
|
||||||
|
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
|
|
||||||
|
#设置日志级别,ERROR/WARN/INFO/DEBUG,默认是INFO以上才显示
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
root: INFO
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user