Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fzm-joying
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
lei
fzm-joying
Commits
b2e98322
Commit
b2e98322
authored
Jul 12, 2021
by
tangtuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
类目|主题等加入缓存
parent
edff9f7d
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
33 additions
and
4 deletions
+33
-4
CategoryController.java
...ain/java/com/fzm/admin/controller/CategoryController.java
+1
-1
LabelController.java
...c/main/java/com/fzm/admin/controller/LabelController.java
+1
-1
CategoryService.java
...src/main/java/com/fzm/common/service/CategoryService.java
+5
-0
LabelService.java
...on/src/main/java/com/fzm/common/service/LabelService.java
+4
-0
CategoryServiceImpl.java
...java/com/fzm/common/service/impl/CategoryServiceImpl.java
+7
-0
LabelServiceImpl.java
...in/java/com/fzm/common/service/impl/LabelServiceImpl.java
+7
-0
CategoryController.java
...in/java/com/fzm/portal/controller/CategoryController.java
+1
-1
LabelController.java
.../main/java/com/fzm/portal/controller/LabelController.java
+1
-1
NftController.java
...rc/main/java/com/fzm/portal/controller/NftController.java
+6
-0
No files found.
joying-admin/src/main/java/com/fzm/admin/controller/CategoryController.java
View file @
b2e98322
...
...
@@ -30,6 +30,6 @@ public class CategoryController {
@GetMapping
(
"/list"
)
@ApiOperation
(
value
=
"查询所有类目信息"
)
public
ResponseModel
<
List
<
Category
>>
list
()
{
return
ResponseModel
.
success
(
categoryService
.
list
());
return
ResponseModel
.
success
(
categoryService
.
list
All
());
}
}
joying-admin/src/main/java/com/fzm/admin/controller/LabelController.java
View file @
b2e98322
...
...
@@ -30,6 +30,6 @@ public class LabelController {
@GetMapping
(
"/list"
)
@ApiOperation
(
value
=
"查询所有标签信息"
)
public
ResponseModel
<
List
<
Label
>>
list
()
{
return
ResponseModel
.
success
(
labelService
.
list
());
return
ResponseModel
.
success
(
labelService
.
list
All
());
}
}
joying-common/src/main/java/com/fzm/common/service/CategoryService.java
View file @
b2e98322
...
...
@@ -3,6 +3,8 @@ package com.fzm.common.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.fzm.common.entity.Category
;
import
java.util.List
;
/**
* @author tangtuo
* @date 2021/7/1 14:35
...
...
@@ -10,4 +12,7 @@ import com.fzm.common.entity.Category;
public
interface
CategoryService
extends
IService
<
Category
>
{
Category
getCategoryById
(
Integer
categoryId
);
List
<
Category
>
listAll
();
}
joying-common/src/main/java/com/fzm/common/service/LabelService.java
View file @
b2e98322
...
...
@@ -4,10 +4,14 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.fzm.common.entity.Category
;
import
com.fzm.common.entity.Label
;
import
java.util.List
;
/**
* @author tangtuo
* @date 2021/7/1 14:35
*/
public
interface
LabelService
extends
IService
<
Label
>
{
List
<
Label
>
listAll
();
}
joying-common/src/main/java/com/fzm/common/service/impl/CategoryServiceImpl.java
View file @
b2e98322
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
com.fzm.common.entity.Category
;
import
com.fzm.common.mapper.CategoryMapper
;
import
com.fzm.common.service.CategoryService
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
...
...
@@ -25,4 +26,10 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
}
return
null
;
}
@Override
@Cacheable
(
value
=
"category"
,
key
=
"'list'"
)
public
List
<
Category
>
listAll
()
{
return
list
();
}
}
joying-common/src/main/java/com/fzm/common/service/impl/LabelServiceImpl.java
View file @
b2e98322
...
...
@@ -7,6 +7,7 @@ import com.fzm.common.mapper.CategoryMapper;
import
com.fzm.common.mapper.LabelMapper
;
import
com.fzm.common.service.CategoryService
;
import
com.fzm.common.service.LabelService
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
...
...
@@ -18,4 +19,10 @@ import java.util.List;
@Service
public
class
LabelServiceImpl
extends
ServiceImpl
<
LabelMapper
,
Label
>
implements
LabelService
{
@Override
@Cacheable
(
value
=
"label"
,
key
=
"'list'"
)
public
List
<
Label
>
listAll
()
{
return
list
();
}
}
joying-portal/src/main/java/com/fzm/portal/controller/CategoryController.java
View file @
b2e98322
...
...
@@ -27,6 +27,6 @@ public class CategoryController {
@GetMapping
(
"/list"
)
@ApiOperation
(
value
=
"查询所有类目信息"
)
public
ResponseModel
<
List
<
Category
>>
list
()
{
return
ResponseModel
.
success
(
categoryService
.
list
());
return
ResponseModel
.
success
(
categoryService
.
list
All
());
}
}
joying-portal/src/main/java/com/fzm/portal/controller/LabelController.java
View file @
b2e98322
...
...
@@ -29,6 +29,6 @@ public class LabelController {
@GetMapping
(
"/list"
)
@ApiOperation
(
value
=
"查询所有主题信息"
)
public
ResponseModel
<
List
<
Label
>>
list
()
{
return
ResponseModel
.
success
(
labelService
.
list
());
return
ResponseModel
.
success
(
labelService
.
list
All
());
}
}
joying-portal/src/main/java/com/fzm/portal/controller/NftController.java
View file @
b2e98322
...
...
@@ -21,6 +21,7 @@ import com.fzm.common.utils.QRCodeUtil;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -36,6 +37,7 @@ import java.util.stream.Collectors;
* @author tangtuo
* @date 2021/6/30 15:08
*/
@Slf4j
@RestController
@RequestMapping
(
value
=
"/nft"
)
@Api
(
tags
=
"nft管理"
)
...
...
@@ -79,10 +81,14 @@ public class NftController {
throw
GlobalException
.
newException
(
ResultCode
.
VALIDATE_FAILED
,
"当选择加密存档的时候,文件和授权阅读不能为空"
);
}
// 判断文件的hash是否被篡改过
log
.
info
(
"verify fileHash start"
);
if
(!
SecureUtil
.
md5
(
file
.
getInputStream
()).
equals
(
fileHash
))
{
throw
GlobalException
.
newException
(
ResultCode
.
VALIDATE_FAILED
,
"文件hash和文件内容不匹配"
);
}
log
.
info
(
"verify fileHash end"
);
log
.
info
(
"upload file start"
);
String
fileUrl
=
ossUtil
.
putEncryptObject
(
file
);
log
.
info
(
"upload file end"
);
nft
.
setFileUrl
(
fileUrl
).
setIsGrant
(
isGrant
).
setFileName
(
file
.
getOriginalFilename
());
}
nft
.
setCategoryId
(
categoryId
)
...
...
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