mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-04 00:55:59 +08:00
Merge remote-tracking branch 'origin/superGroup' into superGroup
This commit is contained in:
@@ -157,14 +157,16 @@ type QuitGroupResp struct {
|
||||
}
|
||||
|
||||
type SetGroupInfoReq struct {
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
GroupName string `json:"groupName"`
|
||||
Notification string `json:"notification"`
|
||||
Introduction string `json:"introduction"`
|
||||
FaceURL string `json:"faceURL"`
|
||||
Ex string `json:"ex"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
GroupName string `json:"groupName"`
|
||||
Notification string `json:"notification"`
|
||||
Introduction string `json:"introduction"`
|
||||
FaceURL string `json:"faceURL"`
|
||||
Ex string `json:"ex"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
NeedVerification *int32 `json:"needVerification" binding "oneof=0 1 2"`
|
||||
}
|
||||
|
||||
type SetGroupInfoResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -496,6 +497,8 @@ type PDefaultTips struct {
|
||||
|
||||
func init() {
|
||||
cfgName := os.Getenv("CONFIG_NAME")
|
||||
fmt.Println(Root, cfgName)
|
||||
|
||||
if len(cfgName) == 0 {
|
||||
cfgName = Root + "/config/config.yaml"
|
||||
}
|
||||
|
||||
@@ -267,6 +267,12 @@ const (
|
||||
ReliableNotificationMsg = 3
|
||||
)
|
||||
|
||||
const (
|
||||
ApplyNeedVerificationInviteDirectly = 0 // 申请需要同意 邀请直接进
|
||||
AllNeedVerification = 1 //所有人进群需要验证,除了群主管理员邀请进群
|
||||
Directly = 2 //直接进群
|
||||
)
|
||||
|
||||
const FriendAcceptTip = "You have successfully become friends, so start chatting"
|
||||
|
||||
func GroupIsBanChat(status int32) bool {
|
||||
|
||||
@@ -7,6 +7,7 @@ type Register struct {
|
||||
Password string `gorm:"column:password;type:varchar(255)" json:"password"`
|
||||
Ex string `gorm:"column:ex;size:1024" json:"ex"`
|
||||
UserID string `gorm:"column:user_id;type:varchar(255)" json:"userID"`
|
||||
AreaCode string `gorm:"column:area_code;type:varchar(255)"`
|
||||
}
|
||||
|
||||
//
|
||||
@@ -76,16 +77,17 @@ func (FriendRequest) TableName() string {
|
||||
type Group struct {
|
||||
//`json:"operationID" binding:"required"`
|
||||
//`protobuf:"bytes,1,opt,name=GroupID" json:"GroupID,omitempty"` `json:"operationID" binding:"required"`
|
||||
GroupID string `gorm:"column:group_id;primary_key;size:64" json:"groupID" binding:"required"`
|
||||
GroupName string `gorm:"column:name;size:255" json:"groupName"`
|
||||
Notification string `gorm:"column:notification;size:255" json:"notification"`
|
||||
Introduction string `gorm:"column:introduction;size:255" json:"introduction"`
|
||||
FaceURL string `gorm:"column:face_url;size:255" json:"faceURL"`
|
||||
CreateTime time.Time `gorm:"column:create_time"`
|
||||
Ex string `gorm:"column:ex" json:"ex;size:1024" json:"ex"`
|
||||
Status int32 `gorm:"column:status"`
|
||||
CreatorUserID string `gorm:"column:creator_user_id;size:64"`
|
||||
GroupType int32 `gorm:"column:group_type"`
|
||||
GroupID string `gorm:"column:group_id;primary_key;size:64" json:"groupID" binding:"required"`
|
||||
GroupName string `gorm:"column:name;size:255" json:"groupName"`
|
||||
Notification string `gorm:"column:notification;size:255" json:"notification"`
|
||||
Introduction string `gorm:"column:introduction;size:255" json:"introduction"`
|
||||
FaceURL string `gorm:"column:face_url;size:255" json:"faceURL"`
|
||||
CreateTime time.Time `gorm:"column:create_time"`
|
||||
Ex string `gorm:"column:ex" json:"ex;size:1024" json:"ex"`
|
||||
Status int32 `gorm:"column:status"`
|
||||
CreatorUserID string `gorm:"column:creator_user_id;size:64"`
|
||||
GroupType int32 `gorm:"column:group_type"`
|
||||
NeedVerification int32 `gorm:"column:need_verification"`
|
||||
}
|
||||
|
||||
//message GroupMemberFullInfo {
|
||||
|
||||
@@ -5,22 +5,23 @@ import (
|
||||
_ "github.com/jinzhu/gorm"
|
||||
)
|
||||
|
||||
func GetRegister(account string) (*db.Register, error) {
|
||||
func GetRegister(account, areaCode string) (*db.Register, error) {
|
||||
dbConn, err := db.DB.MysqlDB.DefaultGormDB()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var r db.Register
|
||||
return &r, dbConn.Table("registers").Where("account = ?",
|
||||
account).Take(&r).Error
|
||||
return &r, dbConn.Table("registers").Where("account = ? or account =? and area_code=?",
|
||||
account, account, areaCode).Take(&r).Error
|
||||
}
|
||||
|
||||
func SetPassword(account, password, ex, userID string) error {
|
||||
func SetPassword(account, password, ex, userID, areaCode string) error {
|
||||
r := db.Register{
|
||||
Account: account,
|
||||
Password: password,
|
||||
Ex: ex,
|
||||
UserID: userID,
|
||||
AreaCode: areaCode,
|
||||
}
|
||||
dbConn, err := db.DB.MysqlDB.DefaultGormDB()
|
||||
if err != nil {
|
||||
|
||||
+312
-300
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,9 @@
|
||||
syntax = "proto3";
|
||||
import "Open_IM/pkg/proto/sdk_ws/wrappers.proto";
|
||||
option go_package = "./sdk_ws;server_api_params";
|
||||
package server_api_params;
|
||||
|
||||
|
||||
////////////////////////////////base///////////////////////////////
|
||||
|
||||
|
||||
@@ -18,6 +20,7 @@ message GroupInfo{
|
||||
int32 status = 10;
|
||||
string creatorUserID = 11;
|
||||
int32 groupType = 12;
|
||||
google.protobuf.Int32Value needVerification = 13;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user