Skip to content

Commit

Permalink
订单服务拆分为多模块
Browse files Browse the repository at this point in the history
  • Loading branch information
AlgerFan committed Aug 26, 2019
1 parent 5e6cdd0 commit e3a3d8f
Show file tree
Hide file tree
Showing 31 changed files with 176 additions and 215 deletions.
15 changes: 15 additions & 0 deletions order/order-client/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>order</artifactId>
<groupId>cn.algerfan</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>order-client</artifactId>


</project>
15 changes: 15 additions & 0 deletions order/order-common/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>order</artifactId>
<groupId>cn.algerfan</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>order-common</artifactId>


</project>
77 changes: 77 additions & 0 deletions order/order-server/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>order</artifactId>
<groupId>cn.algerfan</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>order-server</artifactId>

<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<!-- TODO spring-cloud-starter-feign ——> spring-cloud-starter-openfeign-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<!-- TODO spring-cloud-starter-hystrix ——> spring-cloud-starter-netflix-hystrix-->
<!-- TODO 2.0.2.RELEASE需要引入-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-client</artifactId>
</dependency>
<dependency>
<groupId>cn.algerfan</groupId>
<artifactId>product-client</artifactId>
<version>${product-client.version}</version>
</dependency>
<dependency>
<groupId>cn.algerfan</groupId>
<artifactId>product-common</artifactId>
<version>${product-common.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cn.algerfan.order;
package cn.algerfan.order.server;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cn.algerfan.order.config;
package cn.algerfan.order.server.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package cn.algerfan.order.controller;
package cn.algerfan.order.server.controller;

import cn.algerfan.order.client.ProductClient;
import cn.algerfan.order.common.DecreaseStockOutput;
import cn.algerfan.order.common.ProductInfoOutput;
import cn.algerfan.product.client.ProductClient;
import cn.algerfan.product.common.DecreaseStockOutput;
import cn.algerfan.product.common.ProductInfoOutput;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.ServiceInstance;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package cn.algerfan.order.controller;
package cn.algerfan.order.server.controller;

import cn.algerfan.order.form.OrderForm;
import cn.algerfan.order.converter.OrderFormToOrderDto;
import cn.algerfan.order.dto.OrderDto;
import cn.algerfan.order.enums.Result;
import cn.algerfan.order.exception.OrderException;
import cn.algerfan.order.service.OrderService;
import cn.algerfan.order.util.ResultVoUtil;
import cn.algerfan.order.vo.ResultVo;
import cn.algerfan.order.server.converter.OrderFormToOrderDto;
import cn.algerfan.order.server.dto.OrderDto;
import cn.algerfan.order.server.enums.Result;
import cn.algerfan.order.server.exception.OrderException;
import cn.algerfan.order.server.form.OrderForm;
import cn.algerfan.order.server.service.OrderService;
import cn.algerfan.order.server.util.ResultVoUtil;
import cn.algerfan.order.server.vo.ResultVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package cn.algerfan.order.converter;
package cn.algerfan.order.server.converter;

import cn.algerfan.order.exception.OrderException;
import cn.algerfan.order.form.OrderForm;
import cn.algerfan.order.domain.OrderDetail;
import cn.algerfan.order.dto.OrderDto;
import cn.algerfan.order.enums.Result;
import cn.algerfan.order.server.dto.OrderDto;
import cn.algerfan.order.server.enums.Result;
import cn.algerfan.order.server.exception.OrderException;
import cn.algerfan.order.server.form.OrderForm;
import cn.algerfan.order.server.domain.OrderDetail;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cn.algerfan.order.domain;
package cn.algerfan.order.server.domain;

import lombok.Data;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cn.algerfan.order.domain;
package cn.algerfan.order.server.domain;

import lombok.Data;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cn.algerfan.order.dto;
package cn.algerfan.order.server.dto;

import cn.algerfan.order.domain.OrderDetail;
import cn.algerfan.order.server.domain.OrderDetail;
import lombok.Data;

import java.math.BigDecimal;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cn.algerfan.order.enums;
package cn.algerfan.order.server.enums;

import lombok.Getter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cn.algerfan.order.enums;
package cn.algerfan.order.server.enums;

import lombok.Getter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cn.algerfan.order.enums;
package cn.algerfan.order.server.enums;

import lombok.Getter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cn.algerfan.order.exception;
package cn.algerfan.order.server.exception;

import cn.algerfan.order.enums.Result;
import cn.algerfan.order.server.enums.Result;

/**
* @author algerfan
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cn.algerfan.order.form;
package cn.algerfan.order.server.form;

import lombok.Data;
import org.hibernate.validator.constraints.NotEmpty;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cn.algerfan.order.repository;
package cn.algerfan.order.server.repository;

import cn.algerfan.order.domain.OrderDetail;
import cn.algerfan.order.server.domain.OrderDetail;
import org.springframework.data.jpa.repository.JpaRepository;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cn.algerfan.order.repository;
package cn.algerfan.order.server.repository;

import cn.algerfan.order.domain.OrderMaster;
import cn.algerfan.order.server.domain.OrderMaster;
import org.springframework.data.jpa.repository.JpaRepository;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cn.algerfan.order.service;
package cn.algerfan.order.server.service;

import cn.algerfan.order.dto.OrderDto;
import cn.algerfan.order.server.dto.OrderDto;

/**
* @author algerfan
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package cn.algerfan.order.service.impl;
package cn.algerfan.order.server.service.impl;

import cn.algerfan.order.client.ProductClient;
import cn.algerfan.order.common.DecreaseStockOutput;
import cn.algerfan.order.common.ProductInfoOutput;
import cn.algerfan.order.repository.OrderDetailRepository;
import cn.algerfan.order.repository.OrderMasterRepository;
import cn.algerfan.order.domain.OrderDetail;
import cn.algerfan.order.domain.OrderMaster;
import cn.algerfan.order.dto.OrderDto;
import cn.algerfan.order.enums.OrderStatus;
import cn.algerfan.order.enums.PayStatus;
import cn.algerfan.order.service.OrderService;
import cn.algerfan.order.util.KeyUtil;
import cn.algerfan.order.server.repository.OrderDetailRepository;
import cn.algerfan.order.server.repository.OrderMasterRepository;
import cn.algerfan.order.server.domain.OrderDetail;
import cn.algerfan.order.server.domain.OrderMaster;
import cn.algerfan.order.server.dto.OrderDto;
import cn.algerfan.order.server.enums.OrderStatus;
import cn.algerfan.order.server.enums.PayStatus;
import cn.algerfan.order.server.service.OrderService;
import cn.algerfan.order.server.util.KeyUtil;
import cn.algerfan.product.client.ProductClient;
import cn.algerfan.product.common.DecreaseStockOutput;
import cn.algerfan.product.common.ProductInfoOutput;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cn.algerfan.order.util;
package cn.algerfan.order.server.util;

import java.util.Random;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cn.algerfan.order.util;
package cn.algerfan.order.server.util;

import cn.algerfan.order.vo.ResultVo;
import cn.algerfan.order.server.vo.ResultVo;

/**
* @author algerfan
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cn.algerfan.order.vo;
package cn.algerfan.order.server.vo;

import lombok.Data;

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cn.algerfan.order;
package cn.algerfan.order.server;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package cn.algerfan.order.repository;
package cn.algerfan.order.server.repository;

import cn.algerfan.order.OrderApplicationTests;
import cn.algerfan.order.server.OrderApplicationTests;

import cn.algerfan.order.domain.OrderDetail;
import cn.algerfan.order.server.domain.OrderDetail;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package cn.algerfan.order.repository;
package cn.algerfan.order.server.repository;

import cn.algerfan.order.OrderApplicationTests;
import cn.algerfan.order.domain.OrderMaster;
import cn.algerfan.order.enums.OrderStatus;
import cn.algerfan.order.enums.PayStatus;
import cn.algerfan.order.server.OrderApplicationTests;
import cn.algerfan.order.server.domain.OrderMaster;
import cn.algerfan.order.server.enums.OrderStatus;
import cn.algerfan.order.server.enums.PayStatus;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down
Loading

0 comments on commit e3a3d8f

Please sign in to comment.