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
74232b0e
Commit
74232b0e
authored
Sep 13, 2023
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
成交详情
parent
c84bbb49
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
0 deletions
+56
-0
ch-core/src/main/java/com/wwdz/ch/core/util/MediaUtil.java
ch-core/src/main/java/com/wwdz/ch/core/util/MediaUtil.java
+54
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/QueryPriceServiceImpl.java
.../main/java/com/wwdz/ch/wx/impl/QueryPriceServiceImpl.java
+2
-0
No files found.
ch-core/src/main/java/com/wwdz/ch/core/util/MediaUtil.java
View file @
74232b0e
...
...
@@ -14,6 +14,8 @@ import java.io.ByteArrayOutputStream;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.net.URL
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
MediaUtil
{
...
...
@@ -87,6 +89,58 @@ public class MediaUtil {
return
null
;
}
/**
* 获取展示图片
*
* @param images
* @param videos
* @return
*/
public
static
Map
<
String
,
Object
>
getHomePageImage
(
String
images
,
String
videos
)
{
Map
<
String
,
Object
>
homePageMap
=
new
HashMap
<>();
homePageMap
.
put
(
"url"
,
""
);
homePageMap
.
put
(
"type"
,
2
);
homePageMap
.
put
(
"width"
,
"0"
);
homePageMap
.
put
(
"height"
,
"0"
);
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
images
))
{
String
[]
image
=
images
.
split
(
";"
);
homePageMap
.
put
(
"url"
,
image
[
0
]);
if
(
image
[
0
].
contains
(
"_"
))
{
homePageMap
=
getAspect
(
image
[
0
]);
homePageMap
.
put
(
"url"
,
image
[
0
]);
homePageMap
.
put
(
"type"
,
2
);
}
}
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
videos
))
{
String
[]
vedioImage
=
videos
.
split
(
";"
);
if
(
vedioImage
[
0
].
contains
(
","
))
{
String
[]
video
=
vedioImage
[
0
].
split
(
","
);
homePageMap
=
getAspect
(
video
[
1
]);
homePageMap
.
put
(
"url"
,
video
[
1
]);
homePageMap
.
put
(
"type"
,
1
);
}
}
return
homePageMap
;
}
/**
* 获取图片的长宽
*
* @param image
* @return
*/
public
static
Map
<
String
,
Object
>
getAspect
(
String
image
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
String
[]
_image
=
image
.
split
(
"_"
);
String
[]
infoImage
=
_image
[
1
].
split
(
"\\."
);
String
[]
result
=
infoImage
[
0
].
split
(
"x"
);
map
.
put
(
"width"
,
result
[
0
]);
map
.
put
(
"height"
,
result
[
1
]);
return
map
;
}
public
static
void
main
(
String
[]
args
)
{
String
vedioUrl
=
"https://cdn.wanwudezhi.com/static/web-static/video/53596700878a572ca4fae35243aaa819.mp4"
;
String
url
=
getImageByCutVedio
(
vedioUrl
);
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/QueryPriceServiceImpl.java
View file @
74232b0e
...
...
@@ -5,6 +5,7 @@ import com.github.pagehelper.PageInfo;
import
com.wwdz.ch.core.entity.Chart
;
import
com.wwdz.ch.core.type.PageSearchResult
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.core.util.MediaUtil
;
import
com.wwdz.ch.db.dao.BidRecordDao
;
import
com.wwdz.ch.db.dao.CategoryDao
;
import
com.wwdz.ch.db.dao.ItemDao
;
...
...
@@ -124,6 +125,7 @@ public class QueryPriceServiceImpl implements QueryPriceService {
map
.
put
(
"bidTime"
,
i
.
getBidTime
());
map
.
put
(
"price"
,
StringUtil
.
formatAmount
(
String
.
valueOf
(
Math
.
round
(
i
.
getPrice
()
/
(
double
)
100
))));
map
.
put
(
"platform"
,
"电商平台"
);
map
.
put
(
"homePageImage"
,
MediaUtil
.
getHomePageImage
(
i
.
getImages
(),
i
.
getVideos
()));
map
.
put
(
"detail"
,
i
.
getDetail
());
if
(
StringUtils
.
hasLength
(
i
.
getTopImage
()))
{
map
.
put
(
"image"
,
i
.
getTopImage
());
...
...
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