Commit d5c7ccb5 by mushishixian

config多文件以及brand

parent 2e8f77e7
...@@ -12,15 +12,14 @@ import ( ...@@ -12,15 +12,14 @@ import (
func main() { func main() {
var path string var path string
flag.StringVar(&path, "config", "conf/config.ini", "配置文件") flag.StringVar(&path, "configPath", "conf", "配置文件")
flag.Parse() flag.Parse()
if err := boot.Boot(path); err != nil { if err := boot.Boot(path); err != nil {
panic(err) panic(err)
} }
gin.SetMode(config.Get("web.mode").String())
gin.SetMode(config.Get("web.mode").String())
r := routes.InitRouter() r := routes.InitRouter()
port := config.Get("web.port").String() port := config.Get("web.port").String()
//web改成micro 就是grpc,并直接注册到etcd里面 //web改成micro 就是grpc,并直接注册到etcd里面
service := web.NewService( service := web.NewService(
......
...@@ -4,4 +4,9 @@ ...@@ -4,4 +4,9 @@
3 ="tme" 3 ="tme"
[common] [common]
'MOUSER_API'='http://footstone.liexin.net/webapi/handle_mouser' 'MOUSER_API'='http://footstone.liexin.net/webapi/handle_mouser'
\ No newline at end of file
[brand]
is_not_ti = 0
ti_ly_brand_ids=23,45069,7754,17484,43215,13421,5220,7636,44534,43556,44543,9429,758,9470,10430,10653,10707,11227,11276,11819,12608,12965,12997,13327,13675,13680,13752
ti_zy_brand_ids=23
\ No newline at end of file
...@@ -10,7 +10,8 @@ var ( ...@@ -10,7 +10,8 @@ var (
) )
func SetUp(path string) (err error) { func SetUp(path string) (err error) {
cfg, err = ini.Load(path) //引入多个文件
cfg, err = ini.LooseLoad(path+"/config.ini", path+"/search.ini")
return return
} }
......
package main package main
import (
"flag"
"fmt"
"search_server/boot"
"search_server/model"
)
func main() { func main() {
//var path string var path string
//flag.StringVar(&path, "config", "conf/config.ini", "配置文件") flag.StringVar(&path, "configPath", "conf", "配置文件")
//flag.Parse() flag.Parse()
//if err := boot.Boot(path); err != nil { if err := boot.Boot(path); err != nil {
// log.Error("%s", err) fmt.Println(err)
//} }
fmt.Println(model.GetExcludeBrandIds(1))
//client := client. //client := client.
//c := course.NewCourseService("go.micro.api.jtthink.course", client) //c := course.NewCourseService("go.micro.api.jtthink.course", client)
//course_rsp, _ := c.ListForTop(context.TODO(), &course.ListRequest{Size: 10}) //course_rsp, _ := c.ListForTop(context.TODO(), &course.ListRequest{Size: 10})
......
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