7 Star 1 Fork 1

罗中天/douyin

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.go 1016 Bytes
一键复制 编辑 原始数据 按行查看 历史
黎博凯 提交于 2023-02-19 15:44 +08:00 . feat: favorite对视频点赞计数逻辑增加
package main
import (
"gitee.com/derrickball/douyin/app/favorite/dal"
"gitee.com/derrickball/douyin/app/favorite/kitex_gen/favorite_rpc/favoriteservice"
"gitee.com/derrickball/douyin/app/favorite/rpc"
"gitee.com/derrickball/douyin/pkg/config"
"github.com/cloudwego/kitex/pkg/rpcinfo"
"github.com/cloudwego/kitex/server"
etcd "github.com/kitex-contrib/registry-etcd"
"log"
"net"
)
func Init() {
config.LoadConfig()
dal.Init()
rpc.Init()
}
func main() {
Init()
r, err := etcd.NewEtcdRegistry([]string{config.Config.Address.Etcd})
if err != nil {
panic(err)
}
addr, err := net.ResolveTCPAddr("tcp", config.Config.Address.Favorite)
if err != nil {
panic(err)
}
favoriteSvr := favoriteservice.NewServer(new(FavoriteServiceImpl),
server.WithServerBasicInfo(&rpcinfo.EndpointBasicInfo{ServiceName: config.Config.Service.Favorite}),
server.WithServiceAddr(addr),
server.WithRegistry(r),
)
favoriteErr := favoriteSvr.Run()
if favoriteErr != nil {
log.Println(favoriteErr.Error())
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/derrickball/douyin.git
git@gitee.com:derrickball/douyin.git
derrickball
douyin
douyin
48d44dfe16fa

搜索帮助