web

package
v0.4.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TagTypeHot       = cs.TagTypeHot
	TagTypeNew       = cs.TagTypeNew
	TagTypeFollow    = cs.TagTypeFollow
	TagTypeHotExtral = cs.TagTypeHotExtral
)
View Source
const (
	UserPostsStylePost      = "post"
	UserPostsStyleComment   = "comment"
	UserPostsStyleHighlight = "highlight"
	UserPostsStyleMedia     = "media"
	UserPostsStyleStar      = "star"
)

Variables

View Source
var (
	ErrUsernameHasExisted      = xerror.NewError(20001, "用户名已存在")
	ErrUsernameLengthLimit     = xerror.NewError(20002, "用户名长度3~12")
	ErrUsernameCharLimit       = xerror.NewError(20003, "用户名只能包含字母、数字")
	ErrPasswordLengthLimit     = xerror.NewError(20004, "密码长度6~16")
	ErrUserRegisterFailed      = xerror.NewError(20005, "用户注册失败")
	ErrUserHasBeenBanned       = xerror.NewError(20006, "该账户已被封停")
	ErrNoPermission            = xerror.NewError(20007, "无权限执行该请求")
	ErrUserHasBindOTP          = xerror.NewError(20008, "当前用户已绑定二次验证")
	ErrUserOTPInvalid          = xerror.NewError(20009, "二次验证码验证失败")
	ErrUserNoBindOTP           = xerror.NewError(20010, "当前用户未绑定二次验证")
	ErrErrorOldPassword        = xerror.NewError(20011, "当前用户密码验证失败")
	ErrErrorCaptchaPassword    = xerror.NewError(20012, "图形验证码验证失败")
	ErrAccountNoPhoneBind      = xerror.NewError(20013, "拒绝操作: 账户未绑定手机号")
	ErrTooManyLoginError       = xerror.NewError(20014, "登录失败次数过多,请稍后再试")
	ErrGetPhoneCaptchaError    = xerror.NewError(20015, "短信验证码获取失败")
	ErrTooManyPhoneCaptchaSend = xerror.NewError(20016, "短信验证码获取次数已达今日上限")
	ErrExistedUserPhone        = xerror.NewError(20017, "该手机号已被绑定")
	ErrErrorPhoneCaptcha       = xerror.NewError(20018, "手机验证码不正确")
	ErrMaxPhoneCaptchaUseTimes = xerror.NewError(20019, "手机验证码已达最大使用次数")
	ErrNicknameLengthLimit     = xerror.NewError(20020, "昵称长度2~12")
	ErrNoExistUsername         = xerror.NewError(20021, "用户不存在")
	ErrNoAdminPermission       = xerror.NewError(20022, "无管理权限")
	ErrDisallowUserRegister    = xerror.NewError(20023, "系统不允许注册用户")

	ErrGetPostsFailed          = xerror.NewError(30001, "获取动态列表失败")
	ErrCreatePostFailed        = xerror.NewError(30002, "动态发布失败")
	ErrGetPostFailed           = xerror.NewError(30003, "获取动态详情失败")
	ErrDeletePostFailed        = xerror.NewError(30004, "动态删除失败")
	ErrLockPostFailed          = xerror.NewError(30005, "动态锁定失败")
	ErrGetPostTagsFailed       = xerror.NewError(30006, "获取话题列表失败")
	ErrInvalidDownloadReq      = xerror.NewError(30007, "附件下载请求不合法")
	ErrDownloadReqError        = xerror.NewError(30008, "附件下载请求失败")
	ErrInsuffientDownloadMoney = xerror.NewError(30009, "附件下载失败:账户资金不足")
	ErrDownloadExecFail        = xerror.NewError(30010, "附件下载失败:扣费失败")
	ErrStickPostFailed         = xerror.NewError(30011, "动态置顶失败")
	ErrVisblePostFailed        = xerror.NewError(30012, "更新可见性失败")
	ErrHighlightPostFailed     = xerror.NewError(30013, "动态设为亮点失败")

	ErrGetCommentsFailed   = xerror.NewError(40001, "获取评论列表失败")
	ErrCreateCommentFailed = xerror.NewError(40002, "评论发布失败")
	ErrGetCommentFailed    = xerror.NewError(40003, "获取评论详情失败")
	ErrDeleteCommentFailed = xerror.NewError(40004, "评论删除失败")
	ErrCreateReplyFailed   = xerror.NewError(40005, "评论回复失败")
	ErrGetReplyFailed      = xerror.NewError(40006, "获取评论详情失败")
	ErrMaxCommentCount     = xerror.NewError(40007, "评论数已达最大限制")
	ErrGetCommentThumbs    = xerror.NewError(40008, "获取评论点赞信息失败")

	ErrGetMessagesFailed = xerror.NewError(50001, "获取消息列表失败")
	ErrReadMessageFailed = xerror.NewError(50002, "标记消息已读失败")
	ErrSendWhisperFailed = xerror.NewError(50003, "私信发送失败")
	ErrNoWhisperToSelf   = xerror.NewError(50004, "不允许给自己发送私信")
	ErrTooManyWhisperNum = xerror.NewError(50005, "今日私信次数已达上限")

	ErrGetCollectionsFailed = xerror.NewError(60001, "获取收藏列表失败")
	ErrGetStarsFailed       = xerror.NewError(60002, "获取点赞列表失败")

	ErrRechargeReqFail       = xerror.NewError(70001, "充值请求失败")
	ErrRechargeNotifyError   = xerror.NewError(70002, "充值回调失败")
	ErrGetRechargeFailed     = xerror.NewError(70003, "充值详情获取失败")
	ErrUserWalletBillsFailed = xerror.NewError(70004, "用户钱包账单获取失败")

	ErrNoRequestingFriendToSelf   = xerror.NewError(80001, "不允许添加自己为好友")
	ErrNotExistFriendId           = xerror.NewError(80002, "好友id不存在")
	ErrSendRequestingFriendFailed = xerror.NewError(80003, "申请添加朋友请求发送失败")
	ErrAddFriendFailed            = xerror.NewError(80004, "添加好友失败")
	ErrRejectFriendFailed         = xerror.NewError(80005, "拒绝好友失败")
	ErrDeleteFriendFailed         = xerror.NewError(80006, "删除好友失败")
	ErrGetContactsFailed          = xerror.NewError(80007, "获取联系人列表失败")
	ErrNoActionToSelf             = xerror.NewError(80008, "不允许对自己操作")
	ErrFolloUserFailed            = xerror.NewError(80100, "关注失败")
	ErrUnfollowUserFailed         = xerror.NewError(80101, "取消关注失败")
	ErrListFollowsFailed          = xerror.NewError(80102, "获取关注列表失败")
	ErrListFollowingsFailed       = xerror.NewError(80103, "获取粉丝列表列表失败")
	ErrGetFollowCountFailed       = xerror.NewError(80104, "获取关注计数信息失败")
	ErrNotAllowFollowSelf         = xerror.NewError(80105, "不能关注自己")
	ErrNotAllowUnfollowSelf       = xerror.NewError(80106, "不能取消关注自己")

	ErrFollowTopicFailed      = xerror.NewError(90001, "关注话题失败")
	ErrUnfollowTopicFailed    = xerror.NewError(90002, "取消关注话题失败")
	ErrStickTopicFailed       = xerror.NewError(90003, "更行话题置顶状态失败")
	ErrThumbsUpTweetComment   = xerror.NewError(90101, "评论点赞失败")
	ErrThumbsDownTweetComment = xerror.NewError(90102, "评论点踩失败")
	ErrThumbsUpTweetReply     = xerror.NewError(90103, "评论回复点赞失败")
	ErrThumbsDownTweetReply   = xerror.NewError(90104, "评论回复点踩失败")

	ErrFileUploadFailed = xerror.NewError(10200, "文件上传失败")
	ErrFileInvalidExt   = xerror.NewError(10201, "文件类型不合法")
	ErrFileInvalidSize  = xerror.NewError(10202, "文件大小超限")

	ErrNotImplemented = xerror.NewError(10501, "功能未实现")
)

