parent
eddec34e5d
commit
359d6766f3
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.product.config;
|
||||
package cn.iocoder.mall.product.application.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
@ -0,0 +1,22 @@
|
||||
package cn.iocoder.mall.product.application.convert;
|
||||
|
||||
import cn.iocoder.mall.product.api.bo.ProductCategoryBO;
|
||||
import cn.iocoder.mall.product.application.vo.ProductCategoryVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mappings;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ProductCategoryConvert {
|
||||
|
||||
ProductCategoryConvert INSTANCE = Mappers.getMapper(ProductCategoryConvert.class);
|
||||
|
||||
@Mappings({})
|
||||
ProductCategoryVO convertToVO(ProductCategoryBO category);
|
||||
|
||||
List<ProductCategoryVO> convertToVO(List<ProductCategoryBO> categoryList);
|
||||
|
||||
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.product.vo;
|
||||
package cn.iocoder.mall.product.application.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.product.vo;
|
||||
package cn.iocoder.mall.product.application.vo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
package cn.iocoder.mall.product.application.vo;
|
||||
|
||||
public class ProductSpuVO {
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
package cn.iocoder.mall.product.vo;
|
||||
|
||||
public class ProductSpuVO {
|
||||
}
|
||||
@ -1,32 +1,9 @@
|
||||
spring:
|
||||
application:
|
||||
name: product-application
|
||||
# datasource
|
||||
datasource:
|
||||
url: jdbc:mysql://127.0.0.1:33061/mall_product?useSSL=false
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
username: root
|
||||
password: 123456
|
||||
|
||||
# server
|
||||
server:
|
||||
port: 8081
|
||||
|
||||
# mybatis
|
||||
mybatis:
|
||||
config-location: classpath:mybatis-config.xml
|
||||
mapper-locations: classpath:mapper/*.xml
|
||||
type-aliases-package: cn.iocoder.mall.product.dataobject
|
||||
|
||||
# dubbo
|
||||
dubbo:
|
||||
registry:
|
||||
address: zookeeper://127.0.0.1:2181
|
||||
protocol:
|
||||
port: -1
|
||||
name: dubbo
|
||||
scan:
|
||||
base-packages: cn.iocoder.mall.product.service
|
||||
demo:
|
||||
service:
|
||||
version: 1.0.0
|
||||
port: 18081
|
||||
servlet:
|
||||
context-path: /product-api/
|
||||
@ -0,0 +1,11 @@
|
||||
package cn.iocoder.mall.product.api;
|
||||
|
||||
import cn.iocoder.mall.product.api.bo.ProductCategoryBO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ProductCategoryService {
|
||||
|
||||
List<ProductCategoryBO> getListByPid(Integer pid);
|
||||
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
package cn.iocoder.mall.product.api;
|
||||
|
||||
import cn.iocoder.mall.product.api.bo.ProductSpuBO;
|
||||
|
||||
public interface ProductSpuService {
|
||||
|
||||
ProductSpuBO getProductSpu(Integer id);
|
||||
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.product.bo;
|
||||
package cn.iocoder.mall.product.api.bo;
|
||||
|
||||
/**
|
||||
* 商品分类 BO
|
||||
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.product.bo;
|
||||
package cn.iocoder.mall.product.api.bo;
|
||||
|
||||
public class ProductSkuBO {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.product.bo;
|
||||
package cn.iocoder.mall.product.api.bo;
|
||||
|
||||
public class ProductSpuBO {
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
package cn.iocoder.mall.product.service.api;
|
||||
|
||||
public interface ProductSpuService {
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
<?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>product</artifactId>
|
||||
<groupId>cn.iocoder.mall</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>product-service-impl</artifactId>
|
||||
|
||||
<properties>
|
||||
<org.mapstruct.version>1.3.0.Final</org.mapstruct.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo</artifactId>
|
||||
<version>2.6.5</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.mall</groupId>
|
||||
<artifactId>product-service-api</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct</artifactId>
|
||||
<version>${org.mapstruct.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>27.0.1-jre</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- 提供给 mapstruct 使用 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.5.1</version>
|
||||
<configuration>
|
||||
<source>1.8</source> <!-- or higher, depending on your project -->
|
||||
<target>1.8</target> <!-- or higher, depending on your project -->
|
||||
<annotationProcessorPaths>
|
||||
<path>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-processor</artifactId>
|
||||
<version>${org.mapstruct.version}</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@ -1,6 +1,6 @@
|
||||
package cn.iocoder.mall.product.convert;
|
||||
|
||||
import cn.iocoder.mall.product.bo.ProductSpuBO;
|
||||
import cn.iocoder.mall.product.api.bo.ProductSpuBO;
|
||||
import cn.iocoder.mall.product.dataobject.ProductSpuDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mappings;
|
||||
@ -0,0 +1 @@
|
||||
package cn.iocoder.mall.product;
|
||||
@ -0,0 +1,25 @@
|
||||
spring:
|
||||
# datasource
|
||||
datasource:
|
||||
url: jdbc:mysql://127.0.0.1:33061/mall_product?useSSL=false
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
username: root
|
||||
password: 123456
|
||||
|
||||
# mybatis
|
||||
mybatis:
|
||||
config-location: classpath:mybatis-config.xml
|
||||
mapper-locations: classpath:mapper/*.xml
|
||||
type-aliases-package: cn.iocoder.mall.product.dataobject
|
||||
|
||||
# dubbo
|
||||
dubbo:
|
||||
application:
|
||||
name: product-service
|
||||
registry:
|
||||
address: zookeeper://127.0.0.1:2181
|
||||
protocol:
|
||||
port: -1
|
||||
name: dubbo
|
||||
scan:
|
||||
base-packages: cn.iocoder.mall.product.service
|
||||
Loading…
Reference in new issue