Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoban3.0
haoban-manage3.0
Commits
f4a1601e
Commit
f4a1601e
authored
Oct 29, 2024
by
王祖波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
内容分享企微素材使用老的前端合成还是新的后端合成 0老1新
parent
1b2b8aa5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
6 deletions
+45
-6
ImageCombined.java
...haoban/manage/service/context/combined/ImageCombined.java
+7
-6
ContentSettingController.java
...nage/web/controller/content/ContentSettingController.java
+2
-0
ApolloUtils.java
...ain/java/com/gic/haoban/manage/web/utils/ApolloUtils.java
+23
-0
ContentSettingVO.java
...om/gic/haoban/manage/web/vo/content/ContentSettingVO.java
+13
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/context/combined/ImageCombined.java
View file @
f4a1601e
package
com
.
gic
.
haoban
.
manage
.
service
.
context
.
combined
;
package
com
.
gic
.
haoban
.
manage
.
service
.
context
.
combined
;
import
com.ctrip.framework.apollo.Config
;
import
com.ctrip.framework.apollo.Config
;
import
com.ctrip.framework.apollo.ConfigChangeListener
;
import
com.ctrip.framework.apollo.ConfigService
;
import
com.ctrip.framework.apollo.ConfigService
;
import
com.ctrip.framework.apollo.model.ConfigChange
;
import
com.ctrip.framework.apollo.model.ConfigChange
;
import
com.ctrip.framework.apollo.model.ConfigChangeEvent
;
import
com.ctrip.framework.apollo.model.ConfigChangeEvent
;
...
@@ -13,6 +14,7 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -13,6 +14,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
javax.annotation.PostConstruct
;
import
javax.imageio.ImageIO
;
import
javax.imageio.ImageIO
;
import
javax.imageio.ImageReader
;
import
javax.imageio.ImageReader
;
import
javax.imageio.stream.ImageInputStream
;
import
javax.imageio.stream.ImageInputStream
;
...
@@ -23,6 +25,7 @@ import java.io.File;
...
@@ -23,6 +25,7 @@ import java.io.File;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.net.URL
;
import
java.net.URL
;
import
java.util.Arrays
;
import
java.util.Iterator
;
import
java.util.Iterator
;
import
java.util.concurrent.ArrayBlockingQueue
;
import
java.util.concurrent.ArrayBlockingQueue
;
import
java.util.concurrent.ThreadPoolExecutor
;
import
java.util.concurrent.ThreadPoolExecutor
;
...
@@ -52,12 +55,7 @@ public class ImageCombined {
...
@@ -52,12 +55,7 @@ public class ImageCombined {
new
ThreadPoolExecutor
.
AbortPolicy
()
new
ThreadPoolExecutor
.
AbortPolicy
()
);
);
private
ImageCombined
()
{
private
static
void
refreshThreadPool
(
ConfigChangeEvent
changeEvent
)
{
Config
config
=
ConfigService
.
getAppConfig
();
config
.
addChangeListener
(
this
::
refreshThreadPool
);
}
private
void
refreshThreadPool
(
ConfigChangeEvent
changeEvent
)
{
if
(!
StringUtils
.
equals
(
changeEvent
.
getNamespace
(),
APPLICATION
))
{
if
(!
StringUtils
.
equals
(
changeEvent
.
getNamespace
(),
APPLICATION
))
{
return
;
return
;
}
}
...
@@ -90,7 +88,10 @@ public class ImageCombined {
...
@@ -90,7 +88,10 @@ public class ImageCombined {
static
{
static
{
ImageIO
.
scanForPlugins
();
// 初始化图像插件
ImageIO
.
scanForPlugins
();
// 初始化图像插件
Config
config
=
ConfigService
.
getAppConfig
();
config
.
addChangeListener
(
ImageCombined:
:
refreshThreadPool
);
}
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
BufferedImage
largeImage
=
loadImageWithCache
(
LARGE_IMAGE_URL
);
BufferedImage
largeImage
=
loadImageWithCache
(
LARGE_IMAGE_URL
);
BufferedImage
qrCodeImage
=
ImageIO
.
read
(
new
URL
(
QR_CODE_URL
));
BufferedImage
qrCodeImage
=
ImageIO
.
read
(
new
URL
(
QR_CODE_URL
));
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/ContentSettingController.java
View file @
f4a1601e
...
@@ -5,6 +5,7 @@ import com.gic.commons.util.EntityUtil;
...
@@ -5,6 +5,7 @@ import com.gic.commons.util.EntityUtil;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.content.api.dto.setting.ContentSettingDTO
;
import
com.gic.content.api.dto.setting.ContentSettingDTO
;
import
com.gic.content.api.service.ContentSettingApiService
;
import
com.gic.content.api.service.ContentSettingApiService
;
import
com.gic.haoban.manage.web.utils.ApolloUtils
;
import
com.gic.haoban.manage.web.vo.content.ContentSettingVO
;
import
com.gic.haoban.manage.web.vo.content.ContentSettingVO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -39,6 +40,7 @@ public class ContentSettingController {
...
@@ -39,6 +40,7 @@ public class ContentSettingController {
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
}
ContentSettingVO
contentSettingVO
=
EntityUtil
.
changeEntityByJSON
(
ContentSettingVO
.
class
,
serviceResponse
.
getResult
());
ContentSettingVO
contentSettingVO
=
EntityUtil
.
changeEntityByJSON
(
ContentSettingVO
.
class
,
serviceResponse
.
getResult
());
contentSettingVO
.
setCombinedType
(
ApolloUtils
.
combinedType
(
enterpriseId
));
return
RestResponse
.
successResult
(
contentSettingVO
);
return
RestResponse
.
successResult
(
contentSettingVO
);
}
}
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/utils/ApolloUtils.java
0 → 100644
View file @
f4a1601e
package
com
.
gic
.
haoban
.
manage
.
web
.
utils
;
import
com.ctrip.framework.apollo.Config
;
import
com.ctrip.framework.apollo.ConfigService
;
import
com.gic.api.base.commons.Constant
;
import
org.apache.commons.lang3.StringUtils
;
public
class
ApolloUtils
{
/**
* 内容分享企微素材使用老的前端合成还是新的后端合成 0老1新
* @return
*/
public
static
Integer
combinedType
(
String
eid
)
{
Config
config
=
ConfigService
.
getAppConfig
();
String
combinedEid
=
config
.
getProperty
(
"combinedEid"
,
""
);
if
(
StringUtils
.
isBlank
(
combinedEid
))
{
return
Constant
.
FLAG_TRUE
;
}
return
combinedEid
.
contains
(
eid
)
?
Constant
.
FLAG_TRUE
:
Constant
.
FLAG_FALSE
;
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/vo/content/ContentSettingVO.java
View file @
f4a1601e
...
@@ -75,6 +75,11 @@ public class ContentSettingVO implements Serializable {
...
@@ -75,6 +75,11 @@ public class ContentSettingVO implements Serializable {
*/
*/
private
Integer
showStyle
;
private
Integer
showStyle
;
/**
* 0老模式1新模式
*/
private
Integer
combinedType
;
public
Long
getContentSettingId
()
{
public
Long
getContentSettingId
()
{
return
contentSettingId
;
return
contentSettingId
;
}
}
...
@@ -170,4 +175,12 @@ public class ContentSettingVO implements Serializable {
...
@@ -170,4 +175,12 @@ public class ContentSettingVO implements Serializable {
public
void
setShowStyle
(
Integer
showStyle
)
{
public
void
setShowStyle
(
Integer
showStyle
)
{
this
.
showStyle
=
showStyle
;
this
.
showStyle
=
showStyle
;
}
}
public
Integer
getCombinedType
()
{
return
combinedType
;
}
public
void
setCombinedType
(
Integer
combinedType
)
{
this
.
combinedType
=
combinedType
;
}
}
}
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