nolint

Functions

This section is empty.

Types

type AddFriendReq

type AddFriendReq struct {
	BaseInfo `json:"-" binding:"-"`
	UserId   int64 `json:"user_id" binding:"required"`
}

type AlipayNotifyReq

type AlipayNotifyReq struct {
	Ctx         context.Context
	ID          int64
	TradeNo     string
	TradeStatus alipay.TradeStatus
}

func (*AlipayNotifyReq) Bind added in v0.4.0

func (r *AlipayNotifyReq) Bind(c *gin.Context) mir.Error

type BaseInfo

type BaseInfo struct {
	User *ms.User
}

func (*BaseInfo) SetUser

func (b *BaseInfo) SetUser(user *ms.User)

type BasePageReq

type BasePageReq struct {
	UserId   int64
	Page     int
	PageSize int
}

func BasePageReqFrom

func BasePageReqFrom(c *gin.Context) (*BasePageReq, mir.Error)

func (*BasePageReq) Bind added in v0.4.0

func (r *BasePageReq) Bind(c *gin.Context) mir.Error

type ChangeAvatarReq

type ChangeAvatarReq struct {
	BaseInfo `json:"-" binding:"-"`
	Avatar   string `json:"avatar" form:"avatar" binding:"required"`
}

type ChangeNicknameReq

type ChangeNicknameReq struct {
	BaseInfo `json:"-" binding:"-"`
	Nickname string `json:"nickname" form:"nickname" binding:"required"`
}

type ChangePasswordReq

type ChangePasswordReq struct {
	BaseInfo    `json:"-" binding:"-"`
	Password    string `json:"password" form:"password" binding:"required"`
	OldPassword string `json:"old_password" form:"old_password" binding:"required"`
}

type ChangeUserStatusReq

type ChangeUserStatusReq struct {
	BaseInfo `json:"-" binding:"-"`
	ID       int64 `json:"id" form:"id" binding:"required"`
	Status   int   `json:"status" form:"status" binding:"required,oneof=1 2"`
}

type CollectionTweetReq

type CollectionTweetReq struct {
	SimpleInfo `json:"-" binding:"-"`
	ID         int64 `json:"id" binding:"required"`
}

type CollectionTweetResp

type CollectionTweetResp struct {
	Status bool `json:"status"`
}

type CreateCommentReplyReq

type CreateCommentReplyReq struct {
	SimpleInfo `json:"-" binding:"-"`
	CommentID  int64  `json:"comment_id" binding:"required"`
	Content    string `json:"content" binding:"required"`
	AtUserID   int64  `json:"at_user_id"`
	ClientIP   string `json:"-" binding:"-"`
}

func (*CreateCommentReplyReq) Bind added in v0.4.0

func (r *CreateCommentReplyReq) Bind(c *gin.Context) mir.Error

type CreateCommentReplyResp

type CreateCommentReplyResp ms.CommentReply

type CreateCommentReq

type CreateCommentReq struct {
	SimpleInfo `json:"-" binding:"-"`
	PostID     int64              `json:"post_id" binding:"required"`
	Contents   []*PostContentItem `json:"contents" binding:"required"`
	Users      []string           `json:"users" binding:"required"`
	ClientIP   string             `json:"-" binding:"-"`
}

func (*CreateCommentReq) Bind added in v0.4.0

func (r *CreateCommentReq) Bind(c *gin.Context) mir.Error

type CreateCommentResp

type CreateCommentResp ms.Comment

type CreateTweetReq

type CreateTweetReq struct {
	BaseInfo        `json:"-" binding:"-"`
	Contents        []*PostContentItem `json:"contents" binding:"required"`
	Tags            []string           `json:"tags" binding:"required"`
	Users           []string           `json:"users" binding:"required"`
	AttachmentPrice int64              `json:"attachment_price"`
	Visibility      core.PostVisibleT  `json:"visibility"`
	ClientIP        string             `json:"-" binding:"-"`
}

func (*CreateTweetReq) Bind added in v0.4.0

func (r *CreateTweetReq) Bind(c *gin.Context) mir.Error

type CreateTweetResp

type CreateTweetResp ms.PostFormated

type DeleteCommentReplyReq

type DeleteCommentReplyReq struct {
	BaseInfo `json:"-" binding:"-"`
	ID       int64 `json:"id" binding:"required"`
}

type DeleteCommentReq

type DeleteCommentReq struct {
	BaseInfo `json:"-" binding:"-"`
	ID       int64 `json:"id" binding:"required"`
}

type DeleteFriendReq

type DeleteFriendReq struct {
	BaseInfo `json:"-" binding:"-"`
	UserId   int64 `json:"user_id"`
}

type DeleteTweetReq

type DeleteTweetReq struct {
	BaseInfo `json:"-" binding:"-"`
	ID       int64 `json:"id" binding:"required"`
}

type DownloadAttachmentPrecheckReq

type DownloadAttachmentPrecheckReq struct {
	BaseInfo  `form:"-" binding:"-"`
	ContentID int64 `form:"id"`
}

func (*DownloadAttachmentPrecheckReq) Bind added in v0.4.0

func (r *DownloadAttachmentPrecheckReq) Bind(c *gin.Context) mir.Error

type DownloadAttachmentPrecheckResp

type DownloadAttachmentPrecheckResp struct {
	Paid bool `json:"paid"`
}

type DownloadAttachmentReq

type DownloadAttachmentReq struct {
	BaseInfo  `form:"-" binding:"-"`
	ContentID int64 `form:"id"`
}

func (*DownloadAttachmentReq) Bind added in v0.4.0

func (r *DownloadAttachmentReq) Bind(c *gin.Context) mir.Error

type DownloadAttachmentResp

type DownloadAttachmentResp struct {
	SignedURL string `json:"signed_url"`
}

type FollowTopicReq added in v0.3.0

type FollowTopicReq struct {
	SimpleInfo `json:"-" binding:"-"`
	TopicId    int64 `json:"topic_id" binding:"required"`
}

type FollowUserReq added in v0.4.0

type FollowUserReq struct {
	BaseInfo `json:"-" binding:"-"`
	UserId   int64 `json:"user_id" binding:"required"`
}

type GetCaptchaResp

type GetCaptchaResp struct {
	Id      string `json:"id"`
	Content string `json:"b64s"`
}

type GetCollectionsReq

type GetCollectionsReq BasePageReq

func (*GetCollectionsReq) Bind added in v0.4.0

func (r *GetCollectionsReq) Bind(c *gin.Context) mir.Error

type GetCollectionsResp

type GetCollectionsResp base.PageResp

type GetContactsReq

type GetContactsReq struct {
	BaseInfo `form:"-" binding:"-"`
	Page     int `form:"-" binding:"-"`
	PageSize int `form:"-" binding:"-"`
}

func (*GetContactsReq) SetPageInfo

func (r *GetContactsReq) SetPageInfo(page int, pageSize int)

type GetContactsResp

type GetContactsResp base.PageResp

type GetMessagesReq

type GetMessagesReq BasePageReq

func (*GetMessagesReq) Bind added in v0.4.0

func (r *GetMessagesReq) Bind(c *gin.Context) mir.Error

type GetMessagesResp

type GetMessagesResp base.PageResp

type GetStarsReq

type GetStarsReq BasePageReq

func (*GetStarsReq) Bind added in v0.4.0

func (r *GetStarsReq) Bind(c *gin.Context) mir.Error

type GetStarsResp

type GetStarsResp base.PageResp

type GetUnreadMsgCountReq

type GetUnreadMsgCountReq struct {
	SimpleInfo `json:"-" binding:"-"`
}

type GetUnreadMsgCountResp

type GetUnreadMsgCountResp struct {
	Count int64 `json:"count"`
}

type GetUserProfileReq

type GetUserProfileReq struct {
	BaseInfo `form:"-" binding:"-"`
	Username string `form:"username" binding:"required"`
}

type GetUserProfileResp

type GetUserProfileResp struct {
	ID          int64  `json:"id"`
	Nickname    string `json:"nickname"`
	Username    string `json:"username"`
	Status      int    `json:"status"`
	Avatar      string `json:"avatar"`
	IsAdmin     bool   `json:"is_admin"`
	IsFriend    bool   `json:"is_friend"`
	IsFollowing bool   `json:"is_following"`
	CreatedOn   int64  `json:"created_on"`
	Follows     int64  `json:"follows"`
	Followings  int64  `json:"followings"`
}

type GetUserTweetsReq

type GetUserTweetsReq struct {
	BaseInfo `form:"-" binding:"-"`
	Username string `form:"username" binding:"required"`
	Style    string `form:"style"`
	Page     int    `form:"-" binding:"-"`
	PageSize int    `form:"-" binding:"-"`
}

