web

package
v0.0.0-...-8be1489 Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddFollowingReq

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

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
}

type BaseInfo

type BaseInfo struct {
	User *core.User
}

func (*BaseInfo) SetUser

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

type BasePageReq

type BasePageReq struct {
	UserId   int64
	Page     int
	PageSize int
}

func BasePageReqFrom

func BasePageReqFrom(c *gin.Context) (*BasePageReq, 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:"-"`
}

type CreateCommentReplyResp

type CreateCommentReplyResp core.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:"-"`
}

type CreateCommentResp

type CreateCommentResp core.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:"-"`
}

type CreateTweetResp

type CreateTweetResp core.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 DeleteFollowingReq

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

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"`
}

type DownloadAttachmentPrecheckResp

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

type DownloadAttachmentReq

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

type DownloadAttachmentResp

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

type GetCaptchaResp

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

type GetCollectionsReq

type GetCollectionsReq BasePageReq

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

type GetMessagesResp

type GetMessagesResp base.PageResp

type GetStarsReq

type GetStarsReq BasePageReq

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"`
}

type GetUserTweetsReq

type GetUserTweetsReq struct {
	BaseInfo `form:"-" binding:"-"`
	Username string `form:"username" binding:"required"`
	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 ListFollowersReq

type ListFollowersReq struct {
	BaseInfo `form:"-" binding:"-"`
}

type ListFollowersResp

type ListFollowersResp base.PageResp

type ListFollowingsReq

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

type ListFollowingsResp

type ListFollowingsResp 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    core.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 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
}

type SuggestTagsResp

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

type SuggestUsersReq

type SuggestUsersReq struct {
	Keyword string
}

type SuggestUsersResp

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

type SyncSearchIndexReq

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

type TagType

type TagType string
const (
	TagTypeHot TagType = "hot"
	TagTypeNew TagType = "new"
)

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:"-"`
}

type TimelineResp

type TimelineResp base.PageResp

type TopicListReq

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

type TopicListResp

type TopicListResp struct {
	Topics []*core.TagFormated `json:"topics"`
}

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

type TweetCollectionStatusReq

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

type TweetCollectionStatusResp

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

type TweetCommentsReq

type TweetCommentsReq struct {
	TweetId  int64 `form:"id"`
	Page     int   `form:"-"`
	PageSize int   `form:"-"`
}

type TweetCommentsResp

type TweetCommentsResp base.PageResp

type TweetDetailReq

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

type TweetDetailResp

type TweetDetailResp core.PostFormated

type TweetStarStatusReq

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

type TweetStarStatusResp

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

type UploadAttachmentReq

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

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      core.AttachmentType `json:"type"`
	Content   string              `json:"content"`
}

type UserInfoReq

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

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"`
}

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"`
}

type UserRechargeLinkResp

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

type UserRechargeResultReq

type UserRechargeResultReq struct {
	UserId int64
	Id     int64
}

type UserRechargeResultResp

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

type UserWalletBillsReq

type UserWalletBillsReq struct {
	UserId   int64
	Page     int
	PageSize int
}

type UserWalletBillsResp

type UserWalletBillsResp base.PageResp

type VersionResp

type VersionResp struct {
	BuildInfo *debug.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