Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
T
tanpu-community
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
探普后端
tanpu-community
Commits
9b11bd9b
Commit
9b11bd9b
authored
Aug 18, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图片审核失败图片
parent
0f994b09
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
16 deletions
+28
-16
FileChechStatusEnum.java
...va/com/tanpu/community/api/enums/FileChechStatusEnum.java
+1
-1
FileRecordEntity.java
...anpu/community/dao/entity/community/FileRecordEntity.java
+0
-5
BatchFeignCallService.java
...va/com/tanpu/community/service/BatchFeignCallService.java
+27
-10
No files found.
community-api/src/main/java/com/tanpu/community/api/enums/FileChechStatusEnum.java
View file @
9b11bd9b
...
@@ -8,7 +8,7 @@ public enum FileChechStatusEnum {
...
@@ -8,7 +8,7 @@ public enum FileChechStatusEnum {
INIT
(
0
,
"初始化"
),
INIT
(
0
,
"初始化"
),
PASS
(
1
,
"审核通过"
),
PASS
(
1
,
"审核通过"
),
NOT_PASS
(
2
,
"审核不通过"
);
FAILED
(
2
,
"审核不通过"
);
public
static
final
HashSet
<
String
>
ossTypeSet
=
SetUtils
.
hashSet
(
"jpg"
,
"jpeg"
,
"png"
,
"txt"
);
public
static
final
HashSet
<
String
>
ossTypeSet
=
SetUtils
.
hashSet
(
"jpg"
,
"jpeg"
,
"png"
,
"txt"
);
...
...
community-service/src/main/java/com/tanpu/community/dao/entity/community/FileRecordEntity.java
View file @
9b11bd9b
...
@@ -3,7 +3,6 @@ package com.tanpu.community.dao.entity.community;
...
@@ -3,7 +3,6 @@ package com.tanpu.community.dao.entity.community;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.tanpu.community.api.enums.FileChechStatusEnum
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
...
@@ -64,10 +63,6 @@ public class FileRecordEntity implements Serializable {
...
@@ -64,10 +63,6 @@ public class FileRecordEntity implements Serializable {
private
String
checkTaskId
;
private
String
checkTaskId
;
public
String
getUrl
(){
public
String
getUrl
(){
if
(
FileChechStatusEnum
.
NOT_PASS
.
getCode
().
equals
(
checkStatus
)){
// 审核不通过,返回默认图片
return
"https://tamp-sit.oss-cn-shanghai.aliyuncs.com/community/pic/default/not_exist.jpg"
;
}
return
getPreviewUrl
().
substring
(
0
,
getPreviewUrl
().
indexOf
(
"?"
));
return
getPreviewUrl
().
substring
(
0
,
getPreviewUrl
().
indexOf
(
"?"
));
}
}
...
...
community-service/src/main/java/com/tanpu/community/service/BatchFeignCallService.java
View file @
9b11bd9b
...
@@ -18,6 +18,7 @@ import com.tanpu.community.api.beans.vo.feign.fatools.UserInfoResp;
...
@@ -18,6 +18,7 @@ import com.tanpu.community.api.beans.vo.feign.fatools.UserInfoResp;
import
com.tanpu.community.api.beans.vo.feign.product.FundInfoBaseResp
;
import
com.tanpu.community.api.beans.vo.feign.product.FundInfoBaseResp
;
import
com.tanpu.community.api.beans.vo.feign.product.ProductInfoVO
;
import
com.tanpu.community.api.beans.vo.feign.product.ProductInfoVO
;
import
com.tanpu.community.api.beans.vo.feign.zhibo.ZhiboListResp
;
import
com.tanpu.community.api.beans.vo.feign.zhibo.ZhiboListResp
;
import
com.tanpu.community.api.enums.FileChechStatusEnum
;
import
com.tanpu.community.dao.entity.community.FileRecordEntity
;
import
com.tanpu.community.dao.entity.community.FileRecordEntity
;
import
com.tanpu.community.dao.entity.community.TopicEntity
;
import
com.tanpu.community.dao.entity.community.TopicEntity
;
import
com.tanpu.community.feign.course.FeignClientForCourse
;
import
com.tanpu.community.feign.course.FeignClientForCourse
;
...
@@ -180,7 +181,10 @@ public class BatchFeignCallService {
...
@@ -180,7 +181,10 @@ public class BatchFeignCallService {
curriculumIds
.
add
(
c
.
getValue
());
curriculumIds
.
add
(
c
.
getValue
());
}
else
if
(
c
.
getType
().
equals
(
RelTypeEnum
.
SINGLE_IMG
.
type
))
{
}
else
if
(
c
.
getType
().
equals
(
RelTypeEnum
.
SINGLE_IMG
.
type
))
{
imageIds
.
add
(
c
.
getValue
());
imageIds
.
add
(
c
.
getValue
());
}
else
if
(
c
.
getType
().
equals
(
RelTypeEnum
.
NEW_COURSE_SECTION_AUDIO
.
type
)
||
}
else
if
(
c
.
getType
().
equals
(
RelTypeEnum
.
MULTIPLE_IMAGE
.
type
))
{
c
.
getImgList
().
forEach
(
img
->
imageIds
.
add
(
img
.
getRelId
()));
}
else
if
(
c
.
getType
().
equals
(
RelTypeEnum
.
NEW_COURSE_SECTION_AUDIO
.
type
)
||
c
.
getType
().
equals
(
RelTypeEnum
.
NEW_COURSE_SECTION_VIDEO
.
type
))
{
c
.
getType
().
equals
(
RelTypeEnum
.
NEW_COURSE_SECTION_VIDEO
.
type
))
{
courseIds
.
add
(
c
.
getValue
());
courseIds
.
add
(
c
.
getValue
());
}
}
...
@@ -436,6 +440,13 @@ public class BatchFeignCallService {
...
@@ -436,6 +440,13 @@ public class BatchFeignCallService {
//压缩图片
//压缩图片
.
resizeUrl
(
imgEntity
.
getUrl
()
+
CommunityConstant
.
OSS_RESIZE_RATIO
)
.
resizeUrl
(
imgEntity
.
getUrl
()
+
CommunityConstant
.
OSS_RESIZE_RATIO
)
.
build
();
.
build
();
// 图片审核屏蔽
if
(
FileChechStatusEnum
.
FAILED
.
getCode
().
equals
(
imgEntity
.
getCheckStatus
())){
imagesDTO
.
setRemark
(
"https://tamp-sit.oss-cn-shanghai.aliyuncs.com/community/pic/default/check_fail.png"
);
imagesDTO
.
setResizeUrl
(
"https://tamp-sit.oss-cn-shanghai.aliyuncs.com/community/pic/default/check_fail.png?x-oss-process=image/resize,p_50"
);
imagesDTO
.
setImgWidth
(
1035
);
imagesDTO
.
setImgHeight
(
1115
);
}
themeContent
.
setImgList
(
Collections
.
singletonList
(
imagesDTO
));
themeContent
.
setImgList
(
Collections
.
singletonList
(
imagesDTO
));
}
}
}
}
...
@@ -446,15 +457,21 @@ public class BatchFeignCallService {
...
@@ -446,15 +457,21 @@ public class BatchFeignCallService {
if
(
imgUrlMap
.
containsKey
(
imagesDTO
.
getRelId
()))
{
if
(
imgUrlMap
.
containsKey
(
imagesDTO
.
getRelId
()))
{
FileRecordEntity
imgEntity
=
imgUrlMap
.
get
(
imagesDTO
.
getRelId
());
FileRecordEntity
imgEntity
=
imgUrlMap
.
get
(
imagesDTO
.
getRelId
());
// 处理屏蔽图片
// 图片审核不通过,替换为默认图片
imagesDTO
.
setRemark
(
imgEntity
.
getUrl
());
if
(
FileChechStatusEnum
.
FAILED
.
getCode
().
equals
(
imgEntity
.
getCheckStatus
())){
//压缩图片地址
imagesDTO
.
setRemark
(
"https://tamp-sit.oss-cn-shanghai.aliyuncs.com/community/pic/default/check_fail.png"
);
imagesDTO
.
setResizeUrl
(
imgEntity
.
getUrl
()
+
CommunityConstant
.
OSS_RESIZE_RATIO
);
imagesDTO
.
setResizeUrl
(
"https://tamp-sit.oss-cn-shanghai.aliyuncs.com/community/pic/default/check_fail.png?x-oss-process=image/resize,p_50"
);
String
extInfo
=
imgEntity
.
getExtInfo
();
imagesDTO
.
setImgWidth
(
1035
);
if
(!
StringUtils
.
isEmpty
(
extInfo
))
{
imagesDTO
.
setImgHeight
(
1115
);
Map
<
String
,
Object
>
extMap
=
JsonUtil
.
toMap
(
extInfo
);
}
else
{
imagesDTO
.
setImgHeight
((
Integer
)
extMap
.
get
(
"height"
));
imagesDTO
.
setRemark
(
imgEntity
.
getUrl
());
imagesDTO
.
setImgWidth
((
Integer
)
extMap
.
get
(
"width"
));
imagesDTO
.
setResizeUrl
(
imgEntity
.
getUrl
()
+
CommunityConstant
.
OSS_RESIZE_RATIO
);
String
extInfo
=
imgEntity
.
getExtInfo
();
if
(!
StringUtils
.
isEmpty
(
extInfo
))
{
Map
<
String
,
Object
>
extMap
=
JsonUtil
.
toMap
(
extInfo
);
imagesDTO
.
setImgHeight
((
Integer
)
extMap
.
get
(
"height"
));
imagesDTO
.
setImgWidth
((
Integer
)
extMap
.
get
(
"width"
));
}
}
}
}
}
}
}
...
...
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