feat(新增): order模块初始化
This commit is contained in:
parent
6ace927de5
commit
f70211ce62
|
@ -26,6 +26,7 @@
|
|||
<file url="file://$PROJECT_DIR$/service/service-activity/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/service/service-cart/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/service/service-home/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/service/service-order/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/service/service-product/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/service/service-search/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/service/service-sys/src/main/java" charset="UTF-8" />
|
||||
|
|
|
@ -19,7 +19,7 @@ public class CodeGet {
|
|||
// 全局配置
|
||||
GlobalConfig gc = new GlobalConfig();
|
||||
// TODO 需要修改路径名称
|
||||
gc.setOutputDir("G:\\File\\Java\\ssyx\\ssyx-parent\\service\\service-activity" + "/src/main/java");
|
||||
gc.setOutputDir("G:\\File\\Java\\ssyx\\ssyx-parent\\service\\service-order" + "/src/main/java");
|
||||
|
||||
gc.setServiceName("%sService"); // 去掉Service接口的首字母I
|
||||
gc.setAuthor("bunny");
|
||||
|
@ -29,7 +29,7 @@ public class CodeGet {
|
|||
// 3、数据源配置
|
||||
DataSourceConfig dsc = new DataSourceConfig();
|
||||
// TODO 需要修改数据库
|
||||
dsc.setUrl("jdbc:mysql://106.15.251.123:3305/shequ-activity?serverTimezone=GMT%2B8&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true");
|
||||
dsc.setUrl("jdbc:mysql://106.15.251.123:3305/shequ-order?serverTimezone=GMT%2B8&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true");
|
||||
dsc.setDriverName("com.mysql.cj.jdbc.Driver");
|
||||
dsc.setUsername("root");
|
||||
dsc.setPassword("02120212");
|
||||
|
@ -40,7 +40,7 @@ public class CodeGet {
|
|||
PackageConfig pc = new PackageConfig();
|
||||
pc.setParent("com.atguigu.ssyx");
|
||||
// TODO 需要修改模块名
|
||||
pc.setModuleName("activity");
|
||||
pc.setModuleName("order");
|
||||
pc.setController("controller");
|
||||
pc.setService("service");
|
||||
pc.setMapper("mapper");
|
||||
|
@ -59,7 +59,7 @@ public class CodeGet {
|
|||
private static StrategyConfig getStrategyConfig() {
|
||||
StrategyConfig strategy = new StrategyConfig();
|
||||
// TODO 要生成的表
|
||||
strategy.setInclude("seckill_time");
|
||||
strategy.setInclude("cart_info", "order_item", "order_info", "order_deliver");
|
||||
strategy.setNaming(NamingStrategy.underline_to_camel);// 数据库表映射到实体的命名策略
|
||||
strategy.setColumnNaming(NamingStrategy.underline_to_camel);// 数据库表字段映射到实体的命名策略
|
||||
strategy.setEntityLombokModel(true); // lombok 模型 @Accessors(chain = true) setter链式操作
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
<module>service-user</module>
|
||||
<module>service-home</module>
|
||||
<module>service-cart</module>
|
||||
<module>service-order</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.atguigu</groupId>
|
||||
<artifactId>service</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>service-order</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>service-order</name>
|
||||
<url>https://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.atguigu</groupId>
|
||||
<artifactId>service-product-client</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,22 @@
|
|||
package com.atguigu.ssyx.order;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.cloud.client.SpringCloudApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
@SpringCloudApplication
|
||||
@ComponentScan(basePackages = {
|
||||
"com.atguigu.ssyx.common",
|
||||
"com.atguigu.ssyx.order"
|
||||
})
|
||||
@EnableTransactionManagement
|
||||
@EnableDiscoveryClient
|
||||
@EnableFeignClients(basePackages = {"com.atguigu.ssyx.client"})
|
||||
public class ServiceOrderApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ServiceOrderApplication.class, args);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.atguigu.ssyx.order.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单配送表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author bunny
|
||||
* @since 2024-04-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/order/order-deliver")
|
||||
public class OrderDeliverController {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.atguigu.ssyx.order.controller;
|
||||
|
||||
|
||||
import com.atguigu.ssyx.common.result.Result;
|
||||
import com.atguigu.ssyx.order.service.OrderInfoService;
|
||||
import com.atguigu.ssyx.vo.order.OrderConfirmVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.RestController;
|
||||
|
||||
@Api(value = "Order管理", tags = "Order管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/order")
|
||||
public class OrderInfoController {
|
||||
@Autowired
|
||||
private OrderInfoService orderInfoService;
|
||||
|
||||
@ApiOperation("确认订单")
|
||||
@GetMapping("auth/confirmOrder")
|
||||
public Result<OrderConfirmVo> confirm() {
|
||||
OrderConfirmVo vo = orderInfoService.confirmOrder();
|
||||
return Result.success(vo);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.atguigu.ssyx.order.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单项信息 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author bunny
|
||||
* @since 2024-04-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/order/order-item")
|
||||
public class OrderItemController {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.atguigu.ssyx.order.mapper;
|
||||
|
||||
import com.atguigu.ssyx.model.order.OrderDeliver;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单配送表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author bunny
|
||||
* @since 2024-04-10
|
||||
*/
|
||||
public interface OrderDeliverMapper extends BaseMapper<OrderDeliver> {
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.atguigu.ssyx.order.mapper;
|
||||
|
||||
import com.atguigu.ssyx.model.order.OrderInfo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author bunny
|
||||
* @since 2024-04-10
|
||||
*/
|
||||
public interface OrderInfoMapper extends BaseMapper<OrderInfo> {
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.atguigu.ssyx.order.mapper;
|
||||
|
||||
import com.atguigu.ssyx.model.order.OrderItem;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单项信息 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author bunny
|
||||
* @since 2024-04-10
|
||||
*/
|
||||
public interface OrderItemMapper extends BaseMapper<OrderItem> {
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.atguigu.ssyx.order.service;
|
||||
|
||||
import com.atguigu.ssyx.model.order.OrderDeliver;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单配送表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author bunny
|
||||
* @since 2024-04-10
|
||||
*/
|
||||
public interface OrderDeliverService extends IService<OrderDeliver> {
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.atguigu.ssyx.order.service;
|
||||
|
||||
import com.atguigu.ssyx.model.order.OrderInfo;
|
||||
import com.atguigu.ssyx.vo.order.OrderConfirmVo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
public interface OrderInfoService extends IService<OrderInfo> {
|
||||
|
||||
/**
|
||||
* * 确认订单
|
||||
*
|
||||
* @return 订单确认内容
|
||||
*/
|
||||
OrderConfirmVo confirmOrder();
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.atguigu.ssyx.order.service;
|
||||
|
||||
import com.atguigu.ssyx.model.order.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单项信息 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author bunny
|
||||
* @since 2024-04-10
|
||||
*/
|
||||
public interface OrderItemService extends IService<OrderItem> {
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.atguigu.ssyx.order.service.impl;
|
||||
|
||||
import com.atguigu.ssyx.model.order.OrderDeliver;
|
||||
import com.atguigu.ssyx.order.mapper.OrderDeliverMapper;
|
||||
import com.atguigu.ssyx.order.service.OrderDeliverService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单配送表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author bunny
|
||||
* @since 2024-04-10
|
||||
*/
|
||||
@Service
|
||||
public class OrderDeliverServiceImpl extends ServiceImpl<OrderDeliverMapper, OrderDeliver> implements OrderDeliverService {
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.atguigu.ssyx.order.service.impl;
|
||||
|
||||
import com.atguigu.ssyx.model.order.OrderInfo;
|
||||
import com.atguigu.ssyx.order.mapper.OrderInfoMapper;
|
||||
import com.atguigu.ssyx.order.service.OrderInfoService;
|
||||
import com.atguigu.ssyx.vo.order.OrderConfirmVo;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo> implements OrderInfoService {
|
||||
|
||||
/**
|
||||
* * 确认订单
|
||||
*
|
||||
* @return 订单确认内容
|
||||
*/
|
||||
@Override
|
||||
public OrderConfirmVo confirmOrder() {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.atguigu.ssyx.order.service.impl;
|
||||
|
||||
import com.atguigu.ssyx.model.order.OrderItem;
|
||||
import com.atguigu.ssyx.order.mapper.OrderItemMapper;
|
||||
import com.atguigu.ssyx.order.service.OrderItemService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单项信息 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author bunny
|
||||
* @since 2024-04-10
|
||||
*/
|
||||
@Service
|
||||
public class OrderItemServiceImpl extends ServiceImpl<OrderItemMapper, OrderItem> implements OrderItemService {
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
server:
|
||||
port: 8209
|
||||
|
||||
bunny:
|
||||
datasource:
|
||||
host: 106.15.251.123
|
||||
port: 3305
|
||||
sqlData: shequ-order
|
||||
username: root
|
||||
password: "02120212"
|
||||
|
||||
redis:
|
||||
host: 47.120.65.66
|
||||
port: 6379
|
||||
database: 3
|
||||
password: "02120212"
|
||||
|
||||
rabbitmq:
|
||||
# host: 192.168.1.4
|
||||
host: 192.168.3.98
|
||||
port: 5672
|
||||
username: bunny
|
||||
password: "02120212"
|
||||
|
||||
nacos:
|
||||
server-addr: z-bunny.cn:8848
|
||||
discovery:
|
||||
namespace: ssyx
|
|
@ -0,0 +1,68 @@
|
|||
server:
|
||||
port: 8209
|
||||
spring:
|
||||
application:
|
||||
name: service-order
|
||||
profiles:
|
||||
active: dev
|
||||
|
||||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${bunny.datasource.host}:${bunny.datasource.port}/${bunny.datasource.sqlData}?serverTimezone=GMT%2B8&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true
|
||||
username: ${bunny.datasource.username}
|
||||
password: ${bunny.datasource.password}
|
||||
|
||||
redis:
|
||||
host: ${bunny.redis.host}
|
||||
port: ${bunny.redis.port}
|
||||
database: ${bunny.redis.database}
|
||||
password: ${bunny.redis.password}
|
||||
lettuce:
|
||||
pool:
|
||||
max-active: 20 #最大连接数
|
||||
max-wait: -1 #最大阻塞等待时间(负数表示没限制)
|
||||
max-idle: 5 #最大空闲
|
||||
min-idle: 0 #最小空闲
|
||||
|
||||
rabbitmq:
|
||||
host: ${bunny.rabbitmq.host}
|
||||
port: ${bunny.rabbitmq.port}
|
||||
username: ${bunny.rabbitmq.username}
|
||||
password: ${bunny.rabbitmq.password}
|
||||
publisher-confirm-type: CORRELATED
|
||||
publisher-returns: true
|
||||
listener:
|
||||
simple:
|
||||
prefetch: 1
|
||||
concurrency: 3
|
||||
acknowledge-mode: manual
|
||||
retry:
|
||||
enabled: true # 开启消费者失败重试
|
||||
initial-interval: 1000ms # 初始失败等待时长
|
||||
multiplier: 1 # 下次失败等待时间被树,下次等待时长 multiplier * last-interval
|
||||
max-attempts: 3 # 最大重试次数
|
||||
stateless: true # true 无状态 false 有状态。如果业务中包含事务,这里改为false
|
||||
|
||||
cloud:
|
||||
sentinel:
|
||||
log:
|
||||
dir: logs/${spring.application.name}/sentinel
|
||||
nacos:
|
||||
discovery:
|
||||
namespace: ${bunny.nacos.discovery.namespace}
|
||||
server-addr: ${bunny.nacos.server-addr}
|
||||
|
||||
jackson:
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
time-zone: GMT+8
|
||||
|
||||
logging:
|
||||
level:
|
||||
com.atguigu.ssyx.order.mapper: debug
|
||||
com.atguigu.ssyx.order.controller: info
|
||||
com.atguigu.ssyx.order.service: info
|
||||
pattern:
|
||||
dateformat: HH:mm:ss:SSS
|
||||
file:
|
||||
path: "logs/${spring.application.name}"
|
|
@ -0,0 +1,16 @@
|
|||
-----------------▄██-█▄---------
|
||||
-----------------███▄██▄--------
|
||||
-----------------███████--------
|
||||
-----------------▀███████-------
|
||||
-------------------██████▄▄-----
|
||||
-------------------█████████▄---
|
||||
-------------------██████▄████--
|
||||
-------▄███████████████████████-
|
||||
-----▄███████████████████████▀--
|
||||
---▄██████████████████████------
|
||||
---███████████████████████------
|
||||
---███████████████████████------
|
||||
-▄▄██████████████████████▀------
|
||||
-█████████████████▀█████--------
|
||||
-▀██████████████▀▀-▀█████▄------
|
||||
-------▀▀▀▀▀▀▀▀▀------▀▀▀▀------
|
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.atguigu.ssyx.order.mapper.OrderDeliverMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.atguigu.ssyx.order.mapper.OrderInfoMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.atguigu.ssyx.order.mapper.OrderItemMapper">
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue