Merge remote-tracking branch 'origin/tuoyun' into tuoyun

pull/141/head
wenxu12345 3 years ago
commit 14841a44ad

@ -78,7 +78,6 @@ func UserToken(c *gin.Context) {
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()})
return
}
resp := api.UserTokenResp{CommResp: api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg},
UserToken: api.UserTokenInfo{UserID: req.FromUserID, Token: reply.Token, ExpiredTime: reply.ExpiredTime}}
log.NewInfo(req.OperationID, "UserRegister return ", resp)

@ -101,6 +101,7 @@ func FriendApplicationRejectedNotification(req *pbFriend.AddFriendResponseReq) {
}
func FriendAddedNotification(operationID, opUserID, fromUserID, toUserID string) {
return
friendAddedTips := open_im_sdk.FriendAddedTips{Friend: &open_im_sdk.FriendInfo{}, OpUser: &open_im_sdk.PublicUserInfo{}}
user, err := imdb.GetUserByUserID(opUserID)
if err != nil {

@ -116,8 +116,8 @@ type GroupRequest struct {
UserID string `gorm:"column:user_id;primary_key;size:64"`
GroupID string `gorm:"column:group_id;primary_key;size:64"`
HandleResult int32 `gorm:"column:handle_result"`
ReqMsg string `gorm:"column:req_msg;size:255"`
HandledMsg string `gorm:"column:handle_msg;size:255"`
ReqMsg string `gorm:"column:req_msg;size:1024"`
HandledMsg string `gorm:"column:handle_msg;size:1024"`
ReqTime time.Time `gorm:"column:req_time"`
HandleUserID string `gorm:"column:handle_user_id;size:64"`
HandledTime time.Time `gorm:"column:handle_time"`

@ -52,7 +52,6 @@ func initMysqlDB() {
}
log.NewInfo("open db ok ", dsn)
db.AutoMigrate(&Friend{},
&FriendRequest{},
&Group{},
@ -60,41 +59,43 @@ func initMysqlDB() {
&GroupRequest{},
&User{},
&Black{})
db.Set("gorm:table_options", "CHARSET=utf8")
if !db.HasTable(&Friend{}) {
log.NewInfo("CreateTable Friend")
db.CreateTable(&Friend{})
}
if !db.HasTable(&FriendRequest{}) {
log.NewInfo("CreateTable FriendRequest")
db.CreateTable(&FriendRequest{})
}
if !db.HasTable(&Group{}) {
log.NewInfo("CreateTable Group")
db.CreateTable(&Group{})
}
if !db.HasTable(&GroupMember{}) {
log.NewInfo("CreateTable GroupMember")
db.CreateTable(&GroupMember{})
}
if !db.HasTable(&GroupRequest{}) {
log.NewInfo("CreateTable GroupRequest")
db.CreateTable(&GroupRequest{})
}
if !db.HasTable(&User{}) {
log.NewInfo("CreateTable User")
db.CreateTable(&User{})
}
if !db.HasTable(&Black{}) {
log.NewInfo("CreateTable Black")
db.CreateTable(&Black{})
}
//
//if !db.HasTable(&Friend{}) {
// log.NewInfo("CreateTable Friend")
// db.CreateTable(&Friend{})
//}
//
//if !db.HasTable(&FriendRequest{}) {
// log.NewInfo("CreateTable FriendRequest")
// db.CreateTable(&FriendRequest{})
//}
//
//if !db.HasTable(&Group{}) {
// log.NewInfo("CreateTable Group")
// db.CreateTable(&Group{})
//}
//
//if !db.HasTable(&GroupMember{}) {
// log.NewInfo("CreateTable GroupMember")
// db.CreateTable(&GroupMember{})
//}
//
//if !db.HasTable(&GroupRequest{}) {
// log.NewInfo("CreateTable GroupRequest")
// db.CreateTable(&GroupRequest{})
//}
//
//if !db.HasTable(&User{}) {
// log.NewInfo("CreateTable User")
// db.CreateTable(&User{})
//}
//
//if !db.HasTable(&Black{}) {
// log.NewInfo("CreateTable Black")
// db.CreateTable(&Black{})
//}
return

Loading…
Cancel
Save