func (*GetUserTweetsReq) SetPageInfo

func (r *GetUserTweetsReq) SetPageInfo(page int, pageSize int)

type GetUserTweetsResp

type GetUserTweetsResp base.PageResp

type HighlightTweetReq added in v0.4.0

type HighlightTweetReq struct {
	BaseInfo `json:"-" binding:"-"`
	ID       int64 `json:"id" binding:"required"`
}

type HighlightTweetResp added in v0.4.0

type HighlightTweetResp struct {
	HighlightStatus int `json:"highlight_status"`
}

type ListFollowingsReq

type ListFollowingsReq struct {
	BaseInfo `form:"-" binding:"-"`
	joint.BasePageInfo
	Username string `form:"username" binding:"required"`
}

type ListFollowingsResp

type ListFollowingsResp base.PageResp

type ListFollowsReq added in v0.4.0

type ListFollowsReq struct {
	BaseInfo `json:"-" binding:"-"`
	joint.BasePageInfo
	Username string `form:"username" binding:"required"`
}

type ListFollowsResp added in v0.4.0

type ListFollowsResp base.PageResp

type LockTweetReq

type LockTweetReq struct {
	BaseInfo `json:"-" binding:"-"`
	ID       int64 `json:"id" binding:"required"`
}

type LockTweetResp

type LockTweetResp struct {
	LockStatus int `json:"lock_status"`
}

type LoginReq

type LoginReq struct {
	Username string `json:"username" form:"username" binding:"required"`
	Password string `json:"password" form:"password" binding:"required"`
}

type LoginResp

type LoginResp struct {
	Token string `json:"token"`
}

type PostContentItem

type PostContentItem struct {
	Content string          `json:"content"  binding:"required"`
	Type    ms.PostContentT `json:"type"  binding:"required"`
	Sort    int64           `json:"sort"  binding:"required"`
}

func (*PostContentItem) Check

Check 检查PostContentItem属性

type ReadMessageReq

type ReadMessageReq struct {
	SimpleInfo `json:"-" binding:"-"`
	ID         int64 `json:"id" binding:"required"`
}

type RegisterReq

type RegisterReq struct {
	Username string `json:"username" form:"username" binding:"required"`
	Password string `json:"password" form:"password" binding:"required"`
}

type RegisterResp

type RegisterResp struct {
	UserId   int64  `json:"id"`
	Username string `json:"username"`
}

type RejectFriendReq

type RejectFriendReq struct {
	BaseInfo `json:"-" binding:"-"`
	UserId   int64 `json:"user_id" binding:"required"`
}

type RequestingFriendReq

type RequestingFriendReq struct {
	BaseInfo  `json:"-" binding:"-"`
	UserId    int64  `json:"user_id" binding:"required"`
	Greetings string `json:"greetings" binding:"required"`
}

type SendCaptchaReq

type SendCaptchaReq struct {
	Phone        string `json:"phone" form:"phone" binding:"required"`
	ImgCaptcha   string `json:"img_captcha" form:"img_captcha" binding:"required"`
	ImgCaptchaID string `json:"img_captcha_id" form:"img_captcha_id" binding:"required"`
}

type SendWhisperReq

type SendWhisperReq struct {
	SimpleInfo `json:"-" binding:"-"`
	UserID     int64  `json:"user_id" binding:"required"`
	Content    string `json:"content" binding:"required"`
}

type SimpleInfo

type SimpleInfo struct {
	Uid int64
}

func (*SimpleInfo) SetUserId

func (s *SimpleInfo) SetUserId(id int64)

type StarTweetReq

type StarTweetReq struct {
	SimpleInfo `json:"-" binding:"-"`
	ID         int64 `json:"id" binding:"required"`
}

type StarTweetResp

type StarTweetResp struct {
	Status bool `json:"status"`
}

type StickTopicReq added in v0.3.0

type StickTopicReq struct {
	SimpleInfo `json:"-" binding:"-"`
	TopicId    int64 `json:"topic_id" binding:"required"`
}

type StickTopicResp added in v0.3.0

type StickTopicResp struct {
	StickStatus int8 `json:"top_status"`
}

type StickTweetReq

