youdu

package module
v2.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 16 Imported by: 0

README

Youdu Go SDK

Lint GoDoc Go Report Card Language MIT license

🚀 Youdu SDK is a Go package that provides API implementation related to Youdu IM

Getting Started

Features

Installation

go get github.com/addcnos/youdu/v2

Usage

Please refer to the Documentation

package main

import (
	"context"
	"fmt"
	"net/http"
	"time"

	"github.com/addcnos/youdu/v2"
)

func main() {
	client := youdu.NewClient(&youdu.Config{
		Addr:   "http://examaple",
		Buin:   111222333,
		AppID:  "111222333",
		AesKey: "111333445",
	}, youdu.WithHTTPClient(&http.Client{
		Timeout: 3 * time.Second,
	}))

	resp, err := client.SendTextMessage(context.Background(), youdu.TextMessageRequest{
		ToUser:  "11111",
		MsgType: youdu.MsgTypeText,
		Text: youdu.MessageText{
			Content: "hello",
		},
	})
	if err != nil {
		panic(err)
	}

	fmt.Println(resp)
}

Contributing

Very welcome to join us! Raise an Issue or submit a Pull Request.

License

MIT License © 2022-2023 addcnos

Documentation

Index

Constants

View Source
const (
	NormalRequestType  requestType = "normal"
	SpecialRequestType requestType = "special"
)

Variables

View Source
var (
	ErrReceiveEmptyEncrypt = newError(-1, "encrypt is empty")
	ErrReceiveEmptyData    = newError(-1, "data is empty")
)
View Source
var ErrUnexpectedResponseCode = errors.New("youdu sdk: unexpected response code")

Functions

func NewRetryableHTTPClient added in v2.4.0

func NewRetryableHTTPClient(opts ...RetryableHTTPClientOption) *http.Client

func WithEncryptor added in v2.1.0

func WithEncryptor(encryptor *Encryptor) func(c *Client)

func WithHTTPClient added in v2.3.0

func WithHTTPClient(client *http.Client) func(c *Client)

Types

type BatchDeleteUserRequest added in v2.2.0

