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
619caf18
Commit
619caf18
authored
Oct 16, 2018
by
田超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://begitlab.chubanyun.me:12122/rays/pcloud-common-parent
parents
93b29219
ea57b278
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
119 deletions
+52
-119
PromotionTaskQueueBiz.java
...ava/com/pcloud/common/core/biz/PromotionTaskQueueBiz.java
+8
-5
PromotionTaskQueueBizImpl.java
...com/pcloud/common/core/biz/PromotionTaskQueueBizImpl.java
+9
-32
PromotionTerminateQueueBiz.java
...om/pcloud/common/core/biz/PromotionTerminateQueueBiz.java
+8
-5
PromotionTerminateQueueBizImpl.java
...cloud/common/core/biz/PromotionTerminateQueueBizImpl.java
+8
-31
TemplateQueueBizImpl.java
...java/com/pcloud/common/core/biz/TemplateQueueBizImpl.java
+9
-33
MQTopicProducer.java
...java/com/pcloud/common/core/constant/MQTopicProducer.java
+10
-13
No files found.
pcloud-common-core/src/main/java/com/pcloud/common/core/biz/PromotionTaskQueueBiz.java
View file @
619caf18
package
com
.
pcloud
.
common
.
core
.
biz
;
package
com
.
pcloud
.
common
.
core
.
biz
;
import
com.pcloud.common.core.dto.PromotionTaskDto
;
import
com.pcloud.common.core.dto.PromotionTaskDto
;
import
com.pcloud.common.exceptions.BizException
;
/**
/**
* @Description:促销任务队列
* @Description:促销任务队列
* @Author:lixg
* @Author:lixg @Date:2018/6/12 @Version:1.0
* @Date:2018/6/12
* @Version:1.0
*/
*/
public
interface
PromotionTaskQueueBiz
{
public
interface
PromotionTaskQueueBiz
{
/**
void
send
(
PromotionTaskDto
promotionTaskDto
);
* 发送消息
*
* @param promotionTaskDto
*/
void
send
(
PromotionTaskDto
promotionTaskDto
)
throws
BizException
;
}
}
pcloud-common-core/src/main/java/com/pcloud/common/core/biz/PromotionTaskQueueBizImpl.java
View file @
619caf18
package
com
.
pcloud
.
common
.
core
.
biz
;
package
com
.
pcloud
.
common
.
core
.
biz
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.constant.MQQueueConstant
;
import
com.pcloud.common.core.dto.PromotionTaskDto
;
import
com.pcloud.common.core.dto.PromotionTaskDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
import
org.slf4j.Logger
;
import
org.springframework.amqp.core.AmqpTemplate
;
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
javax.jms.JMSException
;
import
javax.jms.ObjectMessage
;
import
javax.jms.Session
;
@Service
(
"promotionTaskQueueBiz"
)
@Service
(
"promotionTaskQueueBiz"
)
public
class
PromotionTaskQueueBizImpl
implements
PromotionTaskQueueBiz
{
public
class
PromotionTaskQueueBizImpl
implements
PromotionTaskQueueBiz
{
@Autowired
private
AmqpTemplate
amqpTemplate
;
/**
/**
*
* 促销任务QUEUE
*/
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
PromotionTaskQueueBizImpl
.
class
);
/**
* 消息模板
*/
*/
@Autowired
(
required
=
false
)
@Qualifier
(
"jmsPromotionTaskTemplate"
)
private
JmsTemplate
jmsPromotionTaskTemplate
;
@Override
@Override
@ParamLog
(
"促销任务QUEUE"
)
public
void
send
(
PromotionTaskDto
promotionTaskDto
)
throws
BizException
{
public
void
send
(
PromotionTaskDto
promotionTaskDto
)
throws
BizException
{
MessageCreator
messageCreator
=
new
MessageCreator
()
{
amqpTemplate
.
convertAndSend
(
MQQueueConstant
.
PROMOTION_TASK
,
promotionTaskDto
);
@Override
public
ObjectMessage
createMessage
(
Session
session
)
throws
JMSException
{
return
session
.
createObjectMessage
(
promotionTaskDto
);
}
};
try
{
jmsPromotionTaskTemplate
.
send
(
messageCreator
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"发送失败,"
+
e
.
getMessage
()
+
","
+
promotionTaskDto
,
e
);
throw
BizException
.
SEND_QUEUE_FAIL
;
}
logger
.
info
(
"发送成功,"
+
promotionTaskDto
);
}
}
}
}
pcloud-common-core/src/main/java/com/pcloud/common/core/biz/PromotionTerminateQueueBiz.java
View file @
619caf18
package
com
.
pcloud
.
common
.
core
.
biz
;
package
com
.
pcloud
.
common
.
core
.
biz
;
import
com.pcloud.common.core.dto.PromotionTerminateDto
;
import
com.pcloud.common.core.dto.PromotionTerminateDto
;
import
com.pcloud.common.exceptions.BizException
;
/**
/**
* @Description:促销终止队列
* @Description:促销终止队列
* @Author:lixg
* @Author:lixg @Date:2018/6/12 @Version:1.0
* @Date:2018/6/12
* @Version:1.0
*/
*/
public
interface
PromotionTerminateQueueBiz
{
public
interface
PromotionTerminateQueueBiz
{
/**
void
send
(
PromotionTerminateDto
promotionTerminateDto
);
* 促销终止队列
*
* @param promotionTerminateDto
*/
void
send
(
PromotionTerminateDto
promotionTerminateDto
)
throws
BizException
;
}
}
pcloud-common-core/src/main/java/com/pcloud/common/core/biz/PromotionTerminateQueueBizImpl.java
View file @
619caf18
package
com
.
pcloud
.
common
.
core
.
biz
;
package
com
.
pcloud
.
common
.
core
.
biz
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.constant.MQQueueConstant
;
import
com.pcloud.common.core.dto.PromotionTerminateDto
;
import
com.pcloud.common.core.dto.PromotionTerminateDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
import
org.slf4j.Logger
;
import
org.springframework.amqp.core.AmqpTemplate
;
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
javax.jms.JMSException
;
import
javax.jms.ObjectMessage
;
import
javax.jms.Session
;
@Service
(
"promotionTerminateQueueBiz"
)
@Service
(
"promotionTerminateQueueBiz"
)
public
class
PromotionTerminateQueueBizImpl
implements
PromotionTerminateQueueBiz
{
public
class
PromotionTerminateQueueBizImpl
implements
PromotionTerminateQueueBiz
{
@Autowired
private
AmqpTemplate
amqpTemplate
;
/**
/**
*
*
促销终止QUEUE
*/
*/
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
PromotionTerminateQueueBizImpl
.
class
);
/**
* 消息模板
*/
@Autowired
(
required
=
false
)
@Qualifier
(
"jmsPromotionTerminateTemplate"
)
private
JmsTemplate
jmsPromotionTerminateTemplate
;
@Override
@Override
@ParamLog
(
"促销终止QUEUE"
)
public
void
send
(
PromotionTerminateDto
promotionTerminateDto
)
throws
BizException
{
public
void
send
(
PromotionTerminateDto
promotionTerminateDto
)
throws
BizException
{
MessageCreator
messageCreator
=
new
MessageCreator
()
{
amqpTemplate
.
convertAndSend
(
MQQueueConstant
.
PROMOTION_TERMINATE
,
promotionTerminateDto
);
@Override
public
ObjectMessage
createMessage
(
Session
session
)
throws
JMSException
{
return
session
.
createObjectMessage
(
promotionTerminateDto
);
}
};
try
{
jmsPromotionTerminateTemplate
.
send
(
messageCreator
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"发送失败,"
+
e
.
getMessage
()
+
","
+
promotionTerminateDto
,
e
);
throw
BizException
.
SEND_QUEUE_FAIL
;
}
logger
.
info
(
"发送成功,"
+
promotionTerminateDto
);
}
}
}
}
pcloud-common-core/src/main/java/com/pcloud/common/core/biz/TemplateQueueBizImpl.java
View file @
619caf18
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.TemplateMessageDto
;
import
com.pcloud.common.core.dto.TemplateMessageDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
...
@@ -19,39 +13,21 @@ import com.pcloud.common.exceptions.BizException;
...
@@ -19,39 +13,21 @@ import com.pcloud.common.exceptions.BizException;
*
*
* @描述:发送模板消息队列实现类
* @描述:发送模板消息队列实现类
* @作者:songx
* @作者:songx
* @创建时间:2016年11月23日,下午4:53:43
* @创建时间:2016年11月23日,下午4:53:43 @版本:1.0
* @版本:1.0
*/
*/
@Component
(
"templateQueueBiz"
)
@Component
(
"templateQueueBiz"
)
public
class
TemplateQueueBizImpl
implements
TemplateQueueBiz
{
public
class
TemplateQueueBizImpl
implements
TemplateQueueBiz
{
/**
@Autowired
*
private
AmqpTemplate
amqpTemplate
;
*/
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
TemplateQueueBizImpl
.
class
);
@Autowired
(
required
=
false
)
@Qualifier
(
"jmsTemplateTemplate"
)
private
JmsTemplate
jmsTemplateTemplate
;
/**
/**
* 发送
队列
* 发送
模板消息
*/
*/
@Override
@Override
@ParamLog
(
"发送模板消息QUEUE"
)
public
void
sendMessageQueue
(
TemplateMessageDto
templateMessageDto
)
throws
BizException
{
public
void
sendMessageQueue
(
TemplateMessageDto
templateMessageDto
)
throws
BizException
{
MessageCreator
messageCreator
=
new
MessageCreator
()
{
amqpTemplate
.
convertAndSend
(
MQQueueConstant
.
TEMPLATE
,
templateMessageDto
);
@Override
public
ObjectMessage
createMessage
(
Session
session
)
throws
JMSException
{
return
session
.
createObjectMessage
(
templateMessageDto
);
}
};
try
{
jmsTemplateTemplate
.
send
(
messageCreator
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"发送失败,"
+
e
.
getMessage
()
+
","
+
templateMessageDto
,
e
);
throw
BizException
.
SEND_QUEUE_FAIL
;
}
logger
.
info
(
"发送成功,"
+
templateMessageDto
);
}
}
}
}
pcloud-common-core/src/main/java/com/pcloud/common/core/constant/MQTopicProducer.java
View file @
619caf18
...
@@ -16,37 +16,34 @@ public class MQTopicProducer {
...
@@ -16,37 +16,34 @@ public class MQTopicProducer {
*/
*/
public
static
final
String
FILE_TRANSCODE
=
"topic.fileTranscode"
;
public
static
final
String
FILE_TRANSCODE
=
"topic.fileTranscode"
;
/**
/**
* 应用新增
* 应用新增
*/
*/
public
static
final
String
APP_ADD
=
"topic.appAdd"
;
public
static
final
String
APP_ADD
=
"topic.appAdd"
;
/**
/**
* 应用删除(新)
* 应用删除(新)
*/
*/
public
static
final
String
APP_DELETE_NEW
=
"topic.appDeleteNew"
;
public
static
final
String
APP_DELETE_NEW
=
"topic.appDeleteNew"
;
/**
/**
* 选择默认渠道
* 选择默认渠道
*/
*/
public
static
final
String
CHOOSE_DEFAULT_CHANNEL
=
"topic.chooseDefaultChannel"
;
public
static
final
String
CHOOSE_DEFAULT_CHANNEL
=
"topic.chooseDefaultChannel"
;
/**
* TEMPLETAPPCREATE
*/
/**
public
static
final
String
TEMPLET_APP_CREATE
=
"topic.templetAppCreate"
;
* topic交换机名称(勿改)
*/
public
static
final
String
EXCHAGE
=
"rays.topic"
;
/**
/**
* 更新图书封面图
* 更新图书封面图
*/
*/
public
static
final
String
UPDATE_BOOK_COVERIMG
=
"topic.updateBookCoverImg"
;
public
static
final
String
UPDATE_BOOK_COVERIMG
=
"topic.updateBookCoverImg"
;
/**
* topic交换机名称(勿改)
*/
public
static
final
String
EXCHAGE
=
"rays.topic"
;
}
}
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