Commit d5c7ccb5 by mushishixian

config多文件以及brand

parent 2e8f77e7
......@@ -12,15 +12,14 @@ import (
func main() {
var path string
flag.StringVar(&path, "config", "conf/config.ini", "配置文件")
flag.StringVar(&path, "configPath", "conf", "配置文件")
flag.Parse()
if err := boot.Boot(path); err != nil {
panic(err)
}
gin.SetMode(config.Get("web.mode").String())
gin.SetMode(config.Get("web.mode").String())
r := routes.InitRouter()
port := config.Get("web.port").String()
//web改成micro 就是grpc,并直接注册到etcd里面
service := web.NewService(
......
......@@ -4,4 +4,9 @@
3 ="tme"
[common]
'MOUSER_API'='http://footstone.liexin.net/webapi/handle_mouser'
\ No newline at end of file
'MOUSER_API'='http://footstone.liexin.net/webapi/handle_mouser'
[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 (
)
func SetUp(path string) (err error) {
cfg, err = ini.Load(path)
//引入多个文件
cfg, err = ini.LooseLoad(path+"/config.ini", path+"/search.ini")
return
}
......
package main
import (
"flag"
"fmt"
"search_server/boot"
"search_server/model"
)
func main() {
//var path string
//flag.StringVar(&path, "config", "conf/config.ini", "配置文件")
//flag.Parse()
//if err := boot.Boot(path); err != nil {
// log.Error("%s", err)
//}
var path string
flag.StringVar(&path, "configPath", "conf", "配置文件")
flag.Parse()
if err := boot.Boot(path); err != nil {
fmt.Println(err)
}
fmt.Println(model.GetExcludeBrandIds(1))
//client := client.
//c := course.NewCourseService("go.micro.api.jtthink.course", client)
//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