记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
3ecc01f2
Commit
3ecc01f2
authored
May 26, 2022
by
zhengfuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改分页搜索;
parent
c8da9f79
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
8 deletions
+41
-8
GoblinGoodsInfoListVoo.java
...quidnet/service/goblin/dto/vo/GoblinGoodsInfoListVoo.java
+31
-0
GoblinFrontController.java
...dnet/service/goblin/controller/GoblinFrontController.java
+2
-5
GoblinFrontServiceImpl.java
...t/service/goblin/service/impl/GoblinFrontServiceImpl.java
+8
-3
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinGoodsInfoListVoo.java
0 → 100644
View file @
3ecc01f2
package
com
.
liquidnet
.
service
.
goblin
.
dto
.
vo
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
@ApiModel
(
value
=
"GoblinGoodsInfoListVo"
,
description
=
"商品SPU List"
)
@Data
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
public
class
GoblinGoodsInfoListVoo
implements
Serializable
,
Cloneable
{
private
List
<
GoblinGoodsInfoListVo
>
list
;
@ApiModelProperty
(
position
=
55
,
value
=
"数量"
)
private
long
count
;
private
static
final
GoblinGoodsInfoListVoo
obj
=
new
GoblinGoodsInfoListVoo
();
public
static
GoblinGoodsInfoListVoo
getNew
()
{
try
{
return
(
GoblinGoodsInfoListVoo
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
GoblinGoodsInfoListVoo
();
}
}
/* public int compareTo(GoblinGoodsInfoVo arg0) {
return this.getCount().compareTo(arg0.getCount());
}*/
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinFrontController.java
View file @
3ecc01f2
package
com
.
liquidnet
.
service
.
goblin
.
controller
;
package
com
.
liquidnet
.
service
.
goblin
.
controller
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.commons.lang.util.StringUtil
;
import
com.liquidnet.commons.lang.util.StringUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
com.liquidnet.service.goblin.entity.GoblinFrontHotWord
;
import
com.liquidnet.service.goblin.entity.GoblinFrontHotWord
;
import
com.liquidnet.service.goblin.service.GoblinFrontService
;
import
com.liquidnet.service.goblin.service.impl.GoblinFrontServiceImpl
;
import
com.liquidnet.service.goblin.service.impl.GoblinFrontServiceImpl
;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -134,9 +131,9 @@ public class GoblinFrontController {
...
@@ -134,9 +131,9 @@ public class GoblinFrontController {
@GetMapping
(
"searchGoodesName"
)
@GetMapping
(
"searchGoodesName"
)
@ApiOperation
(
"搜索商品名字、或商铺名字"
)
@ApiOperation
(
"搜索商品名字、或商铺名字"
)
public
ResponseDto
<
List
<
GoblinGoodsInfoListVo
>>
searchGoodesName
(
@RequestParam
(
name
=
"name"
,
required
=
true
)
String
nam
e
)
throws
ParseException
{
public
ResponseDto
<
GoblinGoodsInfoListVoo
>
searchGoodesName
(
@RequestParam
(
name
=
"name"
,
required
=
true
)
String
name
,
@RequestParam
(
name
=
"page"
,
required
=
true
)
int
page
,
@RequestParam
(
name
=
"pageSize"
,
required
=
true
)
int
pageSiz
e
)
throws
ParseException
{
if
(
StringUtil
.
isNotBlank
(
name
))
{
if
(
StringUtil
.
isNotBlank
(
name
))
{
return
ResponseDto
.
success
(
goblinFrontService
.
searchGoodesName
(
name
));
return
ResponseDto
.
success
(
goblinFrontService
.
searchGoodesName
(
name
,
page
,
pageSize
));
}
}
return
ResponseDto
.
success
(
null
);
return
ResponseDto
.
success
(
null
);
}
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinFrontServiceImpl.java
View file @
3ecc01f2
...
@@ -463,7 +463,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -463,7 +463,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
}
}
public
List
<
GoblinGoodsInfoListVo
>
searchGoodesName
(
String
nam
e
)
{
public
GoblinGoodsInfoListVoo
searchGoodesName
(
String
name
,
int
page
,
int
pageSiz
e
)
{
List
<
String
>
listStore
=
mongoUtils
.
getStoreInfoVoRegexName
(
name
);
List
<
String
>
listStore
=
mongoUtils
.
getStoreInfoVoRegexName
(
name
);
Pattern
pattern
=
Pattern
.
compile
(
"^.*"
+
name
+
".*$"
,
Pattern
.
CASE_INSENSITIVE
);
Pattern
pattern
=
Pattern
.
compile
(
"^.*"
+
name
+
".*$"
,
Pattern
.
CASE_INSENSITIVE
);
Query
query
=
new
Query
();
Query
query
=
new
Query
();
...
@@ -475,11 +475,14 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -475,11 +475,14 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
),
),
new
Criteria
().
orOperator
(
Criteria
.
where
(
"spuType"
).
exists
(
false
),
(
Criteria
.
where
(
"spuType"
).
is
(
0
)))
new
Criteria
().
orOperator
(
Criteria
.
where
(
"spuType"
).
exists
(
false
),
(
Criteria
.
where
(
"spuType"
).
is
(
0
)))
));
));
query
.
with
(
PageRequest
.
of
(
0
,
20
)).
with
(
Sort
.
by
(
query
.
with
(
PageRequest
.
of
(
page
,
pageSize
)).
with
(
Sort
.
by
(
//Sort.Order.desc("count"),
//Sort.Order.desc("count"),
Sort
.
Order
.
desc
(
"shelvesAt"
)
Sort
.
Order
.
desc
(
"shelvesAt"
)
));
));
List
<
GoblinGoodsInfoVo
>
list
=
mongoTemplate
.
find
(
query
,
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
List
<
GoblinGoodsInfoVo
>
list
=
mongoTemplate
.
find
(
query
,
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
long
count
=
mongoTemplate
.
count
(
query
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
GoblinGoodsInfoListVoo
goblinGoodsInfoListVoo
=
GoblinGoodsInfoListVoo
.
getNew
();
goblinGoodsInfoListVoo
.
setCount
(
count
);
ArrayList
<
GoblinGoodsInfoListVo
>
list1
=
ObjectUtil
.
getGoblinGoodsInfoListVo
();
ArrayList
<
GoblinGoodsInfoListVo
>
list1
=
ObjectUtil
.
getGoblinGoodsInfoListVo
();
//遍历
//遍历
for
(
GoblinGoodsInfoVo
goblinGoodsInfoVo
:
list
)
{
for
(
GoblinGoodsInfoVo
goblinGoodsInfoVo
:
list
)
{
...
@@ -507,7 +510,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -507,7 +510,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
list1
.
add
(
goblinGoodsInfoListVo
);
list1
.
add
(
goblinGoodsInfoListVo
);
}
}
}
}
return
list1
;
goblinGoodsInfoListVoo
.
setList
(
list1
);
return
goblinGoodsInfoListVoo
;
//return list1;
}
}
public
GoblinFrontCategoryListVo
getStoreGoodes
(
String
storeId
,
String
categoryId
,
String
name
)
{
public
GoblinFrontCategoryListVo
getStoreGoodes
(
String
storeId
,
String
categoryId
,
String
name
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment