记得上下班打卡 | 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
01ee0a7e
Commit
01ee0a7e
authored
Jan 14, 2022
by
zhengfuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改分类的东西
parent
814c120a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
1 deletion
+65
-1
GoblinCategoryzfVo.java
...m/liquidnet/service/goblin/dto/vo/GoblinCategoryzfVo.java
+27
-0
GoblinFrontController.java
...dnet/service/goblin/controller/GoblinFrontController.java
+8
-1
GoblinFrontServiceImpl.java
...t/service/goblin/service/impl/GoblinFrontServiceImpl.java
+30
-0
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinCategoryzfVo.java
0 → 100644
View file @
01ee0a7e
package
com
.
liquidnet
.
service
.
goblin
.
dto
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
@ApiModel
(
value
=
"GoblinSelfGoodsCategoryVo"
,
description
=
"平台分类信息"
)
@Data
public
class
GoblinCategoryzfVo
implements
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
-
2342407105969740471L
;
@ApiModelProperty
(
value
=
"传入的当前分类信息"
)
GoblinSelfGoodsCategoryVo
goblinSelfGoodsCategoryVo
;
@ApiModelProperty
(
value
=
"当前分类子信息"
)
List
<
GoblinSelfGoodsCategoryVo
>
list
;
private
static
final
GoblinCategoryzfVo
obj
=
new
GoblinCategoryzfVo
();
public
static
GoblinCategoryzfVo
getNew
()
{
try
{
return
(
GoblinCategoryzfVo
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
GoblinCategoryzfVo
();
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinFrontController.java
View file @
01ee0a7e
...
...
@@ -84,11 +84,18 @@ public class GoblinFrontController {
return
ResponseDto
.
success
(
goblinFrontService
.
getCube
());
}
@GetMapping
(
"getCategoryList"
)
@ApiOperation
(
"获取分类列表商品"
)
@ApiOperation
(
"获取分类列表商品
( 1、销量优先、2、新品优先、3、价格降序、4、价格升序)
"
)
public
ResponseDto
<
GoblinFrontCategoryListVo
>
getCategoryList
(
@RequestParam
(
name
=
"type"
,
required
=
true
)
String
type
,
@RequestParam
(
name
=
"categoryId"
,
required
=
true
)
String
categoryId
,
@RequestParam
(
name
=
"page"
,
required
=
true
)
int
page
,
@RequestParam
(
name
=
"pageSize"
,
required
=
true
)
int
pageSize
)
throws
ParseException
{
return
ResponseDto
.
success
(
goblinFrontService
.
getCategoryList
(
type
,
categoryId
,
page
,
pageSize
));
}
@GetMapping
(
"getCategory"
)
@ApiOperation
(
"获取分类子集"
)
public
ResponseDto
getCategory
(
@RequestParam
(
name
=
"categoryId"
,
required
=
true
)
String
categoryId
)
throws
ParseException
{
return
ResponseDto
.
success
(
goblinFrontService
.
getCategory
(
categoryId
));
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinFrontServiceImpl.java
View file @
01ee0a7e
...
...
@@ -273,6 +273,36 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
return
goblinFrontCubeVo
;
}
/**
* 找到分类
*/
public
GoblinCategoryzfVo
getCategory
(
String
categoryId
){
GoblinCategoryzfVo
goblinCategoryzfVo
=
GoblinCategoryzfVo
.
getNew
();
ArrayList
<
GoblinSelfGoodsCategoryVo
>
list1
=
ObjectUtil
.
getGoblinSelfGoodsCategoryVoArrayList
();
//先找到 当前的分类id
GoblinSelfGoodsCategoryVo
pa
=
null
;
//获取到分类
List
<
GoblinSelfGoodsCategoryVo
>
list
=
goblinRedisUtils
.
getSelfGoodsCategoryVos
();
for
(
GoblinSelfGoodsCategoryVo
goblinSelfGoodsCategoryVo:
list
){
if
(
categoryId
.
equals
(
goblinSelfGoodsCategoryVo
.
getCateId
()))
{
goblinCategoryzfVo
.
setGoblinSelfGoodsCategoryVo
(
goblinSelfGoodsCategoryVo
);
pa
=
goblinSelfGoodsCategoryVo
;
}
}
//找到 该分类的子集
if
(
null
!=
pa
){
for
(
GoblinSelfGoodsCategoryVo
goblinSelfGoodsCategoryVo:
list
){
if
(
pa
.
getCateId
().
equals
(
goblinSelfGoodsCategoryVo
.
getCatePid
())){
list1
.
add
(
goblinSelfGoodsCategoryVo
);
}
}
}
goblinCategoryzfVo
.
setList
(
list1
);
return
goblinCategoryzfVo
;
}
/**
* 获取分类列表
* 1、销量优先、2、新品优先、3、价格降序、4、价格升序
...
...
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