Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
23b3b98f
Commit
23b3b98f
authored
Sep 14, 2023
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
类目
parent
4f720f0f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
0 deletions
+60
-0
ch-admin-api/src/main/java/com/wwdz/ch/admin/config/ShiroConfig.java
...i/src/main/java/com/wwdz/ch/admin/config/ShiroConfig.java
+1
-0
ch-admin-api/src/main/java/com/wwdz/ch/admin/controller/CategoryController.java
...java/com/wwdz/ch/admin/controller/CategoryController.java
+21
-0
ch-admin-api/src/main/java/com/wwdz/ch/admin/job/SynCategoryInfo.java
.../src/main/java/com/wwdz/ch/admin/job/SynCategoryInfo.java
+38
-0
No files found.
ch-admin-api/src/main/java/com/wwdz/ch/admin/config/ShiroConfig.java
View file @
23b3b98f
...
@@ -113,6 +113,7 @@ public class ShiroConfig {
...
@@ -113,6 +113,7 @@ public class ShiroConfig {
filterChainDefinitionMap
.
put
(
"/admin/item/updateUrl"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/admin/item/updateUrl"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/admin/item/synToEs"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/admin/item/synToEs"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/admin/category/copy"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/admin/invitationCode/**"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/admin/invitationCode/**"
,
"anon"
);
// filterChainDefinitionMap.put("/admin/**", "anon");
// filterChainDefinitionMap.put("/admin/**", "anon");
...
...
ch-admin-api/src/main/java/com/wwdz/ch/admin/controller/CategoryController.java
View file @
23b3b98f
...
@@ -9,9 +9,11 @@ import javax.validation.constraints.NotNull;
...
@@ -9,9 +9,11 @@ import javax.validation.constraints.NotNull;
import
com.wwdz.ch.admin.annotation.RequiresPermissionsDesc
;
import
com.wwdz.ch.admin.annotation.RequiresPermissionsDesc
;
import
com.wwdz.ch.admin.entity.vo.CategoryVo
;
import
com.wwdz.ch.admin.entity.vo.CategoryVo
;
import
com.wwdz.ch.admin.job.SynCategoryInfo
;
import
com.wwdz.ch.admin.service.CategoryService
;
import
com.wwdz.ch.admin.service.CategoryService
;
import
com.wwdz.ch.admin.util.AuthSupport
;
import
com.wwdz.ch.admin.util.AuthSupport
;
import
com.wwdz.ch.core.type.ListResult
;
import
com.wwdz.ch.core.type.ListResult
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.domain.Category
;
import
com.wwdz.ch.db.domain.Category
;
import
com.wwdz.ch.db.dao.CategoryDao
;
import
com.wwdz.ch.db.dao.CategoryDao
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
...
@@ -44,6 +46,9 @@ public class CategoryController {
...
@@ -44,6 +46,9 @@ public class CategoryController {
@Autowired
@Autowired
private
CategoryService
categoryService
;
private
CategoryService
categoryService
;
@Autowired
SynCategoryInfo
synCategoryInfo
;
@RequiresPermissions
(
"admin:category:list"
)
@RequiresPermissions
(
"admin:category:list"
)
@RequiresPermissionsDesc
(
menu
=
{
"商场管理"
,
"类目管理"
},
button
=
"查询"
)
@RequiresPermissionsDesc
(
menu
=
{
"商场管理"
,
"类目管理"
},
button
=
"查询"
)
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
...
@@ -171,4 +176,20 @@ public class CategoryController {
...
@@ -171,4 +176,20 @@ public class CategoryController {
return
ResponseUtil
.
ok
(
data
);
return
ResponseUtil
.
ok
(
data
);
}
}
@GetMapping
(
"/copy"
)
public
Result
copy
(
Integer
id
)
{
logger
.
info
(
"【请求开始】复制类目信息"
);
try
{
if
(
id
==
null
)
{
return
Result
.
failed
(
"id不能为空"
);
}
synCategoryInfo
.
execute
(
id
);
return
Result
.
success
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"复制类目信息 error:{}"
,
e
);
}
return
Result
.
failed
();
}
}
}
ch-admin-api/src/main/java/com/wwdz/ch/admin/job/SynCategoryInfo.java
0 → 100644
View file @
23b3b98f
package
com.wwdz.ch.admin.job
;
import
com.wwdz.ch.db.dao.CategoryDao
;
import
com.wwdz.ch.db.domain.Category
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Component
public
class
SynCategoryInfo
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
SynCategoryInfo
.
class
);
@Autowired
CategoryDao
categoryDao
;
public
void
execute
(
int
id
)
{
Category
category
=
categoryDao
.
findById
(
id
);
List
<
Category
>
categoryList
=
categoryDao
.
queryByPids
(
Arrays
.
asList
(
id
));
logger
.
info
(
"模板id:{}, 子类目数量:{}"
,
id
,
categoryList
.
size
());
categoryList
.
forEach
(
c
->
{
c
.
setIntroduction
(
category
.
getIntroduction
());
c
.
setExtra
(
category
.
getExtra
());
c
.
setIcon
(
category
.
getIcon
());
categoryDao
.
updateById
(
c
);
logger
.
info
(
"类目id:{}, 更新内容:{}"
,
c
.
getId
(),
c
);
});
}
}
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