Commit c6b8d157 by 李洪

代码冲突

parent 6eb3d80a
...@@ -56,7 +56,7 @@ func newMysqlClient() { ...@@ -56,7 +56,7 @@ func newMysqlClient() {
beeLogger.Log.Fatalf("db connect error => %v", err) beeLogger.Log.Fatalf("db connect error => %v", err)
return return
} }
orm.RegisterModel(new(CompanyApp), new(ImBase), new(ImChatRoom), new(ImUserRelationship), new(ImUser)) orm.RegisterModel(new(CompanyApp), new(ImBase), new(ImChatRoom), new(ImUserRelationship), new(ImUser), new(ImChatRoomUser))
orm.Debug = true orm.Debug = true
MysqlClient = orm.NewOrm() MysqlClient = orm.NewOrm()
beeLogger.Log.Success("MySQL connect success") beeLogger.Log.Success("MySQL connect success")
......
...@@ -26,6 +26,16 @@ type ImChatRoom struct { ...@@ -26,6 +26,16 @@ type ImChatRoom struct {
Updatetime string Updatetime string
} }
type ImChatRoomUser struct {
Id int64
RoomId int64
Operator string
Accid string
Role int64
Createtime string
Updatetime string
}
type ImUserRelationship struct { type ImUserRelationship struct {
Id int Id int
Accid string Accid string
......
...@@ -7,16 +7,17 @@ import ( ...@@ -7,16 +7,17 @@ import (
"im-microservice/pb" "im-microservice/pb"
"im-microservice/sevice/health" "im-microservice/sevice/health"
"im-microservice/sevice/im_chat_room" "im-microservice/sevice/im_chat_room"
"im-microservice/sevice/im_chat_room_user"
ic "im-microservice/sevice/im_configure" ic "im-microservice/sevice/im_configure"
"im-microservice/sevice/im_user" "im-microservice/sevice/im_user"
iur "im-microservice/sevice/im_user_relationship" iur "im-microservice/sevice/im_user_relationship"
"google.golang.org/grpc"
"google.golang.org/grpc/keepalive"
"google.golang.org/grpc/reflection"
"github.com/grpc-ecosystem/go-grpc-middleware" "github.com/grpc-ecosystem/go-grpc-middleware"
grpc_zap "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap" grpc_zap "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap"
grpc_recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery" grpc_recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery"
"google.golang.org/grpc"
"google.golang.org/grpc/keepalive"
"google.golang.org/grpc/reflection"
) )
var ( var (
...@@ -39,17 +40,19 @@ func init() { ...@@ -39,17 +40,19 @@ func init() {
rpc_server := grpc.NewServer(grpc.KeepaliveEnforcementPolicy(kaep), grpc.KeepaliveParams(kasp), rpc_server := grpc.NewServer(grpc.KeepaliveEnforcementPolicy(kaep), grpc.KeepaliveParams(kasp),
grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer( grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(
middleware.Interceptor, middleware.Interceptor,
middleware.Auth, //middleware.Auth,
grpc_recovery.UnaryServerInterceptor(middleware.RecoveryInterceptor()), grpc_recovery.UnaryServerInterceptor(middleware.RecoveryInterceptor()),
grpc_zap.UnaryServerInterceptor(middleware.ZapInterceptor()), grpc_zap.UnaryServerInterceptor(middleware.ZapInterceptor()),
))) )))
srv := health.NewServer() srv := health.NewServer()
pb.RegisterHealthServer(rpc_server, srv) pb.RegisterHealthServer(rpc_server, srv)
pb.RegisterConfigureSeviceServer(rpc_server, &ic.ConfigureSevice{}) pb.RegisterConfigureSeviceServer(rpc_server, &ic.ConfigureSevice{})
pb.RegisterChatRoomServiceServer(rpc_server, &im_chat_room.ImChatRoomService{}) pb.RegisterChatRoomServiceServer(rpc_server, &im_chat_room.ImChatRoomService{})
pb.RegisterImUserServer(rpc_server, &im_user.ImUserServer{}) pb.RegisterImUserServer(rpc_server, &im_user.ImUserServer{})
pb.RegisterUserRelationshipServiceServer(rpc_server, &iur.UserRelationshipService{}) pb.RegisterUserRelationshipServiceServer(rpc_server, &iur.UserRelationshipService{})
pb.RegisterChatRoomUserServer(rpc_server, &im_chat_room_user.ChatRoomUserServer{})
reflection.Register(rpc_server) reflection.Register(rpc_server)
RpcServer = rpc_server RpcServer = rpc_server
} }
...@@ -37,7 +37,6 @@ func createAccid() string { ...@@ -37,7 +37,6 @@ func createAccid() string {
//通过手机号获取用户数据 //通过手机号获取用户数据
func GetImUserByMobile(mobile string) (db.ImUser, error) { func GetImUserByMobile(mobile string) (db.ImUser, error) {
var c_user db.ImUser var c_user db.ImUser
fmt.Println(db.MysqlClient)
err := db.MysqlClient.QueryTable(u_table_name).Filter("mobile", mobile).One(&c_user) err := db.MysqlClient.QueryTable(u_table_name).Filter("mobile", mobile).One(&c_user)
if err != nil { if err != nil {
return c_user, err return c_user, err
......
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 to comment