type BatchDeleteUserRequest struct {
	DelList []string `json:"delList"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config *Config, opts ...ClientOption) *Client

func (*Client) AddGroupMember added in v2.0.2

func (c *Client) AddGroupMember(ctx context.Context, request GroupUpdateMemberRequest) (response Response, err error)

func (*Client) BatchDeleteUser added in v2.2.0

func (c *Client) BatchDeleteUser(ctx context.Context, request BatchDeleteUserRequest) (response Response, err error)

func (*Client) CreateDept added in v2.1.1

func (c *Client) CreateDept(ctx context.Context, request CreateDeptRequest) (response CreateDeptResponse, err error)

func (*Client) CreateGroup added in v2.0.2

func (c *Client) CreateGroup(
	ctx context.Context,
	request CreateGroupRequest,
) (response CreateGroupResponse, err error)

func (*Client) CreateSession

func (c *Client) CreateSession(
	ctx context.Context, request CreateSessionRequest,
) (response SessionResponse, err error)

func (*Client) CreateUser added in v2.2.0

func (c *Client) CreateUser(ctx context.Context, request CreateUserRequest) (response Response, err error)

func (*Client) DelGroupMember added in v2.0.2

func (c *Client) DelGroupMember(ctx context.Context, request GroupUpdateMemberRequest) (response Response, err error)

func (*Client) DeleteDept added in v2.1.1

func (c *Client) DeleteDept(ctx context.Context, deptID int) (response Response, err error)

func (*Client) DeleteGroup added in v2.0.2

func (c *Client) DeleteGroup(ctx context.Context, groupID string) (response Response, err error)

func (*Client) DeleteUser added in v2.2.0

func (c *Client) DeleteUser(ctx context.Context, userID string) (response Response, err error)

func (*Client) GetDeptAliasList added in v2.1.0

func (c *Client) GetDeptAliasList(ctx context.Context) (response DeptAliasListResponse, err error)

func (*Client) GetDeptIDByAlias added in v2.3.0

func (c *Client) GetDeptIDByAlias(ctx context.Context, alias string) (response DeptIDByAliasResponse, err error)

func (*Client) GetDeptList

func (c *Client) GetDeptList(ctx context.Context, id ...int) (response DeptListResponse, err error)

func (*Client) GetDeptUserList

func (c *Client) GetDeptUserList(ctx context.Context, deptID int) (response DeptUserListResponse, err error)

func (*Client) GetDeptUserSimpleList added in v2.0.3

func (c *Client) GetDeptUserSimpleList(ctx context.Context, deptID int) (response DeptUserListResponse, err error)

func (*Client) GetGroupInfo added in v2.0.2

func (c *Client) GetGroupInfo(ctx context.Context, groupID string) (response GroupInfoResponse, err error)

func (*Client) GetGroupList added in v2.0.2

func (c *Client) GetGroupList(ctx context.Context, userID ...string) (response GroupListResponse, err error)

func (*Client) GetSession

func (c *Client) GetSession(ctx context.Context, sessionID string) (response SessionResponse, err error)

func (*Client) GetToken

func (c *Client) GetToken(ctx context.Context) (string, error)

func (*Client) GetUser

func (c *Client) GetUser(ctx context.Context, userID string) (response UserResponse, err error)

func (*Client) GetUserEnableState added in v2.1.1

func (c *Client) GetUserEnableState(ctx context.Context, userID string) (response UserEnableStateResponse, err error)

func (*Client) Identify

func (c *Client) Identify(ctx context.Context, token string) (response IdentifyResponse, err error)

func (*Client) IsGroupMember added in v2.0.2

func (c *Client) IsGroupMember(
	ctx context.Context, groupID string, userID string,
) (response IsGroupMemberResponse, err error)

func (*Client) SendExLinkMessage

func (c *Client) SendExLinkMessage(
	ctx context.Context, request ExLinkMessageRequest,
) (response Response, err error)

func (*Client) SendFileMessage

func (c *Client) SendFileMessage(ctx context.Context, request FileMessageRequest) (response Response, err error)

func (*Client) SendFileSessionMessage

func (c *Client) SendFileSessionMessage(
	ctx context.Context, request FileSessionMessageRequest,
) (response Response, err error)

func (*Client) SendImageMessage

func (c *Client) SendImageMessage(ctx context.Context, request ImageMessageRequest) (response Response, err error)

func (*Client) SendImageSessionMessage

func (c *Client) SendImageSessionMessage(
	ctx context.Context, request ImageSessionMessageRequest,
) (response Response, err error)

func (*Client) SendLinkMessage

func (c *Client) SendLinkMessage(
	ctx context.Context, request LinkMessageRequest,
) (response Response, err error)

func (*Client) SendMessage

func (c *Client) SendMessage(ctx context.Context, request InterfaceMessageRequest) (response Response, err error)

func (*Client) SendMpNewsMessage

func (c *Client) SendMpNewsMessage(ctx context.Context, request MpNewsMessageRequest) (response Response, err error)

func (*Client) SendPopWindowMessage added in v2.2.0

func (c *Client) SendPopWindowMessage(
	ctx context.Context, request PopWindowMessageRequest,
) (response Response, err error)

func (*Client) SendSessionMessage

func (c *Client) SendSessionMessage(
	ctx context.Context,
	request InterfaceSessionMessageRequest,
) (response Response, err error)

func (*Client) SendSysMessage added in v2.0.2

func (c *Client) SendSysMessage(
	ctx context.Context, request MessageSysMessageRequest,
) (response Response, err error)

func (*Client) SendTextMessage

func (c *Client) SendTextMessage(ctx context.Context, request TextMessageRequest) (response Response, err error)

func (*Client) SendTextSessionMessage

func (c *Client) SendTextSessionMessage(
	ctx context.Context, request TextSessionMessageRequest,
) (response Response, err error)

func (*Client) SendVideoSessionMessage

func (c *Client) SendVideoSessionMessage(
	ctx context.Context, request VideoSessionMessageRequest,
) (response Response, err error)

func (*Client) SendVoiceSessionMessage

func (c *Client) SendVoiceSessionMessage(
	ctx context.Context, request VoiceSessionMessageRequest,
) (response Response, err error)

func (*Client) UpdateDept added in v2.1.1

func (c *Client) UpdateDept(ctx context.Context, request UpdateDeptRequest) (response Response, err error)

func (*Client) UpdateGroup added in v2.0.2

func (c *Client) UpdateGroup(ctx context.Context, request UpdateGroupRequest) (response Response, err error)

func (*Client) UpdateSession

func (c *Client) UpdateSession(
	ctx context.Context, request UpdateSessionRequest,
) (response SessionResponse, err error)

func (*Client) UpdateUser added in v2.2.0

func (c *Client) UpdateUser(ctx context.Context, request UpdateUserRequest) (response Response, err error)

func (*Client) UpdateUserEnableState added in v2.1.1

func (c *Client) UpdateUserEnableState(
	ctx context.Context, request UpdateUserEnableStateRequest,
) (response Response, err error)

func (*Client) UpdateUserPosition added in v2.2.0

func (c *Client) UpdateUserPosition(
	ctx context.Context, request UpdateUserPositionRequest,
) (response Response, err error)

type ClientOption added in v2.1.0

type ClientOption func(c *Client)

type Config

type Config struct {
	Addr   string
	Buin   int
	AppID  string
	AesKey string
}

type CreateDeptRequest added in v2.1.1

type CreateDeptRequest struct {
	Name     string `json:"name"`
	Alias    string `json:"alias"`
	ID       int    `json:"id"`
	ParentID int    `json:"parentId"`
	SortID   int    `json:"sortId"`
}

type CreateDeptResponse added in v2.1.1

type CreateDeptResponse struct {
	ID int `json:"id"`
}

type CreateGroupRequest added in v2.0.2

type CreateGroupRequest struct {
	Name string `json:"name"`
}

type CreateGroupResponse added in v2.0.2

type CreateGroupResponse struct {
	ID string `json:"id"`
}

type CreateSessionRequest

type CreateSessionRequest struct {
	Title   string      `json:"title"`
	Creator string      `json:"creator"`
	Type    SessionType `json:"type,omitempty"`
	Member  []string    `json:"member"`
}

type CreateUserRequest added in v2.2.0

type CreateUserRequest struct {
	UserID      string      `json:"userId"`
	Name        string      `json:"name"`
	Gender      int         `json:"gender"`
	Mobile      string      `json:"mobile"`
	Phone       string      `json:"phone"`
	Email       string      `json:"email"`
	Dept        []int       `json:"dept"`
	EnableState EnableState `json:"enableState"`
	ShortCode   string      `json:"shortCode"`
}

type DeptAliasItem added in v2.1.0

type DeptAliasItem struct {
	ID    int    `json:"id"`
	Alias string `json:"alias"`
}

type DeptAliasListResponse added in v2.1.0

type DeptAliasListResponse struct {
	AliasList []DeptAliasItem `json:"aliasList"`
}

type DeptDetail

type DeptDetail struct {
	DeptID   int    `json:"deptId"`
	Position string `json:"position"`
	Weight   int    `json:"weight"`
	SortID   int    `json:"sortId"`
}

type DeptIDByAliasResponse added in v2.3.0

type DeptIDByAliasResponse struct {
	ID int `json:"id"`
}

type DeptItem added in v2.1.0

type DeptItem struct {
	ID       int    `json:"id"`
	Name     string `json:"name"`
	ParentID int    `json:"parentId"`
	SortID   int    `json:"sortId"`
}

type DeptListResponse

type DeptListResponse struct {
	DeptList []DeptItem `json:"deptList"`
}

type DeptUserListResponse

type DeptUserListResponse struct {
	UserList []UserItem `json:"userList"`
}

type EnableState added in v2.1.1

type EnableState int
const (
	EnableForbidState      EnableState = -1
	EnableAuthorizedState  EnableState = 1
	EnableUnactivatedState EnableState = 0
)

type Encryptor

type Encryptor struct {
	// contains filtered or unexported fields
}

func NewEncryptor

func NewEncryptor(key []byte, appid string) *Encryptor

func NewEncryptorWithConfig

func NewEncryptorWithConfig(config *Config) *Encryptor

func (*Encryptor) Decrypt

func (e *Encryptor) Decrypt(ciphertext string) (*RawData, error)

func (*Encryptor) Encrypt

func (e *Encryptor) Encrypt(plaintext []byte) (string, error)

type Error

type Error struct {
	Code    int    `json:"errcode"`
	Message string `json:"errmsg"`
}

func (*Error) Error

func (e *Error) Error() string

type ExLinkMessageRequest

type ExLinkMessageRequest struct {
	ToUser  string          `json:"toUser"`
	ToDept  string          `json:"toDept"`
	MsgType MsgType         `json:"msgType"`
	ExLink  []MessageExLink `json:"exlink"`
}

type FileMessageRequest

type FileMessageRequest struct {
	ToUser  string       `json:"toUser"`
	ToDept  string       `json:"toDept"`
	MsgType MsgType      `json:"msgType"`
	File    MessageMedia `json:"file"`
}

type FileSessionMessageRequest

type FileSessionMessageRequest struct {
	SessionID string      `json:"sessionId,omitempty"`
	Receiver  string      `json:"receiver,omitempty"`
	Sender    string      `json:"sender"`
	MsgType   MsgType     `json:"msgType"`
	File      MessageFile `json:"file"`
}

type GroupInfoMember added in v2.0.2

type GroupInfoMember struct {
	Account string `json:"account"`
	Name    string `json:"name"`
	Mobile  string `json:"mobile"`
}

type GroupInfoResponse added in v2.0.2

type GroupInfoResponse struct {
	ID      string            `json:"id"`
	Name    string            `json:"name"`
	Members []GroupInfoMember `json:"members"`
}

type GroupItem added in v2.1.0

type GroupItem struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type GroupListResponse added in v2.0.2

type GroupListResponse struct {
	GroupList []GroupItem `json:"groupList"`
}

type GroupUpdateMemberRequest added in v2.0.2

type GroupUpdateMemberRequest struct {
	ID       string   `json:"id"`
	UserList []string `json:"userList"`
}

type IdentifyResponse

type IdentifyResponse struct {
	Status   IdentifyStatus   `json:"status"`
	UserInfo IdentifyUserInfo `json:"userInfo"`
}

type IdentifyStatus

type IdentifyStatus struct {
	Code      int    `json:"code"`
	Message   string `json:"message"`
	CreatedAt string `json:"createdAt"`
}

type IdentifyUserInfo

type IdentifyUserInfo struct {
	Account string `json:"account"`
	ChsName string `json:"chsName"`
	Gender  int    `json:"gender"`
	Mobile  string `json:"mobile"`
	Phone   string `json:"phone"`
	Email   string `json:"email"`
}

type ImageMessageRequest

type ImageMessageRequest struct {
	ToUser  string       `json:"toUser"`
	ToDept  string       `json:"toDept"`
	MsgType MsgType      `json:"msgType"`
	Image   MessageMedia `json:"image"`
}

type ImageSessionMessageRequest

type ImageSessionMessageRequest struct {
	SessionID string       `json:"sessionId,omitempty"`
	Receiver  string       `json:"receiver,omitempty"`
	Sender    string       `json:"sender"`
	MsgType   MsgType      `json:"msgType"`
	Image     MessageMedia `json:"image"`
}

type InterfaceMessageRequest

type InterfaceMessageRequest interface{}

type InterfaceSessionMessageRequest

type InterfaceSessionMessageRequest interface{}

type IsGroupMemberResponse added in v2.0.2

type IsGroupMemberResponse struct {
	Belong bool `json:"belong"`
}

type LinkMessageRequest

type LinkMessageRequest struct {
	ToUser  string      `json:"toUser"`
	ToDept  string      `json:"toDept"`
	MsgType MsgType     `json:"msgType"`
	Link    MessageLink `json:"link"`
}
type MessageExLink struct {
	Title   string `json:"title"`
	URL     string `json:"url"`
	MediaID string `json:"media_id"`
	Digest  string `json:"digest,omitempty"`
}

type MessageFile

type MessageFile struct {
	MediaID string `json:"media_id"`
	Name    string `json:"name"`
	Size    int64  `json:"size"`
}
type MessageLink struct {
	Title  string `json:"title"`
	URL    string `json:"url"`
	Action int    `json:"action,omitempty"`
}

type MessageMedia

type MessageMedia struct {
	MediaID string `json:"media_id"`
}

type MessageMpNews

type MessageMpNews struct {
	Title     string `json:"title"`
	MediaID   string `json:"media_id"`
	Content   string `json:"content"`
	Digest    string `json:"digest,omitempty"`
	ShowFront int    `json:"showFront,omitempty"`
}

type MessagePopWindow added in v2.2.0

type MessagePopWindow struct {
	URL      string `json:"url"`
	Tip      string `json:"tip"`
	Title    string `json:"title"`
	Width    int    `json:"width"`
	Height   int    `json:"height"`
	Duration int    `json:"duration"`
	Position int    `json:"position"`
	NoticeID string `json:"notice_id"`
	PopMode  int    `json:"pop_mode"`
}

type MessageRequest

type MessageRequest struct {
	// General
	ToUser  string  `json:"toUser"`
	ToDept  string  `json:"toDept"`
	MsgType MsgType `json:"msgType"`

	// Text, Image, File, MpNews, Link, ExLink
	Text   MessageText     `json:"text,omitempty"`
	Image  MessageMedia    `json:"image,omitempty"`
	File   MessageMedia    `json:"file,omitempty"`
	MpNews []MessageMpNews `json:"mpnews,omitempty"`
	Link   MessageLink     `json:"link,omitempty"`
	ExLink []MessageExLink `json:"exlink,omitempty"`

	// SysMsg
	ToAll  MessageSysMessageToAll  `json:"toAll,omitempty"`
	SysMsg MessageSysMessageSysMsg `json:"sysMsg"`
}

type MessageSysMessageRequest added in v2.0.2

type MessageSysMessageRequest struct {
	ToUser  string                  `json:"toUser,omitempty"`
	ToDept  string                  `json:"toDept,omitempty"`
	ToAll   MessageSysMessageToAll  `json:"toAll,omitempty"`
	MsgType MsgType                 `json:"msgType"`
	SysMsg  MessageSysMessageSysMsg `json:"sysMsg"`
}

type MessageSysMessageSysMsg added in v2.0.2

type MessageSysMessageSysMsg struct {
	Title       string                       `json:"title"`
	PopDuration int                          `json:"popDuration,omitempty"`
	Msg         []MessageSysMessageSysMsgMsg `json:"msg"`
}

type MessageSysMessageSysMsgMsg added in v2.0.2

type MessageSysMessageSysMsgMsg struct {
	Text MessageText `json:"text,omitempty"`
	Link MessageLink `json:"link,omitempty"`
}

type MessageSysMessageToAll added in v2.0.2

type MessageSysMessageToAll struct {
	OnliyOnline bool `json:"onliyOnline"`
}

type MessageText

type MessageText struct {
	Content string `json:"content"`
}

type MpNewsMessageRequest

type MpNewsMessageRequest struct {
	ToUser  string          `json:"toUser"`
	ToDept  string          `json:"toDept"`
	MsgType MsgType         `json:"msgType"`
	MpNews  []MessageMpNews `json:"mpnews"`
}

type MsgType

type MsgType string
const (
	MsgTypeText   MsgType = "text"
	MsgTypeImage  MsgType = "image"
	MsgTypeFile   MsgType = "file"
	MsgTypeMpNews MsgType = "mpnews"
	MsgTypeLink   MsgType = "link"
	MsgTypeExLink MsgType = "exlink"
	MsgTypeVoice  MsgType = "voice"
	MsgTypeVideo  MsgType = "video"
	MsgTypeSysMsg MsgType = "sysMsg"
)

type NormalRequest added in v2.2.0

type NormalRequest struct {
	Buin    int    `json:"buin"`
	AppID   string `json:"appId"`
	Encrypt string `json:"encrypt"`
}

type PopWindowMessageRequest added in v2.2.0

type PopWindowMessageRequest struct {
	ToUser    string           `json:"toUser"`
	ToDept    string           `json:"toDept"`
	PopWindow MessagePopWindow `json:"popWindow"`
}

type RawData

type RawData struct {
	AppID  string
	Data   []byte
	Length int32
}

type Receive added in v2.0.2

type Receive struct {
	// contains filtered or unexported fields
}

func NewReceive added in v2.0.2

func NewReceive(config *Config) *Receive

func (*Receive) Decrypt added in v2.0.2

func (s *Receive) Decrypt(request ReceiveRequest) (message ReceiveMessage, err error)

type ReceiveMessage added in v2.0.2

type ReceiveMessage struct {
	FromUser   string       `json:"fromUser"`
	CreateTime int          `json:"createTime"`
	PackageID  string       `json:"packageId"`
	MsgType    MsgType      `json:"msgType"`
	Text       MessageText  `json:"text,omitempty"`
	Image      MessageMedia `json:"image,omitempty"`
	File       MessageFile  `json:"file,omitempty"`
}

type ReceiveRequest added in v2.0.2

type ReceiveRequest struct {
	ToBuin  int    `json:"toBuin"`
	ToApp   string `json:"toApp"`
	Encrypt string `json:"encrypt"`
}

type Response

type Response struct {
	ErrCode int    `json:"errcode"`
	ErrMsg  string `json:"errmsg"`
	Encrypt string `json:"encrypt,omitempty"`
}

type RetryableHTTPClientOption added in v2.4.0

type RetryableHTTPClientOption func(client *retryablehttp.Client)

func WithRetryableHTTPClientBackoff added in v2.4.0

func WithRetryableHTTPClientBackoff(backoff retryablehttp.Backoff) RetryableHTTPClientOption

func WithRetryableHTTPClientCheckRetry added in v2.4.0

func WithRetryableHTTPClientCheckRetry(checkRetry retryablehttp.CheckRetry) RetryableHTTPClientOption

func WithRetryableHTTPClientLogger added in v2.4.0

func WithRetryableHTTPClientLogger(logger retryablehttp.Logger) RetryableHTTPClientOption

func WithRetryableHTTPClientRetryMax added in v2.4.0

func WithRetryableHTTPClientRetryMax(max int) RetryableHTTPClientOption

func WithRetryableHTTPClientRetryWaitMax added in v2.4.0

func WithRetryableHTTPClientRetryWaitMax(max time.Duration) RetryableHTTPClientOption

func WithRetryableHTTPClientRetryWaitMin added in v2.4.0

func WithRetryableHTTPClientRetryWaitMin(min time.Duration) RetryableHTTPClientOption

type SessionMessageResponse

type SessionMessageResponse struct {
	SessionID string       `json:"sessionId,omitempty"`
	Receiver  string       `json:"receiver,omitempty"`
	Sender    string       `json:"sender"`
	MsgType   MsgType      `json:"msgType"`
	Text      MessageText  `json:"text,omitempty"`
	Image     MessageMedia `json:"image,omitempty"`
	File      MessageFile  `json:"file,omitempty"`
	Voice     MessageMedia `json:"voice,omitempty"`
	Video     MessageMedia `json:"video,omitempty"`
}

type SessionResponse

type SessionResponse struct {
	SessionID string      `json:"sessionId"`
	Title     string      `json:"title"`
	Owner     string      `json:"owner"`
	Version   int         `json:"version"`
	Type      SessionType `json:"type"`
	Member    []string    `json:"member"`
}

type SessionType

type SessionType string
var SessionMultiType SessionType = "multi"

type SpecialRequest added in v2.2.0

type SpecialRequest struct {
	AppID      string `json:"app_Id"`
	MsgEncrypt string `json:"msg_encrypt"`
}

type TextMessageRequest

type TextMessageRequest struct {
	ToUser  string      `json:"toUser"`
	ToDept  string      `json:"toDept"`
	MsgType MsgType     `json:"msgType"`
	Text    MessageText `json:"text"`
}

type TextSessionMessageRequest

type TextSessionMessageRequest struct {
	SessionID string      `json:"sessionId,omitempty"`
	Receiver  string      `json:"receiver,omitempty"`
	Sender    string      `json:"sender"`
	MsgType   MsgType     `json:"msgType"`
	Text      MessageText `json:"text"`
}

type UpdateDeptRequest added in v2.1.1

type UpdateDeptRequest struct {
	Name     string `json:"name"`
	Alias    string `json:"alias"`
	ID       int    `json:"id"`
	ParentID int    `json:"parentId"`
	SortID   int    `json:"sortId"`
}

type UpdateGroupRequest added in v2.0.2

type UpdateGroupRequest struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type UpdateSessionRequest

type UpdateSessionRequest struct {
	SessionID string   `json:"sessionId"`
	OpUser    string   `json:"opUser"`
	Title     string   `json:"title,omitempty"`
	AddMember []string `json:"addMember"`
	DelMember []string `json:"delMember"`
}

type UpdateUserEnableStateRequest added in v2.1.1

type UpdateUserEnableStateRequest struct {
	UserIDList  []string    `json:"userIdList"`
	EnableState EnableState `json:"enableState"`
}

type UpdateUserPositionRequest added in v2.2.0

type UpdateUserPositionRequest struct {
	UserID   string `json:"userId"`
	DeptID   int    `json:"deptId"`
	Position string `json:"position"`
	Weight   int    `json:"weight"`
	SortID   int    `json:"sortId"`
}

type UpdateUserRequest added in v2.2.0

type UpdateUserRequest struct {
	UserID    string `json:"userId"`
	Name      string `json:"name"`
	Gender    int    `json:"gender"`
	Mobile    string `json:"mobile"`
	Phone     string `json:"phone"`
	Email     string `json:"email"`
	Dept      []int  `json:"dept"`
	ShortCode string `json:"shortCode"`
}

type UserEnableStateResponse added in v2.1.1

type UserEnableStateResponse struct {
	EnableState int `json:"enableState"`
}

type UserItem added in v2.1.0

type UserItem struct {
	UserID     string       `json:"userId"`
	Name       string       `json:"name"`
	Gender     int          `json:"gender"`
	Mobile     string       `json:"mobile,omitempty"`
	Phone      string       `json:"phone,omitempty"`
	Email      string       `json:"email,omitempty"`
	Dept       []int        `json:"dept"`
	DeptDetail []DeptDetail `json:"deptDetail,omitempty"`
}

type UserResponse

type UserResponse struct {
	UserID     string       `json:"userId"`
	Name       string       `json:"name"`
	Gender     int          `json:"gender"`
	Mobile     string       `json:"mobile"`
	Phone      string       `json:"phone"`
	Email      string       `json:"email"`
	Dept       []int        `json:"dept"`
	DeptDetail []DeptDetail `json:"deptDetail"`
}

type VideoSessionMessageRequest

type VideoSessionMessageRequest struct {
	SessionID string       `json:"sessionId,omitempty"`
	Receiver  string       `json:"receiver,omitempty"`
	Sender    string       `json:"sender"`
	MsgType   MsgType      `json:"msgType"`
	Video     MessageMedia `json:"video"`
}

type VoiceSessionMessageRequest

type VoiceSessionMessageRequest struct {
	SessionID string       `json:"sessionId,omitempty"`
	Receiver  string       `json:"receiver,omitempty"`
	Sender    string       `json:"sender"`
	MsgType   MsgType      `json:"msgType"`
	Voice     MessageMedia `json:"voice"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL