mirror of
				https://github.com/openimsdk/open-im-server.git
				synced 2025-10-26 21:22:16 +08:00 
			
		
		
		
	feat: add openim docker
Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com>
This commit is contained in:
		
							parent
							
								
									a42a44e0a3
								
							
						
					
					
						commit
						ad47590e13
					
				| @ -27,6 +27,7 @@ import ( | ||||
| 	"github.com/gin-gonic/gin" | ||||
| 	"github.com/go-playground/validator/v10" | ||||
| 	"github.com/mitchellh/mapstructure" | ||||
| 
 | ||||
| 	"github.com/openimsdk/open-im-server/v3/pkg/authverify" | ||||
| 	"github.com/openimsdk/open-im-server/v3/pkg/common/config" | ||||
| 
 | ||||
|  | ||||
| @ -16,9 +16,10 @@ package push | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 	"github.com/OpenIMSDK/tools/utils" | ||||
| 	"sync" | ||||
| 
 | ||||
| 	"github.com/OpenIMSDK/tools/utils" | ||||
| 
 | ||||
| 	"google.golang.org/grpc" | ||||
| 
 | ||||
| 	"github.com/OpenIMSDK/protocol/constant" | ||||
|  | ||||
| @ -16,8 +16,10 @@ package friend | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 
 | ||||
| 	pbfriend "github.com/OpenIMSDK/protocol/friend" | ||||
| 	"github.com/OpenIMSDK/tools/utils" | ||||
| 
 | ||||
| 	cbapi "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" | ||||
| 	"github.com/openimsdk/open-im-server/v3/pkg/common/config" | ||||
| 	"github.com/openimsdk/open-im-server/v3/pkg/common/http" | ||||
|  | ||||
| @ -16,6 +16,7 @@ package friend | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 
 | ||||
| 	"github.com/OpenIMSDK/tools/tx" | ||||
| 
 | ||||
| 	"github.com/OpenIMSDK/protocol/sdkws" | ||||
|  | ||||
| @ -16,9 +16,10 @@ package group | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 	"github.com/OpenIMSDK/tools/log" | ||||
| 	"time" | ||||
| 
 | ||||
| 	"github.com/OpenIMSDK/tools/log" | ||||
| 
 | ||||
| 	"github.com/OpenIMSDK/protocol/constant" | ||||
| 	"github.com/OpenIMSDK/protocol/group" | ||||
| 	"github.com/OpenIMSDK/protocol/wrapperspb" | ||||
|  | ||||
| @ -17,13 +17,14 @@ package group | ||||
| import ( | ||||
| 	"context" | ||||
| 	"fmt" | ||||
| 	"github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" | ||||
| 	"math/big" | ||||
| 	"math/rand" | ||||
| 	"strconv" | ||||
| 	"strings" | ||||
| 	"time" | ||||
| 
 | ||||
| 	"github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" | ||||
| 
 | ||||
| 	pbconversation "github.com/OpenIMSDK/protocol/conversation" | ||||
| 	"github.com/OpenIMSDK/protocol/wrapperspb" | ||||
| 	"github.com/OpenIMSDK/tools/tx" | ||||
|  | ||||
| @ -16,16 +16,18 @@ package msg | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 
 | ||||
| 	utils2 "github.com/OpenIMSDK/tools/utils" | ||||
| 
 | ||||
| 	"github.com/redis/go-redis/v9" | ||||
| 
 | ||||
| 	cbapi "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" | ||||
| 	"github.com/OpenIMSDK/protocol/constant" | ||||
| 	"github.com/OpenIMSDK/protocol/msg" | ||||
| 	"github.com/OpenIMSDK/protocol/sdkws" | ||||
| 	"github.com/OpenIMSDK/tools/errs" | ||||
| 	"github.com/OpenIMSDK/tools/log" | ||||
| 
 | ||||
| 	cbapi "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" | ||||
| ) | ||||
| 
 | ||||
| func (m *msgServer) GetConversationsHasReadAndMaxSeq(ctx context.Context, req *msg.GetConversationsHasReadAndMaxSeqReq) (resp *msg.GetConversationsHasReadAndMaxSeqResp, err error) { | ||||
|  | ||||
| @ -16,6 +16,7 @@ package msg | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 
 | ||||
| 	"github.com/OpenIMSDK/protocol/sdkws" | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| 
 | ||||
| @ -24,6 +25,7 @@ import ( | ||||
| 	"github.com/OpenIMSDK/tools/log" | ||||
| 	"github.com/OpenIMSDK/tools/mcontext" | ||||
| 	"github.com/OpenIMSDK/tools/utils" | ||||
| 
 | ||||
| 	cbapi "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" | ||||
| 
 | ||||
| 	"github.com/openimsdk/open-im-server/v3/pkg/common/config" | ||||
|  | ||||
| @ -16,6 +16,7 @@ package user | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 
 | ||||
| 	pbuser "github.com/OpenIMSDK/protocol/user" | ||||
| 	"github.com/OpenIMSDK/tools/utils" | ||||
| 
 | ||||
|  | ||||
| @ -37,7 +37,7 @@ type SoundElem struct { | ||||
| 	Duration  int64  `mapstructure:"duration"  validate:"required,min=1"` | ||||
| } | ||||
| type VideoElem struct { | ||||
| 	VideoPath      string `mapstructure:"videoPath" ` | ||||
| 	VideoPath      string `mapstructure:"videoPath"` | ||||
| 	VideoUUID      string `mapstructure:"videoUUID"` | ||||
| 	VideoURL       string `mapstructure:"videoUrl"       validate:"required"` | ||||
| 	VideoType      string `mapstructure:"videoType"      validate:"required"` | ||||
| @ -51,7 +51,7 @@ type VideoElem struct { | ||||
| 	SnapshotHeight int32  `mapstructure:"snapshotHeight" validate:"required"` | ||||
| } | ||||
| type FileElem struct { | ||||
| 	FilePath  string `mapstructure:"filePath" ` | ||||
| 	FilePath  string `mapstructure:"filePath"` | ||||
| 	UUID      string `mapstructure:"uuid"` | ||||
| 	SourceURL string `mapstructure:"sourceUrl" validate:"required"` | ||||
| 	FileName  string `mapstructure:"fileName"  validate:"required"` | ||||
| @ -63,7 +63,7 @@ type AtElem struct { | ||||
| 	IsAtSelf   bool     `mapstructure:"isAtSelf"` | ||||
| } | ||||
| type LocationElem struct { | ||||
| 	Description string  `mapstructure:"description" ` | ||||
| 	Description string  `mapstructure:"description"` | ||||
| 	Longitude   float64 `mapstructure:"longitude"   validate:"required"` | ||||
| 	Latitude    float64 `mapstructure:"latitude"    validate:"required"` | ||||
| } | ||||
|  | ||||
| @ -16,6 +16,7 @@ package config | ||||
| 
 | ||||
| import ( | ||||
| 	"bytes" | ||||
| 
 | ||||
| 	"github.com/OpenIMSDK/tools/discoveryregistry" | ||||
| 	"gopkg.in/yaml.v3" | ||||
| ) | ||||
|  | ||||
| @ -35,7 +35,7 @@ const ( | ||||
| 	DefaultFolderPath    = "../config/" | ||||
| ) | ||||
| 
 | ||||
| // return absolude path join ../config/, this is k8s container config path | ||||
| // return absolude path join ../config/, this is k8s container config path. | ||||
| func GetDefaultConfigPath() string { | ||||
| 	b, err := filepath.Abs(os.Args[0]) | ||||
| 	if err != nil { | ||||
| @ -45,7 +45,7 @@ func GetDefaultConfigPath() string { | ||||
| 	return filepath.Join(filepath.Dir(b), "../config/") | ||||
| } | ||||
| 
 | ||||
| // getProjectRoot returns the absolute path of the project root directory | ||||
| // getProjectRoot returns the absolute path of the project root directory. | ||||
| func GetProjectRoot() string { | ||||
| 	b, _ := filepath.Abs(os.Args[0]) | ||||
| 
 | ||||
|  | ||||
| @ -15,9 +15,10 @@ | ||||
| package convert | ||||
| 
 | ||||
| import ( | ||||
| 	"github.com/OpenIMSDK/protocol/sdkws" | ||||
| 	"time" | ||||
| 
 | ||||
| 	"github.com/OpenIMSDK/protocol/sdkws" | ||||
| 
 | ||||
| 	relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" | ||||
| ) | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										2
									
								
								pkg/common/db/cache/group.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								pkg/common/db/cache/group.go
									
									
									
									
										vendored
									
									
								
							| @ -39,7 +39,7 @@ const ( | ||||
| 	groupMemberIDsKey   = "GROUP_MEMBER_IDS:" | ||||
| 	groupMembersHashKey = "GROUP_MEMBERS_HASH2:" | ||||
| 	groupMemberInfoKey  = "GROUP_MEMBER_INFO:" | ||||
| 	//groupOwnerInfoKey   = "GROUP_OWNER_INFO:" | ||||
| 	//groupOwnerInfoKey   = "GROUP_OWNER_INFO:". | ||||
| 	joinedGroupsKey            = "JOIN_GROUPS_KEY:" | ||||
| 	groupMemberNumKey          = "GROUP_MEMBER_NUM_CACHE:" | ||||
| 	groupRoleLevelMemberIDsKey = "GROUP_ROLE_LEVEL_MEMBER_IDS:" | ||||
|  | ||||
| @ -77,7 +77,7 @@ func (cli *K8sDR) CloseConn(conn *grpc.ClientConn) { | ||||
| 	conn.Close() | ||||
| } | ||||
| 
 | ||||
| // do not use this method for call rpc | ||||
| // do not use this method for call rpc. | ||||
| func (cli *K8sDR) GetClientLocalConns() map[string][]*grpc.ClientConn { | ||||
| 	fmt.Println("should not call this function!!!!!!!!!!!!!!!!!!!!!!!!!") | ||||
| 
 | ||||
|  | ||||
| @ -8,6 +8,7 @@ import ( | ||||
| 	"github.com/OpenIMSDK/tools/discoveryregistry" | ||||
| 	openkeeper "github.com/OpenIMSDK/tools/discoveryregistry/zookeeper" | ||||
| 	"github.com/OpenIMSDK/tools/log" | ||||
| 
 | ||||
| 	"github.com/openimsdk/open-im-server/v3/pkg/common/config" | ||||
| ) | ||||
| 
 | ||||
|  | ||||
| @ -12,8 +12,9 @@ import ( | ||||
| 	"github.com/OpenIMSDK/tools/log" | ||||
| 	"github.com/OpenIMSDK/tools/mcontext" | ||||
| 	"github.com/OpenIMSDK/tools/utils" | ||||
| 	"github.com/openimsdk/open-im-server/v3/pkg/common/config" | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| 
 | ||||
| 	"github.com/openimsdk/open-im-server/v3/pkg/common/config" | ||||
| ) | ||||
| 
 | ||||
| const ( | ||||
|  | ||||
| @ -4,7 +4,7 @@ import ginProm "github.com/openimsdk/open-im-server/v3/pkg/common/ginprometheus" | ||||
| 
 | ||||
| /* | ||||
| labels := prometheus.Labels{"label_one": "any", "label_two": "value"} | ||||
| ApiCustomCnt.MetricCollector.(*prometheus.CounterVec).With(labels).Inc() | ||||
| ApiCustomCnt.MetricCollector.(*prometheus.CounterVec).With(labels).Inc(). | ||||
| */ | ||||
| var ( | ||||
| 	ApiCustomCnt = &ginProm.Metric{ | ||||
|  | ||||
| @ -15,7 +15,7 @@ package version | ||||
| // When releasing a new Kubernetes version, this file is updated by | ||||
| // build/mark_new_version.sh to reflect the new version, and then a | ||||
| // git annotated tag (using format vX.Y where X == Major version and Y | ||||
| // == Minor version) is created to point to the commit that updates | ||||
| // == Minor version) is created to point to the commit that updates. | ||||
| var ( | ||||
| 	// TODO: Deprecate gitMajor and gitMinor, use only gitVersion | ||||
| 	// instead. First step in deprecation, keep the fields but make | ||||
|  | ||||
| @ -25,7 +25,7 @@ func Get() Info { | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| // GetClientVersion returns the git version of the OpenIM client repository | ||||
| // GetClientVersion returns the git version of the OpenIM client repository. | ||||
| func GetClientVersion() (*OpenIMClientVersion, error) { | ||||
| 	clientVersion, err := getClientVersion() | ||||
| 	if err != nil { | ||||
| @ -52,7 +52,7 @@ func getClientVersion() (string, error) { | ||||
| 	return ref.Hash().String(), nil | ||||
| } | ||||
| 
 | ||||
| // GetSingleVersion returns single version of sealer | ||||
| // GetSingleVersion returns single version of sealer. | ||||
| func GetSingleVersion() string { | ||||
| 	return gitVersion | ||||
| } | ||||
|  | ||||
| @ -9,7 +9,7 @@ import ( | ||||
| 	"net/http" | ||||
| ) | ||||
| 
 | ||||
| // API endpoints and other constants | ||||
| // API endpoints and other constants. | ||||
| const ( | ||||
| 	APIHost         = "http://127.0.0.1:10002" | ||||
| 	UserTokenURL    = APIHost + "/auth/user_token" | ||||
| @ -18,27 +18,27 @@ const ( | ||||
| 	OperationID     = "1646445464564" | ||||
| ) | ||||
| 
 | ||||
| // UserTokenRequest represents a request to get a user token | ||||
| // UserTokenRequest represents a request to get a user token. | ||||
| type UserTokenRequest struct { | ||||
| 	Secret     string `json:"secret"` | ||||
| 	PlatformID int    `json:"platformID"` | ||||
| 	UserID     string `json:"userID"` | ||||
| } | ||||
| 
 | ||||
| // UserTokenResponse represents a response containing a user token | ||||
| // UserTokenResponse represents a response containing a user token. | ||||
| type UserTokenResponse struct { | ||||
| 	Token   string `json:"token"` | ||||
| 	ErrCode int    `json:"errCode"` | ||||
| } | ||||
| 
 | ||||
| // User represents user data for registration | ||||
| // User represents user data for registration. | ||||
| type User struct { | ||||
| 	UserID   string `json:"userID"` | ||||
| 	Nickname string `json:"nickname"` | ||||
| 	FaceURL  string `json:"faceURL"` | ||||
| } | ||||
| 
 | ||||
| // UserRegisterRequest represents a request to register a user | ||||
| // UserRegisterRequest represents a request to register a user. | ||||
| type UserRegisterRequest struct { | ||||
| 	Secret string `json:"secret"` | ||||
| 	Users  []User `json:"users"` | ||||
| @ -58,7 +58,7 @@ func main() { | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| // GetUserToken requests a user token from the API | ||||
| // GetUserToken requests a user token from the API. | ||||
| func GetUserToken(userID string) (string, error) { | ||||
| 	reqBody := UserTokenRequest{ | ||||
| 		Secret:     SecretKey, | ||||
| @ -88,7 +88,7 @@ func GetUserToken(userID string) (string, error) { | ||||
| 	return tokenResp.Token, nil | ||||
| } | ||||
| 
 | ||||
| // RegisterUser registers a new user using the API | ||||
| // RegisterUser registers a new user using the API. | ||||
| func RegisterUser(token, userID, nickname, faceURL string) error { | ||||
| 	user := User{ | ||||
| 		UserID:   userID, | ||||
|  | ||||
| @ -7,18 +7,18 @@ import ( | ||||
| 	"github.com/openimsdk/open-im-server/v3/test/e2e/framework/config" | ||||
| ) | ||||
| 
 | ||||
| // UserInfoRequest represents a request to get or update user information | ||||
| // UserInfoRequest represents a request to get or update user information. | ||||
| type UserInfoRequest struct { | ||||
| 	UserIDs  []string       `json:"userIDs,omitempty"` | ||||
| 	UserInfo *gettoken.User `json:"userInfo,omitempty"` | ||||
| } | ||||
| 
 | ||||
| // GetUsersOnlineStatusRequest represents a request to get users' online status | ||||
| // GetUsersOnlineStatusRequest represents a request to get users' online status. | ||||
| type GetUsersOnlineStatusRequest struct { | ||||
| 	UserIDs []string `json:"userIDs"` | ||||
| } | ||||
| 
 | ||||
| // GetUsersInfo retrieves detailed information for a list of user IDs | ||||
| // GetUsersInfo retrieves detailed information for a list of user IDs. | ||||
| func GetUsersInfo(token string, userIDs []string) error { | ||||
| 
 | ||||
| 	url := fmt.Sprintf("http://%s:%s/user/get_users_info", config.LoadConfig().APIHost, config.LoadConfig().APIPort) | ||||
| @ -29,7 +29,7 @@ func GetUsersInfo(token string, userIDs []string) error { | ||||
| 	return sendPostRequestWithToken(url, token, requestBody) | ||||
| } | ||||
| 
 | ||||
| // UpdateUserInfo updates the information for a user | ||||
| // UpdateUserInfo updates the information for a user. | ||||
| func UpdateUserInfo(token, userID, nickname, faceURL string) error { | ||||
| 
 | ||||
| 	url := fmt.Sprintf("http://%s:%s/user/update_user_info", config.LoadConfig().APIHost, config.LoadConfig().APIPort) | ||||
| @ -44,7 +44,7 @@ func UpdateUserInfo(token, userID, nickname, faceURL string) error { | ||||
| 	return sendPostRequestWithToken(url, token, requestBody) | ||||
| } | ||||
| 
 | ||||
| // GetUsersOnlineStatus retrieves the online status for a list of user IDs | ||||
| // GetUsersOnlineStatus retrieves the online status for a list of user IDs. | ||||
| func GetUsersOnlineStatus(token string, userIDs []string) error { | ||||
| 
 | ||||
| 	url := fmt.Sprintf("http://%s:%s/user/get_users_online_status", config.LoadConfig().APIHost, config.LoadConfig().APIPort) | ||||
|  | ||||
| @ -11,29 +11,29 @@ import ( | ||||
| 	"github.com/openimsdk/open-im-server/v3/test/e2e/framework/config" | ||||
| ) | ||||
| 
 | ||||
| // ForceLogoutRequest represents a request to force a user logout | ||||
| // ForceLogoutRequest represents a request to force a user logout. | ||||
| type ForceLogoutRequest struct { | ||||
| 	PlatformID int    `json:"platformID"` | ||||
| 	UserID     string `json:"userID"` | ||||
| } | ||||
| 
 | ||||
| // CheckUserAccountRequest represents a request to check a user account | ||||
| // CheckUserAccountRequest represents a request to check a user account. | ||||
| type CheckUserAccountRequest struct { | ||||
| 	CheckUserIDs []string `json:"checkUserIDs"` | ||||
| } | ||||
| 
 | ||||
| // GetUsersRequest represents a request to get a list of users | ||||
| // GetUsersRequest represents a request to get a list of users. | ||||
| type GetUsersRequest struct { | ||||
| 	Pagination Pagination `json:"pagination"` | ||||
| } | ||||
| 
 | ||||
| // Pagination specifies the page number and number of items per page | ||||
| // Pagination specifies the page number and number of items per page. | ||||
| type Pagination struct { | ||||
| 	PageNumber int `json:"pageNumber"` | ||||
| 	ShowNumber int `json:"showNumber"` | ||||
| } | ||||
| 
 | ||||
| // ForceLogout forces a user to log out | ||||
| // ForceLogout forces a user to log out. | ||||
| func ForceLogout(token, userID string, platformID int) error { | ||||
| 
 | ||||
| 	url := fmt.Sprintf("http://%s:%s/auth/force_logout", config.LoadConfig().APIHost, config.LoadConfig().APIPort) | ||||
| @ -45,7 +45,7 @@ func ForceLogout(token, userID string, platformID int) error { | ||||
| 	return sendPostRequestWithToken(url, token, requestBody) | ||||
| } | ||||
| 
 | ||||
| // CheckUserAccount checks if the user accounts exist | ||||
| // CheckUserAccount checks if the user accounts exist. | ||||
| func CheckUserAccount(token string, userIDs []string) error { | ||||
| 
 | ||||
| 	url := fmt.Sprintf("http://%s:%s/user/account_check", config.LoadConfig().APIHost, config.LoadConfig().APIPort) | ||||
| @ -56,7 +56,7 @@ func CheckUserAccount(token string, userIDs []string) error { | ||||
| 	return sendPostRequestWithToken(url, token, requestBody) | ||||
| } | ||||
| 
 | ||||
| // GetUsers retrieves a list of users with pagination | ||||
| // GetUsers retrieves a list of users with pagination. | ||||
| func GetUsers(token string, pageNumber, showNumber int) error { | ||||
| 
 | ||||
| 	url := fmt.Sprintf("http://%s:%s/user/account_check", config.LoadConfig().APIHost, config.LoadConfig().APIPort) | ||||
| @ -70,7 +70,7 @@ func GetUsers(token string, pageNumber, showNumber int) error { | ||||
| 	return sendPostRequestWithToken(url, token, requestBody) | ||||
| } | ||||
| 
 | ||||
| // sendPostRequestWithToken sends a POST request with a token in the header | ||||
| // sendPostRequestWithToken sends a POST request with a token in the header. | ||||
| func sendPostRequestWithToken(url, token string, body any) error { | ||||
| 	reqBytes, err := json.Marshal(body) | ||||
| 	if err != nil { | ||||
|  | ||||
| @ -10,7 +10,7 @@ import ( | ||||
| ) | ||||
| 
 | ||||
| var ( | ||||
| 	// The default template version | ||||
| 	// The default template version. | ||||
| 	defaultTemplateVersion = "v1.3.0" | ||||
| ) | ||||
| 
 | ||||
| @ -84,7 +84,7 @@ func main() { | ||||
| 	select {} | ||||
| } | ||||
| 
 | ||||
| // getLatestVersion fetches the latest version number from a given URL | ||||
| // getLatestVersion fetches the latest version number from a given URL. | ||||
| func getLatestVersion(url string) (string, error) { | ||||
| 	resp, err := http.Get(url) | ||||
| 	if err != nil { | ||||
| @ -102,7 +102,7 @@ func getLatestVersion(url string) (string, error) { | ||||
| 	return latestVersion, nil | ||||
| } | ||||
| 
 | ||||
| // downloadAndExtract downloads a file from a URL and extracts it to a destination directory | ||||
| // downloadAndExtract downloads a file from a URL and extracts it to a destination directory. | ||||
| func downloadAndExtract(url, destDir string) error { | ||||
| 	resp, err := http.Get(url) | ||||
| 	if err != nil { | ||||
| @ -141,7 +141,7 @@ func downloadAndExtract(url, destDir string) error { | ||||
| 	return cmd.Run() | ||||
| } | ||||
| 
 | ||||
| // startProcess starts a process and prints any errors encountered | ||||
| // startProcess starts a process and prints any errors encountered. | ||||
| func startProcess(cmdPath string) { | ||||
| 	cmd := exec.Command(cmdPath) | ||||
| 	cmd.Stdout = os.Stdout | ||||
|  | ||||
| @ -1,11 +1,12 @@ | ||||
| package pkg | ||||
| 
 | ||||
| import ( | ||||
| 	"time" | ||||
| 
 | ||||
| 	mongoModel "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" | ||||
| 	mysqlModel "github.com/openimsdk/open-im-server/v3/tools/data-conversion/openim/mysql/v3" | ||||
| 	mongoModelRtc "github.com/openimsdk/open-im-server/v3/tools/up35/pkg/internal/rtc/mongo/table" | ||||
| 	mysqlModelRtc "github.com/openimsdk/open-im-server/v3/tools/up35/pkg/internal/rtc/mysql" | ||||
| 	"time" | ||||
| ) | ||||
| 
 | ||||
| type convert struct{} | ||||
|  | ||||
| @ -2,13 +2,15 @@ package mgo | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 	"time" | ||||
| 
 | ||||
| 	"github.com/OpenIMSDK/tools/mgoutil" | ||||
| 	"github.com/OpenIMSDK/tools/pagination" | ||||
| 	"github.com/openimsdk/open-im-server/v3/tools/up35/pkg/internal/rtc/mongo/table" | ||||
| 	"go.mongodb.org/mongo-driver/bson" | ||||
| 	"go.mongodb.org/mongo-driver/mongo" | ||||
| 	"go.mongodb.org/mongo-driver/mongo/options" | ||||
| 	"time" | ||||
| 
 | ||||
| 	"github.com/openimsdk/open-im-server/v3/tools/up35/pkg/internal/rtc/mongo/table" | ||||
| ) | ||||
| 
 | ||||
| func NewMeeting(db *mongo.Database) (table.MeetingInterface, error) { | ||||
|  | ||||
| @ -2,14 +2,16 @@ package mgo | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 	"time" | ||||
| 
 | ||||
| 	"github.com/OpenIMSDK/tools/mgoutil" | ||||
| 	"github.com/OpenIMSDK/tools/pagination" | ||||
| 	"github.com/OpenIMSDK/tools/utils" | ||||
| 	"github.com/openimsdk/open-im-server/v3/tools/up35/pkg/internal/rtc/mongo/table" | ||||
| 	"go.mongodb.org/mongo-driver/bson" | ||||
| 	"go.mongodb.org/mongo-driver/mongo" | ||||
| 	"go.mongodb.org/mongo-driver/mongo/options" | ||||
| 	"time" | ||||
| 
 | ||||
| 	"github.com/openimsdk/open-im-server/v3/tools/up35/pkg/internal/rtc/mongo/table" | ||||
| ) | ||||
| 
 | ||||
| func NewMeetingInvitation(db *mongo.Database) (table.MeetingInvitationInterface, error) { | ||||
| @ -55,7 +57,12 @@ func (x *meetingInvitation) CreateMeetingInvitationInfo(ctx context.Context, roo | ||||
| 
 | ||||
| func (x *meetingInvitation) GetUserInvitedMeetingIDs(ctx context.Context, userID string) (meetingIDs []string, err error) { | ||||
| 	fiveDaysAgo := time.Now().AddDate(0, 0, -5) | ||||
| 	return mgoutil.Find[string](ctx, x.coll, bson.M{"user_id": userID, "create_time": bson.M{"$gte": fiveDaysAgo}}, options.Find().SetSort(bson.M{"create_time": -1}).SetProjection(bson.M{"_id": 0, "room_id": 1})) | ||||
| 	return mgoutil.Find[string]( | ||||
| 		ctx, | ||||
| 		x.coll, | ||||
| 		bson.M{"user_id": userID, "create_time": bson.M{"$gte": fiveDaysAgo}}, | ||||
| 		options.Find().SetSort(bson.M{"create_time": -1}).SetProjection(bson.M{"_id": 0, "room_id": 1}), | ||||
| 	) | ||||
| } | ||||
| 
 | ||||
| func (x *meetingInvitation) Delete(ctx context.Context, roomIDs []string) error { | ||||
|  | ||||
| @ -2,10 +2,12 @@ package mgo | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 
 | ||||
| 	"github.com/OpenIMSDK/tools/mgoutil" | ||||
| 	"github.com/openimsdk/open-im-server/v3/tools/up35/pkg/internal/rtc/mongo/table" | ||||
| 	"go.mongodb.org/mongo-driver/bson" | ||||
| 	"go.mongodb.org/mongo-driver/mongo" | ||||
| 
 | ||||
| 	"github.com/openimsdk/open-im-server/v3/tools/up35/pkg/internal/rtc/mongo/table" | ||||
| ) | ||||
| 
 | ||||
| func NewMeetingRecord(db *mongo.Database) (table.MeetingRecordInterface, error) { | ||||
|  | ||||
| @ -2,13 +2,15 @@ package mgo | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 	"time" | ||||
| 
 | ||||
| 	"github.com/OpenIMSDK/tools/mgoutil" | ||||
| 	"github.com/OpenIMSDK/tools/pagination" | ||||
| 	"github.com/openimsdk/open-im-server/v3/tools/up35/pkg/internal/rtc/mongo/table" | ||||
| 	"go.mongodb.org/mongo-driver/bson" | ||||
| 	"go.mongodb.org/mongo-driver/mongo" | ||||
| 	"go.mongodb.org/mongo-driver/mongo/options" | ||||
| 	"time" | ||||
| 
 | ||||
| 	"github.com/openimsdk/open-im-server/v3/tools/up35/pkg/internal/rtc/mongo/table" | ||||
| ) | ||||
| 
 | ||||
| func NewSignal(db *mongo.Database) (table.SignalInterface, error) { | ||||
|  | ||||
| @ -2,14 +2,16 @@ package mgo | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 	"time" | ||||
| 
 | ||||
| 	"github.com/OpenIMSDK/tools/mgoutil" | ||||
| 	"github.com/OpenIMSDK/tools/pagination" | ||||
| 	"github.com/OpenIMSDK/tools/utils" | ||||
| 	"github.com/openimsdk/open-im-server/v3/tools/up35/pkg/internal/rtc/mongo/table" | ||||
| 	"go.mongodb.org/mongo-driver/bson" | ||||
| 	"go.mongodb.org/mongo-driver/mongo" | ||||
| 	"go.mongodb.org/mongo-driver/mongo/options" | ||||
| 	"time" | ||||
| 
 | ||||
| 	"github.com/openimsdk/open-im-server/v3/tools/up35/pkg/internal/rtc/mongo/table" | ||||
| ) | ||||
| 
 | ||||
| func NewSignalInvitation(db *mongo.Database) (table.SignalInvitationInterface, error) { | ||||
|  | ||||
| @ -2,8 +2,9 @@ package table | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 	"github.com/OpenIMSDK/tools/pagination" | ||||
| 	"time" | ||||
| 
 | ||||
| 	"github.com/OpenIMSDK/tools/pagination" | ||||
| ) | ||||
| 
 | ||||
| type MeetingInfo struct { | ||||
|  | ||||
| @ -2,11 +2,12 @@ package table | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 	"time" | ||||
| 
 | ||||
| 	"github.com/OpenIMSDK/tools/errs" | ||||
| 	"github.com/OpenIMSDK/tools/pagination" | ||||
| 	"github.com/redis/go-redis/v9" | ||||
| 	"go.mongodb.org/mongo-driver/mongo" | ||||
| 	"time" | ||||
| ) | ||||
| 
 | ||||
| type SignalModel struct { | ||||
|  | ||||
| @ -4,12 +4,13 @@ import ( | ||||
| 	"context" | ||||
| 	"errors" | ||||
| 	"fmt" | ||||
| 	"gopkg.in/yaml.v3" | ||||
| 	"log" | ||||
| 	"os" | ||||
| 	"reflect" | ||||
| 	"strconv" | ||||
| 
 | ||||
| 	"gopkg.in/yaml.v3" | ||||
| 
 | ||||
| 	"github.com/go-sql-driver/mysql" | ||||
| 	"go.mongodb.org/mongo-driver/bson" | ||||
| 	"go.mongodb.org/mongo-driver/mongo" | ||||
|  | ||||
| @ -2,9 +2,10 @@ package main | ||||
| 
 | ||||
| import ( | ||||
| 	"flag" | ||||
| 	"github.com/openimsdk/open-im-server/v3/tools/up35/pkg" | ||||
| 	"log" | ||||
| 	"os" | ||||
| 
 | ||||
| 	"github.com/openimsdk/open-im-server/v3/tools/up35/pkg" | ||||
| ) | ||||
| 
 | ||||
| func main() { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user