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
c8b11947
authored
Dec 10, 2019
by
Joneq
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
查询方法
parent
96eb56fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
7 deletions
cmd/static/main.go
cmd/static/main.go
View file @
c8b11947
...
...
@@ -5,10 +5,12 @@ import (
"encoding/json"
"flag"
"fmt"
"github.com/bilibili/kratos/pkg/conf/paladin"
"github.com/bilibili/kratos/pkg/log"
"github.com/ichunt2019/go-msgserver/utils/rabbitmq"
"kaopu-server/internal/logic"
"kaopu-server/internal/model"
"kaopu-server/internal/service"
"os"
"sync"
"time"
)
...
...
@@ -33,8 +35,6 @@ var (
companyAddScore
[]
map
[
string
]
string
//设置等待
wg
sync
.
WaitGroup
//运行方式
runtype
string
)
type
RecvPro
struct
{
...
...
@@ -53,15 +53,33 @@ type RabbitMsg struct {
//获取配置参数
func
GetConfig
()
{
//获取输入参数
flag
.
Parse
()
if
err
:=
paladin
.
Init
();
err
!=
nil
{
panic
(
err
)
}
//初始化日志目录
SetLog
(
"kaopuserver start"
,
0
)
}
func
SetLog
(
k
string
,
v
interface
{}){
//初始化日志目录
log
.
Init
(
&
log
.
Config
{
Dir
:
"logs"
})
defer
log
.
Close
()
log
.
Info
(
k
,
v
)
}
func
main
()
{
//获取config
logic
.
GetConfig
()
GetConfig
()
flag
.
StringVar
(
&
runtype
,
"runtype"
,
"one"
,
"default config path"
)
if
runtype
==
"one"
{
if
os
.
Args
[
2
]
==
"one"
{
//设置协程数量
wg
.
Add
(
1
)
...
...
@@ -88,6 +106,7 @@ func main() {
wg
.
Wait
()
}
else
{
t
:=
&
RecvPro
{}
queueExchange
:=
&
rabbitmq
.
QueueExchange
{
...
...
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