Commit c8b11947 by Joneq

查询方法

parent 96eb56fd
Showing with 26 additions and 7 deletions
...@@ -5,10 +5,12 @@ import ( ...@@ -5,10 +5,12 @@ import (
"encoding/json" "encoding/json"
"flag" "flag"
"fmt" "fmt"
"github.com/bilibili/kratos/pkg/conf/paladin"
"github.com/bilibili/kratos/pkg/log"
"github.com/ichunt2019/go-msgserver/utils/rabbitmq" "github.com/ichunt2019/go-msgserver/utils/rabbitmq"
"kaopu-server/internal/logic"
"kaopu-server/internal/model" "kaopu-server/internal/model"
"kaopu-server/internal/service" "kaopu-server/internal/service"
"os"
"sync" "sync"
"time" "time"
) )
...@@ -33,8 +35,6 @@ var ( ...@@ -33,8 +35,6 @@ var (
companyAddScore []map[string]string companyAddScore []map[string]string
//设置等待 //设置等待
wg sync.WaitGroup wg sync.WaitGroup
//运行方式
runtype string
) )
type RecvPro struct { type RecvPro struct {
...@@ -53,15 +53,33 @@ type RabbitMsg 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() { func main() {
//获取config //获取config
logic.GetConfig() GetConfig()
flag.StringVar(&runtype, "runtype", "one", "default config path") if os.Args[2] == "one" {
if runtype == "one" {
//设置协程数量 //设置协程数量
wg.Add(1) wg.Add(1)
...@@ -88,6 +106,7 @@ func main() { ...@@ -88,6 +106,7 @@ func main() {
wg.Wait() wg.Wait()
}else{ }else{
t := &RecvPro{} t := &RecvPro{}
queueExchange := &rabbitmq.QueueExchange{ 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