Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
kaopu-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1ce40d5f
authored
Dec 09, 2019
by
huangchengyi
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1.0
parent
2325d292
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
cmd/dong/main.go
internal/dao/dong_mod.go
cmd/dong/main.go
View file @
1ce40d5f
...
...
@@ -15,6 +15,10 @@ import (
"time"
)
type
Rabitmq
struct
{
Dsn
string
//rabitmq 配置1
}
type
RecvPro
struct
{}
type
RabbitMsg
struct
{
...
...
@@ -34,6 +38,7 @@ func main() {
model_dong
:=
dao
.
Model_dong
//所有动态模型算法列表
if
mod
==
-
1
{
queues
()
//队列监听
return
}
_
,
ok
:=
model_dong
[
mod
]
...
...
@@ -42,10 +47,6 @@ func main() {
os
.
Exit
(
1
)
}
if
mod
==
-
1
{
queues
()
//队列监听
}
ctx
:=
context
.
Background
()
//上下文
if
mod
>
0
{
...
...
@@ -82,19 +83,25 @@ func main() {
fmt
.
Println
(
"
\r\n
所有任务已经完成"
)
}
}
//队列监听
func
queues
()
{
t
:=
&
RecvPro
{}
var
(
dc
struct
{
Dsn1
*
Rabitmq
// rab配置1
}
)
paladin
.
Get
(
"rabitmq.toml"
)
.
UnmarshalTOML
(
&
dc
)
//读取配置
queueExchange
:=
&
rabbitmq
.
QueueExchange
{
"fengkong_dong_count"
,
"fengkong_dong_count"
,
"fengkong_exchange"
,
"direct"
,
"amqp://
guest:guest@192.168.2.232:5672
/"
,
"amqp://
"
+
dc
.
Dsn1
.
Dsn
+
"
/"
,
}
for
{
...
...
internal/dao/dong_mod.go
View file @
1ce40d5f
This diff is collapsed.
Click to expand it.
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