api_models

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIBaseModel

type APIBaseModel struct {
	Retcode int    `json:"retcode"`
	Message string `json:"message"`
	RawData string // 原始json数据
}

type AuditModel

type AuditModel struct {
	APIBaseModel
	Data struct {
		AuditID string `json:"audit_id"`
	} `json:"data"`
}

type CheckMemberBotAccessTokenModel

type CheckMemberBotAccessTokenModel struct {
	APIBaseModel
	Data struct {
		AccessInfo struct {
			UID               string `json:"uid"`
			VillaID           string `json:"villa_id"`
			MemberAccessToken string `json:"member_access_token"`
			BotTplID          string `json:"bot_tpl_id"`
		} `json:"access_info"`
		Member struct {
			Basic struct {
				UID       string `json:"uid"`
				Nickname  string `json:"nickname"`
				Introduce string `json:"introduce"`
				Avatar    string `json:"avatar"`
				AvatarURL string `json:"avatar_url"`
			} `json:"basic"`
			RoleIDList []string `json:"role_id_list"`
			JoinedAt   string   `json:"joined_at"`
			RoleList   []struct {
				ID       string `json:"id"`
				Name     string `json:"name"`
				Color    string `json:"color"`
				RoleType string `json:"role_type"`
				VillaID  string `json:"villa_id"`
			} `json:"role_list"`
		} `json:"member"`
	} `json:"data"`
}

type CreateRoleModel

type CreateRoleModel struct {
	APIBaseModel
	Data struct {
		ID uint64 `json:"id,string"`
	} `json:"data"`
}

type CreateRoomModel

type CreateRoomModel struct {
	APIBaseModel
	Data struct {
		GoomID uint64 `json:"group_id,string"`
	} `json:"data"`
}

type EmptyModel

type EmptyModel struct {
	APIBaseModel
	Data struct{} `json:"data"`
}

type GetAllEmoticonsModel

type GetAllEmoticonsModel struct {
	APIBaseModel
	Data struct {
		List []struct {
			EmoticonID   uint64 `json:"emoticon_id,string"`
			DescribeText string `json:"describe_text"`
			Icon         string `json:"icon"`
		} `json:"list"`
	} `json:"data"`
}

type GetGroupListModel

type GetGroupListModel struct {
	APIBaseModel
	Data struct {
		List []struct {
			GroupID   uint64 `json:"group_id,string"`
			GroupName string `json:"group_name"`
		} `json:"list"`
	} `json:"data"`
}

type GetMemberModel

type GetMemberModel struct {
	APIBaseModel
	Data struct {
		Member MemberModel `json:"member"`
	} `json:"data"`
}

type GetRoleInfoModel

type GetRoleInfoModel struct {
	APIBaseModel
	Data struct {
		Role struct {
			ID          string `json:"id"`
			Name        string `json:"name"`
			Color       string `json:"color"`
			VillaID     string `json:"villa_id"`
			RoleType    string `json:"role_type"`
			MemberNum   string `json:"member_num"`
			Permissions []struct {
				Key      string `json:"key"`
				Name     string `json:"name"`
				Describe string `json:"describe"`
			} `json:"permissions"`
		} `json:"role"`
	} `json:"data"`
}

type GetRoomModel

type GetRoomModel struct {
	APIBaseModel
	Data struct {
		Room struct {
			RoomID                uint64 `json:"room_id,string"`
			RoomName              string `json:"room_name"`
			RoomType              string `json:"room_type"`
			GroupID               uint64 `json:"group_id,string"`
			RoomDefaultNotifyType string `json:"room_default_notify_type"`
			SendMsgAuthRange      struct {
				IsAllSendMsg bool              `json:"is_all_send_msg"`
				Roles        Uint64StringSlice `json:"roles"`
			} `json:"send_msg_auth_range"`
		} `json:"room"`
	} `json:"data"`
}

type GetUploadFileImageParamsModel added in v0.5.2

type GetUploadFileImageParamsModel struct {
	APIBaseModel
	Data struct {
		Type     string `json:"type"`
		FileName string `json:"file_name"`
		MaxSize  uint32 `json:"max_file_size"`
		Params   struct {
			AccessID    string `json:"accessid"`
			Callback    string `json:"callback"`
			CallbackVar struct {
				XExtra string `json:"x:extra"`
			} `json:"callback_var"`
			Dir                 string `json:"dir"`
			Expire              uint   `json:"expire"`
			Host                string `json:"host"`
			Name                string `json:"name"`
			Policy              string `json:"policy"`
			Signature           string `json:"signature"`
			XOSSContentType     string `json:"x_oss_content_type"`
			ObjectACL           string `json:"object_acl"`
			ContentDisposition  string `json:"content_disposition"`
			Key                 string `json:"key"`
			SuccessActionStatus string `json:"success_action_status"`
		} `json:"params"`
	} `json:"data"`
}

type GetVillaGroupRoomListModel

type GetVillaGroupRoomListModel struct {
	APIBaseModel
	Data struct {
		GroupID   uint64 `json:"group_id,string"`
		GroupName string `json:"group_name"`
		RoomList  []struct {
			RoomID   uint64 `json:"room_id,string"`
			RoomName string `json:"room_name"`
			RoomType string `json:"room_type"`
			GroupID  uint64 `json:"group_id,string"`
		} `json:"room_list"`
	} `json:"data"`
}

type GetVillaMemberRolesModel

type GetVillaMemberRolesModel struct {
	APIBaseModel
	Data struct {
		List []struct {
			ID        string `json:"id"`
			Name      string `json:"name"`
			Color     string `json:"color"`
			RoleType  string `json:"role_type"`
			VillaID   string `json:"villa_id"`
			MemberNum string `json:"member_num"`
		} `json:"list"`
	} `json:"data"`
}

