mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-06 01:55:58 +08:00
feat: add openim docker
Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user