Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
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
徐少华
midjourney-proxy
Commits
e73dfae8
Commit
e73dfae8
authored
Oct 27, 2018
by
田超
Browse files
Options
Browse Files
Download
Plain Diff
fix confict
parents
c5a2320e
d084ce32
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
458 additions
and
468 deletions
+458
-468
email.properties
...ud-common-config/src/main/resources.prod/email.properties
+19
-11
email.properties
pcloud-common-config/src/main/resources.uat/email.properties
+17
-11
ExapiQueueBizImpl.java
...in/java/com/pcloud/common/core/biz/ExapiQueueBizImpl.java
+12
-31
FrontEventBiz.java
...c/main/java/com/pcloud/common/core/biz/FrontEventBiz.java
+6
-7
FundQueueBizImpl.java
...ain/java/com/pcloud/common/core/biz/FundQueueBizImpl.java
+9
-23
FunnelFlowQueueBizImpl.java
...va/com/pcloud/common/core/biz/FunnelFlowQueueBizImpl.java
+25
-51
LabelUsedQueueBizImpl.java
...ava/com/pcloud/common/core/biz/LabelUsedQueueBizImpl.java
+9
-39
MerchantDynamicQueueBizImpl.java
...m/pcloud/common/core/biz/MerchantDynamicQueueBizImpl.java
+14
-37
MessageBiz.java
.../src/main/java/com/pcloud/common/core/biz/MessageBiz.java
+6
-0
MessageBizImpl.java
.../main/java/com/pcloud/common/core/biz/MessageBizImpl.java
+47
-117
OperationLogQueueBizImpl.java
.../com/pcloud/common/core/biz/OperationLogQueueBizImpl.java
+7
-33
UserActionQueueBizImpl.java
...va/com/pcloud/common/core/biz/UserActionQueueBizImpl.java
+10
-36
WeektaskQueueBizImpl.java
...java/com/pcloud/common/core/biz/WeektaskQueueBizImpl.java
+18
-42
MQTopicProducer.java
...java/com/pcloud/common/core/constant/MQTopicProducer.java
+231
-2
PictureUtil.java
...on/src/main/java/com/pcloud/common/utils/PictureUtil.java
+28
-28
No files found.
pcloud-common-config/src/main/resources.prod/email.properties
View file @
e73dfae8
email.fromEmail
=
rays_support@vip.163.com
#email.fromEmail=rays_support@vip.163.com
email.password
=
chubanyun
#email.password=chubanyun
email.reviewFromEmail
=
rays_review@vip.163.com
#email.reviewFromEmail=rays_review@vip.163.com
email.reviewPassword
=
lgsz2017
#email.reviewPassword=lgsz2017
email.saysEmail
=
says_support@vip.163.com
#email.reviewFromEmail=review@5rs.me
email.saysPassword
=
2017sayschuban
#email.reviewPassword=reviewlgsc
## \u81EA\u5B9A\u4E49\u90AE\u7BB1
## \u81EA\u5B9A\u4E49\u90AE\u7BB1
email.fromEmail.new
=
rays_support@vip.163.com
email.user
=
support
email.password.new
=
chubanyun
email.name
=
support@5rs.me
\ No newline at end of file
email.password
=
supportlgsc
email.review.user
=
review
email.review.name
=
review@5rs.me
email.review.password
=
reviewlgsc
mail.smtp.host
=
smtp.5rs.me
mail.imap.host
=
imap.5rs.me
mail.pop.host
=
pop.5rs.me
\ No newline at end of file
pcloud-common-config/src/main/resources.uat/email.properties
View file @
e73dfae8
email.fromEmail
=
rays_support@vip.163.com
#email.fromEmail=rays_support@vip.163.com
email.password
=
chubanyun
#email.password=chubanyun
email.reviewFromEmail
=
rays_review@vip.163.com
#email.reviewFromEmail=rays_review@vip.163.com
email.reviewPassword
=
lgsz2017
#email.reviewPassword=lgsz2017
email.saysEmail
=
says_support@vip.163.com
email.saysPassword
=
2017sayschuban
## \u81EA\u5B9A\u4E49\u90AE\u7BB1
email.user
=
admin
## \u81EA\u5B9A\u4E49\u90AE\u7BB1
email.name
=
admin@raysyun.com
email.fromEmail.new
=
rays_support@vip.163.com
email.password
=
lgsc2018!
email.password.new
=
chubanyun
email.review.user
=
admin
\ No newline at end of file
email.review.name
=
admin@raysyun.com
email.review.password
=
lgsc2018!
mail.smtp.host
=
smtp.raysyun.com
mail.imap.host
=
imap.raysyun.com
mail.pop.host
=
pop.raysyun.com
\ No newline at end of file
pcloud-common-core/src/main/java/com/pcloud/common/core/biz/ExapiQueueBizImpl.java
View file @
e73dfae8
package
com
.
pcloud
.
common
.
core
.
biz
;
package
com
.
pcloud
.
common
.
core
.
biz
;
import
com.pcloud.common.core.dto.ExapiMessageDto
;
import
org.springframework.amqp.core.AmqpTemplate
;
import
com.pcloud.common.exceptions.BizException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.jms.core.JmsTemplate
;
import
org.springframework.jms.core.MessageCreator
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
javax.jms.JMSException
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
javax.jms.ObjectMessage
;
import
com.pcloud.common.core.constant.MQQueueConstant
;
import
javax.jms.Session
;
import
com.pcloud.common.core.dto.ExapiMessageDto
;
@Component
(
"exapiQueueBiz"
)
@Component
(
"exapiQueueBiz"
)
public
class
ExapiQueueBizImpl
implements
ExapiQueueBiz
{
public
class
ExapiQueueBizImpl
implements
ExapiQueueBiz
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ExapiQueueBiz
.
class
);
@Autowired
(
required
=
false
)
@Autowired
@Qualifier
(
"jmsExapiTemplate"
)
private
AmqpTemplate
amqpTemplate
;
private
JmsTemplate
jmsExapiTemplate
;
@Override
@Override
public
void
sendMessageQueue
(
ExapiMessageDto
exapiMessageDto
)
{
@ParamLog
(
"发送对外API queue"
)
MessageCreator
messageCreator
=
new
MessageCreator
()
{
public
void
sendMessageQueue
(
ExapiMessageDto
exapiMessageDto
)
{
@Override
amqpTemplate
.
convertAndSend
(
MQQueueConstant
.
EXAPI
,
exapiMessageDto
);
public
ObjectMessage
createMessage
(
Session
session
)
throws
JMSException
{
}
return
session
.
createObjectMessage
(
exapiMessageDto
);
}
};
try
{
jmsExapiTemplate
.
send
(
messageCreator
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"发送失败,"
+
e
.
getMessage
()
+
","
+
exapiMessageDto
,
e
);
throw
BizException
.
SEND_QUEUE_FAIL
;
}
LOGGER
.
info
(
"发送成功,"
+
exapiMessageDto
);
}
}
}
pcloud-common-core/src/main/java/com/pcloud/common/core/biz/FrontEventBiz.java
View file @
e73dfae8
package
com
.
pcloud
.
common
.
core
.
biz
;
package
com
.
pcloud
.
common
.
core
.
biz
;
import
com.pcloud.common.core.dto.ConvertQueueDto
;
import
com.pcloud.common.core.dto.FrontEventDto
;
import
com.pcloud.common.core.dto.FrontEventDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
...
@@ -10,10 +9,10 @@ import com.pcloud.common.exceptions.BizException;
...
@@ -10,10 +9,10 @@ import com.pcloud.common.exceptions.BizException;
* @description:
* @description:
*/
*/
public
interface
FrontEventBiz
{
public
interface
FrontEventBiz
{
/**
/**
* 发送事件消息
* 发送事件消息
*
*
* @param frontEventDto
* @param frontEventDto
*/
*/
public
void
sendFrontEventQueue
(
FrontEventDto
frontEventDto
)
throws
BizException
;
public
void
sendFrontEventQueue
(
FrontEventDto
frontEventDto
)
throws
BizException
;
}
}
pcloud-common-core/src/main/java/com/pcloud/common/core/biz/FundQueueBizImpl.java
View file @
e73dfae8
package
com
.
pcloud
.
common
.
core
.
biz
;
package
com
.
pcloud
.
common
.
core
.
biz
;
import
javax.jms.JMSException
;
import
javax.jms.ObjectMessage
;
import
javax.jms.Session
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.amqp.core.AmqpTemplate
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.jms.core.JmsTemplate
;
import
org.springframework.jms.core.MessageCreator
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.constant.MQQueueConstant
;
import
com.pcloud.common.core.dto.FundMessageDto
;
import
com.pcloud.common.core.dto.FundMessageDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
/**
/**
* @description 基金资源变更记录消息队列实现类
* @author PENG
* @author PENG
* @date 2017年10月18日 下午2:11:52
* @version 1.0
* @version 1.0
* @description 基金资源变更记录消息队列实现类
* @date 2017年10月18日 下午2:11:52
*/
*/
@Component
(
"fundQueueBiz"
)
@Component
(
"fundQueueBiz"
)
public
class
FundQueueBizImpl
implements
FundQueueBiz
{
public
class
FundQueueBizImpl
implements
FundQueueBiz
{
...
@@ -29,29 +24,20 @@ public class FundQueueBizImpl implements FundQueueBiz {
...
@@ -29,29 +24,20 @@ public class FundQueueBizImpl implements FundQueueBiz {
*/
*/
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
FundQueueBizImpl
.
class
);
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
FundQueueBizImpl
.
class
);
@Autowired
(
required
=
false
)
@Autowired
@Qualifier
(
"jmsFundTemplate"
)
private
AmqpTemplate
amqpTemplate
;
private
JmsTemplate
jmsFundTemplate
;
/**
/**
* 发送队列
* 发送队列
*/
*/
@Override
@Override
@ParamLog
(
"发送基金资源变更记录消息QUEUE"
)
public
void
sendFundMessage
(
FundMessageDto
fundMessageDto
)
throws
BizException
{
public
void
sendFundMessage
(
FundMessageDto
fundMessageDto
)
throws
BizException
{
MessageCreator
messageCreator
=
new
MessageCreator
()
{
@Override
public
ObjectMessage
createMessage
(
Session
session
)
throws
JMSException
{
return
session
.
createObjectMessage
(
fundMessageDto
);
}
};
try
{
try
{
jmsFundTemplate
.
send
(
messageCreator
);
amqpTemplate
.
convertAndSend
(
MQQueueConstant
.
FUND
,
fundMessageDto
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"发送失败,"
+
e
.
getMessage
()
+
","
+
fundMessageDto
.
toString
(),
e
);
logger
.
error
(
"发送失败,"
+
e
.
getMessage
()
+
","
+
fundMessageDto
.
toString
(),
e
);
throw
BizException
.
SEND_QUEUE_FAIL
;
throw
BizException
.
SEND_QUEUE_FAIL
;
}
}
logger
.
info
(
"发送成功,"
+
fundMessageDto
.
toString
());
}
}
}
}
pcloud-common-core/src/main/java/com/pcloud/common/core/biz/FunnelFlowQueueBizImpl.java
View file @
e73dfae8
package
com
.
pcloud
.
common
.
core
.
biz
;
package
com
.
pcloud
.
common
.
core
.
biz
;
import
javax.jms.JMSException
;
import
org.springframework.amqp.core.AmqpTemplate
;
import
javax.jms.ObjectMessage
;
import
javax.jms.Session
;
import
org.apache.activemq.command.ActiveMQQueue
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.jms.core.JmsTemplate
;
import
org.springframework.jms.core.MessageCreator
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.constant.FunnelFlowStruct.FlowNode
;
import
com.pcloud.common.core.constant.FunnelFlowStruct.FlowNode
;
import
com.pcloud.common.core.constant.FunnelFlowStruct.TargetRoleType
;
import
com.pcloud.common.core.constant.FunnelFlowStruct.TargetRoleType
;
import
com.pcloud.common.core.constant.FunnelFlowStruct.TargetType
;
import
com.pcloud.common.core.constant.FunnelFlowStruct.TargetType
;
import
com.pcloud.common.core.constant.MQQueueConstant
;
import
com.pcloud.common.core.dto.FunnelFlowQueueDto
;
import
com.pcloud.common.core.dto.FunnelFlowQueueDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
/**
/**
* @描述: 发送模板消息队列实现类
* @描述: 发送模板消息队列实现类 @作者: shuyh @创建时间: 2018年1月9日 @版本:1.0
* @作者: shuyh
* @创建时间: 2018年1月9日
* @版本:1.0
*/
*/
@Component
(
"funnelFlowQueueBiz"
)
@Component
(
"funnelFlowQueueBiz"
)
public
class
FunnelFlowQueueBizImpl
implements
FunnelFlowQueueBiz
{
public
class
FunnelFlowQueueBizImpl
implements
FunnelFlowQueueBiz
{
/**
@Autowired
*
private
AmqpTemplate
amqpTemplate
;
*/
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
FunnelFlowQueueBizImpl
.
class
);
@Autowired
(
required
=
false
)
@Qualifier
(
"jmsFunnelFlowTemplate"
)
private
JmsTemplate
jmsFunnelFlowTemplate
;
@Autowired
(
required
=
false
)
@Qualifier
(
"funnelFlowQueue"
)
private
ActiveMQQueue
funnelFlowQueue
;
/**
/**
*
发送队列
*
用户漏斗QUEUE
*/
*/
@Override
@Override
@ParamLog
(
"用户漏斗QUEUE"
)
public
void
sendMessageQueue
(
FunnelFlowQueueDto
funnelFlowQueueDto
)
throws
BizException
{
public
void
sendMessageQueue
(
FunnelFlowQueueDto
funnelFlowQueueDto
)
throws
BizException
{
MessageCreator
messageCreator
=
new
MessageCreator
()
{
amqpTemplate
.
convertAndSend
(
MQQueueConstant
.
FUNNEL_FLOW
,
funnelFlowQueueDto
);
@Override
public
ObjectMessage
createMessage
(
Session
session
)
throws
JMSException
{
return
session
.
createObjectMessage
(
funnelFlowQueueDto
);
}
};
try
{
jmsFunnelFlowTemplate
.
send
(
funnelFlowQueue
,
messageCreator
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"发送失败,"
+
e
.
getMessage
()
+
","
+
funnelFlowQueueDto
,
e
);
throw
BizException
.
SEND_QUEUE_FAIL
;
}
logger
.
info
(
"发送成功,"
+
funnelFlowQueueDto
);
}
}
/**
/**
* 发送队列
* 发送队列
*/
*/
@Override
@Override
public
void
sendMessageQueue
(
TargetType
targetType
,
TargetRoleType
targetRoleType
,
FlowNode
flowNode
,
String
ip
,
String
userAgent
)
throws
BizException
{
public
void
sendMessageQueue
(
TargetType
targetType
,
TargetRoleType
targetRoleType
,
FlowNode
flowNode
,
String
ip
,
FunnelFlowQueueDto
funnelFlowQueueDto
=
new
FunnelFlowQueueDto
(
targetType
,
targetRoleType
,
flowNode
,
ip
,
userAgent
);
String
userAgent
)
throws
BizException
{
FunnelFlowQueueDto
funnelFlowQueueDto
=
new
FunnelFlowQueueDto
(
targetType
,
targetRoleType
,
flowNode
,
ip
,
userAgent
);
sendMessageQueue
(
funnelFlowQueueDto
);
sendMessageQueue
(
funnelFlowQueueDto
);
}
}
...
@@ -75,18 +45,22 @@ public class FunnelFlowQueueBizImpl implements FunnelFlowQueueBiz{
...
@@ -75,18 +45,22 @@ public class FunnelFlowQueueBizImpl implements FunnelFlowQueueBiz{
* 发送队列
* 发送队列
*/
*/
@Override
@Override
public
void
sendMessageQueue
(
TargetType
targetType
,
Long
targetId
,
TargetRoleType
targetRoleType
,
Long
targetRoleId
,
FlowNode
flowNode
)
throws
BizException
{
public
void
sendMessageQueue
(
TargetType
targetType
,
Long
targetId
,
TargetRoleType
targetRoleType
,
Long
targetRoleId
,
FunnelFlowQueueDto
funnelFlowQueueDto
=
new
FunnelFlowQueueDto
(
targetType
,
targetId
,
targetRoleType
,
targetRoleId
,
flowNode
);
FlowNode
flowNode
)
throws
BizException
{
FunnelFlowQueueDto
funnelFlowQueueDto
=
new
FunnelFlowQueueDto
(
targetType
,
targetId
,
targetRoleType
,
targetRoleId
,
flowNode
);
sendMessageQueue
(
funnelFlowQueueDto
);
sendMessageQueue
(
funnelFlowQueueDto
);
}
}
/**
/**
* 发送队列
* 发送队列
*/
*/
@Override
@Override
public
void
sendMessageQueue
(
TargetType
targetType
,
Long
targetId
,
String
subtypeCode
,
TargetRoleType
targetRoleType
,
Long
targetRoleId
,
FlowNode
flowNode
)
throws
BizException
{
public
void
sendMessageQueue
(
TargetType
targetType
,
Long
targetId
,
String
subtypeCode
,
FunnelFlowQueueDto
funnelFlowQueueDto
=
new
FunnelFlowQueueDto
(
targetType
,
targetId
,
subtypeCode
,
targetRoleType
,
targetRoleId
,
flowNode
);
TargetRoleType
targetRoleType
,
Long
targetRoleId
,
FlowNode
flowNode
)
throws
BizException
{
FunnelFlowQueueDto
funnelFlowQueueDto
=
new
FunnelFlowQueueDto
(
targetType
,
targetId
,
subtypeCode
,
targetRoleType
,
targetRoleId
,
flowNode
);
sendMessageQueue
(
funnelFlowQueueDto
);
sendMessageQueue
(
funnelFlowQueueDto
);
}
}
}
}
pcloud-common-core/src/main/java/com/pcloud/common/core/biz/LabelUsedQueueBizImpl.java
View file @
e73dfae8
package
com
.
pcloud
.
common
.
core
.
biz
;
package
com
.
pcloud
.
common
.
core
.
biz
;
import
javax.jms.JMSException
;
import
org.springframework.amqp.core.AmqpTemplate
;
import
javax.jms.ObjectMessage
;
import
javax.jms.Session
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.jms.core.JmsTemplate
;
import
org.springframework.jms.core.MessageCreator
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.constant.MQQueueConstant
;
import
com.pcloud.common.core.dto.LabelUsedMessageDto
;
import
com.pcloud.common.core.dto.LabelUsedMessageDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
/**
/**
* @描述: 标签使用队列实现类
* @描述: 标签使用队列实现类 @作者: shuyh @创建时间: 2017年5月23日 @版本:1.0
* @作者: shuyh
* @创建时间: 2017年5月23日
* @版本:1.0
*/
*/
@Component
(
"labelUsedQueueBiz"
)
@Component
(
"labelUsedQueueBiz"
)
public
class
LabelUsedQueueBizImpl
implements
LabelUsedQueueBiz
{
public
class
LabelUsedQueueBizImpl
implements
LabelUsedQueueBiz
{
/**
@Autowired
*
private
AmqpTemplate
amqpTemplate
;
*/
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
LabelUsedQueueBizImpl
.
class
);
@Autowired
(
required
=
false
)
@Qualifier
(
"jmsLabelUsedTemplate"
)
private
JmsTemplate
jmsLabelUsedTemplate
;
/**
* 发送队列
*/
@Override
@Override
@ParamLog
(
"标签使用QUEUE"
)
public
void
sendMessageQueue
(
LabelUsedMessageDto
labelUsedMessageDto
)
throws
BizException
{
public
void
sendMessageQueue
(
LabelUsedMessageDto
labelUsedMessageDto
)
throws
BizException
{
MessageCreator
messageCreator
=
new
MessageCreator
()
{
amqpTemplate
.
convertAndSend
(
MQQueueConstant
.
LABEL_USED
,
labelUsedMessageDto
);
@Override
public
ObjectMessage
createMessage
(
Session
session
)
throws
JMSException
{
return
session
.
createObjectMessage
(
labelUsedMessageDto
);
}
};
try
{
jmsLabelUsedTemplate
.
send
(
messageCreator
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"发送失败,"
+
e
.
getMessage
()
+
","
+
labelUsedMessageDto
,
e
);
throw
BizException
.
SEND_QUEUE_FAIL
;
}
logger
.
info
(
"发送成功,"
+
labelUsedMessageDto
);
}
}
}
}
pcloud-common-core/src/main/java/com/pcloud/common/core/biz/MerchantDynamicQueueBizImpl.java
View file @
e73dfae8
package
com
.
pcloud
.
common
.
core
.
biz
;
package
com
.
pcloud
.
common
.
core
.
biz
;
import
com.pcloud.common.core.dto.DynamicDto
;
import
org.springframework.amqp.core.AmqpTemplate
;
import
com.pcloud.common.exceptions.BizException
;
import
org.apache.activemq.command.ActiveMQQueue
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.jms.core.JmsTemplate
;
import
org.springframework.jms.core.MessageCreator
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
javax.jms.JMSException
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
javax.jms.ObjectMessage
;
import
com.pcloud.common.core.constant.MQQueueConstant
;
import
javax.jms.Session
;
import
com.pcloud.common.core.dto.DynamicDto
;
import
com.pcloud.common.exceptions.BizException
;
/**
/**
* @描述:
* @描述:
* @作者:lucas
*
* @创建时间:2017年12月14日,15:58
* @作者:lucas @创建时间:2017年12月14日,15:58 @版本:1.0
* @版本:1.0
*/
*/
@Component
(
"merchantDynamicQueueBiz"
)
@Component
(
"merchantDynamicQueueBiz"
)
public
class
MerchantDynamicQueueBizImpl
implements
MerchantDynamicQueueBiz
{
public
class
MerchantDynamicQueueBizImpl
implements
MerchantDynamicQueueBiz
{
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
MerchantDynamicQueueBizImpl
.
class
);
@Autowired
/**
private
AmqpTemplate
amqpTemplate
;
* 消息模板
*/
@Autowired
(
required
=
false
)
@Qualifier
(
"jmsDynamicTemplate"
)
private
JmsTemplate
jmsDynamicTemplate
;
@Override
@Override
public
void
send
(
DynamicDto
dynamicDto
)
throws
BizException
{
@ParamLog
(
"动态监控QUEUE"
)
MessageCreator
messageCreator
=
new
MessageCreator
()
{
public
void
send
(
DynamicDto
dynamicDto
)
throws
BizException
{
@Override
amqpTemplate
.
convertAndSend
(
MQQueueConstant
.
MERCHANT_DYNAMIC
,
dynamicDto
);
public
ObjectMessage
createMessage
(
Session
session
)
throws
JMSException
{
}
return
session
.
createObjectMessage
(
dynamicDto
);
}
};
try
{
jmsDynamicTemplate
.
send
(
messageCreator
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"发送失败,"
+
e
.
getMessage
()+
","
+
dynamicDto
,
e
);
throw
BizException
.
SEND_QUEUE_FAIL
;
}
logger
.
info
(
"发送成功,"
+
dynamicDto
);
}
}
}
pcloud-common-core/src/main/java/com/pcloud/common/core/biz/MessageBiz.java
View file @
e73dfae8
...
@@ -2,6 +2,7 @@ package com.pcloud.common.core.biz;
...
@@ -2,6 +2,7 @@ package com.pcloud.common.core.biz;
import
com.pcloud.common.core.dto.SendAppMessageDto
;
import
com.pcloud.common.core.dto.SendEmailDto
;
import
com.pcloud.common.core.dto.SendEmailDto
;
import
com.pcloud.common.core.dto.SendMessageDto
;
import
com.pcloud.common.core.dto.SendMessageDto
;
import
com.pcloud.common.core.dto.SendNotifyDto
;
import
com.pcloud.common.core.dto.SendNotifyDto
;
...
@@ -37,5 +38,10 @@ public interface MessageBiz {
...
@@ -37,5 +38,10 @@ public interface MessageBiz {
* @param sendSMSDto
* @param sendSMSDto
*/
*/
void
sendSMS
(
SendMessageDto
smsParam
);
void
sendSMS
(
SendMessageDto
smsParam
);
/**
* 短信推送
*/
void
sendAppMessage
(
SendAppMessageDto
sendAppMessageDto
);
}
}
pcloud-common-core/src/main/java/com/pcloud/common/core/biz/MessageBizImpl.java
View file @
e73dfae8
package
com
.
pcloud
.
common
.
core
.
biz
;
package
com
.
pcloud
.
common
.
core
.
biz
;
import
java.io.IOException
;
import
javax.jms.JMSException
;
import
javax.jms.Message
;
import
javax.jms.Session
;
import
org.codehaus.jackson.map.ObjectMapper
;
import
org.codehaus.jackson.map.ObjectMapper
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.amqp.core.AmqpTemplate
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.jms.core.JmsTemplate
;
import
org.springframework.jms.core.MessageCreator
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.constant.MQQueueConstant
;
import
com.pcloud.common.core.dto.SendAppMessageDto
;
import
com.pcloud.common.core.dto.SendEmailDto
;
import
com.pcloud.common.core.dto.SendEmailDto
;
import
com.pcloud.common.core.dto.SendMessageDto
;
import
com.pcloud.common.core.dto.SendMessageDto
;
import
com.pcloud.common.core.dto.SendNotifyDto
;
import
com.pcloud.common.core.dto.SendNotifyDto
;
...
@@ -20,148 +16,82 @@ import com.pcloud.common.utils.mq.MqMessage;
...
@@ -20,148 +16,82 @@ import com.pcloud.common.utils.mq.MqMessage;
import
com.pcloud.common.utils.mq.MqMessageTypeEnum
;
import
com.pcloud.common.utils.mq.MqMessageTypeEnum
;
/**
/**
*
* @描述:邮件业务实现
* @描述:邮件业务实现
* @作者:shichunshan
* @作者:shichunshan
* @创建时间:2016年6月24日,下午2:19:27
* @创建时间:2016年6月24日,下午2:19:27 @版本:1.0
* @版本:1.0
*/
*/
@Component
(
"mailBiz"
)
@Component
(
"messageQueueBiz"
)
public
class
MessageBizImpl
implements
MessageBiz
{
public
class
MessageBizImpl
implements
MessageBiz
{
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
MessageBizImpl
.
class
);
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
MessageBizImpl
.
class
);
@Autowired
private
AmqpTemplate
amqpTemplate
;
/**
/**
* 消息模板
* 发送邮件
*
* @param sendEmailDto
*/
*/
@Autowired
(
required
=
false
)
@Qualifier
(
"jmsMessageTemplate"
)
private
JmsTemplate
jmsMessageTemplate
;
@Override
@Override
@ParamLog
(
"发送邮件"
)
public
void
sendEmail
(
SendEmailDto
sendEmailDto
)
{
public
void
sendEmail
(
SendEmailDto
sendEmailDto
)
{
MessageCreator
messageCreator
=
new
MessageCreator
()
{
@Override
public
Message
createMessage
(
Session
session
)
throws
JMSException
{
MqMessage
mqMessage
=
null
;
try
{
mqMessage
=
formateMessage
(
sendEmailDto
);
logger
.
info
(
"mqMessage+++++++++++"
+
mqMessage
);
}
catch
(
IOException
e
)
{
logger
.
error
(
"邮件发送失败,"
+
sendEmailDto
);
return
null
;
}
return
session
.
createObjectMessage
(
mqMessage
);
}
};
try
{
try
{
jmsMessageTemplate
.
send
(
messageCreator
);
ObjectMapper
objectMapper
=
new
ObjectMapper
();
String
content
=
objectMapper
.
writeValueAsString
(
sendEmailDto
);
MqMessage
mqMessage
=
new
MqMessage
(
MqMessageTypeEnum
.
EMAIL
,
content
);
amqpTemplate
.
convertAndSend
(
MQQueueConstant
.
MESSAGE
,
mqMessage
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"邮件发送失败,"
+
e
.
getMessage
()
+
","
+
sendEmailDto
,
e
);
logger
.
error
(
"邮件发送失败,"
+
e
.
getMessage
()
+
","
+
sendEmailDto
,
e
);
return
;
}
}
logger
.
info
(
"邮件发送成功,"
+
sendEmailDto
);
}
}
/**
/**
* 格式化邮件内容
* 发送站内信
*
* @param mailParam
* 邮件参数
* @return 队列消息
* @throws IOException
* 序列化为json错误
*/
*/
private
MqMessage
formateMessage
(
SendEmailDto
sendEmailDto
)
throws
IOException
{
ObjectMapper
objectMapper
=
new
ObjectMapper
();
String
content
=
objectMapper
.
writeValueAsString
(
sendEmailDto
);
return
new
MqMessage
(
MqMessageTypeEnum
.
EMAIL
,
content
);
}
@Override
@Override
@ParamLog
(
"发送站内信"
)
public
void
sendLetter
(
SendNotifyDto
sendNotifyDto
)
{
public
void
sendLetter
(
SendNotifyDto
sendNotifyDto
)
{
MessageCreator
messageCreator
=
new
MessageCreator
()
{
@Override
public
Message
createMessage
(
Session
session
)
throws
JMSException
{
MqMessage
mqMessage
=
null
;
try
{
mqMessage
=
formateMessage
(
sendNotifyDto
);
logger
.
info
(
"mqMessage+++++++++++"
+
mqMessage
);
}
catch
(
IOException
e
)
{
logger
.
error
(
"站内信发送失败,"
+
sendNotifyDto
);
return
null
;
}
return
session
.
createObjectMessage
(
mqMessage
);
}
};
try
{
try
{
jmsMessageTemplate
.
send
(
messageCreator
);
ObjectMapper
objectMapper
=
new
ObjectMapper
();
String
content
=
objectMapper
.
writeValueAsString
(
sendNotifyDto
);
MqMessage
mqMessage
=
new
MqMessage
(
MqMessageTypeEnum
.
LETTER
,
content
);
amqpTemplate
.
convertAndSend
(
MQQueueConstant
.
MESSAGE
,
mqMessage
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"站内信发送失败,"
+
e
.
getMessage
()
+
","
+
sendNotifyDto
,
e
);
logger
.
error
(
"站内信发送失败,"
+
e
.
getMessage
()
+
","
+
sendNotifyDto
,
e
);
return
;
}
}
logger
.
info
(
"站内信发送成功,"
+
sendNotifyDto
);
}
}
/**
/**
* 格式化站内信内容
* 发送短信
*
* @param sendNotifyDto
* 站内信参数
* @return 队列消息
* @throws IOException
* 序列化为json错误
*/
*/
private
MqMessage
formateMessage
(
SendNotifyDto
sendNotifyDto
)
throws
IOException
{
ObjectMapper
objectMapper
=
new
ObjectMapper
();
String
content
=
objectMapper
.
writeValueAsString
(
sendNotifyDto
);
return
new
MqMessage
(
MqMessageTypeEnum
.
LETTER
,
content
);
}
@Override
@Override
public
void
sendSMS
(
SendMessageDto
smsParam
)
{
@ParamLog
(
"发送短信"
)
MessageCreator
messageCreator
=
new
MessageCreator
()
{
public
void
sendSMS
(
SendMessageDto
sendMessageDto
)
{
@Override
public
Message
createMessage
(
Session
session
)
throws
JMSException
{
MqMessage
mqMessage
=
null
;
try
{
mqMessage
=
formateMessage
(
smsParam
);
logger
.
info
(
"mqMessage+++++++++++"
+
mqMessage
);
}
catch
(
IOException
e
)
{
logger
.
error
(
"短信发送失败,"
+
smsParam
);
return
null
;
}
return
session
.
createObjectMessage
(
mqMessage
);
}
};
try
{
try
{
jmsMessageTemplate
.
send
(
messageCreator
);
ObjectMapper
objectMapper
=
new
ObjectMapper
();
String
content
=
objectMapper
.
writeValueAsString
(
sendMessageDto
);
MqMessage
mqMessage
=
new
MqMessage
(
MqMessageTypeEnum
.
SHORT_MESSAGE
,
content
);
amqpTemplate
.
convertAndSend
(
MQQueueConstant
.
MESSAGE
,
mqMessage
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"短信发送失败,"
+
e
.
getMessage
()
+
","
+
smsParam
,
e
);
logger
.
error
(
"短信发送失败,"
+
e
.
getMessage
()
+
","
+
sendMessageDto
,
e
);
return
;
}
}
logger
.
info
(
"短信发送成功,"
+
smsParam
);
}
}
/**
/**
* 格式化内容
* 发送app推送
*
* @param sendSMSDto
* 邮件参数
* @return 队列消息
* @throws IOException
* 序列化为json错误
*/
*/
private
MqMessage
formateMessage
(
SendMessageDto
smsParam
)
throws
IOException
{
@Override
ObjectMapper
objectMapper
=
new
ObjectMapper
();
@ParamLog
(
"发送APP推送"
)
String
content
=
objectMapper
.
writeValueAsString
(
smsParam
);
public
void
sendAppMessage
(
SendAppMessageDto
sendAppMessageDto
)
{
return
new
MqMessage
(
MqMessageTypeEnum
.
SHORT_MESSAGE
,
content
);
try
{
ObjectMapper
objectMapper
=
new
ObjectMapper
();
String
content
=
objectMapper
.
writeValueAsString
(
sendAppMessageDto
);
MqMessage
mqMessage
=
new
MqMessage
(
MqMessageTypeEnum
.
APP_MESSAGE
,
content
);
amqpTemplate
.
convertAndSend
(
MQQueueConstant
.
MESSAGE
,
mqMessage
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"APP推送发送失败,"
+
e
.
getMessage
()
+
","
+
sendAppMessageDto
,
e
);
}
}
}
}
}
pcloud-common-core/src/main/java/com/pcloud/common/core/biz/OperationLogQueueBizImpl.java
View file @
e73dfae8
package
com
.
pcloud
.
common
.
core
.
biz
;
package
com
.
pcloud
.
common
.
core
.
biz
;
import
javax.jms.JMSException
;
import
org.springframework.amqp.core.AmqpTemplate
;
import
javax.jms.ObjectMessage
;
import
javax.jms.Session
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.jms.core.JmsTemplate
;
import
org.springframework.jms.core.MessageCreator
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.constant.MQQueueConstant
;
import
com.pcloud.common.core.dto.OperationLogDto
;
import
com.pcloud.common.core.dto.OperationLogDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
@Service
(
"operationLogQueueBiz"
)
@Service
(
"operationLogQueueBiz"
)
public
class
OperationLogQueueBizImpl
implements
OperationLogQueueBiz
{
public
class
OperationLogQueueBizImpl
implements
OperationLogQueueBiz
{
/**
@Autowired
*
private
AmqpTemplate
amqpTemplate
;
*/
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
OperationLogQueueBizImpl
.
class
);
/**
* 消息模板
*/
@Autowired
(
required
=
false
)
@Qualifier
(
"jmsLogTemplate"
)
private
JmsTemplate
jmsLogTemplate
;
@Override
@Override
@ParamLog
(
"日志记录QUEUE"
)
public
void
send
(
OperationLogDto
operationLog
)
throws
BizException
{
public
void
send
(
OperationLogDto
operationLog
)
throws
BizException
{
MessageCreator
messageCreator
=
new
MessageCreator
()
{
amqpTemplate
.
convertAndSend
(
MQQueueConstant
.
LOG
,
operationLog
);
@Override
public
ObjectMessage
createMessage
(
Session
session
)
throws
JMSException
{
return
session
.
createObjectMessage
(
operationLog
);
}
};
try
{
jmsLogTemplate
.
send
(
messageCreator
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"发送失败,"
+
e
.
getMessage
()
+
","
+
operationLog
,
e
);
throw
BizException
.
SEND_QUEUE_FAIL
;
}
logger
.
info
(
"发送成功,"
+
operationLog
);
}
}
}
}
pcloud-common-core/src/main/java/com/pcloud/common/core/biz/UserActionQueueBizImpl.java
View file @
e73dfae8
package
com
.
pcloud
.
common
.
core
.
biz
;
package
com
.
pcloud
.
common
.
core
.
biz
;
import
javax.jms.JMSException
;
import
org.springframework.amqp.core.AmqpTemplate
;
import
javax.jms.ObjectMessage
;
import
javax.jms.Session
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.jms.core.JmsTemplate
;
import
org.springframework.jms.core.MessageCreator
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.constant.MQQueueConstant
;
import
com.pcloud.common.core.dto.UserActionMessageDto
;
import
com.pcloud.common.core.dto.UserActionMessageDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
/**
/**
* @描述: 发送模板消息队列实现类
* @描述: 发送模板消息队列实现类 @作者: shuyh @创建时间: 2017年5月23日 @版本:1.0
* @作者: shuyh
* @创建时间: 2017年5月23日
* @版本:1.0
*/
*/
@Service
(
"userActionQueueBiz"
)
@Service
(
"userActionQueueBiz"
)
public
class
UserActionQueueBizImpl
implements
UserActionQueueBiz
{
public
class
UserActionQueueBizImpl
implements
UserActionQueueBiz
{
/**
@Autowired
*
private
AmqpTemplate
amqpTemplate
;
*/
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
UserActionQueueBizImpl
.
class
);
@Autowired
(
required
=
false
)
@Qualifier
(
"jmsUserActionTemplate"
)
private
JmsTemplate
jmsUserActionTemplate
;
/**
/**
*
发送队列
*
用户行为QUEUE
*/
*/
@Override
@Override
@ParamLog
(
"用户行为QUEUE"
)
public
void
sendMessageQueue
(
UserActionMessageDto
userActionMessageDto
)
throws
BizException
{
public
void
sendMessageQueue
(
UserActionMessageDto
userActionMessageDto
)
throws
BizException
{
MessageCreator
messageCreator
=
new
MessageCreator
()
{
amqpTemplate
.
convertAndSend
(
MQQueueConstant
.
USER_ACTION
,
userActionMessageDto
);
@Override
public
ObjectMessage
createMessage
(
Session
session
)
throws
JMSException
{
return
session
.
createObjectMessage
(
userActionMessageDto
);
}
};
try
{
jmsUserActionTemplate
.
send
(
messageCreator
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"发送失败,"
+
e
.
getMessage
()
+
","
+
userActionMessageDto
,
e
);
throw
BizException
.
SEND_QUEUE_FAIL
;
}
logger
.
info
(
"发送成功,"
+
userActionMessageDto
);
}
}
}
}
pcloud-common-core/src/main/java/com/pcloud/common/core/biz/WeektaskQueueBizImpl.java
View file @
e73dfae8
package
com
.
pcloud
.
common
.
core
.
biz
;
package
com
.
pcloud
.
common
.
core
.
biz
;
import
com.pcloud.common.core.dto.WeektaskMessageDto
;
import
org.springframework.amqp.core.AmqpTemplate
;
import
com.pcloud.common.exceptions.BizException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.jms.core.JmsTemplate
;
import
org.springframework.jms.core.MessageCreator
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
javax.jms.JMSException
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
javax.jms.ObjectMessage
;
import
com.pcloud.common.core.constant.MQQueueConstant
;
import
javax.jms.Session
;
import
com.pcloud.common.core.dto.WeektaskMessageDto
;
import
com.pcloud.common.exceptions.BizException
;
/**
/**
* 编辑周任务队列实现
* 编辑周任务队列实现
...
@@ -21,37 +16,18 @@ import javax.jms.Session;
...
@@ -21,37 +16,18 @@ import javax.jms.Session;
* @create 2017-09-21 09:33
* @create 2017-09-21 09:33
**/
**/
@Component
(
"weektaskQueueBiz"
)
@Component
(
"weektaskQueueBiz"
)
public
class
WeektaskQueueBizImpl
implements
WeektaskQueueBiz
{
public
class
WeektaskQueueBizImpl
implements
WeektaskQueueBiz
{
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
WeektaskQueueBizImpl
.
class
);
@Autowired
private
AmqpTemplate
amqpTemplate
;
@Autowired
(
required
=
false
)
@Qualifier
(
"jmsWeektaskTemplate"
)
/**
private
JmsTemplate
jmsWeekstaskTemplate
;
* 发送队列
*/
// @Autowired(required= false)
@Override
// @Qualifier("raystask")
@ParamLog
(
"红榜任务QUEUE"
)
// private ActiveMQQueue templateQueue;
public
void
sendMessageQueue
(
WeektaskMessageDto
weektaskMessageDto
)
throws
BizException
{
amqpTemplate
.
convertAndSend
(
MQQueueConstant
.
WEEK_TASK
,
weektaskMessageDto
);
/**
}
* 发送队列
*/
@Override
public
void
sendMessageQueue
(
WeektaskMessageDto
weektaskMessageDto
)
throws
BizException
{
MessageCreator
messageCreator
=
new
MessageCreator
()
{
@Override
public
ObjectMessage
createMessage
(
Session
session
)
throws
JMSException
{
return
session
.
createObjectMessage
(
weektaskMessageDto
);
}
};
try
{
jmsWeekstaskTemplate
.
send
(
messageCreator
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"发送失败,"
+
e
.
getMessage
()
+
","
+
weektaskMessageDto
,
e
);
throw
BizException
.
SEND_QUEUE_FAIL
;
}
logger
.
info
(
"发送成功,"
+
weektaskMessageDto
);
}
}
}
pcloud-common-core/src/main/java/com/pcloud/common/core/constant/MQTopicProducer.java
View file @
e73dfae8
...
@@ -17,33 +17,262 @@ public class MQTopicProducer {
...
@@ -17,33 +17,262 @@ public class MQTopicProducer {
public
static
final
String
FILE_TRANSCODE
=
"topic.fileTranscode"
;
public
static
final
String
FILE_TRANSCODE
=
"topic.fileTranscode"
;
/**
/**
* 报名新增用户
*/
public
static
final
String
BM_ADD_USER
=
"topic.bmAddUser"
;
/**
* 应用新增
* 应用新增
*/
*/
public
static
final
String
APP_ADD
=
"topic.appAdd"
;
public
static
final
String
APP_ADD
=
"topic.appAdd"
;
/**
/**
* 应用修改
*/
public
static
final
String
APP_UPDATE
=
"topic.appUpdate"
;
/**
* 应用删除
*/
public
static
final
String
APP_DELETE
=
"topic.appDelete"
;
/**
* 应用删除(新)
* 应用删除(新)
*/
*/
public
static
final
String
APP_DELETE_NEW
=
"topic.appDeleteNew"
;
public
static
final
String
APP_DELETE_NEW
=
"topic.appDeleteNew"
;
/**
/**
* 应用审核
*/
public
static
final
String
APP_AUDIT
=
"topic.appAudit"
;
/**
* 选择默认渠道
* 选择默认渠道
*/
*/
public
static
final
String
CHOOSE_DEFAULT_CHANNEL
=
"topic.chooseDefaultChannel"
;
public
static
final
String
CHOOSE_DEFAULT_CHANNEL
=
"topic.chooseDefaultChannel"
;
/**
/**
* 删除视频
*/
public
static
final
String
DELETE_VIDEO
=
"topic.deleteVideo"
;
/**
* 标签修改
*/
public
static
final
String
LABEL_UPDATE
=
"topic.labelUpdate"
;
/**
* 支付
*/
public
static
final
String
PAYMENT
=
"topic.payment"
;
/**
* TIP
*/
public
static
final
String
TIP
=
"topic.tip"
;
/**
* 订单完成
*/
public
static
final
String
FINISH_ORDER
=
"topic.finishOrder"
;
/**
* 资源修改
*/
public
static
final
String
RESOURCE_UPDATE
=
"topic.resourceUpdate"
;
/**
* 资源删除
*/
public
static
final
String
RESOURCE_DELETE
=
"topic.resourceDelete"
;
/**
* 扫码记录
*/
public
static
final
String
SCAN_RECORD
=
"topic.scanRecord"
;
/**
* 图书删除
*/
public
static
final
String
BOOK_DELETE
=
"topic.bookDelete"
;
/**
* BOOKTHAW
*/
public
static
final
String
BOOK_THAW
=
"topic.bookThaw"
;
/**
* TEMPLETAPPCREATE
* TEMPLETAPPCREATE
*/
*/
public
static
final
String
TEMPLET_APP_CREATE
=
"topic.templetAppCreate"
;
public
static
final
String
TEMPLET_APP_CREATE
=
"topic.templetAppCreate"
;
/**
/**
*
更新图书封面图
*
PERMISSION
*/
*/
public
static
final
String
UPDATE_BOOK_COVERIMG
=
"topic.updateBookCoverImg"
;
public
static
final
String
PERMISSION
=
"topic.permission"
;
/**
* PROMOTION_EXPIRE
*/
public
static
final
String
PROMOTION_EXPIRE
=
"topic.promotionExpire"
;
/**
* 商品修改
*/
public
static
final
String
PRODUCT_UPDATE
=
"topic.productUpdate"
;
/**
* 商品删除
*/
public
static
final
String
PRODUCT_DELETE
=
"topic.productDelete"
;
/**
* 商品审核
*/
public
static
final
String
PRODUCT_AUDIT
=
"topic.productAudit"
;
/**
* 商品图片1修改
*/
public
static
final
String
PRODUCT_PIC1_UPDATE
=
"topic.productPic1Update"
;
/**
* 用户注册
*/
public
static
final
String
REGISTER_PARTY
=
"topic.registerParty"
;
/**
* 用户修改
*/
public
static
final
String
UPDATE_PARTY
=
"topic.updateParty"
;
/**
* 问答确认
*/
public
static
final
String
QA_ASK
=
"topic.qaAsk"
;
/**
* 问答完成
*/
public
static
final
String
QA_FINISH
=
"topic.qaFinish"
;
/**
* 问答答案
*/
public
static
final
String
QA_ANSWER
=
"topic.qaAnswer"
;
/**
* 问答取消
*/
public
static
final
String
QA_REFUSE
=
"topic.qaRefuse"
;
/**
* QR_MESSAGE_UPDATE
*/
public
static
final
String
QR_MESSAGE_UPDATE
=
"topic.qrMessageUpdate"
;
/**
* GIVE_GIFT
*/
public
static
final
String
GIVE_GIFT
=
"topic.giveGift"
;
/**
* 修改密码
*/
public
static
final
String
UPDATE_PWD
=
"topic.updatePwd"
;
/**
* 管理消息
*/
public
static
final
String
MANAGE_MESSAGE
=
"topic.manageMessage"
;
/**
* RETURN_4_ADVISER
*/
public
static
final
String
RETURN_4_ADVISER
=
"topic.return4adviser"
;
/**
* 退款
*/
public
static
final
String
REFUND
=
"topic.refund"
;
/**
* 退货
*/
public
static
final
String
REFUND_PRODUCT
=
"topic.refundProduct"
;
/**
* 发货
*/
public
static
final
String
SEND_PRODUCT
=
"topic.sendProduct"
;
/**
* 确认收货
*/
public
static
final
String
CONFIRM_ORDER
=
"topic.confirmOrder"
;
/**
* 申请退货
*/
public
static
final
String
APPLY_REFUND_PRODUCT
=
"topic.applyRefundProduct"
;
/**
* 取消订单
*/
public
static
final
String
CANCEL_ORDER
=
"topic.cancelOrder"
;
/**
* 模板二维码扫描
*/
public
static
final
String
TEMP_QRCODE_SCAN
=
"topic.tempQrcodeScan"
;
/**
* 删除二维码
*/
public
static
final
String
DELETE_QRCODE
=
"topic.deleteQrcode"
;
/**
* 二维码图书修改
*/
public
static
final
String
QRCODE_BOOK_UPDATE
=
"topic.qrcodeBookUpdate"
;
/**
* 重置
*/
public
static
final
String
RECHARGE
=
"topic.recharge"
;
/**
* 改变显示状态
*/
public
static
final
String
CHANGE_SHOW_STATE
=
"topic.changeShowState"
;
/**
* 删除合作出版社
*/
public
static
final
String
DELETE_COOPERATIVE_AGENT
=
"topic.deleteCooperativeAgent"
;
/**
* TASK_BONUS
*/
public
static
final
String
TASK_BONUS
=
"topic.taskBonus"
;
/**
* 读者消息
*/
public
static
final
String
READER_MESSAGE
=
"topic.readerMessage"
;
/**
* 记录用户习惯
*/
public
static
final
String
RECORD_USER_HABIT
=
"topic.recordUserHabit"
;
/**
/**
* topic交换机名称(勿改)
* topic交换机名称(勿改)
*/
*/
public
static
final
String
EXCHAGE
=
"rays.topic"
;
public
static
final
String
EXCHAGE
=
"rays.topic"
;
/**
* 更新图书封面图
*/
public
static
final
String
UPDATE_BOOK_COVERIMG
=
"topic.updateBookCoverImg"
;
}
}
pcloud-common/src/main/java/com/pcloud/common/utils/PictureUtil.java
View file @
e73dfae8
...
@@ -89,6 +89,25 @@ public class PictureUtil {
...
@@ -89,6 +89,25 @@ public class PictureUtil {
return
color
;
return
color
;
}
}
private
static
BufferedImage
subPic
(
BufferedImage
picImage
){
int
w
=
picImage
.
getWidth
();
int
h
=
picImage
.
getHeight
();
int
x1
=
w
,
y1
=
h
,
x2
=
0
,
y2
=
0
;
for
(
int
i
=
0
;
i
<
w
;
i
++){
for
(
int
j
=
0
;
j
<
h
;
j
++){
int
rgb
=
picImage
.
getRGB
(
i
,
j
);
if
(
rgb
!=
0
){
//不透明
if
(
i
<
x1
)
x1
=
i
;
if
(
j
<
y1
)
y1
=
j
;
if
(
i
>
x2
)
x2
=
i
;
if
(
j
>
y2
)
y2
=
j
;
}
}
}
return
picImage
.
getSubimage
(
x1
,
y1
,
x2
-
x1
+
1
,
y2
-
y1
+
1
);
}
public
static
String
getQrCover
(
String
bookPic
,
boolean
isDefault
){
public
static
String
getQrCover
(
String
bookPic
,
boolean
isDefault
){
String
resultPath
=
""
;
String
resultPath
=
""
;
...
@@ -137,7 +156,7 @@ public class PictureUtil {
...
@@ -137,7 +156,7 @@ public class PictureUtil {
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
// String bookPic = "https://file.5rs.me/oss/upload/image/jpg/c2c7f0b85f9f4eb683cd86a2945bc5e5.jpg";
// String bookPic = "https://file.5rs.me/oss/upload/image/jpg/c2c7f0b85f9f4eb683cd86a2945bc5e5.jpg";
String
s
=
""
;
String
s
=
""
;
String
bookPic
=
"C:\\Users\\LiHao\\Desktop\\封面图\\
aa.jp
g"
;
String
bookPic
=
"C:\\Users\\LiHao\\Desktop\\封面图\\
yy.pn
g"
;
String
playPic
=
"C:\\Users\\LiHao\\Desktop\\封面图\\播放按钮.png"
;
String
playPic
=
"C:\\Users\\LiHao\\Desktop\\封面图\\播放按钮.png"
;
String
defaultBackgroundPic
=
"C:\\Users\\LiHao\\Desktop\\封面图\\默认图背景.png"
;
String
defaultBackgroundPic
=
"C:\\Users\\LiHao\\Desktop\\封面图\\默认图背景.png"
;
String
resultPath
=
"C:\\Users\\LiHao\\Desktop\\封面图\\result.jpg"
;
String
resultPath
=
"C:\\Users\\LiHao\\Desktop\\封面图\\result.jpg"
;
...
@@ -155,12 +174,12 @@ public class PictureUtil {
...
@@ -155,12 +174,12 @@ public class PictureUtil {
bookPicImage
=
ImageIO
.
read
(
new
URL
(
bookPic
));
bookPicImage
=
ImageIO
.
read
(
new
URL
(
bookPic
));
playPicImage
=
ImageIO
.
read
(
new
URL
(
playPic
));
playPicImage
=
ImageIO
.
read
(
new
URL
(
playPic
));
defaultBackgroudImage
=
ImageIO
.
read
(
new
URL
(
defaultBackgroundPic
));
defaultBackgroudImage
=
ImageIO
.
read
(
new
URL
(
defaultBackgroundPic
));
oathI
=
ImageIO
.
read
(
new
URL
(
oath
));
oathI
=
ImageIO
.
read
(
new
URL
(
oath
));
}
else
{
}
else
{
bookPicImage
=
ImageIO
.
read
(
new
File
(
bookPic
));
bookPicImage
=
ImageIO
.
read
(
new
File
(
bookPic
));
playPicImage
=
ImageIO
.
read
(
new
File
(
playPic
));
playPicImage
=
ImageIO
.
read
(
new
File
(
playPic
));
defaultBackgroudImage
=
ImageIO
.
read
(
new
File
(
defaultBackgroundPic
));
defaultBackgroudImage
=
ImageIO
.
read
(
new
File
(
defaultBackgroundPic
));
oathI
=
ImageIO
.
read
(
new
File
(
oath
));
oathI
=
ImageIO
.
read
(
new
File
(
oath
));
}
}
//画一个空的背景
//画一个空的背景
...
@@ -168,8 +187,7 @@ public class PictureUtil {
...
@@ -168,8 +187,7 @@ public class PictureUtil {
Graphics2D
g
=
bg
.
createGraphics
();
Graphics2D
g
=
bg
.
createGraphics
();
//获取主题色
//获取主题色
Color
c
=
getImagePixel
(
bookPic
);
Color
c
=
getImagePixel
(
bookPic
);
bookPicImage
=
subPic
(
bookPicImage
);
//画纯色的背景或者默认背景图
//画纯色的背景或者默认背景图
g
.
setColor
(
c
);
g
.
setColor
(
c
);
if
(
isDefalut
){
if
(
isDefalut
){
...
@@ -186,26 +204,9 @@ public class PictureUtil {
...
@@ -186,26 +204,9 @@ public class PictureUtil {
// g.drawImage(oathI.getScaledInstance(185,252, Image.SCALE_DEFAULT), 258, 33, null);
// g.drawImage(oathI.getScaledInstance(185,252, Image.SCALE_DEFAULT), 258, 33, null);
g
.
drawImage
(
bookPicImage
.
getScaledInstance
(
157
,
224
,
Image
.
SCALE_DEFAULT
),
265
,
30
,
null
);
BufferedImage
image
=
new
BufferedImage
(
157
,
200
,
BufferedImage
.
TYPE_INT_ARGB
);
Graphics2D
gs
=
image
.
createGraphics
();
Map
mapH
=
new
HashMap
();
mapH
.
put
(
RenderingHints
.
KEY_ANTIALIASING
,
RenderingHints
.
VALUE_ANTIALIAS_ON
);
//抗锯齿 (抗锯齿总开关)
mapH
.
put
(
RenderingHints
.
KEY_TEXT_ANTIALIASING
,
RenderingHints
.
VALUE_TEXT_ANTIALIAS_ON
);
gs
.
setRenderingHints
(
mapH
);
// gs.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
gs
.
setClip
(
new
RoundRectangle2D
.
Double
(
0
,
0
,
157
,
224
,
12
,
12
));
gs
.
drawImage
(
bookPicImage
.
getScaledInstance
(
157
,
224
,
Image
.
SCALE_DEFAULT
),
0
,
0
,
null
);
g
.
drawImage
(
image
.
getScaledInstance
(
157
,
224
,
Image
.
SCALE_DEFAULT
),
272
,
38
,
null
);
g
.
drawImage
(
playPicImage
.
getScaledInstance
(
80
,
80
,
Image
.
SCALE_DEFAULT
),
306
,
105
,
null
);
g
.
drawImage
(
playPicImage
.
getScaledInstance
(
80
,
80
,
Image
.
SCALE_DEFAULT
),
306
,
105
,
null
);
//
g.drawRect(265,30,172,238);
g
.
drawRect
(
265
,
30
,
172
,
238
);
//保存图片
//保存图片
...
@@ -230,5 +231,4 @@ public class PictureUtil {
...
@@ -230,5 +231,4 @@ public class PictureUtil {
}
}
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