dao

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

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

func New

func New(engine *gorm.DB, zinc *zinc.ZincClient) *Dao

func (*Dao) BulkPushDoc

func (d *Dao) BulkPushDoc(data []map[string]interface{}) (bool, error)

func (*Dao) CreateAttachment

func (d *Dao) CreateAttachment(attachment *model.Attachment) (*model.Attachment, error)

func (*Dao) CreateComment

func (d *Dao) CreateComment(comment *model.Comment) (*model.Comment, error)

func (*Dao) CreateCommentContent

func (d *Dao) CreateCommentContent(content *model.CommentContent) (*model.CommentContent, error)

func (*Dao) CreateCommentReply

func (d *Dao) CreateCommentReply(reply *model.CommentReply) (*model.CommentReply, error)

func (*Dao) CreateMessage

func (d *Dao) CreateMessage(msg *model.Message) (*model.Message, error)

func (*Dao) CreatePost

func (d *Dao) CreatePost(post *model.Post) (*model.Post, error)

func (*Dao) CreatePostCollection

func (d *Dao) CreatePostCollection(postID, userID int64) (*model.PostCollection, error)

func (*Dao) CreatePostContent

func (d *Dao) CreatePostContent(content *model.PostContent) (*model.PostContent, error)

func (*Dao) CreatePostStar

func (d *Dao) CreatePostStar(postID, userID int64) (*model.PostStar, error)

func (*Dao) CreateRecharge

func (d *Dao) CreateRecharge(userId, amount int64) (*model.WalletRecharge, error)

func (*Dao) CreateSearchIndex

func (d *Dao) CreateSearchIndex(indexName string)

func (*Dao) CreateTag

func (d *Dao) CreateTag(tag *model.Tag) (*model.Tag, error)

func (*Dao) CreateUser

func (d *Dao) CreateUser(user *model.User) (*model.User, error)

创建用户

func (*Dao) DelDoc

func (d *Dao) DelDoc(indexName, id string) error

func (*Dao) DeleteComment

func (d *Dao) DeleteComment(comment *model.Comment) error

func (*Dao) DeleteCommentReply

func (d *Dao) DeleteCommentReply(reply *model.CommentReply) error

func (*Dao) DeletePost

func (d *Dao) DeletePost(post *model.Post) error

func (*Dao) DeletePostCollection

func (d *Dao) DeletePostCollection(p *model.PostCollection) error

func (*Dao) DeletePostStar

func (d *Dao) DeletePostStar(p *model.PostStar) error

func (*Dao) DeleteTag

func (d *Dao) DeleteTag(tag *model.Tag) error

func (*Dao) GetCommentByID

func (d *Dao) GetCommentByID(id int64) (*model.Comment, error)

func (*Dao) GetCommentContentsByIDs

func (d *Dao) GetCommentContentsByIDs(ids []int64) ([]*model.CommentContent, error)

func (*Dao) GetCommentCount

func (d *Dao) GetCommentCount(conditions *model.ConditionsT) (int64, error)

func (*Dao) GetCommentRepliesByID

func (d *Dao) GetCommentRepliesByID(ids []int64) ([]*model.CommentReplyFormated, error)

func (*Dao) GetCommentReplyByID

func (d *Dao) GetCommentReplyByID(id int64) (*model.CommentReply, error)

func (*Dao) GetComments

func (d *Dao) GetComments(conditions *model.ConditionsT, offset, limit int) ([]*model.Comment, error)

func (*Dao) GetLatestPhoneCaptcha

func (d *Dao) GetLatestPhoneCaptcha(phone string) (*model.Captcha, error)

获取最新短信验证码

func (*Dao) GetMessageByID

func (d *Dao) GetMessageByID(id int64) (*model.Message, error)

func (*Dao) GetMessageCount

func (d *Dao) GetMessageCount(conditions *model.ConditionsT) (int64, error)

func (*Dao) GetMessages

func (d *Dao) GetMessages(conditions *model.ConditionsT, offset, limit int) ([]*model.MessageFormated, error)

func (*Dao) GetPostAttatchmentBill

func (d *Dao) GetPostAttatchmentBill(postID, userID int64) (*model.PostAttachmentBill, error)

func (*Dao) GetPostByID

func (d *Dao) GetPostByID(id int64) (*model.Post, error)

func (*Dao) GetPostContentByID

func (d *Dao) GetPostContentByID(id int64) (*model.PostContent, error)

func (*Dao) GetPostContentsByIDs

func (d *Dao) GetPostContentsByIDs(ids []int64) ([]*model.PostContent, error)

func (*Dao) GetPostCount

func (d *Dao) GetPostCount(conditions *model.ConditionsT) (int64, error)

func (*Dao) GetPosts

func (d *Dao) GetPosts(conditions *model.ConditionsT, offset, limit int) ([]*model.Post, error)

func (*Dao) GetRechargeByID

func (d *Dao) GetRechargeByID(id int64) (*model.WalletRecharge, error)

func (*Dao) GetTags

func (d *Dao) GetTags(conditions *model.ConditionsT, offset, limit int) ([]*model.Tag, error)

func (*Dao) GetTagsByKeyword

func (d *Dao) GetTagsByKeyword(keyword string) ([]*model.Tag, error)

根据关键词模糊获取用户列表

func (*Dao) GetUnreadCount

func (d *Dao) GetUnreadCount(userID int64) (int64, error)

func (*Dao) GetUserByID

func (d *Dao) GetUserByID(id int64) (*model.User, error)

根据用户ID获取用户

func (*Dao) GetUserByPhone

func (d *Dao) GetUserByPhone(phone string) (*model.User, error)

根据手机号获取用户

func (*Dao) GetUserByUsername

func (d *Dao) GetUserByUsername(username string) (*model.User, error)

根据用户名获取用户

func (*Dao) GetUserPostCollection

func (d *Dao) GetUserPostCollection(postID, userID int64) (*model.PostCollection, error)

func (*Dao) GetUserPostCollectionCount

func (d *Dao) GetUserPostCollectionCount(userID int64) (int64, error)

func (*Dao) GetUserPostCollections

func (d *Dao) GetUserPostCollections(userID int64, offset, limit int) ([]*model.PostCollection, error)

func (*Dao) GetUserPostStar

func (d *Dao) GetUserPostStar(postID, userID int64) (*model.PostStar, error)

func (*Dao) GetUserPostStarCount

func (d *Dao) GetUserPostStarCount(userID int64) (int64, error)

func (*Dao) GetUserPostStars

func (d *Dao) GetUserPostStars(userID int64, offset, limit int) ([]*model.PostStar, error)

func (*Dao) GetUserWalletBillCount

func (d *Dao) GetUserWalletBillCount(userID int64) (int64, error)

func (*Dao) GetUserWalletBills

func (d *Dao) GetUserWalletBills(userID int64, offset, limit int) ([]*model.WalletStatement, error)

func (*Dao) GetUsersByIDs

func (d *Dao) GetUsersByIDs(ids []int64) ([]*model.User, error)

根据IDs获取用户列表

func (*Dao) GetUsersByKeyword

func (d *Dao) GetUsersByKeyword(keyword string) ([]*model.User, error)

根据关键词模糊获取用户列表

func (*Dao) HandlePostAttachmentBought

func (d *Dao) HandlePostAttachmentBought(post *model.Post, user *model.User) error

func (*Dao) HandleRechargeSuccess

func (d *Dao) HandleRechargeSuccess(recharge *model.WalletRecharge, tradeNo string) error

func (*Dao) LockPost

func (d *Dao) LockPost(post *model.Post) error

func (*Dao) QueryAll

func (d *Dao) QueryAll(q *QueryT, indexName string, offset, limit int) (*zinc.QueryResultT, error)

func (*Dao) QuerySearch

func (d *Dao) QuerySearch(indexName, query string, offset, limit int) (*zinc.QueryResultT, error)

func (*Dao) QueryTagSearch

func (d *Dao) QueryTagSearch(indexName, query string, offset, limit int) (*zinc.QueryResultT, error)

func (*Dao) ReadMessage

func (d *Dao) ReadMessage(message *model.Message) error

func (*Dao) SendPhoneCaptcha

func (d *Dao) SendPhoneCaptcha(phone string) error

发送短信验证码

func (*Dao) StickPost

func (d *Dao) StickPost(post *model.Post) error

func (*Dao) UpdatePost

func (d *Dao) UpdatePost(post *model.Post) error

func (*Dao) UpdateUser

func (d *Dao) UpdateUser(user *model.User) error

更新用户

func (*Dao) UsePhoneCaptcha

func (d *Dao) UsePhoneCaptcha(captcha *model.Captcha) error

更新短信验证码

type JuhePhoneCaptchaRsp

type JuhePhoneCaptchaRsp struct {
	ErrorCode int    `json:"error_code"`
	Reason    string `json:"reason"`
}

type QueryT

type QueryT struct {
	Query string
	Type  SearchType
}

type SearchType

type SearchType string
const SearchTypeDefault SearchType = "search"
const SearchTypeTag SearchType = "tag"

Jump to

Keyboard shortcuts

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