// Code generated by goctl. DO NOT EDIT! // Source: biService.proto package main import ( "flag" "fmt" "bp.jydev.jianyu360.cn/BaseService/biService/entity" "bp.jydev.jianyu360.cn/BaseService/biService/rpc/internal/config" "bp.jydev.jianyu360.cn/BaseService/biService/rpc/internal/server" "bp.jydev.jianyu360.cn/BaseService/biService/rpc/internal/svc" "bp.jydev.jianyu360.cn/BaseService/biService/rpc/pb" "github.com/nsqio/go-nsq" "github.com/zeromicro/go-zero/core/conf" "github.com/zeromicro/go-zero/core/logx" "github.com/zeromicro/go-zero/zrpc" "google.golang.org/grpc" ) var configFile = flag.String("f", "etc/biservice.yaml", "the config file") func main() { flag.Parse() var c config.Config conf.MustLoad(*configFile, &c) ctx := svc.NewServiceContext(c) srv := server.NewBiServiceServer(ctx) entity.PublicKey = c.PublicKey entity.InitMysql(c.Mysql.JianYu, c.Mysql.JyDoc, c.Mysql.Bi, c.Mysql.Tidb, c.Mysql.BiTidb, c.Mysql.CallTidb, c.Mysql.BiService) entity.InitMail(c.Mail) entity.InitMongo(c.Mongo.Qfw.MongodbAddr, c.Mongo.Qfw.DbName, c.Mongo.Qfw.Size) entity.InitBiddingMgo(c.Mongo.Bidding.MongodbAddr, c.Mongo.Bidding.DbName, c.Mongo.Bidding.UserName, c.Mongo.Bidding.Password, c.Mongo.Bidding.Size) entity.InitQyxyMgo(c.Mongo.Qyxy.MongodbAddr, c.Mongo.Qyxy.DbName, c.Mongo.Qyxy.UserName, c.Mongo.Qyxy.Password, c.Mongo.Qyxy.Size) entity.InitEs(c.Es.Version, c.Es.Address, c.Es.UserName, c.Es.Password, c.Es.DbSize) entity.InitEntEs(c.EntEs.Version, c.EntEs.Address, c.EntEs.UserName, c.EntEs.Password, c.EntEs.DbSize) entity.InitArea() entity.InitRedis(c.RedisAddress) entity.InitConfig(c.ExportDirectory, c.UpdateProjectUrl, c.ExportUrl, c.ExportCount) //合力亿捷 entity.GetHlyj(c.Hlyj.Appid, c.Hlyj.Account, c.Hlyj.Secret, c.Hlyj.TokenUrl, c.Hlyj.CallUrl, c.Hlyj.Integratedid, c.Hlyj.CallFlag) //nsq config := nsq.NewConfig() consumer, err := nsq.NewConsumer(c.TopicName, "jy_position_sync", config) if err != nil { fmt.Println(err) } consumer.AddHandler(&entity.Handler{}) err = consumer.ConnectToNSQLookupd(c.NsqUrl) if err != nil { fmt.Println(err) } // s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { pb.RegisterBiServiceServer(grpcServer, srv) }) logx.MustSetup(c.Logx) defer s.Stop() fmt.Printf("Starting rpc server at %s...\n", c.ListenOn) s.Start() }