package main import ( "data_tidb/config" "github.com/spf13/cobra" "jygit.jydev.jianyu360.cn/data_processing/common_utils/log" "jygit.jydev.jianyu360.cn/data_processing/common_utils/udp" ) var ( UdpClient udp.UdpClient ) func init() { config.Init("./common.toml") InitLog() InitMgo() InitMysql() InitField() //InitOss(false) //redis.InitRedis1("qyxy_id=127.0.0.1:8379", 1) //redis.InitRedis1("qyxy_id=192.168.3.166:4379", 1) log.Info("init success") //启动 nohup ./MTB bidding & } func main() { //go SaveFunc() //go SaveExpandFunc() //go SaveDetailFunc() //go SaveAttrFunc() //go SaveIntentFunc() //go SaveBidderFunc() //go SaveGoodsFunc() //go saveErrMethod() taskB() //rootCmd := &cobra.Command{Use: "my cmd"} //rootCmd.AddCommand(bidding()) //rootCmd.AddCommand(project()) //rootCmd.AddCommand(projectAdd()) //if err := rootCmd.Execute(); err != nil { // fmt.Println("rootCmd.Execute failed", err.Error()) //} //UdpClient = udp.UdpClient{Local: config.Conf.Udp.LocPort, BufSize: 1024} //UdpClient.Listen(processUdpMsg) //log.Info("Udp服务监听", zap.String("port:", config.Conf.Udp.LocPort)) c := make(chan bool, 1) <-c } // @Description 标讯数据 // @Author J 2022/9/20 17:52 func bidding() *cobra.Command { cmdClient := &cobra.Command{ Use: "bidding", Short: "Start processing bidding data", Run: func(cmd *cobra.Command, args []string) { //go SaveFunc() //go SaveTagFunc() //go SaveExpandFunc() //go SaveAttrFunc() //go SaveImfFunc() //go SaveIntentFunc() //go SaveWinnerFunc() //go SavePackageFunc() //go SavePurFunc() //go saveErrMethod() taskB() }, } //cmdClient.Flags().StringVarP(&cfg, "conf", "c", "", "server config [toml]") return cmdClient } // @Description 项目数据 // @Author J 2022/9/20 17:52 func project() *cobra.Command { cmdClient := &cobra.Command{ Use: "project", Short: "Start processing project data", Run: func(cmd *cobra.Command, args []string) { //go SaveProFunc() //go SaveProTagFunc() //go SaveProbFunc() //go SaveRelationFunc() taskP() }, } //cmdClient.Flags().StringVarP(&cfg, "conf", "c", "", "server config [toml]") return cmdClient } // @Description 项目数据 // @Author J 2022/9/20 17:52 func projectAdd() *cobra.Command { var pici int64 cmdClient := &cobra.Command{ Use: "project", Short: "Start processing project data", Run: func(cmd *cobra.Command, args []string) { //go SaveProFunc() //go SaveProTagFunc() //go SaveProbFunc() go SaveRelationFunc() taskPAdd(pici) }, } cmdClient.Flags().Int64VarP(&pici, "pici", "p", 0, "") return cmdClient }