Skip to content

Commit d92e4ff

Browse files
committed
商品相关查询服务开发
1 parent 512feb2 commit d92e4ff

24 files changed

Lines changed: 590 additions & 37 deletions

File tree

gpmall-parent/pom.xml

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,32 +27,12 @@
2727
<user-api.version>0.0.1-SNAPSHOT</user-api.version>
2828
<joda-time.version>2.10.3</joda-time.version>
2929
<redisson.version>3.11.1</redisson.version>
30+
<pagehelper.version>5.1.10</pagehelper.version>
31+
<pagehelper.sprinboo.version>1.2.12</pagehelper.sprinboo.version>
3032
</properties>
3133

3234
<dependencyManagement>
3335
<dependencies>
34-
<!--二方包统一管理-->
35-
<!--<dependency>
36-
<artifactId>commons-support</artifactId>
37-
<groupId>com.gpmall.commons</groupId>
38-
<version>${gpmall.commons}</version>
39-
</dependency>
40-
<dependency>
41-
<groupId>com.gpmall.commons</groupId>
42-
<version>${gpmall.commons}</version>
43-
<artifactId>commons-core</artifactId>
44-
</dependency>
45-
<dependency>
46-
<groupId>com.gpmall.commons</groupId>
47-
<version>${gpmall.commons}</version>
48-
<artifactId>commons-tool</artifactId>
49-
</dependency>-->
50-
<!--<dependency>-->
51-
<!--<artifactId>user-api</artifactId>-->
52-
<!--<groupId>com.gpmall.user</groupId>-->
53-
<!--<version>${user-api.version}</version>-->
54-
<!--</dependency>-->
55-
5636
<dependency>
5737
<groupId>org.springframework.boot</groupId>
5838
<artifactId>spring-boot-dependencies</artifactId>
@@ -172,6 +152,22 @@
172152
<version>${redisson.version}</version>
173153
</dependency>
174154

155+
<dependency>
156+
<groupId>com.github.pagehelper</groupId>
157+
<artifactId>pagehelper</artifactId>
158+
<version>${pagehelper.version}</version>
159+
</dependency>
160+
<dependency>
161+
<groupId>com.github.pagehelper</groupId>
162+
<artifactId>pagehelper-spring-boot-autoconfigure</artifactId>
163+
<version>${pagehelper.sprinboo.version}</version>
164+
</dependency>
165+
<dependency>
166+
<groupId>com.github.pagehelper</groupId>
167+
<artifactId>pagehelper-spring-boot-starter</artifactId>
168+
<version>${pagehelper.sprinboo.version}</version>
169+
</dependency>
170+
175171
</dependencies>
176172

177173
</dependencyManagement>

order-services/pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.gpmall.order</groupId>
8+
<artifactId>order-services</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
11+
12+
</project>

