Commit c8b11947 by Joneq

查询方法

parent 96eb56fd
Showing with 26 additions and 7 deletions
......@@ -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{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment