Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttachmentCheckService ¶ added in v0.1.2
type CacheIndexService ¶ added in v0.1.2
type CacheIndexService interface { IndexPostsService SendAction(active IndexActionT) }
CacheIndexService cache index service interface
type DataService ¶
type DataService interface { WalletService SearchService IndexPostsService GetComments(conditions *model.ConditionsT, offset, limit int) ([]*model.Comment, error) GetCommentByID(id int64) (*model.Comment, error) DeleteComment(comment *model.Comment) error GetCommentCount(conditions *model.ConditionsT) (int64, error) CreateComment(comment *model.Comment) (*model.Comment, error) CreateCommentReply(reply *model.CommentReply) (*model.CommentReply, error) GetCommentReplyByID(id int64) (*model.CommentReply, error) DeleteCommentReply(reply *model.CommentReply) error GetCommentContentsByIDs(ids []int64) ([]*model.CommentContent, error) GetCommentRepliesByID(ids []int64) ([]*model.CommentReplyFormated, error) CreateCommentContent(content *model.CommentContent) (*model.CommentContent, error) CreateMessage(msg *model.Message) (*model.Message, error) GetUnreadCount(userID int64) (int64, error) GetMessageByID(id int64) (*model.Message, error) ReadMessage(message *model.Message) error GetMessages(conditions *model.ConditionsT, offset, limit int) ([]*model.MessageFormated, error) GetMessageCount(conditions *model.ConditionsT) (int64, error) CreateAttachment(attachment *model.Attachment) (*model.Attachment, error) CreatePost(post *model.Post) (*model.Post, error) DeletePost(post *model.Post) error LockPost(post *model.Post) error StickPost(post *model.Post) error GetPostByID(id int64) (*model.Post, error) GetPosts(conditions *model.ConditionsT, offset, limit int) ([]*model.Post, error) GetPostCount(conditions *model.ConditionsT) (int64, error) UpdatePost(post *model.Post) error GetUserPostStar(postID, userID int64) (*model.PostStar, error) GetUserPostStars(userID int64, offset, limit int) ([]*model.PostStar, error) GetUserPostStarCount(userID int64) (int64, error) CreatePostStar(postID, userID int64) (*model.PostStar, error) DeletePostStar(p *model.PostStar) error GetUserPostCollection(postID, userID int64) (*model.PostCollection, error) GetUserPostCollections(userID int64, offset, limit int) ([]*model.PostCollection, error) GetUserPostCollectionCount(userID int64) (int64, error) GetUserWalletBills(userID int64, offset, limit int) ([]*model.WalletStatement, error) GetUserWalletBillCount(userID int64) (int64, error) CreatePostCollection(postID, userID int64) (*model.PostCollection, error) DeletePostCollection(p *model.PostCollection) error GetPostAttatchmentBill(postID, userID int64) (*model.PostAttachmentBill, error) CreatePostContent(content *model.PostContent) (*model.PostContent, error) GetPostContentsByIDs(ids []int64) ([]*model.PostContent, error) GetPostContentByID(id int64) (*model.PostContent, error) CreateTag(tag *model.Tag) (*model.Tag, error) DeleteTag(tag *model.Tag) error GetTags(conditions *model.ConditionsT, offset, limit int) ([]*model.Tag, error) GetUserByID(id int64) (*model.User, error) GetUserByUsername(username string) (*model.User, error) GetUserByPhone(phone string) (*model.User, error) GetUsersByIDs(ids []int64) ([]*model.User, error) GetUsersByKeyword(keyword string) ([]*model.User, error) GetTagsByKeyword(keyword string) ([]*model.Tag, error) CreateUser(user *model.User) (*model.User, error) UpdateUser(user *model.User) error GetLatestPhoneCaptcha(phone string) (*model.Captcha, error) UsePhoneCaptcha(captcha *model.Captcha) error SendPhoneCaptcha(phone string) error }
DataService data service interface that process data related logic on database
type IndexActionT ¶ added in v0.1.2
type IndexActionT uint8
const ( IdxActNop IndexActionT = iota + 1 IdxActCreatePost IdxActUpdatePost IdxActDeletePost IdxActStickPost )
func (IndexActionT) String ¶ added in v0.1.2
func (a IndexActionT) String() string
type IndexPostsService ¶ added in v0.1.2
type IndexPostsService interface {
IndexPosts(offset int, limit int) ([]*model.PostFormated, error)
}
type ObjectStorageService ¶ added in v0.1.2
type ObjectStorageService interface { PutObject(objectKey string, reader io.Reader, objectSize int64, contentType string) (string, error) SignURL(objectKey string, expiredInSec int64) (string, error) ObjectURL(objetKey string) string ObjectKey(cUrl string) string }
ObjectStorageService storage service interface that implement base AliOSS、MINIO or other
type QueryT ¶
type QueryT struct { Query string Type SearchType }
type SearchService ¶
type SearchService interface { CreateSearchIndex(indexName string) BulkPushDoc(data []map[string]interface{}) (bool, error) DelDoc(indexName, id string) error QueryAll(q *QueryT, indexName string, offset, limit int) (*zinc.QueryResultT, error) QuerySearch(indexName, query string, offset, limit int) (*zinc.QueryResultT, error) QueryTagSearch(indexName, query string, offset, limit int) (*zinc.QueryResultT, error) }
SearchService search service interface that implement base zinc
type SearchType ¶
type SearchType string
const ( SearchTypeDefault SearchType = "search" SearchTypeTag SearchType = "tag" )
type WalletService ¶
type WalletService interface { GetRechargeByID(id int64) (*model.WalletRecharge, error) CreateRecharge(userId, amount int64) (*model.WalletRecharge, error) HandleRechargeSuccess(recharge *model.WalletRecharge, tradeNo string) error HandlePostAttachmentBought(post *model.Post, user *model.User) error }
WalletService wallet service interface
Source Files
¶
Click to show internal directories.
Click to hide internal directories.