search-service/pom.xml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.gpmall.search</groupId>
8+
<artifactId>search-service</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
11+
<name>search-service</name>
12+
<!-- FIXME change it to the project's website -->
13+
<url>http://www.example.com</url>
14+
15+
<properties>
16+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17+
<maven.compiler.source>1.7</maven.compiler.source>
18+
<maven.compiler.target>1.7</maven.compiler.target>
19+
</properties>
20+
21+
<dependencies>
22+
<dependency>
23+
<groupId>junit</groupId>
24+
<artifactId>junit</artifactId>
25+
<version>4.11</version>
26+
<scope>test</scope>
27+
</dependency>
28+
</dependencies>
29+
30+
<build>
31+
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
32+
<plugins>
33+
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
34+
<plugin>
35+
<artifactId>maven-clean-plugin</artifactId>
36+
<version>3.1.0</version>
37+
</plugin>
38+
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
39+
<plugin>
40+
<artifactId>maven-resources-plugin</artifactId>
41+
<version>3.0.2</version>
42+
</plugin>
43+
<plugin>
44+
<artifactId>maven-compiler-plugin</artifactId>
45+
<version>3.8.0</version>
46+
</plugin>
47+
<plugin>
48+
<artifactId>maven-surefire-plugin</artifactId>
49+
<version>2.22.1</version>
50+
</plugin>
51+
<plugin>
52+
<artifactId>maven-jar-plugin</artifactId>
53+
<version>3.0.2</version>
54+
</plugin>
55+
<plugin>
56+
<artifactId>maven-install-plugin</artifactId>
57+
<version>2.5.2</version>
58+
</plugin>
59+
<plugin>
60+
<artifactId>maven-deploy-plugin</artifactId>
61+
<version>2.8.2</version>
62+
</plugin>
63+
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
64+
<plugin>
65+
<artifactId>maven-site-plugin</artifactId>
66+
<version>3.7.1</version>
67+
</plugin>
68+
<plugin>
69+
<artifactId>maven-project-info-reports-plugin</artifactId>
70+
<version>3.0.0</version>
71+
</plugin>
72+
</plugins>
73+
</pluginManagement>
74+
</build>
75+
</project>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.gpmall.search;
2+
3+
/**
4+
* Hello world!
5+
*
6+
*/
7+
public class App
8+
{
9+
public static void main( String[] args )
10+
{
11+
System.out.println( "Hello World!" );
12+
}
13+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.gpmall.search;
2+
3+
import static org.junit.Assert.assertTrue;
4+
5+
import org.junit.Test;
6+
7+
/**
8+
* Unit test for simple App.
9+
*/
10+
public class AppTest
11+
{
12+
/**
13+
* Rigorous Test :-)
14+
*/
15+
@Test
16+
public void shouldAnswerWithTrue()
17+
{
18+
assertTrue( true );
19+
}
20+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.gpmall.shopping;
2+
3+
import com.gpmall.shopping.dto.AllProductRequest;
4+
import com.gpmall.shopping.dto.AllProductResponse;
5+
import com.gpmall.shopping.dto.ProductDetailRequest;
6+
import com.gpmall.shopping.dto.ProductDetailResponse;
7+
8+
/**
9+
* 腾讯课堂搜索【咕泡学院】
10+
* 官网:www.gupaoedu.com
11+
* 风骚的Mic 老师
12+
* create-date: 2019/7/24-16:25
13+
* 商品信息服务接口
14+
* 查询所有商品,以及商品详情
15+
*/
16+
public interface IProductService {
17+
18+
/**
19+
* 查看商品明细
20+
* @param request
21+
* @return
22+
*/
23+
ProductDetailResponse getProductDetail(ProductDetailRequest request);
24+
25+
/**
26+
* 查询所有商品(分页)
27+
* @param request
28+
* @return
29+
*/
30+
AllProductResponse getAllProduct(AllProductRequest request);
31+
32+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.gpmall.shopping.dto;
2+
3+
import com.gpmall.commons.result.AbstractRequest;
4+
import com.gpmall.commons.tool.exception.ValidateException;
5+
import com.gpmall.shopping.constants.ShoppingRetCode;
6+
import lombok.Data;
7+
8+
/**
9+
* 腾讯课堂搜索【咕泡学院】
10+
* 官网:www.gupaoedu.com
11+
* 风骚的Mic 老师
12+
* create-date: 2019/7/24-16:29
13+
*/
14+
@Data
15+
public class AllProductRequest extends AbstractRequest {
16+
17+
private Integer page;
18+
private Integer size;
19+
private String sort;
20+
private Long cid;
21+
private Integer priceGt;
22+
private Integer priceLte;
23+
24+
@Override
25+
public void requestCheck() {
26+
if(page<=0){
27+
setPage(1);
28+
}
29+
}
30+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.gpmall.shopping.dto;
2+
3+
import com.gpmall.commons.result.AbstractResponse;
4+
import lombok.Data;
5+
6+
import java.util.List;
7+
8+
/**
9+
* 腾讯课堂搜索【咕泡学院】
10+
* 官网:www.gupaoedu.com
11+
* 风骚的Mic 老师
12+
* create-date: 2019/7/24-16:29
13+
*/
14+
@Data
15+
public class AllProductResponse extends AbstractResponse {
16+
17+
private List<ProductDto> productDtoList;
18+
19+
private Long total;
20+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.gpmall.shopping.dto;
2+
3+
import lombok.Data;
4+
5+
import java.io.Serializable;
6+
import java.math.BigDecimal;
7+
import java.util.List;
8+
9+
/**
10+
* 腾讯课堂搜索【咕泡学院】
11+
* 官网:www.gupaoedu.com
12+
* 风骚的Mic 老师
13+
* create-date: 2019/7/24-18:08
14+
*/
15+
@Data
16+
public class ProductDetailDto implements Serializable {
17+
18+
private static final long serialVersionUID = -597050593951733519L;
19+
private Long productId;
20+
21+
private BigDecimal salePrice;
22+
23+
private String productName;
24+
25+
private String subTitle;
26+
27+
private Long limitNum;
28+
29+
private String productImageBig;
30+
31+
private String detail;
32+
33+
private List<String> productImageSmall;
34+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.gpmall.shopping.dto;
2+
3+
import com.gpmall.commons.result.AbstractRequest;
4+
import com.gpmall.commons.tool.exception.ValidateException;
5+
import com.gpmall.shopping.constants.ShoppingRetCode;
6+
import lombok.Data;
7+
8+
/**
9+
* 腾讯课堂搜索【咕泡学院】
10+
* 官网:www.gupaoedu.com
11+
* 风骚的Mic 老师
12+
* create-date: 2019/7/24-16:27
13+
*/
14+
@Data
15+
public class ProductDetailRequest extends AbstractRequest {
16+
17+
private Integer id;
18+
19+
@Override
20+
public void requestCheck() {
21+
if(id==null){
22+
throw new ValidateException(ShoppingRetCode.REQUISITE_PARAMETER_NOT_EXIST.getCode(),ShoppingRetCode.REQUISITE_PARAMETER_NOT_EXIST.getMessage());
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)