type StickTweetReq struct {
	BaseInfo `json:"-" binding:"-"`
	ID       int64 `json:"id" binding:"required"`
}

type StickTweetResp

type StickTweetResp struct {
	StickStatus int `json:"top_status"`
}

type SuggestTagsReq

type SuggestTagsReq struct {
	Keyword string
}

func (*SuggestTagsReq) Bind added in v0.4.0

func (r *SuggestTagsReq) Bind(c *gin.Context) mir.Error

type SuggestTagsResp

type SuggestTagsResp struct {
	Suggests []string `json:"suggest"`
}

type SuggestUsersReq

type SuggestUsersReq struct {
	Keyword string
}

func (*SuggestUsersReq) Bind added in v0.4.0

func (r *SuggestUsersReq) Bind(c *gin.Context) mir.Error

type SuggestUsersResp

type SuggestUsersResp struct {
	Suggests []string `json:"suggest"`
}

type SyncSearchIndexReq

type SyncSearchIndexReq struct {
	BaseInfo `json:"-" binding:"-"`
}

type TagType

type TagType = cs.TagType

type TimelineReq

type TimelineReq struct {
	BaseInfo   `form:"-"  binding:"-"`
	Query      string              `form:"query"`
	Visibility []core.PostVisibleT `form:"query"`
	Type       string              `form:"type"`
	Page       int                 `form:"-"  binding:"-"`
	PageSize   int                 `form:"-"  binding:"-"`
}

func (*TimelineReq) Bind added in v0.4.0

func (r *TimelineReq) Bind(c *gin.Context) mir.Error

type TimelineResp

type TimelineResp base.PageResp

type TopicListReq

type TopicListReq struct {
	SimpleInfo `form:"-"  binding:"-"`
	Type       TagType `json:"type" form:"type" binding:"required"`
	Num        int     `json:"num" form:"num" binding:"required"`
	ExtralNum  int     `json:"extral_num" form:"extral_num"`
}

type TopicListResp

type TopicListResp struct {
	Topics       cs.TagList `json:"topics"`
	ExtralTopics cs.TagList `json:"extral_topics,omitempty"`
}

TopicListResp 主题返回值 TODO: 优化内容定义

type TweetCollectionStatusReq

type TweetCollectionStatusReq struct {
	SimpleInfo `json:"-" binding:"-"`
	TweetId    int64 `form:"id"`
}

func (*TweetCollectionStatusReq) Bind added in v0.4.0

func (r *TweetCollectionStatusReq) Bind(c *gin.Context) mir.Error

type TweetCollectionStatusResp

type TweetCollectionStatusResp struct {
	Status bool `json:"status"`
}

type TweetCommentThumbsReq added in v0.3.0

type TweetCommentThumbsReq struct {
	SimpleInfo `json:"-" binding:"-"`
	TweetId    int64 `json:"tweet_id" binding:"required"`
	CommentId  int64 `json:"comment_id" binding:"required"`
}

type TweetCommentsReq

type TweetCommentsReq struct {
	SimpleInfo   `form:"-" binding:"-"`
	TweetId      int64  `form:"id" binding:"required"`
	SortStrategy string `form:"sort_strategy"`
	Page         int    `form:"-" binding:"-"`
	PageSize     int    `form:"-" binding:"-"`
}

func (*TweetCommentsReq) SetPageInfo added in v0.3.0

func (r *TweetCommentsReq) SetPageInfo(page int, pageSize int)

type TweetCommentsResp

type TweetCommentsResp base.PageResp

type TweetDetailReq

type TweetDetailReq struct {
	TweetId int64 `form:"id"`
}

type TweetDetailResp

type TweetDetailResp ms.PostFormated

type TweetReplyThumbsReq added in v0.3.0

type TweetReplyThumbsReq struct {
	SimpleInfo `json:"-" binding:"-"`
	TweetId    int64 `json:"tweet_id" binding:"required"`
	CommentId  int64 `json:"comment_id" binding:"required"`
	ReplyId    int64 `json:"reply_id" binding:"required"`
}

type TweetStarStatusReq

type TweetStarStatusReq struct {
	SimpleInfo `json:"-" binding:"-"`
	TweetId    int64 `form:"id"`
}

func (*TweetStarStatusReq) Bind added in v0.4.0

