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
6aaedfd4
Commit
6aaedfd4
authored
Jul 13, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文件上传 图片宽高
parent
618b0d9d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
3 deletions
+15
-3
CommunityConstant.java
.../main/java/com/tanpu/community/api/CommunityConstant.java
+10
-1
OSSFileService.java
...main/java/com/tanpu/community/service/OSSFileService.java
+3
-1
ProductService.java
...main/java/com/tanpu/community/service/ProductService.java
+2
-1
No files found.
community-api/src/main/java/com/tanpu/community/api/CommunityConstant.java
View file @
6aaedfd4
package
com
.
tanpu
.
community
.
api
;
package
com
.
tanpu
.
community
.
api
;
import
org.springframework.beans.factory.annotation.Value
;
/**
/**
* monitor系统常量
* monitor系统常量
*/
*/
...
@@ -8,7 +10,14 @@ public final class CommunityConstant {
...
@@ -8,7 +10,14 @@ public final class CommunityConstant {
public
static
final
String
PACKAGE_BASE
=
"com.tanpu.community"
;
public
static
final
String
PACKAGE_BASE
=
"com.tanpu.community"
;
public
static
final
String
OSS_PREFIX_URL
=
"https://tamp-sit.oss-cn-shanghai.aliyuncs.com"
;
public
static
final
String
OSS_PREFIX_URL
=
"https://tamp-sit.oss-cn-shanghai.aliyuncs.com/"
;
@Value
(
"${aliyun.oss.bucketName}"
)
public
String
OSS_BUCKET_NAME
;
@Value
(
"${aliyun.oss.endpoint}"
)
public
String
OSS_END_POINT
;
public
static
final
String
OSS_PREFIX_FOLDER
=
"community/"
;
public
static
final
String
OSS_PREFIX_FOLDER
=
"community/"
;
}
}
community-service/src/main/java/com/tanpu/community/service/OSSFileService.java
View file @
6aaedfd4
package
com
.
tanpu
.
community
.
service
;
package
com
.
tanpu
.
community
.
service
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.tanpu.common.constant.BizStatus
;
import
com.tanpu.common.constant.BizStatus
;
import
com.tanpu.common.exception.BizException
;
import
com.tanpu.common.exception.BizException
;
import
com.tanpu.common.util.AliyunOSSHelper
;
import
com.tanpu.common.util.AliyunOSSHelper
;
...
@@ -119,6 +120,7 @@ public class OSSFileService {
...
@@ -119,6 +120,7 @@ public class OSSFileService {
}
}
public
List
<
FileRecordEntity
>
queryByIds
(
List
<
String
>
fileIds
)
{
public
List
<
FileRecordEntity
>
queryByIds
(
List
<
String
>
fileIds
)
{
return
fileRecordMapper
.
selectBatchIds
(
fileIds
);
return
fileRecordMapper
.
selectList
(
new
LambdaQueryWrapper
<
FileRecordEntity
>()
.
in
(
FileRecordEntity:
:
getFileId
,
fileIds
));
}
}
}
}
community-service/src/main/java/com/tanpu/community/service/ProductService.java
View file @
6aaedfd4
...
@@ -384,12 +384,13 @@ public class ProductService {
...
@@ -384,12 +384,13 @@ public class ProductService {
}
else
if
(
themeContent
.
getType
().
equals
(
RelTypeEnum
.
SINGLE_IMG
.
type
))
{
}
else
if
(
themeContent
.
getType
().
equals
(
RelTypeEnum
.
SINGLE_IMG
.
type
))
{
if
(
imgUrlMap
.
containsKey
(
themeContent
.
getValue
()))
{
if
(
imgUrlMap
.
containsKey
(
themeContent
.
getValue
()))
{
FileRecordEntity
imgEntity
=
imgUrlMap
.
get
(
themeContent
.
getValue
());
FileRecordEntity
imgEntity
=
imgUrlMap
.
get
(
themeContent
.
getValue
());
themeContent
.
setValue
(
imgEntity
.
getUrl
());
String
extInfo
=
imgEntity
.
getExtInfo
();
String
extInfo
=
imgEntity
.
getExtInfo
();
if
(!
StringUtils
.
isEmpty
(
extInfo
)){
if
(!
StringUtils
.
isEmpty
(
extInfo
)){
Map
<
String
,
Object
>
extMap
=
JsonUtil
.
toMap
(
extInfo
);
Map
<
String
,
Object
>
extMap
=
JsonUtil
.
toMap
(
extInfo
);
ImagesDTO
imagesDTO
=
ImagesDTO
.
builder
().
imgHeight
((
Integer
)
extMap
.
get
(
"height"
))
ImagesDTO
imagesDTO
=
ImagesDTO
.
builder
().
imgHeight
((
Integer
)
extMap
.
get
(
"height"
))
.
imgWidth
((
Integer
)
extMap
.
get
(
"width"
))
.
imgWidth
((
Integer
)
extMap
.
get
(
"width"
))
.
remark
(
imgEntity
.
getUrl
())
.
relId
(
imgEntity
.
getFileId
())
.
build
();
.
build
();
themeContent
.
setImgList
(
Collections
.
singletonList
(
imagesDTO
));
themeContent
.
setImgList
(
Collections
.
singletonList
(
imagesDTO
));
}
}
...
...
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