main.go 618 Bytes
Newer Older
chenweijian's avatar
chenweijian committed
1 2 3 4
package main

import (
	"fmt"
hujiebin's avatar
hujiebin committed
5
	"git.hilo.cn/hilo-common/resource/consul"
hujiebin's avatar
hujiebin committed
6
	"hilo-user/domain/service/event_s"
chenweijian's avatar
chenweijian committed
7 8 9 10
	"hilo-user/route"
)

const (
hujiebin's avatar
hujiebin committed
11 12 13
	PORT         = 9040
	RegisterName = "hiloUser"
	RegisterTag  = "用户中心"
chenweijian's avatar
chenweijian committed
14 15 16 17
)

func main() {
	//cron.Init()                     // 开启定时任务
hujiebin's avatar
hujiebin committed
18
	event_s.EventInit()                                      // 注册事件(内部事件+mysql拟kafka)
hujiebin's avatar
hujiebin committed
19 20 21
	r := route.InitRouter()                                  // 注册路由
	consul.RegisterToConsul(PORT, RegisterName, RegisterTag) // 服务注册
	r.Run(fmt.Sprintf(":%d", PORT))                          // 启动服务
chenweijian's avatar
chenweijian committed
22
}