func (r *TweetStarStatusReq) Bind(c *gin.Context) mir.Error

type TweetStarStatusResp

type TweetStarStatusResp struct {
	Status bool `json:"status"`
}

type UnfollowTopicReq added in v0.3.0

type UnfollowTopicReq struct {
	SimpleInfo `json:"-" binding:"-"`
	TopicId    int64 `json:"topic_id" binding:"required"`
}

type UnfollowUserReq added in v0.4.0

type UnfollowUserReq struct {
	BaseInfo `json:"-" binding:"-"`
	UserId   int64 `json:"user_id" binding:"required"`
}

type UploadAttachmentReq

type UploadAttachmentReq struct {
	SimpleInfo  `json:"-" binding:"-"`
	UploadType  string
	ContentType string
	File        multipart.File
	FileSize    int64
	FileExt     string
}

func (*UploadAttachmentReq) Bind added in v0.4.0

func (r *UploadAttachmentReq) Bind(c *gin.Context) (xerr mir.Error)

type UploadAttachmentResp

type UploadAttachmentResp struct {
	UserID    int64             `json:"user_id"`
	FileSize  int64             `json:"file_size"`
	ImgWidth  int               `json:"img_width"`
	ImgHeight int               `json:"img_height"`
	Type      ms.AttachmentType `json:"type"`
	Content   string            `json:"content"`
}

type UserInfoReq

type UserInfoReq struct {
	BaseInfo `json:"-" binding:"-"`
	Username string `json:"username" form:"username" binding:"required"`
}

func (*UserInfoReq) Bind added in v0.4.0

func (r *UserInfoReq) Bind(c *gin.Context) mir.Error

type UserInfoResp

type UserInfoResp struct {
	Id         int64  `json:"id"`
	Nickname   string `json:"nickname"`
	Username   string `json:"username"`
	Status     int    `json:"status"`
	Avatar     string `json:"avatar"`
	Balance    int64  `json:"balance"`
	Phone      string `json:"phone"`
	IsAdmin    bool   `json:"is_admin"`
	CreatedOn  int64  `json:"created_on"`
	Follows    int64  `json:"follows"`
	Followings int64  `json:"followings"`
}

type UserPhoneBindReq

type UserPhoneBindReq struct {
	BaseInfo `json:"-" binding:"-"`
	Phone    string `json:"phone" form:"phone" binding:"required"`
	Captcha  string `json:"captcha" form:"captcha" binding:"required"`
}

type UserRechargeLinkReq

type UserRechargeLinkReq struct {
	BaseInfo `json:"-" form:"-" binding:"-"`
	Host     string `json:"-" form:"-" binding:"-"`
	Amount   int64  `json:"amount" form:"amount" binding:"required"`
}

func (*UserRechargeLinkReq) Bind added in v0.4.0

func (r *UserRechargeLinkReq) Bind(c *gin.Context) mir.Error

type UserRechargeLinkResp

type UserRechargeLinkResp struct {
	Id  int64  `json:"id"`
	Pay string `json:"pay"`
}

type UserRechargeResultReq

type UserRechargeResultReq struct {
	UserId int64
	Id     int64
}

func (*UserRechargeResultReq) Bind added in v0.4.0

func (r *UserRechargeResultReq) Bind(c *gin.Context) mir.Error

type UserRechargeResultResp

type UserRechargeResultResp struct {
	Id     int64  `json:"id"`
	Status string `json:"status"`
}

type UserWalletBillsReq

type UserWalletBillsReq struct {
	UserId   int64
	Page     int
	PageSize int
}

func (*UserWalletBillsReq) Bind added in v0.4.0

func (r *UserWalletBillsReq) Bind(c *gin.Context) mir.Error

type UserWalletBillsResp

type UserWalletBillsResp base.PageResp

type VersionResp

type VersionResp struct {
	BuildInfo *version.BuildInfo `json:"build_info"`
}

type VisibleTweetReq

type VisibleTweetReq struct {
	BaseInfo   `json:"-" binding:"-"`
	ID         int64             `json:"id"`
	Visibility core.PostVisibleT `json:"visibility"`
}

type VisibleTweetResp

type VisibleTweetResp struct {
	Visibility core.PostVisibleT `json:"visibility"`
}

Jump to

Keyboard shortcuts

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