type GetVillaMembersModel

type GetVillaMembersModel struct {
	APIBaseModel
	Data struct {
		List          []MemberModel `json:"list"`
		NextOffsetStr string        `json:"next_offset_str"`
	} `json:"data"`
}

type GetVillaModel

type GetVillaModel struct {
	APIBaseModel
	Data struct {
		Villa struct {
			VillaID        uint64   `json:"villa_id,string"`
			Name           string   `json:"name"`
			VillaAvatarURL string   `json:"villa_avatar_url"`
			OwnerUID       uint64   `json:"owner_uid,string"`
			IsOfficial     bool     `json:"is_official"`
			Introduce      string   `json:"introduce"`
			CategoryID     uint32   `json:"category_id"`
			Tags           []string `json:"tags"`
		} `json:"villa"`
	} `json:"data"`
}

type MemberModel

type MemberModel struct {
	Basic struct {
		UID       string `json:"uid"`
		Nickname  string `json:"nickname"`
		Introduce string `json:"introduce"`
		AvatarURL string `json:"avatar_url"`
	} `json:"basic"`
	RoleIDList []string          `json:"role_id_list"`
	JoinedAt   string            `json:"joined_at"`
	RoleList   []MemberRoleModel `json:"role_list"`
}

type MemberRoleModel

type MemberRoleModel struct {
	ID        uint64            `json:"id,string"`
	Name      string            `json:"name"`
	VillaID   uint64            `json:"villa_id,string"`
	Color     string            `json:"color"`
	RoleType  string            `json:"role_type"`
	IsAllRoom bool              `json:"is_all_room"`
	RoomIDs   Uint64StringSlice `json:"room_ids"`
}

type MsgContentType

type MsgContentType string

user input message struct wrapper

const (
	MsgTypeText  MsgContentType = "MHY:Text"
	MsgTypeImage MsgContentType = "MHY:Image"
	MsgTypePost  MsgContentType = "MHY:Post"
)
type MsgEntityLink struct {
	Text                   string
	URL                    string
	RequiresBotAccessToken bool
}

type MsgEntityMentionAll

type MsgEntityMentionAll struct {
	Text string
}

type MsgEntityMentionRobot

type MsgEntityMentionRobot struct {
	Text  string
	BotID string
}

type MsgEntityMentionUser

type MsgEntityMentionUser struct {
	Text   string
	UserID uint64
}

type MsgEntityType added in v0.3.0

type MsgEntityType string
const (
	MsgEntityMentionRobotType  MsgEntityType = "mentioned_robot"
	MsgEntityMentionUserType   MsgEntityType = "mentioned_user"
	MsgEntityMentionAllType    MsgEntityType = "mention_all"
	MsgEntityVillaRoomLinkType MsgEntityType = "villa_room_link"
	MsgEntityLinkType          MsgEntityType = "link"
)
type MsgEntityVillaRoomLink struct {
	Text    string
	VillaID uint64
	RoomID  uint64
}

type MsgInputModel

type MsgInputModel map[string]interface{}

func NewMsg

func NewMsg(msg_type MsgContentType) (MsgInputModel, error)

func (MsgInputModel) AppendText

func (msg MsgInputModel) AppendText(args ...interface{}) error

func (MsgInputModel) Finialize

func (msg MsgInputModel) Finialize(room_id uint64) MsgInputModel

return a deep copy of msg

func (MsgInputModel) SetImage

func (msg MsgInputModel) SetImage(url string, args ...interface{}) error

设置图片消息内容,接受图片url, 图片宽度, 图片高度, 图片大小 4种类型的参数,宽高单位为像素,图片大小单位为字节,不应超过10M

func (MsgInputModel) SetPost

func (msg MsgInputModel) SetPost(post_id string) error

func (MsgInputModel) SetText

func (msg MsgInputModel) SetText(args ...interface{}) error

设置文本消息内容

func (MsgInputModel) SetTextQuote

func (msg MsgInputModel) SetTextQuote(quoted_message_id string, quoted_message_send_time uint64) error

设置引用回复消息,接受被引用消息的id和发送时间

type MsgMentionType

type MsgMentionType uint64
const (
	MentionAll  MsgMentionType = 1
	MentionUser MsgMentionType = 2
)

type SendMessageModel

type SendMessageModel struct {
	APIBaseModel
	Data struct {
		BotMsgId string `json:"bot_msg_id"`
	} `json:"data"`
}

type Uint64StringSlice added in v0.4.14

type Uint64StringSlice []uint64

func (Uint64StringSlice) MarshalJSON added in v0.4.14

func (slice Uint64StringSlice) MarshalJSON() ([]byte, error)

func (*Uint64StringSlice) UnmarshalJSON added in v0.4.14

func (slice *Uint64StringSlice) UnmarshalJSON(b []byte) error

type UploadFileImageModel added in v0.5.2

type UploadFileImageModel struct {
	APIBaseModel
	Data struct {
		NewURL    string `json:"url"`
		SecretURL string `json:"secret_url"`
		Object    string `json:"object"`
	} `json:"data"`
}

type UploadImageModel added in v0.4.0

type UploadImageModel struct {
	APIBaseModel
	Data struct {
		NewURL string `json:"new_url"`
	} `json:"data"`
}

type UserInputAudit

type UserInputAudit struct {
	AuditContent string `json:"audit_content,omitempty"` // 待审核内容,必填
	PassThrough  string `json:"pass_through,omitempty"`  // 透传信息,该字段会在审核结果回调时携带给开发者,选填
	UID          uint64 `json:"room_id,omitempty"`       // 用户id, 必填
	RoomID       uint64 `json:"uid,omitempty"`           // 房间id,选填
}

user input audit struct wrapper

Jump to

Keyboard shortcuts

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