Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gogirl-miniapp-backend
Overview
Overview
Details
Activity
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
huluobin
gogirl-miniapp-backend
Commits
a1a99c0d
Commit
a1a99c0d
authored
Aug 03, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
4c802a0d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
11 deletions
+10
-11
MallCategoryServiceImpl.java
...pplication/product/mall/impl/MallCategoryServiceImpl.java
+9
-10
application.yml
src/main/resources/application.yml
+1
-1
No files found.
src/main/java/com/gogirl/application/product/mall/impl/MallCategoryServiceImpl.java
View file @
a1a99c0d
...
@@ -3,7 +3,6 @@ package com.gogirl.application.product.mall.impl;
...
@@ -3,7 +3,6 @@ package com.gogirl.application.product.mall.impl;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.gogirl.application.product.mall.MallCategoryService
;
import
com.gogirl.application.product.mall.MallCategoryService
;
import
com.gogirl.domain.product.mall.MallCategory
;
import
com.gogirl.domain.product.mall.MallCategory
;
import
com.gogirl.infrastructure.common.util.ListUtil
;
import
com.gogirl.infrastructure.mapper.order.mall.CategoryMapper
;
import
com.gogirl.infrastructure.mapper.order.mall.CategoryMapper
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -25,7 +24,9 @@ public class MallCategoryServiceImpl extends ServiceImpl<CategoryMapper, MallCat
...
@@ -25,7 +24,9 @@ public class MallCategoryServiceImpl extends ServiceImpl<CategoryMapper, MallCat
@Override
@Override
public
List
<
MallCategory
>
getCategoryList
(
Long
categoryId
)
{
public
List
<
MallCategory
>
getCategoryList
(
Long
categoryId
)
{
List
<
MallCategory
>
list
=
this
.
getCategoryTreeList
();
List
<
MallCategory
>
list
=
this
.
getCategoryTreeList
();
return
findSubTree
(
list
,
categoryId
);
List
<
MallCategory
>
result
=
new
ArrayList
<>();
findSubTree
(
list
,
categoryId
,
result
);
return
result
;
}
}
/**
/**
...
@@ -34,19 +35,17 @@ public class MallCategoryServiceImpl extends ServiceImpl<CategoryMapper, MallCat
...
@@ -34,19 +35,17 @@ public class MallCategoryServiceImpl extends ServiceImpl<CategoryMapper, MallCat
* @param list
* @param list
* @param subTreeId
* @param subTreeId
*/
*/
private
List
<
MallCategory
>
findSubTree
(
List
<
MallCategory
>
list
,
Long
subTreeId
)
{
private
void
findSubTree
(
List
<
MallCategory
>
list
,
Long
subTreeId
,
List
<
MallCategory
>
result
)
{
for
(
MallCategory
mallCategory
:
list
)
{
for
(
MallCategory
mallCategory
:
list
)
{
if
(
mallCategory
.
getChildList
()
==
null
)
{
mallCategory
.
setChildList
(
new
ArrayList
<>());
}
if
(
mallCategory
.
getId
().
equals
(
subTreeId
))
{
if
(
mallCategory
.
getId
().
equals
(
subTreeId
))
{
if
(
ListUtil
.
isEmpty
(
mallCategory
.
getChildList
()))
{
result
.
addAll
(
mallCategory
.
getChildList
());
return
new
ArrayList
<>();
}
return
mallCategory
.
getChildList
();
}
else
if
(
ListUtil
.
isNotEmpty
(
mallCategory
.
getChildList
()))
{
this
.
findSubTree
(
mallCategory
.
getChildList
(),
subTreeId
);
}
}
findSubTree
(
mallCategory
.
getChildList
(),
subTreeId
,
result
);
}
}
return
new
ArrayList
<>();
}
}
/**
/**
...
...
src/main/resources/application.yml
View file @
a1a99c0d
spring
:
spring
:
profiles
:
profiles
:
active
:
pr
od
active
:
pr
e
servlet
:
servlet
:
#文件上传最大容量
#文件上传最大容量
multipart
:
multipart
:
...
...
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