Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
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
YZG
yzg-util
Commits
01f34a1a
Commit
01f34a1a
authored
Apr 10, 2019
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消息队列服务
parent
757cf29d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
123 additions
and
0 deletions
+123
-0
MqService.java
...q/src/main/java/com/yanzuoguang/mq/service/MqService.java
+50
-0
MqServiceImpl.java
...n/java/com/yanzuoguang/mq/service/impl/MqServiceImpl.java
+73
-0
No files found.
yzg-util-mq/src/main/java/com/yanzuoguang/mq/service/MqService.java
0 → 100644
View file @
01f34a1a
package
com
.
yanzuoguang
.
mq
.
service
;
import
com.yanzuoguang.mq.vo.MessageVo
;
import
com.yanzuoguang.mq.vo.QueueVo
;
import
com.yanzuoguang.mq.vo.req.QueueQueryReqVo
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
com.yanzuoguang.util.vo.ResponseResult
;
/**
* 消息队列服务
*/
public
interface
MqService
{
/**
* 保存演示DEMO
*
* @param req
*/
ResponseResult
<
String
>
createQueue
(
QueueVo
req
);
/**
* 查询队列
*
* @param req 请求数据
* @return 查询结果
*/
ResponseResult
<
PageSizeData
<
QueueVo
>>
queryQueue
(
QueueQueryReqVo
req
);
/**
* 查询队列
*
* @return 查询结果
*/
ResponseResult
<
String
>
queryInit
();
/**
* 发送消息
*
* @param req 需要发送的消息
* @return 消息编号,但是没有任何意义,发送成功会更改
*/
ResponseResult
<
String
>
message
(
MessageVo
req
);
/**
* 发送错误消息
*
* @param req
* @return
*/
ResponseResult
<
String
>
message_error
(
MessageVo
req
);
}
yzg-util-mq/src/main/java/com/yanzuoguang/mq/service/impl/MqServiceImpl.java
0 → 100644
View file @
01f34a1a
package
com
.
yanzuoguang
.
mq
.
service
.
impl
;
import
com.yanzuoguang.mq.service.MessageService
;
import
com.yanzuoguang.mq.service.QueueService
;
import
com.yanzuoguang.mq.vo.MessageVo
;
import
com.yanzuoguang.mq.vo.QueueVo
;
import
com.yanzuoguang.mq.vo.req.QueueQueryReqVo
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
com.yanzuoguang.util.vo.ResponseResult
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
@Component
public
class
MqServiceImpl
{
@Autowired
private
QueueService
queueService
;
@Autowired
private
MessageService
messageService
;
/**
* 保存演示DEMO
*
* @param req
*/
public
ResponseResult
<
String
>
createQueue
(
QueueVo
req
)
{
req
.
check
();
return
ResponseResult
.
result
(
queueService
.
create
(
req
));
}
/**
* 查询队列
*
* @param req 请求数据
* @return 查询结果
*/
public
ResponseResult
<
PageSizeData
<
QueueVo
>>
queryQueue
(
QueueQueryReqVo
req
)
{
return
ResponseResult
.
result
(
queueService
.
query
(
req
));
}
/**
* 查询队列
*
* @return 查询结果
*/
public
ResponseResult
<
String
>
queryInit
()
{
queueService
.
init
();
return
ResponseResult
.
result
(
"初始化完成"
);
}
/**
* 发送消息
*
* @param req 需要发送的消息
* @return 消息编号,但是没有任何意义,发送成功会更改
*/
public
ResponseResult
<
String
>
message
(
MessageVo
req
)
{
req
.
check
();
return
ResponseResult
.
result
(
messageService
.
send
(
req
));
}
/**
* 发送错误消息
*
* @param req
* @return
*/
public
ResponseResult
<
String
>
message_error
(
MessageVo
req
)
{
req
.
check
();
return
ResponseResult
.
result
(
messageService
.
onError
(
req
));
}
}
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