merge from r/paopao-ce-plus branch

r/paopao-ce-xtra
Michael Li 1 year ago
commit ee2375d628
No known key found for this signature in database

@ -11,6 +11,10 @@ All notable changes to paopao-ce are documented in this file.
### Changed ### Changed
- change man content width to 600px and optimize tweet/comment/replay text length. [#333](https://github.com/rocboss/paopao-ce/pull/333) - change man content width to 600px and optimize tweet/comment/replay text length. [#333](https://github.com/rocboss/paopao-ce/pull/333)
## 0.3.1
### Fixed
- fixed: video player assets cdn error. [&caff8c0](https://github.com/rocboss/paopao-ce/commit/caff8c052be6c8d59576011192f830fd98e17ab3 'commit caff8c0')
## 0.3.0 ## 0.3.0
### Added ### Added

@ -30,6 +30,7 @@ type Priv interface {
DeleteComment(*web.DeleteCommentReq) mir.Error DeleteComment(*web.DeleteCommentReq) mir.Error
CreateComment(*web.CreateCommentReq) (*web.CreateCommentResp, mir.Error) CreateComment(*web.CreateCommentReq) (*web.CreateCommentResp, mir.Error)
VisibleTweet(*web.VisibleTweetReq) (*web.VisibleTweetResp, mir.Error) VisibleTweet(*web.VisibleTweetReq) (*web.VisibleTweetResp, mir.Error)
HighlightTweet(*web.HighlightTweetReq) (*web.HighlightTweetResp, mir.Error)
StickTweet(*web.StickTweetReq) (*web.StickTweetResp, mir.Error) StickTweet(*web.StickTweetReq) (*web.StickTweetResp, mir.Error)
LockTweet(*web.LockTweetReq) (*web.LockTweetResp, mir.Error) LockTweet(*web.LockTweetReq) (*web.LockTweetResp, mir.Error)
CollectionTweet(*web.CollectionTweetReq) (*web.CollectionTweetResp, mir.Error) CollectionTweet(*web.CollectionTweetReq) (*web.CollectionTweetResp, mir.Error)
@ -213,6 +214,20 @@ func RegisterPrivServant(e *gin.Engine, s Priv) {
resp, err := s.VisibleTweet(req) resp, err := s.VisibleTweet(req)
s.Render(c, resp, err) s.Render(c, resp, err)
}) })
router.Handle("POST", "/post/highlight", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
req := new(web.HighlightTweetReq)
if err := s.Bind(c, req); err != nil {
s.Render(c, nil, err)
return
}
resp, err := s.HighlightTweet(req)
s.Render(c, resp, err)
})
router.Handle("POST", "/post/stick", func(c *gin.Context) { router.Handle("POST", "/post/stick", func(c *gin.Context) {
select { select {
case <-c.Request.Context().Done(): case <-c.Request.Context().Done():
@ -399,6 +414,10 @@ func (UnimplementedPrivServant) VisibleTweet(req *web.VisibleTweetReq) (*web.Vis
return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
} }
func (UnimplementedPrivServant) HighlightTweet(req *web.HighlightTweetReq) (*web.HighlightTweetResp, mir.Error) {
return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
}
func (UnimplementedPrivServant) StickTweet(req *web.StickTweetReq) (*web.StickTweetResp, mir.Error) { func (UnimplementedPrivServant) StickTweet(req *web.StickTweetReq) (*web.StickTweetResp, mir.Error) {
return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
} }

@ -102,7 +102,7 @@ services:
- paopao-network - paopao-network
backend: backend:
image: bitbus/paopao-ce:0.3.0 image: bitbus/paopao-ce:0.3
restart: always restart: always
depends_on: depends_on:
- db - db

@ -13,7 +13,7 @@ import (
type PostCollection struct { type PostCollection struct {
*Model *Model
Post *Post `json:"-"` Post *Post `db:"post" json:"-"`
PostID int64 `db:"post_id" json:"post_id"` PostID int64 `db:"post_id" json:"post_id"`
UserID int64 `db:"user_id" json:"user_id"` UserID int64 `db:"user_id" json:"user_id"`
} }

@ -13,7 +13,7 @@ import (
type PostStar struct { type PostStar struct {
*Model *Model
Post *Post `json:"-"` Post *Post `db:"post" json:"-"`
PostID int64 `json:"post_id"` PostID int64 `json:"post_id"`
UserID int64 `json:"user_id"` UserID int64 `json:"user_id"`
} }

@ -225,9 +225,32 @@ func (s *tweetManageSrv) DeletePost(post *ms.Post) (mediaContents []string, err
return return
} }
func (s *tweetManageSrv) deleteCommentByPostId(tx *sqlx.Tx, postId int64) ([]string, error) { func (s *tweetManageSrv) deleteCommentByPostId(tx *sqlx.Tx, postId int64) (mediaContents []string, err error) {
// TODO var commentIds []int64
return nil, nil // 获取推文的所有评论id
err = tx.Stmtx(s.q.CommentIdsByPostId).Select(&commentIds, postId)
if err != nil {
return nil, err
}
// 获取评论的媒体内容
err = s.inSelectx(tx, &mediaContents, s.q.CommentMediaFromCommentIds, commentIds)
if err != nil {
return nil, err
}
// 删评论
now := time.Now().Unix()
if _, err = tx.Stmtx(s.q.DelCommentByPostId).Exec(now, postId); err != nil {
return nil, err
}
// 删评论内容
if _, err = s.inExecx(tx, s.q.DelCommentContentByCommentIds, now, commentIds); err != nil {
return nil, err
}
// 删评论的评论
if _, err = s.inExecx(tx, s.q.DelReplyByCommentIds, now, commentIds); err != nil {
return nil, err
}
return
} }
func (s *tweetManageSrv) LockPost(r *ms.Post) error { func (s *tweetManageSrv) LockPost(r *ms.Post) error {
@ -332,44 +355,39 @@ func (s *tweetSrv) GetPostCount(c ms.ConditionsT) (res int64, err error) {
return return
} }
func (s *tweetSrv) GetUserPostStar(postID, userID int64) (*ms.PostStar, error) { func (s *tweetSrv) GetUserPostStar(postID, userID int64) (res *ms.PostStar, err error) {
res := &ms.PostStar{} err = s.q.GetUserPostStar.Get(res, postID, userID, userID)
err := s.q.GetUserPostStar.Get(res, postID, userID) return
return res, err
} }
func (s *tweetSrv) GetUserPostStars(userID int64, offset, limit int) ([]*ms.PostStar, error) { func (s *tweetSrv) GetUserPostStars(userID int64, offset, limit int) (res []*ms.PostStar, err error) {
res := []*ms.PostStar{} err = s.q.GetUserPostStar.Select(&res, userID, userID, limit, offset)
err := s.q.GetUserPostStar.Select(&res, userID, limit, offset) return
return res, err
} }
func (s *tweetSrv) GetUserPostStarCount(userID int64) (res int64, err error) { func (s *tweetSrv) GetUserPostStarCount(userID int64) (res int64, err error) {
err = s.q.GetUserPostStarCount.Get(&res, userID) err = s.q.GetUserPostStarCount.Get(&res, userID, userID)
return return
} }
func (s *tweetSrv) GetUserPostCollection(postID, userID int64) (*ms.PostCollection, error) { func (s *tweetSrv) GetUserPostCollection(postID, userID int64) (res *ms.PostCollection, err error) {
res := &ms.PostCollection{} err = s.q.GetUserPostCollection.Get(res, postID, userID, userID)
err := s.q.GetUserPostCollection.Get(res, postID, userID) return
return res, err
} }
func (s *tweetSrv) GetUserPostCollections(userID int64, offset, limit int) ([]*ms.PostCollection, error) { func (s *tweetSrv) GetUserPostCollections(userID int64, offset, limit int) (res []*ms.PostCollection, err error) {
res := []*ms.PostCollection{} err = s.q.GetUserPostCollections.Select(&res, userID, userID, limit, offset)
err := s.q.GetUserPostCollections.Select(&res, userID, limit, offset)
return res, err return res, err
} }
func (s *tweetSrv) GetUserPostCollectionCount(userID int64) (res int64, err error) { func (s *tweetSrv) GetUserPostCollectionCount(userID int64) (res int64, err error) {
err = s.q.GetUserPostCollectionCount.Get(&res) err = s.q.GetUserPostCollectionCount.Get(&res, userID, userID)
return return
} }
func (s *tweetSrv) GetPostAttatchmentBill(postID, userID int64) (*ms.PostAttachmentBill, error) { func (s *tweetSrv) GetPostAttatchmentBill(postID, userID int64) (res *ms.PostAttachmentBill, err error) {
res := &ms.PostAttachmentBill{} err = s.q.GetPostAttachmentBill.Get(res, postID, userID)
err := s.q.GetPostAttachmentBill.Get(res, postID, userID) return
return res, err
} }
func (s *tweetSrv) GetPostContentsByIDs(ids []int64) (res []*ms.PostContent, err error) { func (s *tweetSrv) GetPostContentsByIDs(ids []int64) (res []*ms.PostContent, err error) {
@ -377,10 +395,9 @@ func (s *tweetSrv) GetPostContentsByIDs(ids []int64) (res []*ms.PostContent, err
return return
} }
func (s *tweetSrv) GetPostContentByID(id int64) (*ms.PostContent, error) { func (s *tweetSrv) GetPostContentByID(id int64) (res *ms.PostContent, err error) {
res := &ms.PostContent{} err = s.q.GetPostContentById.Get(res, id)
err := s.q.GetPostContentById.Get(res, id) return
return res, err
} }
func (s *tweetSrvA) TweetInfoById(id int64) (*cs.TweetInfo, error) { func (s *tweetSrvA) TweetInfoById(id int64) (*cs.TweetInfo, error) {

@ -12,134 +12,139 @@ import (
) )
const ( const (
_TagsFromNames = `SELECT * FROM @tag WHERE tag IN (?) AND is_del=0` _TagsFromNames = `SELECT * FROM @tag WHERE tag IN (?) AND is_del=0`
_UpdateTagQuote = `UPDATE @tag SET quote_num=?, modified_on=? WHERE id=? AND is_del=0` _UpdateTagQuote = `UPDATE @tag SET quote_num=?, modified_on=? WHERE id=? AND is_del=0`
_AuthorizationManage_BeFriendIds = `SELECT user_id FROM @contact WHERE friend_id=? AND status=2 AND is_del=0` _AuthorizationManage_BeFriendIds = `SELECT user_id FROM @contact WHERE friend_id=? AND status=2 AND is_del=0`
_AuthorizationManage_IsFriend = `SELECT status FROM @contact WHERE user_id=? AND friend_id=? AND is_del=0` _AuthorizationManage_IsFriend = `SELECT status FROM @contact WHERE user_id=? AND friend_id=? AND is_del=0`
_AuthorizationManage_MyFriendSet = `SELECT friend_id FROM @contact WHERE user_id=? AND status=2 AND is_del=0` _AuthorizationManage_MyFriendSet = `SELECT friend_id FROM @contact WHERE user_id=? AND status=2 AND is_del=0`
_Comment_GetCommentById = `SELECT * FROM @comment WHERE id=? AND is_del=0` _Comment_GetCommentById = `SELECT * FROM @comment WHERE id=? AND is_del=0`
_Comment_GetCommentContentsByIds = `SELECT * FROM @comment_content WHERE comment_id IN (?)` _Comment_GetCommentContentsByIds = `SELECT * FROM @comment_content WHERE comment_id IN (?)`
_Comment_GetCommentCount = `SELECT count(*) FROM @comment WHERE post_id=:post_id AND is_del=0` _Comment_GetCommentCount = `SELECT count(*) FROM @comment WHERE post_id=:post_id AND is_del=0`
_Comment_GetCommentReplyById = `SELECT * FROM @comment_reply WHERE id=? AND is_del=0` _Comment_GetCommentReplyById = `SELECT * FROM @comment_reply WHERE id=? AND is_del=0`
_Comment_GetCommentThumbs = `SELECT * FROM @tweet_comment_thumbs WHERE user_id=? AND tweet_id=?` _Comment_GetCommentThumbs = `SELECT * FROM @tweet_comment_thumbs WHERE user_id=? AND tweet_id=?`
_Comment_GetComments = `SELECT * FROM @comment WHERE post_id=? AND is_del=0 ORDER BY %order% LIMIT ? OFFSET ?` _Comment_GetComments = `SELECT * FROM @comment WHERE post_id=? AND is_del=0 ORDER BY %order% LIMIT ? OFFSET ?`
_Comment_GetCommmentRepliesByIds = `SELECT * FROM @comment_reply WHERE comment_id IN (?) ORDER BY id ASC` _Comment_GetCommmentRepliesByIds = `SELECT * FROM @comment_reply WHERE comment_id IN (?) ORDER BY id ASC`
_Comment_GetUsersByIds = `SELECT id, nickname, username, status, avatar, is_admin FROM @user WHERE id IN (?)` _Comment_GetUsersByIds = `SELECT id, nickname, username, status, avatar, is_admin FROM @user WHERE id IN (?)`
_CommentManage_CreateComment = `INSERT INTO @comment (post_id, user_id, ip, ip_loc, created_on) VALUES (?, ?, ?, ?, ?)` _CommentManage_CreateComment = `INSERT INTO @comment (post_id, user_id, ip, ip_loc, created_on) VALUES (?, ?, ?, ?, ?)`
_CommentManage_CreateCommentContent = `INSERT INTO @comment_content (comment_id, user_id, content, type, sort, created_on) VALUES (?, ?, ?, ?, ?, ?)` _CommentManage_CreateCommentContent = `INSERT INTO @comment_content (comment_id, user_id, content, type, sort, created_on) VALUES (?, ?, ?, ?, ?, ?)`
_CommentManage_CreateCommentReply = `INSERT INTO @comment_reply (comment_id, user_id, content, at_user_id, ip, ip_loc, created_on) VALUES (?, ?, ?, ?, ?, ?, ?)` _CommentManage_CreateCommentReply = `INSERT INTO @comment_reply (comment_id, user_id, content, at_user_id, ip, ip_loc, created_on) VALUES (?, ?, ?, ?, ?, ?, ?)`
_CommentManage_CreateThumbsUpdownComment = `INSERT INTO @tweet_comment_thumbs (user_id, tweet_id, comment_id, reply_id, is_thumbs_up, is_thumbs_down, comment_type, created_on) VALUES (:user_id, :tweet_id, :comment_id, :reply_id, :is_thumbs_up, :is_thumbs_down, :comment_type, :created_on)` _CommentManage_CreateThumbsUpdownComment = `INSERT INTO @tweet_comment_thumbs (user_id, tweet_id, comment_id, reply_id, is_thumbs_up, is_thumbs_down, comment_type, created_on) VALUES (:user_id, :tweet_id, :comment_id, :reply_id, :is_thumbs_up, :is_thumbs_down, :comment_type, :created_on)`
_CommentManage_DeleteComment = `UPDATE @comment SET deleted_on=?, is_del=1 WHERE id=? AND is_del=0` _CommentManage_DeleteComment = `UPDATE @comment SET deleted_on=?, is_del=1 WHERE id=? AND is_del=0`
_CommentManage_DeleteCommentReply = `UPDATE @comment_reply SET deleted_on=?, is_del=1 WHERE id=? AND is_del=0` _CommentManage_DeleteCommentReply = `UPDATE @comment_reply SET deleted_on=?, is_del=1 WHERE id=? AND is_del=0`
_CommentManage_DeleteCommentThumbs = `UPDATE @tweet_comment_thumbs SET deleted_on=?, is_del=1 WHERE user_id=? AND tweet_id=? AND comment_id=? AND is_del=0` _CommentManage_DeleteCommentThumbs = `UPDATE @tweet_comment_thumbs SET deleted_on=?, is_del=1 WHERE user_id=? AND tweet_id=? AND comment_id=? AND is_del=0`
_CommentManage_DeleteReplyThumbs = `UPDATE @tweet_comment_thumbs SET deleted_on=?, is_del=1 WHERE user_id=? AND comment_id=? AND reply_id=? AND is_del=0` _CommentManage_DeleteReplyThumbs = `UPDATE @tweet_comment_thumbs SET deleted_on=?, is_del=1 WHERE user_id=? AND comment_id=? AND reply_id=? AND is_del=0`
_CommentManage_GetCommentReplyThumb = `SELECT * FROM @tweet_comment_thumbs WHERE user_id=? AND tweet_id=? AND comment_id=? AND reply_id=? AND comment_type=1 AND is_del=0` _CommentManage_GetCommentReplyThumb = `SELECT * FROM @tweet_comment_thumbs WHERE user_id=? AND tweet_id=? AND comment_id=? AND reply_id=? AND comment_type=1 AND is_del=0`
_CommentManage_GetTweetCommentThumb = `SELECT * FROM @tweet_comment_thumbs WHERE user_id=? AND tweet_id=? AND comment_id=? AND comment_type=0 AND is_del=0` _CommentManage_GetTweetCommentThumb = `SELECT * FROM @tweet_comment_thumbs WHERE user_id=? AND tweet_id=? AND comment_id=? AND comment_type=0 AND is_del=0`
_CommentManage_UpdateCommentThumbsCount = `UPDATE @comment SET thumbs_up_count=?, thumbs_down_count=?, modified_on=? WHERE id=? AND is_del=0` _CommentManage_UpdateCommentThumbsCount = `UPDATE @comment SET thumbs_up_count=?, thumbs_down_count=?, modified_on=? WHERE id=? AND is_del=0`
_CommentManage_UpdateReplyThumbsCount = `UPDATE @comment_reply SET thumbs_up_count=?, thumbs_down_count=?, modified_on=? WHERE id=? AND is_del=0` _CommentManage_UpdateReplyThumbsCount = `UPDATE @comment_reply SET thumbs_up_count=?, thumbs_down_count=?, modified_on=? WHERE id=? AND is_del=0`
_CommentManage_UpdateThumbsUpdownComment = `UPDATE @tweet_comment_thumbs SET is_thumbs_up=:is_thumbs_up, is_thumbs_down=:is_thumbs_down, modified_on=:modified_on WHERE id=:id AND is_del=0` _CommentManage_UpdateThumbsUpdownComment = `UPDATE @tweet_comment_thumbs SET is_thumbs_up=:is_thumbs_up, is_thumbs_down=:is_thumbs_down, modified_on=:modified_on WHERE id=:id AND is_del=0`
_ContactManager_AddFriendMsgsUpdate = `UPDATE @message SET reply_id=?, modified_on=? WHERE ((sender_user_id = ? AND receiver_user_id = ?) OR (sender_user_id = ? AND receiver_user_id = ?)) AND type = ? AND reply_id = ?` _ContactManager_AddFriendMsgsUpdate = `UPDATE @message SET reply_id=?, modified_on=? WHERE ((sender_user_id = ? AND receiver_user_id = ?) OR (sender_user_id = ? AND receiver_user_id = ?)) AND type = ? AND reply_id = ?`
_ContactManager_CreateContact = `INSERT INTO @contact (user_id, friend_id, status, created_on) VALUES (?, ?, ?, ?)` _ContactManager_CreateContact = `INSERT INTO @contact (user_id, friend_id, status, created_on) VALUES (?, ?, ?, ?)`
_ContactManager_CreateMessage = `INSERT INTO @message (sender_user_id, receiver_user_id, type, brief, content, reply_id, created_on) VALUES (:sender_user_id, :receiver_user_id, :type, :brief, :content, :reply_id, :created_on)` _ContactManager_CreateMessage = `INSERT INTO @message (sender_user_id, receiver_user_id, type, brief, content, reply_id, created_on) VALUES (:sender_user_id, :receiver_user_id, :type, :brief, :content, :reply_id, :created_on)`
_ContactManager_DelFriend = `UPDATE @contact SET status=4, is_del=1, deleted_on=? WHERE id=?` _ContactManager_DelFriend = `UPDATE @contact SET status=4, is_del=1, deleted_on=? WHERE id=?`
_ContactManager_FreshContactStatus = `UPDATE @contact SET status=?, modified_on=?, is_del=0 WHERE id=?` _ContactManager_FreshContactStatus = `UPDATE @contact SET status=?, modified_on=?, is_del=0 WHERE id=?`
_ContactManager_GetContact = `SELECT id, user_id, friend_id, group_id, remark, status, is_top, is_black, notice_enable, is_del FROM @contact WHERE user_id=? AND friend_id=?` _ContactManager_GetContact = `SELECT id, user_id, friend_id, group_id, remark, status, is_top, is_black, notice_enable, is_del FROM @contact WHERE user_id=? AND friend_id=?`
_ContactManager_GetContacts = `SELECT id, user_id, friend_id, group_id, remark, status, is_top, is_black, notice_enable, is_del FROM @contact WHERE (user_id=? AND friend_id=?) OR (user_id=? AND friend_id=?)` _ContactManager_GetContacts = `SELECT id, user_id, friend_id, group_id, remark, status, is_top, is_black, notice_enable, is_del FROM @contact WHERE (user_id=? AND friend_id=?) OR (user_id=? AND friend_id=?)`
_ContactManager_GetUserFriend = `SELECT id, user_id, friend_id, group_id, remark, status, is_top, is_black, notice_enable, is_del FROM @contact WHERE user_id=? AND friend_id=? AND is_del=0` _ContactManager_GetUserFriend = `SELECT id, user_id, friend_id, group_id, remark, status, is_top, is_black, notice_enable, is_del FROM @contact WHERE user_id=? AND friend_id=? AND is_del=0`
_ContactManager_IsFriend = `SELECT true FROM @contact WHERE user_id=? AND friend_id=? AND is_del=0 AND status=2` _ContactManager_IsFriend = `SELECT true FROM @contact WHERE user_id=? AND friend_id=? AND is_del=0 AND status=2`
_ContactManager_ListFriend = `SELECT c.friend_id user_id, u.username username, u.nickname nickname, u.avatar avatar, u.phone phone FROM @contact c JOIN @user u ON c.friend_id=u.id WHERE user_id=? AND status=2 AND is_del=0 ORDER BY u.nickname ASC LIMIT ? OFFSET ?` _ContactManager_ListFriend = `SELECT c.friend_id user_id, u.username username, u.nickname nickname, u.avatar avatar, u.phone phone FROM @contact c JOIN @user u ON c.friend_id=u.id WHERE user_id=? AND status=2 AND is_del=0 ORDER BY u.nickname ASC LIMIT ? OFFSET ?`
_ContactManager_RejectFriendMsgsUpdate = `UPDATE @message SET reply_id=?, modified_on=? WHERE sender_user_id = ? AND receiver_user_id = ? AND type = ? AND reply_id = ?` _ContactManager_RejectFriendMsgsUpdate = `UPDATE @message SET reply_id=?, modified_on=? WHERE sender_user_id = ? AND receiver_user_id = ? AND type = ? AND reply_id = ?`
_ContactManager_TotalFriendsById = `SELECT count(*) FROM @contact WHERE user_id=? AND status=2 AND is_del=0` _ContactManager_TotalFriendsById = `SELECT count(*) FROM @contact WHERE user_id=? AND status=2 AND is_del=0`
_FollowIndexA_UserInfo = `SELECT * FROM @user WHERE username=?` _FollowIndexA_UserInfo = `SELECT * FROM @user WHERE username=?`
_FollowIndex_UserInfo = `SELECT * FROM @user WHERE username=?` _FollowIndex_UserInfo = `SELECT * FROM @user WHERE username=?`
_FriendIndexA_UserInfo = `SELECT * FROM @user WHERE username=?` _FriendIndexA_UserInfo = `SELECT * FROM @user WHERE username=?`
_FriendIndex_UserInfo = `SELECT * FROM @user WHERE username=?` _FriendIndex_UserInfo = `SELECT * FROM @user WHERE username=?`
_LightIndexA_UserInfo = `SELECT * FROM @user WHERE username=?` _LightIndexA_UserInfo = `SELECT * FROM @user WHERE username=?`
_LightIndex_UserInfo = `SELECT * FROM @user WHERE username=?` _LightIndex_UserInfo = `SELECT * FROM @user WHERE username=?`
_Message_CreateMessage = `INSERT INTO @message (sender_user_id, receiver_user_id, type, brief, content, post_id, comment_id, reply_id, created_on) VALUES (:sender_user_id, :receiver_user_id, :type, :brief, :content, :post_id, :comment_id, :reply_id, :created_on)` _Message_CreateMessage = `INSERT INTO @message (sender_user_id, receiver_user_id, type, brief, content, post_id, comment_id, reply_id, created_on) VALUES (:sender_user_id, :receiver_user_id, :type, :brief, :content, :post_id, :comment_id, :reply_id, :created_on)`
_Message_GetMessageById = `SELECT * FROM @message WHERE id=? AND is_del=0` _Message_GetMessageById = `SELECT * FROM @message WHERE id=? AND is_del=0`
_Message_GetMessageCount = `SELECT count(*) FROM @message WHERE receiver_user_id=:recerver_user_id AND is_del=0` _Message_GetMessageCount = `SELECT count(*) FROM @message WHERE receiver_user_id=:recerver_user_id AND is_del=0`
_Message_GetMessages = `SELECT * FROM @message WHERE receiver_user_id=:recerver_user_id AND is_del=0 ORDER BY id DESC LIMIT :limit OFFSET :offset` _Message_GetMessages = `SELECT * FROM @message WHERE receiver_user_id=:recerver_user_id AND is_del=0 ORDER BY id DESC LIMIT :limit OFFSET :offset`
_Message_GetUnreadCount = `SELECT count(*) FROM @message WHERE receiver_user_id=? AND is_read=0 AND is_del=0` _Message_GetUnreadCount = `SELECT count(*) FROM @message WHERE receiver_user_id=? AND is_read=0 AND is_del=0`
_Message_ReadMessage = `UPDATE @message SET is_read=1, modified_on=? WHERE id=?` _Message_ReadMessage = `UPDATE @message SET is_read=1, modified_on=? WHERE id=?`
_Security_CreatePhoneCaptcha = `INSERT INTO @captcha (phone, captcha, expired_on, created_on) VALUES (:phone, :captcha, :expired_on, :created_on)` _Security_CreatePhoneCaptcha = `INSERT INTO @captcha (phone, captcha, expired_on, created_on) VALUES (:phone, :captcha, :expired_on, :created_on)`
_Security_GetLatestPhoneCaptcha = `SELECT * FROM @captcha WHERE phone=? AND is_del=0` _Security_GetLatestPhoneCaptcha = `SELECT * FROM @captcha WHERE phone=? AND is_del=0`
_Security_UsePhoneCaptcha = `UPDATE @captcha SET use_times=use_times+1, modified_on=? WHERE id=? AND is_del=0` _Security_UsePhoneCaptcha = `UPDATE @captcha SET use_times=use_times+1, modified_on=? WHERE id=? AND is_del=0`
_SimpleIndexA_UserInfo = `SELECT * FROM @user WHERE username=?` _SimpleIndexA_UserInfo = `SELECT * FROM @user WHERE username=?`
_SimpleIndex_UserInfo = `SELECT * FROM @user WHERE username=?` _SimpleIndex_UserInfo = `SELECT * FROM @user WHERE username=?`
_TopicA_DecrTagsById = `UPDATE @tag SET quote_num=quote_num-1, modified_on=? WHERE id IN (?)` _TopicA_DecrTagsById = `UPDATE @tag SET quote_num=quote_num-1, modified_on=? WHERE id IN (?)`
_TopicA_HotTags = `SELECT t.id id, t.user_id user_id, t.tag tag, t.quote_num quote_num, u.id, u.nickname, u.username, u.status, u.avatar, u.is_admin FROM @tag t JOIN @user u ON t.user_id = u.id WHERE t.is_del = 0 AND t.quote_num > 0 ORDER BY t.quote_num DESC LIMIT ? OFFSET ?` _TopicA_HotTags = `SELECT t.id id, t.user_id user_id, t.tag tag, t.quote_num quote_num, u.id, u.nickname, u.username, u.status, u.avatar, u.is_admin FROM @tag t JOIN @user u ON t.user_id = u.id WHERE t.is_del = 0 AND t.quote_num > 0 ORDER BY t.quote_num DESC LIMIT ? OFFSET ?`
_TopicA_IncrTagsById = `UPDATE @tag SET quote_num=quote_num+1, is_del=0, modified_on=? WHERE id IN (?)` _TopicA_IncrTagsById = `UPDATE @tag SET quote_num=quote_num+1, is_del=0, modified_on=? WHERE id IN (?)`
_TopicA_InsertTag = `INSERT INTO @tag (user_id, tag, created_on, modified_on, quote_num) VALUES (?, ?, ?, ?, 1)` _TopicA_InsertTag = `INSERT INTO @tag (user_id, tag, created_on, modified_on, quote_num) VALUES (?, ?, ?, ?, 1)`
_TopicA_NewestTags = `SELECT t.id id, t.user_id user_id, t.tag tag, t.quote_num quote_num, u.id, u.nickname, u.username, u.status, u.avatar, u.is_admin FROM @tag t JOIN @user u ON t.user_id = u.id WHERE t.is_del = 0 AND t.quote_num > 0 ORDER BY t.id DESC LIMIT ? OFFSET ?` _TopicA_NewestTags = `SELECT t.id id, t.user_id user_id, t.tag tag, t.quote_num quote_num, u.id, u.nickname, u.username, u.status, u.avatar, u.is_admin FROM @tag t JOIN @user u ON t.user_id = u.id WHERE t.is_del = 0 AND t.quote_num > 0 ORDER BY t.id DESC LIMIT ? OFFSET ?`
_TopicA_TagsByIdA = `SELECT id FROM @tag WHERE id IN (?) AND is_del = 0 AND quote_num > 0` _TopicA_TagsByIdA = `SELECT id FROM @tag WHERE id IN (?) AND is_del = 0 AND quote_num > 0`
_TopicA_TagsByIdB = `SELECT id, user_id, tag, quote_num FROM @tag WHERE id IN (?)` _TopicA_TagsByIdB = `SELECT id, user_id, tag, quote_num FROM @tag WHERE id IN (?)`
_TopicA_TagsByKeywordA = `SELECT id, user_id, tag, quote_num FROM @tag WHERE is_del = 0 ORDER BY quote_num DESC LIMIT 6` _TopicA_TagsByKeywordA = `SELECT id, user_id, tag, quote_num FROM @tag WHERE is_del = 0 ORDER BY quote_num DESC LIMIT 6`
_TopicA_TagsByKeywordB = `SELECT id, user_id, tag, quote_num FROM @tag WHERE is_del = 0 AND tag LIKE ? ORDER BY quote_num DESC LIMIT 6` _TopicA_TagsByKeywordB = `SELECT id, user_id, tag, quote_num FROM @tag WHERE is_del = 0 AND tag LIKE ? ORDER BY quote_num DESC LIMIT 6`
_TopicA_TagsForIncr = `SELECT id, user_id, tag, quote_num FROM @tag WHERE tag IN (?)` _TopicA_TagsForIncr = `SELECT id, user_id, tag, quote_num FROM @tag WHERE tag IN (?)`
_TweetA_AttachmentByTweetId = `SELECT * FROM @user WHERE username=?` _TweetA_AttachmentByTweetId = `SELECT * FROM @user WHERE username=?`
_TweetA_FavoriteByTweetId = `SELECT * FROM @user WHERE username=?` _TweetA_FavoriteByTweetId = `SELECT * FROM @user WHERE username=?`
_TweetA_ReactionByTweetId = `SELECT * FROM @user WHERE username=?` _TweetA_ReactionByTweetId = `SELECT * FROM @user WHERE username=?`
_TweetA_TweetInfoById = `SELECT * FROM @user WHERE username=?` _TweetA_TweetInfoById = `SELECT * FROM @user WHERE username=?`
_TweetA_TweetItemById = `SELECT * FROM @user WHERE username=?` _TweetA_TweetItemById = `SELECT * FROM @user WHERE username=?`
_TweetA_UserFavorites = `SELECT * FROM @user WHERE username=?` _TweetA_UserFavorites = `SELECT * FROM @user WHERE username=?`
_TweetA_UserInfo = `SELECT * FROM @user WHERE username=?` _TweetA_UserInfo = `SELECT * FROM @user WHERE username=?`
_TweetA_UserReactions = `SELECT * FROM @user WHERE username=?` _TweetA_UserReactions = `SELECT * FROM @user WHERE username=?`
_TweetA_UserTweetsByAdmin = `SELECT * FROM @user WHERE username=?` _TweetA_UserTweetsByAdmin = `SELECT * FROM @user WHERE username=?`
_TweetA_UserTweetsByFriend = `SELECT * FROM @user WHERE username=?` _TweetA_UserTweetsByFriend = `SELECT * FROM @user WHERE username=?`
_TweetA_UserTweetsByGuest = `SELECT * FROM @user WHERE username=?` _TweetA_UserTweetsByGuest = `SELECT * FROM @user WHERE username=?`
_TweetA_UserTweetsBySelf = `SELECT * FROM @user WHERE username=?` _TweetA_UserTweetsBySelf = `SELECT * FROM @user WHERE username=?`
_Tweet_GetAnyPostCount = `SELECT count(*) FROM @post WHERE visibility IN (?)` _Tweet_GetAnyPostCount = `SELECT count(*) FROM @post WHERE visibility IN (?)`
_Tweet_GetAnyPosts = `SELECT * FROM @post WHERE visibility IN (?) AND is_del=0 LIMIT ? OFFSET ?` _Tweet_GetAnyPosts = `SELECT * FROM @post WHERE visibility IN (?) AND is_del=0 LIMIT ? OFFSET ?`
_Tweet_GetPostAttachmentBill = `SELECT * FROM @user WHERE username=?` _Tweet_GetPostAttachmentBill = `SELECT * FROM @post_attachment_bill WHERE post_id=? AND user_id=? AND is_del=0`
_Tweet_GetPostById = `SELECT * FROM @post WHERE id=? AND is_del=0` _Tweet_GetPostById = `SELECT * FROM @post WHERE id=? AND is_del=0`
_Tweet_GetPostContentById = `SELECT * FROM @user WHERE username=?` _Tweet_GetPostContentById = `SELECT * FROM @post_content WHERE id=? AND is_del=0`
_Tweet_GetPostContentsByIds = `SELECT * FROM @post_content WHERE post_id IN (?) AND is_del=0` _Tweet_GetPostContentsByIds = `SELECT * FROM @post_content WHERE post_id IN (?) AND is_del=0`
_Tweet_GetUserPostCollection = `SELECT * FROM @user WHERE username=?` _Tweet_GetUserPostCollection = `SELECT s.*, P.ID "post.id", P.user_id "post.user_id", P.comment_count "post.comment_count", P.collection_count "post.collection_count", P.upvote_count "post.upvote_count", P.share_count "post.share_count", P.visibility "post.visibility", P.is_top "post.is_top", P.is_essence "post.is_essence", P.is_lock "post.is_lock", P.latest_replied_on "post.latest_replied_on", P.tags "post.tags", P.attachment_price "post.attachment_price", P.ip "post.ip", P.ip_loc "post.ip_loc", P.is_del "post.is_del", P.created_on "post.created_on", P.modified_on "post.modified_on", P.deleted_on "post.deleted_on" FROM @post_collection s JOIN @post P ON s.post_id = P.ID WHERE s.post_id = ? AND s.user_id = ? AND s.is_del = 0 AND ( visibility <> 1 OR ( visibility = 1 AND P.user_id = ? ) ) ORDER BY P.ID DESC`
_Tweet_GetUserPostCollectionCount = `SELECT * FROM @user WHERE username=?` _Tweet_GetUserPostCollectionCount = `SELECT count(*) FROM @post_collection s JOIN @post P ON s.post_id = P.ID WHERE s.user_id = ? AND s.is_del = 0 AND ( visibility <> 1 OR ( visibility = 1 AND P.user_id = ? ) )`
_Tweet_GetUserPostCollections = `SELECT * FROM @user WHERE username=?` _Tweet_GetUserPostCollections = `SELECT s.*, P.ID "post.id", P.user_id "post.user_id", P.comment_count "post.comment_count", P.collection_count "post.collection_count", P.upvote_count "post.upvote_count", P.share_count "post.share_count", P.visibility "post.visibility", P.is_top "post.is_top", P.is_essence "post.is_essence", P.is_lock "post.is_lock", P.latest_replied_on "post.latest_replied_on", P.tags "post.tags", P.attachment_price "post.attachment_price", P.ip "post.ip", P.ip_loc "post.ip_loc", P.is_del "post.is_del", P.created_on "post.created_on", P.modified_on "post.modified_on", P.deleted_on "post.deleted_on" FROM @post_collection s JOIN @post P ON s.post_id = P.ID WHERE s.user_id = ? AND s.is_del = 0 AND ( visibility <> 1 OR ( visibility = 1 AND P.user_id = ? ) ) ORDER BY s.ID DESC, P.ID DESC LIMIT ? OFFSET ?`
_Tweet_GetUserPostCount = `SELECT count(*) FROM @post WHERE user_id=? AND visibility IN (?)` _Tweet_GetUserPostCount = `SELECT count(*) FROM @post WHERE user_id=? AND visibility IN (?)`
_Tweet_GetUserPostStar = `SELECT * FROM @user WHERE username=?` _Tweet_GetUserPostStar = `SELECT s.*, P.ID "post.id", P.user_id "post.user_id", P.comment_count "post.comment_count", P.collection_count "post.collection_count", P.upvote_count "post.upvote_count", P.share_count "post.share_count", P.visibility "post.visibility", P.is_top "post.is_top", P.is_essence "post.is_essence", P.is_lock "post.is_lock", P.latest_replied_on "post.latest_replied_on", P.tags "post.tags", P.attachment_price "post.attachment_price", P.ip "post.ip", P.ip_loc "post.ip_loc", P.is_del "post.is_del", P.created_on "post.created_on", P.modified_on "post.modified_on", P.deleted_on "post.deleted_on" FROM @post_star s JOIN @post P ON s.post_id = P.ID WHERE s.post_id = ? AND s.user_id = ? AND s.is_del = 0 AND ( visibility <> 1 OR ( visibility = 1 AND P.user_id = ? ) ) ORDER BY P.ID DESC`
_Tweet_GetUserPostStarCount = `SELECT * FROM @user WHERE username=?` _Tweet_GetUserPostStarCount = `SELECT count(*) FROM @post_star s JOIN @post P ON s.post_id = P.ID WHERE s.user_id = ? AND s.is_del = 0 AND ( visibility <> 1 OR ( visibility = 1 AND P.user_id = ? ) )`
_Tweet_GetUserPostStars = `SELECT * FROM @user WHERE username=?` _Tweet_GetUserPostStars = `SELECT s.*, P.ID "post.id", P.user_id "post.user_id", P.comment_count "post.comment_count", P.collection_count "post.collection_count", P.upvote_count "post.upvote_count", P.share_count "post.share_count", P.visibility "post.visibility", P.is_top "post.is_top", P.is_essence "post.is_essence", P.is_lock "post.is_lock", P.latest_replied_on "post.latest_replied_on", P.tags "post.tags", P.attachment_price "post.attachment_price", P.ip "post.ip", P.ip_loc "post.ip_loc", P.is_del "post.is_del", P.created_on "post.created_on", P.modified_on "post.modified_on", P.deleted_on "post.deleted_on" FROM @post_star s JOIN @post P ON s.post_id = P.ID WHERE s.user_id = ? AND s.is_del = 0 AND ( visibility <> 1 OR ( visibility = 1 AND P.user_id = ? ) ) ORDER BY s.ID DESC, P.ID DESC LIMIT ? OFFSET ?`
_Tweet_GetUserPosts = `SELECT * FROM @post WHERE user_id=? AND visibility IN (?) ORDER BY latest_replies_on DESC LIMIT ? OFFSET ?` _Tweet_GetUserPosts = `SELECT * FROM @post WHERE user_id=? AND visibility IN (?) ORDER BY latest_replies_on DESC LIMIT ? OFFSET ?`
_TweetHelpA_UserInfo = `SELECT * FROM @user WHERE username=?` _TweetHelpA_UserInfo = `SELECT * FROM @user WHERE username=?`
_TweetHelp_GetPostContentByIds = `SELECT id, post_id, content, type, sort FROM @post_content WHERE post_id IN (?) AND is_del=0` _TweetHelp_GetPostContentByIds = `SELECT id, post_id, content, type, sort FROM @post_content WHERE post_id IN (?) AND is_del=0`
_TweetHelp_GetUsersByIds = `SELECT id, username, nickname, status, avatar, is_admin FROM @user WHERE id IN (?) AND is_del=0` _TweetHelp_GetUsersByIds = `SELECT id, username, nickname, status, avatar, is_admin FROM @user WHERE id IN (?) AND is_del=0`
_TweetManageA_UserInfo = `SELECT * FROM @user WHERE username=?` _TweetManageA_UserInfo = `SELECT * FROM @user WHERE username=?`
_TweetManage_AddAttachment = `INSERT INTO @attachment (user_id, file_size, img_width, img_height, type, content, created_on) VALUES (?, ?, ?, ?, ?, ?, ?)` _TweetManage_AddAttachment = `INSERT INTO @attachment (user_id, file_size, img_width, img_height, type, content, created_on) VALUES (?, ?, ?, ?, ?, ?, ?)`
_TweetManage_AddPost = `INSERT INTO @post (user_id, tags, ip, ip_loc, attachment_price, visibility, latest_replies_on, created_on) VALUES (:user_id, :tags, :ip, :ip_loc, :attachment_price, :visibility, :latest_replies_on, :created_on)` _TweetManage_AddPost = `INSERT INTO @post (user_id, tags, ip, ip_loc, attachment_price, visibility, latest_replies_on, created_on) VALUES (:user_id, :tags, :ip, :ip_loc, :attachment_price, :visibility, :latest_replies_on, :created_on)`
_TweetManage_AddPostCollection = `INSERT INTO @post_collection (post_id, user_id, created_on) VALUES (?, ?, ?)` _TweetManage_AddPostCollection = `INSERT INTO @post_collection (post_id, user_id, created_on) VALUES (?, ?, ?)`
_TweetManage_AddPostContent = `INSERT INTO @post_content (post_id, user_id, content, type, sort, created_on) VALUES (:post_id, :user_id, :content, :type, :sort, :created_on)` _TweetManage_AddPostContent = `INSERT INTO @post_content (post_id, user_id, content, type, sort, created_on) VALUES (:post_id, :user_id, :content, :type, :sort, :created_on)`
_TweetManage_AddPostStar = `INSERT INTO @post_star (post_id, user_id, created_on) VALUES (?, ?, ?)` _TweetManage_AddPostStar = `INSERT INTO @post_star (post_id, user_id, created_on) VALUES (?, ?, ?)`
_TweetManage_DelPostById = `UPDATE @post SET is_del=1, deleted_on=? WHERE id=? AND is_del=0` _TweetManage_CommentIdsByPostId = `SELECT id FROM @comment WHERE post_id=? AND is_del=0`
_TweetManage_DelPostCollection = `UPDATE @post_collection SET is_del=1, deleted_on=? WHERE id=? AND is_del=0` _TweetManage_CommentMediaFromCommentIds = `SELECT content FROM @comment_content WHERE comment_id IN (?) AND type=3 AND is_del=0`
_TweetManage_DelPostStar = `UPDATE @post_star SET is_del=1, deleted_on=? WHERE id=? AND is_del=0` _TweetManage_DelCommentByPostId = `UPDATE @comment SET deleted_on=?, is_del=1 WHERE post_id=? AND is_del=0`
_TweetManage_LockPost = `UPDATE @post SET is_lock=1-is_lock, modified_on=? WHERE id=? AND is_del=0` _TweetManage_DelCommentContentByCommentIds = `UPDATE @comment_content SET deleted_on=?, is_del=1 WHERE comment_id IN (?) AND is_del=0`
_TweetManage_MediaContentByPostId = `SELECT content FROM post_content WHERE post_id=? AND is_del=0 AND type IN (3, 4, 5, 7, 8)` _TweetManage_DelPostById = `UPDATE @post SET is_del=1, deleted_on=? WHERE id=? AND is_del=0`
_TweetManage_StickPost = `UPDATE @post SET is_top=1-is_top, modified_on=? WHERE id=? AND is_del=0` _TweetManage_DelPostCollection = `UPDATE @post_collection SET is_del=1, deleted_on=? WHERE id=? AND is_del=0`
_TweetManage_UpdatePost = `UPDATE @post SET comment_count=:comment_count, upvote_count=:upvote_count, collection_count=:collection_count, latest_replies_on=:latest_replies_on, modified_on=:modified_on WHERE id=:id AND is_del=0` _TweetManage_DelPostStar = `UPDATE @post_star SET is_del=1, deleted_on=? WHERE id=? AND is_del=0`
_TweetManage_VisiblePost = `UPDATE @post SET visibility=?, is_top=?, modified_on=? WHERE id=? AND is_del=0` _TweetManage_DelReplyByCommentIds = `UPDATE @comment_reply SET deleted_on=?, is_del=1 WHERE comment_id IN (?) AND is_del=0`
_UserManage_CreateUser = `INSERT INTO @user (username, nickname, password, salt, avatar, status, created_on) VALUES (:username, :nickname, :password, :salt, :avatar, :status, :created_on)` _TweetManage_LockPost = `UPDATE @post SET is_lock=1-is_lock, modified_on=? WHERE id=? AND is_del=0`
_UserManage_GetAnyUsers = `SELECT * FROM @user WHERE is_del=0 ORDER BY id ASC limit 6` _TweetManage_MediaContentByPostId = `SELECT content FROM post_content WHERE post_id=? AND is_del=0 AND type IN (3, 4, 5, 7, 8)`
_UserManage_GetUserById = `SELECT * FROM @user WHERE id=? AND is_del=0` _TweetManage_StickPost = `UPDATE @post SET is_top=1-is_top, modified_on=? WHERE id=? AND is_del=0`
_UserManage_GetUserByPhone = `SELECT * FROM @user WHERE phone=? AND is_del=0` _TweetManage_UpdatePost = `UPDATE @post SET comment_count=:comment_count, upvote_count=:upvote_count, collection_count=:collection_count, latest_replies_on=:latest_replies_on, modified_on=:modified_on WHERE id=:id AND is_del=0`
_UserManage_GetUserByUsername = `SELECT * FROM @user WHERE username=? AND is_del=0` _TweetManage_VisiblePost = `UPDATE @post SET visibility=?, is_top=?, modified_on=? WHERE id=? AND is_del=0`
_UserManage_GetUsersByIds = `SELECT * FROM @user WHERE id IN (?) AND is_del=0` _UserManage_CreateUser = `INSERT INTO @user (username, nickname, password, salt, avatar, status, created_on) VALUES (:username, :nickname, :password, :salt, :avatar, :status, :created_on)`
_UserManage_GetUsersByKeyword = `SELECT * FROM @user WHERE username LIKE ? AND is_del=0 limit 6` _UserManage_GetAnyUsers = `SELECT * FROM @user WHERE is_del=0 ORDER BY id ASC limit 6`
_UserManage_UpdateUser = `UPDATE @user SET username=:username, nickname=:nickname, phone=:phone, password=:password, salt=:salt, status=:status, avatar=:avatar, balance=:balance, is_admin=:is_admin, modified_on=:modified_on WHERE id=? AND is_del=0` _UserManage_GetUserById = `SELECT * FROM @user WHERE id=? AND is_del=0`
_Wallet_AddUserBalance = `UPDATE @user SET balance=balance+?, modified_on=? WHERE id=? AND is_del=0` _UserManage_GetUserByPhone = `SELECT * FROM @user WHERE phone=? AND is_del=0`
_Wallet_CreateRecharge = `INSERT INTO @wallet_recharge (user_id, amount, created_on) VALUES (?, ?, ?)` _UserManage_GetUserByUsername = `SELECT * FROM @user WHERE username=? AND is_del=0`
_Wallet_CreateWalletStatement = `INSERT INTO @wallet_statement (user_id, change_amount, balance_snapshot, reason, created_on) VALUES (?, ?, ?, ?, ?)` _UserManage_GetUsersByIds = `SELECT * FROM @user WHERE id IN (?) AND is_del=0`
_Wallet_GetRechargeById = `SELECT * FROM @wallet_recharge WHERE id=? AND is_del=?` _UserManage_GetUsersByKeyword = `SELECT * FROM @user WHERE username LIKE ? AND is_del=0 limit 6`
_Wallet_GetUserBalance = `SELECT balance FROM @user WHERE id=? AND is_del=0` _UserManage_UpdateUser = `UPDATE @user SET username=:username, nickname=:nickname, phone=:phone, password=:password, salt=:salt, status=:status, avatar=:avatar, balance=:balance, is_admin=:is_admin, modified_on=:modified_on WHERE id=? AND is_del=0`
_Wallet_GetUserByUid = `SELECT * FROM @user WHERE id=? AND is_del=0` _Wallet_AddUserBalance = `UPDATE @user SET balance=balance+?, modified_on=? WHERE id=? AND is_del=0`
_Wallet_GetUserWalletBillCount = `SELECT count(*) FROM @wallet_statement WHERE user_id=? AND is_del=0` _Wallet_CreateRecharge = `INSERT INTO @wallet_recharge (user_id, amount, created_on) VALUES (?, ?, ?)`
_Wallet_GetUserWalletBills = `SELECT * FROM @wallet_statement WHERE user_id=? AND is_del=0 ORDER BY id DESC LIMIT ? OFFSET ?` _Wallet_CreateWalletStatement = `INSERT INTO @wallet_statement (user_id, change_amount, balance_snapshot, reason, created_on) VALUES (?, ?, ?, ?, ?)`
_Wallet_MarkSuccessRecharge = `UPDATE @wallet_recharge SET trade_no=?, trade_status='TRADE_SUCCESS', modified_on=? WHERE id=? AND is_del=0` _Wallet_GetRechargeById = `SELECT * FROM @wallet_recharge WHERE id=? AND is_del=?`
_Wallet_MinusUserBalance = `UPDATE @user SET balance=balance-?, modified_on=? WHERE id=? AND is_del=0` _Wallet_GetUserBalance = `SELECT balance FROM @user WHERE id=? AND is_del=0`
_Wallet_NewPostAttachmentBill = `INSERT INTO @post_attachment_bill (post_id, user_id, paid_amount, created_on) VALUES (?, ?, ?, ?)` _Wallet_GetUserByUid = `SELECT * FROM @user WHERE id=? AND is_del=0`
_Wallet_NewPostBill = `INSERT INTO @wallet_statement (post_id, user_id, change_amount, balance_snapshot, reason, created_on) VALUES (?, ?, ?, ?, ?, ?)` _Wallet_GetUserWalletBillCount = `SELECT count(*) FROM @wallet_statement WHERE user_id=? AND is_del=0`
_Wallet_GetUserWalletBills = `SELECT * FROM @wallet_statement WHERE user_id=? AND is_del=0 ORDER BY id DESC LIMIT ? OFFSET ?`
_Wallet_MarkSuccessRecharge = `UPDATE @wallet_recharge SET trade_no=?, trade_status='TRADE_SUCCESS', modified_on=? WHERE id=? AND is_del=0`
_Wallet_MinusUserBalance = `UPDATE @user SET balance=balance-?, modified_on=? WHERE id=? AND is_del=0`
_Wallet_NewPostAttachmentBill = `INSERT INTO @post_attachment_bill (post_id, user_id, paid_amount, created_on) VALUES (?, ?, ?, ?)`
_Wallet_NewPostBill = `INSERT INTO @wallet_statement (post_id, user_id, change_amount, balance_snapshot, reason, created_on) VALUES (?, ?, ?, ?, ?, ?)`
) )
type Yesql struct { type Yesql struct {
@ -316,20 +321,25 @@ type TweetHelpA struct {
} }
type TweetManage struct { type TweetManage struct {
yesql.Namespace `yesql:"tweet_manage"` yesql.Namespace `yesql:"tweet_manage"`
AddAttachment *sqlx.Stmt `yesql:"add_attachment"` CommentMediaFromCommentIds string `yesql:"comment_media_from_comment_ids"`
AddPostCollection *sqlx.Stmt `yesql:"add_post_collection"` DelCommentContentByCommentIds string `yesql:"del_comment_content_by_comment_ids"`
AddPostStar *sqlx.Stmt `yesql:"add_post_star"` DelReplyByCommentIds string `yesql:"del_reply_by_comment_ids"`
DelPostById *sqlx.Stmt `yesql:"del_post_by_id"` AddAttachment *sqlx.Stmt `yesql:"add_attachment"`
DelPostCollection *sqlx.Stmt `yesql:"del_post_collection"` AddPostCollection *sqlx.Stmt `yesql:"add_post_collection"`
DelPostStar *sqlx.Stmt `yesql:"del_post_star"` AddPostStar *sqlx.Stmt `yesql:"add_post_star"`
LockPost *sqlx.Stmt `yesql:"lock_post"` CommentIdsByPostId *sqlx.Stmt `yesql:"comment_ids_by_post_id"`
MediaContentByPostId *sqlx.Stmt `yesql:"media_content_by_post_id"` DelCommentByPostId *sqlx.Stmt `yesql:"del_comment_by_post_id"`
StickPost *sqlx.Stmt `yesql:"stick_post"` DelPostById *sqlx.Stmt `yesql:"del_post_by_id"`
VisiblePost *sqlx.Stmt `yesql:"visible_post"` DelPostCollection *sqlx.Stmt `yesql:"del_post_collection"`
AddPost *sqlx.NamedStmt `yesql:"add_post"` DelPostStar *sqlx.Stmt `yesql:"del_post_star"`
AddPostContent *sqlx.NamedStmt `yesql:"add_post_content"` LockPost *sqlx.Stmt `yesql:"lock_post"`
UpdatePost *sqlx.NamedStmt `yesql:"update_post"` MediaContentByPostId *sqlx.Stmt `yesql:"media_content_by_post_id"`
StickPost *sqlx.Stmt `yesql:"stick_post"`
VisiblePost *sqlx.Stmt `yesql:"visible_post"`
AddPost *sqlx.NamedStmt `yesql:"add_post"`
AddPostContent *sqlx.NamedStmt `yesql:"add_post_content"`
UpdatePost *sqlx.NamedStmt `yesql:"update_post"`
} }
type TweetManageA struct { type TweetManageA struct {
@ -839,7 +849,11 @@ func BuildTweetManage(p yesql.PreparexBuilder, ctx ...context.Context) (obj *Twe
} else { } else {
c = context.Background() c = context.Background()
} }
obj = &TweetManage{} obj = &TweetManage{
CommentMediaFromCommentIds: p.QueryHook(_TweetManage_CommentMediaFromCommentIds),
DelCommentContentByCommentIds: p.QueryHook(_TweetManage_DelCommentContentByCommentIds),
DelReplyByCommentIds: p.QueryHook(_TweetManage_DelReplyByCommentIds),
}
if obj.AddAttachment, err = p.PreparexContext(c, p.Rebind(p.QueryHook(_TweetManage_AddAttachment))); err != nil { if obj.AddAttachment, err = p.PreparexContext(c, p.Rebind(p.QueryHook(_TweetManage_AddAttachment))); err != nil {
return return
} }
@ -849,6 +863,12 @@ func BuildTweetManage(p yesql.PreparexBuilder, ctx ...context.Context) (obj *Twe
if obj.AddPostStar, err = p.PreparexContext(c, p.Rebind(p.QueryHook(_TweetManage_AddPostStar))); err != nil { if obj.AddPostStar, err = p.PreparexContext(c, p.Rebind(p.QueryHook(_TweetManage_AddPostStar))); err != nil {
return return
} }
if obj.CommentIdsByPostId, err = p.PreparexContext(c, p.Rebind(p.QueryHook(_TweetManage_CommentIdsByPostId))); err != nil {
return
}
if obj.DelCommentByPostId, err = p.PreparexContext(c, p.Rebind(p.QueryHook(_TweetManage_DelCommentByPostId))); err != nil {
return
}
if obj.DelPostById, err = p.PreparexContext(c, p.Rebind(p.QueryHook(_TweetManage_DelPostById))); err != nil { if obj.DelPostById, err = p.PreparexContext(c, p.Rebind(p.QueryHook(_TweetManage_DelPostById))); err != nil {
return return
} }

@ -358,41 +358,180 @@ SELECT count(*) FROM @post WHERE visibility IN (?);
-- name: get_user_post_star@tweet -- name: get_user_post_star@tweet
-- prepare: stmt -- prepare: stmt
SELECT * FROM @user WHERE username=? SELECT
s.*,
P.ID "post.id",
P.user_id "post.user_id",
P.comment_count "post.comment_count",
P.collection_count "post.collection_count",
P.upvote_count "post.upvote_count",
P.share_count "post.share_count",
P.visibility "post.visibility",
P.is_top "post.is_top",
P.is_essence "post.is_essence",
P.is_lock "post.is_lock",
P.latest_replied_on "post.latest_replied_on",
P.tags "post.tags",
P.attachment_price "post.attachment_price",
P.ip "post.ip",
P.ip_loc "post.ip_loc",
P.is_del "post.is_del",
P.created_on "post.created_on",
P.modified_on "post.modified_on",
P.deleted_on "post.deleted_on"
FROM
@post_star s
JOIN @post P ON s.post_id = P.ID
WHERE
s.post_id = ?
AND s.user_id = ?
AND s.is_del = 0
AND ( visibility <> 1 OR ( visibility = 1 AND P.user_id = ? ) )
ORDER BY
P.ID DESC;
-- name: get_user_post_stars@tweet -- name: get_user_post_stars@tweet
-- prepare: stmt -- prepare: stmt
SELECT * FROM @user WHERE username=? SELECT
s.*,
P.ID "post.id",
P.user_id "post.user_id",
P.comment_count "post.comment_count",
P.collection_count "post.collection_count",
P.upvote_count "post.upvote_count",
P.share_count "post.share_count",
P.visibility "post.visibility",
P.is_top "post.is_top",
P.is_essence "post.is_essence",
P.is_lock "post.is_lock",
P.latest_replied_on "post.latest_replied_on",
P.tags "post.tags",
P.attachment_price "post.attachment_price",
P.ip "post.ip",
P.ip_loc "post.ip_loc",
P.is_del "post.is_del",
P.created_on "post.created_on",
P.modified_on "post.modified_on",
P.deleted_on "post.deleted_on"
FROM
@post_star s
JOIN @post P ON s.post_id = P.ID
WHERE
s.user_id = ?
AND s.is_del = 0
AND ( visibility <> 1 OR ( visibility = 1 AND P.user_id = ? ) )
ORDER BY
s.ID DESC,
P.ID DESC
LIMIT ? OFFSET ?;
-- name: get_user_post_star_count@tweet -- name: get_user_post_star_count@tweet
-- prepare: stmt -- prepare: stmt
SELECT * FROM @user WHERE username=? SELECT
count(*)
FROM
@post_star s
JOIN @post P ON s.post_id = P.ID
WHERE
s.user_id = ?
AND s.is_del = 0
AND ( visibility <> 1 OR ( visibility = 1 AND P.user_id = ? ) );
-- name: get_user_post_collection@tweet -- name: get_user_post_collection@tweet
-- prepare: stmt -- prepare: stmt
SELECT * FROM @user WHERE username=? SELECT
s.*,
P.ID "post.id",
P.user_id "post.user_id",
P.comment_count "post.comment_count",
P.collection_count "post.collection_count",
P.upvote_count "post.upvote_count",
P.share_count "post.share_count",
P.visibility "post.visibility",
P.is_top "post.is_top",
P.is_essence "post.is_essence",
P.is_lock "post.is_lock",
P.latest_replied_on "post.latest_replied_on",
P.tags "post.tags",
P.attachment_price "post.attachment_price",
P.ip "post.ip",
P.ip_loc "post.ip_loc",
P.is_del "post.is_del",
P.created_on "post.created_on",
P.modified_on "post.modified_on",
P.deleted_on "post.deleted_on"
FROM
@post_collection s
JOIN @post P ON s.post_id = P.ID
WHERE
s.post_id = ?
AND s.user_id = ?
AND s.is_del = 0
AND ( visibility <> 1 OR ( visibility = 1 AND P.user_id = ? ) )
ORDER BY
P.ID DESC;
-- name: get_user_post_collections@tweet -- name: get_user_post_collections@tweet
-- prepare: stmt -- prepare: stmt
SELECT * FROM @user WHERE username=? SELECT
s.*,
P.ID "post.id",
P.user_id "post.user_id",
P.comment_count "post.comment_count",
P.collection_count "post.collection_count",
P.upvote_count "post.upvote_count",
P.share_count "post.share_count",
P.visibility "post.visibility",
P.is_top "post.is_top",
P.is_essence "post.is_essence",
P.is_lock "post.is_lock",
P.latest_replied_on "post.latest_replied_on",
P.tags "post.tags",
P.attachment_price "post.attachment_price",
P.ip "post.ip",
P.ip_loc "post.ip_loc",
P.is_del "post.is_del",
P.created_on "post.created_on",
P.modified_on "post.modified_on",
P.deleted_on "post.deleted_on"
FROM
@post_collection s
JOIN @post P ON s.post_id = P.ID
WHERE
s.user_id = ?
AND s.is_del = 0
AND ( visibility <> 1 OR ( visibility = 1 AND P.user_id = ? ) )
ORDER BY
s.ID DESC,
P.ID DESC
LIMIT ? OFFSET ?;
-- name: get_user_post_collection_count@tweet -- name: get_user_post_collection_count@tweet
-- prepare: stmt -- prepare: stmt
SELECT * FROM @user WHERE username=? SELECT
count(*)
FROM
@post_collection s
JOIN @post P ON s.post_id = P.ID
WHERE
s.user_id = ?
AND s.is_del = 0
AND ( visibility <> 1 OR ( visibility = 1 AND P.user_id = ? ) );
-- name: get_post_attachment_bill@tweet -- name: get_post_attachment_bill@tweet
-- prepare: stmt -- prepare: stmt
SELECT * FROM @user WHERE username=? SELECT * FROM @post_attachment_bill WHERE post_id=? AND user_id=? AND is_del=0;
-- name: get_post_contents_by_ids@tweet -- name: get_post_contents_by_ids@tweet
-- prepare: raw -- prepare: raw
-- clause: in -- clause: in
SELECT * FROM @post_content SELECT *
FROM @post_content
WHERE post_id IN (?) AND is_del=0; WHERE post_id IN (?) AND is_del=0;
-- name: get_post_content_by_id@tweet -- name: get_post_content_by_id@tweet
-- prepare: stmt -- prepare: stmt
SELECT * FROM @user WHERE username=? SELECT * FROM @post_content WHERE id=? AND is_del=0;
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- tweet_manage sql dml -- tweet_manage sql dml
@ -460,6 +599,29 @@ VALUES (:post_id, :user_id, :content, :type, :sort, :created_on);
INSERT INTO @attachment (user_id, file_size, img_width, img_height, type, content, created_on) INSERT INTO @attachment (user_id, file_size, img_width, img_height, type, content, created_on)
VALUES (?, ?, ?, ?, ?, ?, ?); VALUES (?, ?, ?, ?, ?, ?, ?);
-- name: comment_ids_by_post_id@tweet_manage
-- prepare: stmt
SELECT id FROM @comment WHERE post_id=? AND is_del=0;
-- name: comment_media_from_comment_ids@tweet_manage
-- prepare: raw
-- clause: in
SELECT content FROM @comment_content WHERE comment_id IN (?) AND type=3 AND is_del=0;
-- name: del_comment_by_post_id@tweet_manage
-- prepare: stmt
UPDATE @comment SET deleted_on=?, is_del=1 WHERE post_id=? AND is_del=0;
-- name: del_comment_content_by_comment_ids@tweet_manage
-- prepare: raw
-- clause: in
UPDATE @comment_content SET deleted_on=?, is_del=1 WHERE comment_id IN (?) AND is_del=0;
-- name: del_reply_by_comment_ids@tweet_manage
-- prepare: raw
-- clause: in
UPDATE @comment_reply SET deleted_on=?, is_del=1 WHERE comment_id IN (?) AND is_del=0;
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- tweet_help sql dml -- tweet_help sql dml
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------

@ -21,10 +21,11 @@ const (
) )
const ( const (
UserPostsStylePost = "post" UserPostsStylePost = "post"
UserPostsStyleComment = "comment" UserPostsStyleComment = "comment"
UserPostsStyleMedia = "media" UserPostsStyleHighlight = "highlight"
UserPostsStyleStar = "star" UserPostsStyleMedia = "media"
UserPostsStyleStar = "star"
) )
type TagType = cs.TagType type TagType = cs.TagType

@ -86,10 +86,19 @@ type StickTweetReq struct {
ID int64 `json:"id" binding:"required"` ID int64 `json:"id" binding:"required"`
} }
type HighlightTweetReq struct {
BaseInfo `json:"-" binding:"-"`
ID int64 `json:"id" binding:"required"`
}
type StickTweetResp struct { type StickTweetResp struct {
StickStatus int `json:"top_status"` StickStatus int `json:"top_status"`
} }
type HighlightTweetResp struct {
HighlightStatus int `json:"highlight_status"`
}
type VisibleTweetReq struct { type VisibleTweetReq struct {
BaseInfo `json:"-" binding:"-"` BaseInfo `json:"-" binding:"-"`
ID int64 `json:"id"` ID int64 `json:"id"`

@ -90,4 +90,6 @@ var (
ErrFileUploadFailed = xerror.NewError(10200, "文件上传失败") ErrFileUploadFailed = xerror.NewError(10200, "文件上传失败")
ErrFileInvalidExt = xerror.NewError(10201, "文件类型不合法") ErrFileInvalidExt = xerror.NewError(10201, "文件类型不合法")
ErrFileInvalidSize = xerror.NewError(10202, "文件大小超限") ErrFileInvalidSize = xerror.NewError(10202, "文件大小超限")
ErrNotImplemented = xerror.NewError(10501, "功能未实现")
) )

@ -66,6 +66,8 @@ func (s *looseSrv) GetUserTweets(req *web.GetUserTweetsReq) (res *web.GetUserTwe
switch req.Style { switch req.Style {
case web.UserPostsStyleComment: case web.UserPostsStyleComment:
res, err = s.getUserCommentTweets(req, isSelf) res, err = s.getUserCommentTweets(req, isSelf)
case web.UserPostsStyleHighlight:
res, err = s.getUserHighlightTweets(req, isSelf)
case web.UserPostsStyleMedia: case web.UserPostsStyleMedia:
res, err = s.getUserMediaTweets(req, isSelf) res, err = s.getUserMediaTweets(req, isSelf)
case web.UserPostsStyleStar: case web.UserPostsStyleStar:
@ -84,6 +86,12 @@ func (s *looseSrv) getUserCommentTweets(req *web.GetUserTweetsReq, isSelf bool)
return (*web.GetUserTweetsResp)(resp), nil return (*web.GetUserTweetsResp)(resp), nil
} }
func (s *looseSrv) getUserHighlightTweets(req *web.GetUserTweetsReq, isSelf bool) (*web.GetUserTweetsResp, mir.Error) {
// TODO: add implement logic
resp := base.PageRespFrom(nil, req.Page, req.PageSize, 0)
return (*web.GetUserTweetsResp)(resp), nil
}
func (s *looseSrv) getUserMediaTweets(req *web.GetUserTweetsReq, isSelf bool) (*web.GetUserTweetsResp, mir.Error) { func (s *looseSrv) getUserMediaTweets(req *web.GetUserTweetsReq, isSelf bool) (*web.GetUserTweetsResp, mir.Error) {
// TODO: add implement logic // TODO: add implement logic
resp := base.PageRespFrom(nil, req.Page, req.PageSize, 0) resp := base.PageRespFrom(nil, req.Page, req.PageSize, 0)

@ -634,6 +634,11 @@ func (s *privSrv) StickTweet(req *web.StickTweetReq) (*web.StickTweetResp, mir.E
}, nil }, nil
} }
func (s *privSrv) HighlightTweet(req *web.HighlightTweetReq) (*web.HighlightTweetResp, mir.Error) {
// TODO
return nil, web.ErrNotImplemented
}
func (s *privSrv) LockTweet(req *web.LockTweetReq) (*web.LockTweetResp, mir.Error) { func (s *privSrv) LockTweet(req *web.LockTweetReq) (*web.LockTweetResp, mir.Error) {
post, err := s.Ds.GetPostByID(req.ID) post, err := s.Ds.GetPostByID(req.ID)
if err != nil { if err != nil {

@ -42,6 +42,9 @@ type Priv struct {
// StickTweet 置顶动态 // StickTweet 置顶动态
StickTweet func(Post, web.StickTweetReq) web.StickTweetResp `mir:"/post/stick"` StickTweet func(Post, web.StickTweetReq) web.StickTweetResp `mir:"/post/stick"`
// HighlightTweet 推文亮点设置
HighlightTweet func(Post, web.HighlightTweetReq) web.HighlightTweetResp `mir:"/post/highlight"`
// VisibleTweet 修改动态可见度 // VisibleTweet 修改动态可见度
VisibleTweet func(Post, web.VisibleTweetReq) web.VisibleTweetResp `mir:"/post/visibility"` VisibleTweet func(Post, web.VisibleTweetReq) web.VisibleTweetResp `mir:"/post/visibility"`

@ -1 +1 @@
import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-c955aa6b.js";import{u as a}from"./vue-router-b8e3382f.js";import{F as i,e as c,a2 as u}from"./naive-ui-62663ad7.js";import{d as l,c as d,V as t,a1 as o,o as f,e as x}from"./@vue-e0e89260.js";import{_ as g}from"./index-8b4e1776.js";import"./vuex-473b3783.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./@vicons-d502290a.js";import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";/* empty css */const v=l({__name:"404",setup(h){const e=a(),_=()=>{e.push({path:"/"})};return(k,w)=>{const n=s,p=c,r=u,m=i;return f(),d("div",null,[t(n,{title:"404"}),t(m,{class:"main-content-wrap wrap404",bordered:""},{default:o(()=>[t(r,{status:"404",title:"404 资源不存在",description:"再看看其他的吧"},{footer:o(()=>[t(p,{onClick:_},{default:o(()=>[x("回主页")]),_:1})]),_:1})]),_:1})])}}});const M=g(v,[["__scopeId","data-v-e62daa85"]]);export{M as default}; import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-9aadc380.js";import{u as a}from"./vue-router-b8e3382f.js";import{F as i,e as c,a2 as u}from"./naive-ui-62663ad7.js";import{d as l,c as d,V as t,a1 as o,o as f,e as x}from"./@vue-e0e89260.js";import{_ as g}from"./index-d9d021c3.js";import"./vuex-473b3783.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./@vicons-b553c29f.js";import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";/* empty css */const v=l({__name:"404",setup(h){const e=a(),_=()=>{e.push({path:"/"})};return(k,w)=>{const n=s,p=c,r=u,m=i;return f(),d("div",null,[t(n,{title:"404"}),t(m,{class:"main-content-wrap wrap404",bordered:""},{default:o(()=>[t(r,{status:"404",title:"404 资源不存在",description:"再看看其他的吧"},{footer:o(()=>[t(p,{onClick:_},{default:o(()=>[x("回主页")]),_:1})]),_:1})]),_:1})])}}});const M=g(v,[["__scopeId","data-v-e62daa85"]]);export{M as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1 +1 @@
import{_ as F}from"./post-skeleton-627d3fc3.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-c955aa6b.js";import{u as V}from"./vuex-473b3783.js";import{b as z}from"./vue-router-b8e3382f.js";import{a as A}from"./formatTime-cdf4e6f1.js";import{d as R,r as n,j as S,c as o,V as a,a1 as p,o as e,_ as u,O as l,F as I,a4 as L,Q as M,a as s,M as _,L as O}from"./@vue-e0e89260.js";import{F as P,G as j,I as q,H as D}from"./naive-ui-62663ad7.js";import{_ as E}from"./index-8b4e1776.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./@vicons-d502290a.js";import"./moment-2ab8298d.js";import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";/* empty css */const G={key:0,class:"pagination-wrap"},H={key:0,class:"skeleton-wrap"},Q={key:1},T={key:0,class:"empty-wrap"},U={class:"bill-line"},$=R({__name:"Anouncement",setup(J){const d=V(),g=z(),v=n(!1),r=n([]),i=n(+g.query.p||1),f=n(20),c=n(0),h=m=>{i.value=m};return S(()=>{}),(m,K)=>{const y=N,k=j,x=F,w=q,B=D,C=P;return e(),o("div",null,[a(y,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[c.value>1?(e(),o("div",G,[a(k,{page:i.value,"onUpdate:page":h,"page-slot":u(d).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:p(()=>[v.value?(e(),o("div",H,[a(x,{num:f.value},null,8,["num"])])):(e(),o("div",Q,[r.value.length===0?(e(),o("div",T,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(e(!0),o(I,null,L(r.value,t=>(e(),M(B,{key:t.id},{default:p(()=>[s("div",U,[s("div",null,"NO."+_(t.id),1),s("div",null,_(t.reason),1),s("div",{class:O({income:t.change_amount>=0,out:t.change_amount<0})},_((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),s("div",null,_(u(A)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const kt=E($,[["__scopeId","data-v-d4d04859"]]);export{kt as default}; import{_ as F}from"./post-skeleton-29ef9a0b.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-9aadc380.js";import{u as V}from"./vuex-473b3783.js";import{b as z}from"./vue-router-b8e3382f.js";import{a as A}from"./formatTime-cdf4e6f1.js";import{d as R,r as n,j as S,c as o,V as a,a1 as p,o as e,_ as u,O as l,F as I,a4 as L,Q as M,a as s,M as _,L as O}from"./@vue-e0e89260.js";import{F as P,G as j,I as q,H as D}from"./naive-ui-62663ad7.js";import{_ as E}from"./index-d9d021c3.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./@vicons-b553c29f.js";import"./moment-2ab8298d.js";import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";/* empty css */const G={key:0,class:"pagination-wrap"},H={key:0,class:"skeleton-wrap"},Q={key:1},T={key:0,class:"empty-wrap"},U={class:"bill-line"},$=R({__name:"Anouncement",setup(J){const d=V(),g=z(),v=n(!1),r=n([]),i=n(+g.query.p||1),f=n(20),c=n(0),h=m=>{i.value=m};return S(()=>{}),(m,K)=>{const y=N,k=j,x=F,w=q,B=D,C=P;return e(),o("div",null,[a(y,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[c.value>1?(e(),o("div",G,[a(k,{page:i.value,"onUpdate:page":h,"page-slot":u(d).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:p(()=>[v.value?(e(),o("div",H,[a(x,{num:f.value},null,8,["num"])])):(e(),o("div",Q,[r.value.length===0?(e(),o("div",T,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(e(!0),o(I,null,L(r.value,t=>(e(),M(B,{key:t.id},{default:p(()=>[s("div",U,[s("div",null,"NO."+_(t.id),1),s("div",null,_(t.reason),1),s("div",{class:O({income:t.change_amount>=0,out:t.change_amount<0})},_((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),s("div",null,_(u(A)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const kt=E($,[["__scopeId","data-v-d4d04859"]]);export{kt as default};

@ -0,0 +1 @@
import{_ as P,a as S}from"./post-item.vue_vue_type_style_index_0_lang-926b2075.js";import{_ as V}from"./post-skeleton-29ef9a0b.js";import{_ as $}from"./main-nav.vue_vue_type_style_index_0_lang-9aadc380.js";import{u as I}from"./vuex-473b3783.js";import{b as L}from"./vue-router-b8e3382f.js";import{L as N,_ as R}from"./index-d9d021c3.js";import{d as j,r as s,j as q,c as o,V as e,a1 as c,_ as g,O as v,o as t,F as f,a4 as h,Q as k}from"./@vue-e0e89260.js";import{F as E,G,I as H,H as O}from"./naive-ui-62663ad7.js";import"./content-1dbc9788.js";import"./@vicons-b553c29f.js";import"./paopao-video-player-aa5e8b3f.js";import"./formatTime-cdf4e6f1.js";import"./moment-2ab8298d.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Q={key:0,class:"skeleton-wrap"},T={key:1},U={key:0,class:"empty-wrap"},A={key:1},D={key:2},J={key:0,class:"pagination-wrap"},K=j({__name:"Collection",setup(W){const m=I(),y=L(),_=s(!1),i=s([]),p=s(+y.query.p||1),l=s(20),r=s(0),u=()=>{_.value=!0,N({page:p.value,page_size:l.value}).then(n=>{_.value=!1,i.value=n.list,r.value=Math.ceil(n.pager.total_rows/l.value),window.scrollTo(0,0)}).catch(n=>{_.value=!1})},w=n=>{p.value=n,u()};return q(()=>{u()}),(n,X)=>{const C=$,b=V,x=H,z=P,d=O,B=S,F=E,M=G;return t(),o("div",null,[e(C,{title:"收藏"}),e(F,{class:"main-content-wrap",bordered:""},{default:c(()=>[_.value?(t(),o("div",Q,[e(b,{num:l.value},null,8,["num"])])):(t(),o("div",T,[i.value.length===0?(t(),o("div",U,[e(x,{size:"large",description:"暂无数据"})])):v("",!0),g(m).state.desktopModelShow?(t(),o("div",A,[(t(!0),o(f,null,h(i.value,a=>(t(),k(d,{key:a.id},{default:c(()=>[e(z,{post:a},null,8,["post"])]),_:2},1024))),128))])):(t(),o("div",D,[(t(!0),o(f,null,h(i.value,a=>(t(),k(d,{key:a.id},{default:c(()=>[e(B,{post:a},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),r.value>0?(t(),o("div",J,[e(M,{page:p.value,"onUpdate:page":w,"page-slot":g(m).state.collapsedRight?5:8,"page-count":r.value},null,8,["page","page-slot","page-count"])])):v("",!0)])}}});const Mt=R(K,[["__scopeId","data-v-a5302c9b"]]);export{Mt as default};

@ -1 +0,0 @@
import{_ as P,a as S}from"./post-item.vue_vue_type_style_index_0_lang-cf654b7f.js";import{_ as V}from"./post-skeleton-627d3fc3.js";import{_ as $}from"./main-nav.vue_vue_type_style_index_0_lang-c955aa6b.js";import{u as I}from"./vuex-473b3783.js";import{b as N}from"./vue-router-b8e3382f.js";import{K as R,_ as j}from"./index-8b4e1776.js";import{d as q,r as s,j as E,c as o,V as e,a1 as c,_ as g,O as v,o as t,F as f,a4 as h,Q as k}from"./@vue-e0e89260.js";import{F as G,G as H,I as K,H as L}from"./naive-ui-62663ad7.js";import"./content-c0ce69b7.js";import"./@vicons-d502290a.js";import"./paopao-video-player-aa5e8b3f.js";import"./formatTime-cdf4e6f1.js";import"./moment-2ab8298d.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const O={key:0,class:"skeleton-wrap"},Q={key:1},T={key:0,class:"empty-wrap"},U={key:1},A={key:2},D={key:0,class:"pagination-wrap"},J=q({__name:"Collection",setup(W){const m=I(),y=N(),_=s(!1),i=s([]),p=s(+y.query.p||1),l=s(20),r=s(0),u=()=>{_.value=!0,R({page:p.value,page_size:l.value}).then(n=>{_.value=!1,i.value=n.list,r.value=Math.ceil(n.pager.total_rows/l.value),window.scrollTo(0,0)}).catch(n=>{_.value=!1})},w=n=>{p.value=n,u()};return E(()=>{u()}),(n,X)=>{const C=$,b=V,x=K,z=P,d=L,B=S,F=G,M=H;return t(),o("div",null,[e(C,{title:"收藏"}),e(F,{class:"main-content-wrap",bordered:""},{default:c(()=>[_.value?(t(),o("div",O,[e(b,{num:l.value},null,8,["num"])])):(t(),o("div",Q,[i.value.length===0?(t(),o("div",T,[e(x,{size:"large",description:"暂无数据"})])):v("",!0),g(m).state.desktopModelShow?(t(),o("div",U,[(t(!0),o(f,null,h(i.value,a=>(t(),k(d,{key:a.id},{default:c(()=>[e(z,{post:a},null,8,["post"])]),_:2},1024))),128))])):(t(),o("div",A,[(t(!0),o(f,null,h(i.value,a=>(t(),k(d,{key:a.id},{default:c(()=>[e(B,{post:a},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),r.value>0?(t(),o("div",D,[e(M,{page:p.value,"onUpdate:page":w,"page-slot":g(m).state.collapsedRight?5:8,"page-count":r.value},null,8,["page","page-slot","page-count"])])):v("",!0)])}}});const Mt=j(J,[["__scopeId","data-v-a5302c9b"]]);export{Mt as default};

@ -1 +1 @@
import{u as M,b as P}from"./vue-router-b8e3382f.js";import{d as k,o as e,c as n,a as s,V as a,M as d,r as c,j as R,a1 as f,_ as S,O as h,F as y,a4 as U,Q as q}from"./@vue-e0e89260.js";import{o as x,F as D,G as T,I as j,H as E}from"./naive-ui-62663ad7.js";import{_ as b,N as G}from"./index-8b4e1776.js";import{_ as H}from"./post-skeleton-627d3fc3.js";import{_ as L}from"./main-nav.vue_vue_type_style_index_0_lang-c955aa6b.js";import{u as O}from"./vuex-473b3783.js";import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./evtd-b614532e.js";import"./@css-render-580d83ec.js";import"./vooks-a50491fd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";import"./@vicons-d502290a.js";/* empty css */const Q={class:"avatar"},A={class:"base-info"},J={class:"username"},K={class:"uid"},W=k({__name:"contact-item",props:{contact:{}},setup(C){const l=M(),u=t=>{l.push({name:"user",query:{username:t}})};return(t,o)=>{const _=x;return e(),n("div",{class:"contact-item",onClick:o[0]||(o[0]=r=>u(t.contact.username))},[s("div",Q,[a(_,{size:"large",src:t.contact.avatar},null,8,["src"])]),s("div",A,[s("div",J,[s("strong",null,d(t.contact.nickname),1),s("span",null," @"+d(t.contact.username),1)]),s("div",K,"UID. "+d(t.contact.user_id),1)])])}}});const X=b(W,[["__scopeId","data-v-08ee9b2e"]]),Y={key:0,class:"skeleton-wrap"},Z={key:1},tt={key:0,class:"empty-wrap"},et={key:0,class:"pagination-wrap"},ot=k({__name:"Contacts",setup(C){const l=O(),u=P(),t=c(!1),o=c([]),_=c(+u.query.p||1),r=c(20),m=c(0),w=i=>{_.value=i,v()};R(()=>{v()});const v=(i=!1)=>{o.value.length===0&&(t.value=!0),G({page:_.value,page_size:r.value}).then(p=>{t.value=!1,o.value=p.list,m.value=Math.ceil(p.pager.total_rows/r.value),i&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(p=>{t.value=!1})};return(i,p)=>{const $=L,I=H,z=j,B=X,N=E,V=D,F=T;return e(),n(y,null,[s("div",null,[a($,{title:"好友"}),a(V,{class:"main-content-wrap",bordered:""},{default:f(()=>[t.value?(e(),n("div",Y,[a(I,{num:r.value},null,8,["num"])])):(e(),n("div",Z,[o.value.length===0?(e(),n("div",tt,[a(z,{size:"large",description:"暂无数据"})])):h("",!0),(e(!0),n(y,null,U(o.value,g=>(e(),q(N,{key:g.user_id},{default:f(()=>[a(B,{contact:g},null,8,["contact"])]),_:2},1024))),128))]))]),_:1})]),m.value>0?(e(),n("div",et,[a(F,{page:_.value,"onUpdate:page":w,"page-slot":S(l).state.collapsedRight?5:8,"page-count":m.value},null,8,["page","page-slot","page-count"])])):h("",!0)],64)}}});const zt=b(ot,[["__scopeId","data-v-3b2bf978"]]);export{zt as default}; import{u as N,b as P}from"./vue-router-b8e3382f.js";import{d as k,o as e,c as n,a as s,V as a,M as d,r as c,j as R,a1 as f,_ as S,O as h,F as y,a4 as U,Q as q}from"./@vue-e0e89260.js";import{o as x,F as D,G as O,I as T,H as j}from"./naive-ui-62663ad7.js";import{_ as b,O as E}from"./index-d9d021c3.js";import{_ as G}from"./post-skeleton-29ef9a0b.js";import{_ as H}from"./main-nav.vue_vue_type_style_index_0_lang-9aadc380.js";import{u as L}from"./vuex-473b3783.js";import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./evtd-b614532e.js";import"./@css-render-580d83ec.js";import"./vooks-a50491fd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";import"./@vicons-b553c29f.js";/* empty css */const Q={class:"avatar"},A={class:"base-info"},J={class:"username"},K={class:"uid"},W=k({__name:"contact-item",props:{contact:{}},setup(C){const l=N(),u=t=>{l.push({name:"user",query:{username:t}})};return(t,o)=>{const _=x;return e(),n("div",{class:"contact-item",onClick:o[0]||(o[0]=r=>u(t.contact.username))},[s("div",Q,[a(_,{size:"large",src:t.contact.avatar},null,8,["src"])]),s("div",A,[s("div",J,[s("strong",null,d(t.contact.nickname),1),s("span",null," @"+d(t.contact.username),1)]),s("div",K,"UID. "+d(t.contact.user_id),1)])])}}});const X=b(W,[["__scopeId","data-v-08ee9b2e"]]),Y={key:0,class:"skeleton-wrap"},Z={key:1},tt={key:0,class:"empty-wrap"},et={key:0,class:"pagination-wrap"},ot=k({__name:"Contacts",setup(C){const l=L(),u=P(),t=c(!1),o=c([]),_=c(+u.query.p||1),r=c(20),m=c(0),w=i=>{_.value=i,v()};R(()=>{v()});const v=(i=!1)=>{o.value.length===0&&(t.value=!0),E({page:_.value,page_size:r.value}).then(p=>{t.value=!1,o.value=p.list,m.value=Math.ceil(p.pager.total_rows/r.value),i&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(p=>{t.value=!1})};return(i,p)=>{const $=H,I=G,z=T,B=X,V=j,F=D,M=O;return e(),n(y,null,[s("div",null,[a($,{title:"好友"}),a(F,{class:"main-content-wrap",bordered:""},{default:f(()=>[t.value?(e(),n("div",Y,[a(I,{num:r.value},null,8,["num"])])):(e(),n("div",Z,[o.value.length===0?(e(),n("div",tt,[a(z,{size:"large",description:"暂无数据"})])):h("",!0),(e(!0),n(y,null,U(o.value,g=>(e(),q(V,{key:g.user_id},{default:f(()=>[a(B,{contact:g},null,8,["contact"])]),_:2},1024))),128))]))]),_:1})]),m.value>0?(e(),n("div",et,[a(M,{page:_.value,"onUpdate:page":w,"page-slot":S(l).state.collapsedRight?5:8,"page-count":m.value},null,8,["page","page-slot","page-count"])])):h("",!0)],64)}}});const zt=b(ot,[["__scopeId","data-v-3b2bf978"]]);export{zt as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1 +0,0 @@
.profile-baseinfo[data-v-834be275]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-834be275]{width:55px}.profile-baseinfo .base-info[data-v-834be275]{position:relative;width:calc(100% - 55px)}.profile-baseinfo .base-info .username[data-v-834be275]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .uid[data-v-834be275]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-tabs-wrap[data-v-834be275]{padding:0 16px}.pagination-wrap[data-v-834be275]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .profile-baseinfo[data-v-834be275]{background-color:#18181c}.dark .profile-wrap[data-v-834be275],.dark .pagination-wrap[data-v-834be275]{background-color:#101014bf}

@ -1 +0,0 @@
import{_ as O,a as Q}from"./post-item.vue_vue_type_style_index_0_lang-cf654b7f.js";import{_ as J}from"./post-skeleton-627d3fc3.js";import{_ as K}from"./main-nav.vue_vue_type_style_index_0_lang-c955aa6b.js";import{u as W}from"./vuex-473b3783.js";import{b as X}from"./vue-router-b8e3382f.js";import{A as g,_ as Y}from"./index-8b4e1776.js";import{d as Z,r,j as ee,w as ae,c,V as o,_ as i,Q as M,a1 as h,O as T,o as n,a as _,M as z,F as U,a4 as V}from"./@vue-e0e89260.js";import{F as te,G as se,o as oe,f as ne,g as le,I as re,H as ue}from"./naive-ui-62663ad7.js";import"./content-c0ce69b7.js";import"./@vicons-d502290a.js";import"./paopao-video-player-aa5e8b3f.js";import"./formatTime-cdf4e6f1.js";import"./moment-2ab8298d.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const ce={class:"profile-baseinfo"},ie={class:"avatar"},_e={class:"base-info"},pe={class:"username"},me={class:"uid"},ve={key:0,class:"skeleton-wrap"},de={key:1},fe={key:0,class:"empty-wrap"},ge={key:1},he={key:2},ke={key:1,class:"pagination-wrap"},be=Z({__name:"Profile",setup(ye){const s=W(),p=X(),t=r(!1),l=r([]),d=r("post"),q=r(+p.query.p||1),x=r(1),S=r(1),B=r(1),a=r(+p.query.p||1),u=r(20),m=r(0),k=()=>{switch(d.value){case"post":b();break;case"comment":y();break;case"media":w();break;case"star":P();break}},b=()=>{t.value=!0,g({username:s.state.userInfo.username,style:"post",page:a.value,page_size:u.value}).then(e=>{t.value=!1,l.value=e.list||[],m.value=Math.ceil(e.pager.total_rows/u.value),window.scrollTo(0,0)}).catch(e=>{l.value=[],t.value=!1})},y=()=>{t.value=!0,g({username:s.state.userInfo.username,style:"comment",page:a.value,page_size:u.value}).then(e=>{t.value=!1,l.value=e.list||[],m.value=Math.ceil(e.pager.total_rows/u.value),window.scrollTo(0,0)}).catch(e=>{l.value=[],t.value=!1})},w=()=>{t.value=!0,g({username:s.state.userInfo.username,style:"media",page:a.value,page_size:u.value}).then(e=>{t.value=!1,l.value=e.list||[],m.value=Math.ceil(e.pager.total_rows/u.value),window.scrollTo(0,0)}).catch(e=>{l.value=[],t.value=!1})},P=()=>{t.value=!0,g({username:s.state.userInfo.username,style:"star",page:a.value,page_size:u.value}).then(e=>{t.value=!1,l.value=e.list||[],m.value=Math.ceil(e.pager.total_rows/u.value),window.scrollTo(0,0)}).catch(e=>{l.value=[],t.value=!1})},$=e=>{switch(d.value=e,d.value){case"post":a.value=q.value,b();break;case"comment":a.value=x.value,y();break;case"media":a.value=S.value,w();break;case"star":a.value=B.value,P();break}},F=e=>{switch(a.value=e,d.value){case"post":q.value=e,b();break;case"comment":x.value=a.value,y();break;case"media":S.value=a.value,w();break;case"star":B.value=a.value,P();break}};return ee(()=>{k()}),ae(()=>({path:p.path,query:p.query,refresh:s.state.refresh}),(e,I)=>{if(e.refresh!==I.refresh){a.value=+p.query.p||1,setTimeout(()=>{k()},0);return}I.path!=="/post"&&e.path==="/profile"&&(a.value=+p.query.p||1,setTimeout(()=>{k()},0))}),(e,I)=>{const N=K,D=oe,f=ne,R=le,j=J,A=re,E=O,C=ue,G=Q,H=te,L=se;return n(),c("div",null,[o(N,{title:"主页"}),i(s).state.userInfo.id>0?(n(),M(H,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:h(()=>[_("div",ce,[_("div",ie,[o(D,{size:"large",src:i(s).state.userInfo.avatar},null,8,["src"])]),_("div",_e,[_("div",pe,[_("strong",null,z(i(s).state.userInfo.nickname),1),_("span",null," @"+z(i(s).state.userInfo.username),1)]),_("div",me,"UID. "+z(i(s).state.userInfo.id),1)])]),o(R,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":$},{default:h(()=>[o(f,{name:"post",tab:"泡泡"}),o(f,{name:"comment",tab:"评论"}),o(f,{name:"media",tab:"图文"}),o(f,{name:"star",tab:"喜欢"})]),_:1}),t.value?(n(),c("div",ve,[o(j,{num:u.value},null,8,["num"])])):(n(),c("div",de,[l.value.length===0?(n(),c("div",fe,[o(A,{size:"large",description:"暂无数据"})])):T("",!0),i(s).state.desktopModelShow?(n(),c("div",ge,[(n(!0),c(U,null,V(l.value,v=>(n(),M(C,{key:v.id},{default:h(()=>[o(E,{post:v},null,8,["post"])]),_:2},1024))),128))])):(n(),c("div",he,[(n(!0),c(U,null,V(l.value,v=>(n(),M(C,{key:v.id},{default:h(()=>[o(G,{post:v},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1})):T("",!0),m.value>0?(n(),c("div",ke,[o(L,{page:a.value,"onUpdate:page":F,"page-slot":i(s).state.collapsedRight?5:8,"page-count":m.value},null,8,["page","page-slot","page-count"])])):T("",!0)])}}});const Ye=Y(be,[["__scopeId","data-v-834be275"]]);export{Ye as default};

@ -0,0 +1 @@
.profile-baseinfo[data-v-08661398]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-08661398]{width:55px}.profile-baseinfo .base-info[data-v-08661398]{position:relative;width:calc(100% - 55px)}.profile-baseinfo .base-info .username[data-v-08661398]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .uid[data-v-08661398]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-tabs-wrap[data-v-08661398]{padding:0 16px}.pagination-wrap[data-v-08661398]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .profile-baseinfo[data-v-08661398]{background-color:#18181c}.dark .profile-wrap[data-v-08661398],.dark .pagination-wrap[data-v-08661398]{background-color:#101014bf}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1 +1 @@
import{w as F,x as z,y as I,z as j,_ as E}from"./index-8b4e1776.js";import{p as U}from"./@vicons-d502290a.js";import{d as $,r as i,n as q,j as A,a3 as x,o as c,c as _,V as n,a1 as s,Q as b,e as V,M as f,O as u,_ as h,w as D,a7 as P,F as Q,a4 as G}from"./@vue-e0e89260.js";import{o as H,O as B,j as J,e as K,P as R,M as W,F as X,f as Y,g as Z,a as ee,k as oe}from"./naive-ui-62663ad7.js";import{_ as te}from"./main-nav.vue_vue_type_style_index_0_lang-c955aa6b.js";import{u as ne}from"./vuex-473b3783.js";import"./vue-router-b8e3382f.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./evtd-b614532e.js";import"./@css-render-580d83ec.js";import"./vooks-a50491fd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const se={key:0,class:"tag-item"},ae={key:0,class:"tag-quote"},ce={key:1,class:"tag-quote tag-follow"},le={key:0,class:"options"},ie=$({__name:"tag-item",props:{tag:{},showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(T){const t=T,r=i(!1),m=q(()=>{let e=[];return t.tag.is_following===0?e.push({label:"关注",key:"follow"}):(t.tag.is_top===0?e.push({label:"置顶",key:"stick"}):e.push({label:"取消置顶",key:"unstick"}),e.push({label:"取消关注",key:"unfollow"})),e}),l=e=>{switch(e){case"follow":I({topic_id:t.tag.id}).then(o=>{t.tag.is_following=1,window.$message.success("关注成功")}).catch(o=>{console.log(o)});break;case"unfollow":z({topic_id:t.tag.id}).then(o=>{t.tag.is_following=0,window.$message.success("取消关注")}).catch(o=>{console.log(o)});break;case"stick":F({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("置顶成功")}).catch(o=>{console.log(o)});break;case"unstick":F({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("取消置顶")}).catch(o=>{console.log(o)});break}};return A(()=>{r.value=!1}),(e,o)=>{const w=x("router-link"),g=H,k=B,a=J,d=K,v=R,p=W;return!e.checkFollowing||e.checkFollowing&&e.tag.is_following===1?(c(),_("div",se,[n(p,null,{header:s(()=>[(c(),b(k,{type:"success",size:"large",round:"",key:e.tag.id},{avatar:s(()=>[n(g,{src:e.tag.user.avatar},null,8,["src"])]),default:s(()=>[n(w,{class:"hash-link",to:{name:"home",query:{q:e.tag.tag,t:"tag"}}},{default:s(()=>[V(" #"+f(e.tag.tag),1)]),_:1},8,["to"]),e.showAction?u("",!0):(c(),_("span",ae,"("+f(e.tag.quote_num)+")",1)),e.showAction?(c(),_("span",ce,"("+f(e.tag.quote_num)+")",1)):u("",!0)]),_:1}))]),"header-extra":s(()=>[e.showAction?(c(),_("div",le,[n(v,{placement:"bottom-end",trigger:"click",size:"small",options:m.value,onSelect:l},{default:s(()=>[n(d,{type:"success",quaternary:"",circle:"",block:""},{icon:s(()=>[n(a,null,{default:s(()=>[n(h(U))]),_:1})]),_:1})]),_:1},8,["options"])])):u("",!0)]),_:1})])):u("",!0)}}});const _e=$({__name:"Topic",setup(T){const t=ne(),r=i([]),m=i("hot"),l=i(!1),e=i(!1),o=i(!1);D(e,()=>{e.value||(window.$message.success("保存成功"),t.commit("refreshTopicFollow"))});const w=q({get:()=>{let a="编辑";return e.value&&(a="保存"),a},set:a=>{}}),g=()=>{l.value=!0,j({type:m.value,num:50}).then(a=>{r.value=a.topics,l.value=!1}).catch(a=>{console.log(a),l.value=!1})},k=a=>{m.value=a,a=="follow"?o.value=!0:o.value=!1,g()};return A(()=>{g()}),(a,d)=>{const v=te,p=Y,C=B,L=Z,M=ie,N=ee,O=oe,S=X;return c(),_("div",null,[n(v,{title:"话题"}),n(S,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(L,{type:"line",animated:"","onUpdate:value":k},P({default:s(()=>[n(p,{name:"hot",tab:"热门"}),n(p,{name:"new",tab:"最新"}),h(t).state.userLogined?(c(),b(p,{key:0,name:"follow",tab:"关注"})):u("",!0)]),_:2},[h(t).state.userLogined?{name:"suffix",fn:s(()=>[n(C,{checked:e.value,"onUpdate:checked":d[0]||(d[0]=y=>e.value=y),checkable:""},{default:s(()=>[V(f(w.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(O,{show:l.value},{default:s(()=>[n(N,null,{default:s(()=>[(c(!0),_(Q,null,G(r.value,y=>(c(),b(M,{tag:y,showAction:h(t).state.userLogined&&e.value,checkFollowing:o.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Me=E(_e,[["__scopeId","data-v-15794a53"]]);export{Me as default}; import{x as F,y as z,z as I,A as j,_ as E}from"./index-d9d021c3.js";import{q as U}from"./@vicons-b553c29f.js";import{d as $,r as i,n as q,j as A,a3 as x,o as c,c as _,V as n,a1 as s,Q as b,e as V,M as f,O as u,_ as h,w as D,a7 as P,F as Q,a4 as G}from"./@vue-e0e89260.js";import{o as H,O as B,j as J,e as K,P as R,M as W,F as X,f as Y,g as Z,a as ee,k as oe}from"./naive-ui-62663ad7.js";import{_ as te}from"./main-nav.vue_vue_type_style_index_0_lang-9aadc380.js";import{u as ne}from"./vuex-473b3783.js";import"./vue-router-b8e3382f.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./evtd-b614532e.js";import"./@css-render-580d83ec.js";import"./vooks-a50491fd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const se={key:0,class:"tag-item"},ae={key:0,class:"tag-quote"},ce={key:1,class:"tag-quote tag-follow"},le={key:0,class:"options"},ie=$({__name:"tag-item",props:{tag:{},showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(T){const t=T,r=i(!1),m=q(()=>{let e=[];return t.tag.is_following===0?e.push({label:"关注",key:"follow"}):(t.tag.is_top===0?e.push({label:"置顶",key:"stick"}):e.push({label:"取消置顶",key:"unstick"}),e.push({label:"取消关注",key:"unfollow"})),e}),l=e=>{switch(e){case"follow":I({topic_id:t.tag.id}).then(o=>{t.tag.is_following=1,window.$message.success("关注成功")}).catch(o=>{console.log(o)});break;case"unfollow":z({topic_id:t.tag.id}).then(o=>{t.tag.is_following=0,window.$message.success("取消关注")}).catch(o=>{console.log(o)});break;case"stick":F({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("置顶成功")}).catch(o=>{console.log(o)});break;case"unstick":F({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("取消置顶")}).catch(o=>{console.log(o)});break}};return A(()=>{r.value=!1}),(e,o)=>{const w=x("router-link"),g=H,k=B,a=J,d=K,v=R,p=W;return!e.checkFollowing||e.checkFollowing&&e.tag.is_following===1?(c(),_("div",se,[n(p,null,{header:s(()=>[(c(),b(k,{type:"success",size:"large",round:"",key:e.tag.id},{avatar:s(()=>[n(g,{src:e.tag.user.avatar},null,8,["src"])]),default:s(()=>[n(w,{class:"hash-link",to:{name:"home",query:{q:e.tag.tag,t:"tag"}}},{default:s(()=>[V(" #"+f(e.tag.tag),1)]),_:1},8,["to"]),e.showAction?u("",!0):(c(),_("span",ae,"("+f(e.tag.quote_num)+")",1)),e.showAction?(c(),_("span",ce,"("+f(e.tag.quote_num)+")",1)):u("",!0)]),_:1}))]),"header-extra":s(()=>[e.showAction?(c(),_("div",le,[n(v,{placement:"bottom-end",trigger:"click",size:"small",options:m.value,onSelect:l},{default:s(()=>[n(d,{type:"success",quaternary:"",circle:"",block:""},{icon:s(()=>[n(a,null,{default:s(()=>[n(h(U))]),_:1})]),_:1})]),_:1},8,["options"])])):u("",!0)]),_:1})])):u("",!0)}}});const _e=$({__name:"Topic",setup(T){const t=ne(),r=i([]),m=i("hot"),l=i(!1),e=i(!1),o=i(!1);D(e,()=>{e.value||(window.$message.success("保存成功"),t.commit("refreshTopicFollow"))});const w=q({get:()=>{let a="编辑";return e.value&&(a="保存"),a},set:a=>{}}),g=()=>{l.value=!0,j({type:m.value,num:50}).then(a=>{r.value=a.topics,l.value=!1}).catch(a=>{console.log(a),l.value=!1})},k=a=>{m.value=a,a=="follow"?o.value=!0:o.value=!1,g()};return A(()=>{g()}),(a,d)=>{const v=te,p=Y,C=B,L=Z,M=ie,N=ee,O=oe,S=X;return c(),_("div",null,[n(v,{title:"话题"}),n(S,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(L,{type:"line",animated:"","onUpdate:value":k},P({default:s(()=>[n(p,{name:"hot",tab:"热门"}),n(p,{name:"new",tab:"最新"}),h(t).state.userLogined?(c(),b(p,{key:0,name:"follow",tab:"关注"})):u("",!0)]),_:2},[h(t).state.userLogined?{name:"suffix",fn:s(()=>[n(C,{checked:e.value,"onUpdate:checked":d[0]||(d[0]=y=>e.value=y),checkable:""},{default:s(()=>[V(f(w.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(O,{show:l.value},{default:s(()=>[n(N,null,{default:s(()=>[(c(!0),_(Q,null,G(r.value,y=>(c(),b(M,{tag:y,showAction:h(t).state.userLogined&&e.value,checkFollowing:o.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Me=E(_e,[["__scopeId","data-v-15794a53"]]);export{Me as default};

File diff suppressed because one or more lines are too long

@ -1 +0,0 @@
.whisper-wrap .whisper-line[data-v-0cbfe47c]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-0cbfe47c]{width:100%}.dark .whisper-wrap[data-v-0cbfe47c]{background-color:#101014bf}.whisper-wrap .whisper-line[data-v-60be56a2]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-60be56a2]{width:100%}.dark .whisper-wrap[data-v-60be56a2]{background-color:#101014bf}.profile-tabs-wrap[data-v-fd0defa8]{padding:0 16px}.profile-baseinfo[data-v-fd0defa8]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-fd0defa8]{width:55px}.profile-baseinfo .base-info[data-v-fd0defa8]{position:relative;width:calc(100% - 55px)}.profile-baseinfo .base-info .username[data-v-fd0defa8]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .uid[data-v-fd0defa8]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .top-tag[data-v-fd0defa8]{transform:scale(.75)}.profile-baseinfo .user-opts[data-v-fd0defa8]{position:absolute;top:16px;right:16px;opacity:.75}.pagination-wrap[data-v-fd0defa8]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .profile-baseinfo[data-v-fd0defa8]{background-color:#18181c}.dark .profile-wrap[data-v-fd0defa8],.dark .pagination-wrap[data-v-fd0defa8]{background-color:#101014bf}

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
.whisper-wrap .whisper-line[data-v-0cbfe47c]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-0cbfe47c]{width:100%}.dark .whisper-wrap[data-v-0cbfe47c]{background-color:#101014bf}.whisper-wrap .whisper-line[data-v-60be56a2]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-60be56a2]{width:100%}.dark .whisper-wrap[data-v-60be56a2]{background-color:#101014bf}.profile-tabs-wrap[data-v-b67c9295]{padding:0 16px}.profile-baseinfo[data-v-b67c9295]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-b67c9295]{width:55px}.profile-baseinfo .base-info[data-v-b67c9295]{position:relative;width:calc(100% - 55px)}.profile-baseinfo .base-info .username[data-v-b67c9295]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .uid[data-v-b67c9295]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .top-tag[data-v-b67c9295]{transform:scale(.75)}.profile-baseinfo .user-opts[data-v-b67c9295]{position:absolute;top:16px;right:16px;opacity:.75}.pagination-wrap[data-v-b67c9295]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .profile-baseinfo[data-v-b67c9295]{background-color:#18181c}.dark .profile-wrap[data-v-b67c9295],.dark .pagination-wrap[data-v-b67c9295]{background-color:#101014bf}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1 +1 @@
import{Z as B}from"./index-8b4e1776.js";import{u as E}from"./vuex-473b3783.js";import{u as S}from"./vue-router-b8e3382f.js";import{j as A}from"./vooks-a50491fd.js";import{D as C,y as D,z as N,F as P}from"./@vicons-d502290a.js";import{a3 as R,a4 as V,j as I,e as j,a5 as x,h as F}from"./naive-ui-62663ad7.js";import{d as H,r as h,j as q,o as a,c as f,_ as o,V as e,a1 as t,O as c,a as L,Q as _,e as U,M as $,F as Q}from"./@vue-e0e89260.js";const Z={key:0},G={class:"navbar"},oe=H({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(g){const i=g,n=E(),m=S(),l=h(!1),k=h("left"),u=s=>{s?(localStorage.setItem("PAOPAO_THEME","dark"),n.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),n.commit("triggerTheme","light"))},w=()=>{window.history.length<=1?m.push({path:"/"}):m.go(-1)},v=()=>{l.value=!0};return q(()=>{localStorage.getItem("PAOPAO_THEME")||u(A()==="dark")}),(s,d)=>{const y=B,b=R,O=V,r=I,p=j,M=x,T=F;return a(),f(Q,null,[o(n).state.drawerModelShow?(a(),f("div",Z,[e(O,{show:l.value,"onUpdate:show":d[0]||(d[0]=z=>l.value=z),width:212,placement:k.value,resizable:""},{default:t(()=>[e(b,null,{default:t(()=>[e(y)]),_:1})]),_:1},8,["show","placement"])])):c("",!0),e(T,{size:"small",bordered:!0,class:"nav-title-card"},{header:t(()=>[L("div",G,[o(n).state.drawerModelShow&&!s.back?(a(),_(p,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(r,null,{default:t(()=>[e(o(C))]),_:1})]),_:1})):c("",!0),s.back?(a(),_(p,{key:1,class:"back-btn",onClick:w,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(r,null,{default:t(()=>[e(o(D))]),_:1})]),_:1})):c("",!0),U(" "+$(i.title)+" ",1),i.theme?(a(),_(M,{key:2,value:o(n).state.theme==="dark","onUpdate:value":u,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(r,{component:o(N)},null,8,["component"])]),"unchecked-icon":t(()=>[e(r,{component:o(P)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{oe as _}; import{$ as B}from"./index-d9d021c3.js";import{u as E}from"./vuex-473b3783.js";import{u as S}from"./vue-router-b8e3382f.js";import{j as A}from"./vooks-a50491fd.js";import{D as C,z as D,G as N,J as P}from"./@vicons-b553c29f.js";import{a3 as R,a4 as V,j as I,e as j,a5 as x,h as H}from"./naive-ui-62663ad7.js";import{d as $,r as h,j as q,o as a,c as f,_ as o,V as e,a1 as t,O as c,a as F,Q as _,e as L,M as U,F as G}from"./@vue-e0e89260.js";const J={key:0},Q={class:"navbar"},oe=$({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(g){const i=g,n=E(),m=S(),l=h(!1),k=h("left"),u=s=>{s?(localStorage.setItem("PAOPAO_THEME","dark"),n.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),n.commit("triggerTheme","light"))},w=()=>{window.history.length<=1?m.push({path:"/"}):m.go(-1)},v=()=>{l.value=!0};return q(()=>{localStorage.getItem("PAOPAO_THEME")||u(A()==="dark")}),(s,d)=>{const y=B,b=R,O=V,r=I,p=j,M=x,T=H;return a(),f(G,null,[o(n).state.drawerModelShow?(a(),f("div",J,[e(O,{show:l.value,"onUpdate:show":d[0]||(d[0]=z=>l.value=z),width:212,placement:k.value,resizable:""},{default:t(()=>[e(b,null,{default:t(()=>[e(y)]),_:1})]),_:1},8,["show","placement"])])):c("",!0),e(T,{size:"small",bordered:!0,class:"nav-title-card"},{header:t(()=>[F("div",Q,[o(n).state.drawerModelShow&&!s.back?(a(),_(p,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(r,null,{default:t(()=>[e(o(C))]),_:1})]),_:1})):c("",!0),s.back?(a(),_(p,{key:1,class:"back-btn",onClick:w,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(r,null,{default:t(()=>[e(o(D))]),_:1})]),_:1})):c("",!0),L(" "+U(i.title)+" ",1),i.theme?(a(),_(M,{key:2,value:o(n).state.theme==="dark","onUpdate:value":u,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(r,{component:o(N)},null,8,["component"])]),"unchecked-icon":t(()=>[e(r,{component:o(P)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{oe as _};

@ -1 +1 @@
import{U as r}from"./naive-ui-62663ad7.js";import{d as c,o as s,c as n,a4 as p,a as o,V as t,F as l}from"./@vue-e0e89260.js";import{_ as i}from"./index-8b4e1776.js";const m={class:"user"},d={class:"content"},u=c({__name:"post-skeleton",props:{num:{default:1}},setup(f){return(_,k)=>{const e=r;return s(!0),n(l,null,p(new Array(_.num),a=>(s(),n("div",{class:"skeleton-item",key:a},[o("div",m,[t(e,{circle:"",size:"small"})]),o("div",d,[t(e,{text:"",repeat:3}),t(e,{text:"",style:{width:"60%"}})])]))),128)}}});const b=i(u,[["__scopeId","data-v-ab0015b4"]]);export{b as _}; import{U as r}from"./naive-ui-62663ad7.js";import{d as c,o as s,c as n,a4 as p,a as o,V as t,F as l}from"./@vue-e0e89260.js";import{_ as i}from"./index-d9d021c3.js";const m={class:"user"},d={class:"content"},u=c({__name:"post-skeleton",props:{num:{default:1}},setup(f){return(_,k)=>{const e=r;return s(!0),n(l,null,p(new Array(_.num),a=>(s(),n("div",{class:"skeleton-item",key:a},[o("div",m,[t(e,{circle:"",size:"small"})]),o("div",d,[t(e,{text:"",repeat:3}),t(e,{text:"",style:{width:"60%"}})])]))),128)}}});const b=i(u,[["__scopeId","data-v-ab0015b4"]]);export{b as _};

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0" />
<link rel="manifest" href="/manifest.json" /> <link rel="manifest" href="/manifest.json" />
<title></title> <title></title>
<script type="module" crossorigin src="/assets/index-8b4e1776.js"></script> <script type="module" crossorigin src="/assets/index-d9d021c3.js"></script>
<link rel="modulepreload" crossorigin href="/assets/@vue-e0e89260.js"> <link rel="modulepreload" crossorigin href="/assets/@vue-e0e89260.js">
<link rel="modulepreload" crossorigin href="/assets/vue-router-b8e3382f.js"> <link rel="modulepreload" crossorigin href="/assets/vue-router-b8e3382f.js">
<link rel="modulepreload" crossorigin href="/assets/vuex-473b3783.js"> <link rel="modulepreload" crossorigin href="/assets/vuex-473b3783.js">
@ -27,7 +27,7 @@
<link rel="modulepreload" crossorigin href="/assets/async-validator-dee29e8b.js"> <link rel="modulepreload" crossorigin href="/assets/async-validator-dee29e8b.js">
<link rel="modulepreload" crossorigin href="/assets/date-fns-975a2d8f.js"> <link rel="modulepreload" crossorigin href="/assets/date-fns-975a2d8f.js">
<link rel="modulepreload" crossorigin href="/assets/naive-ui-62663ad7.js"> <link rel="modulepreload" crossorigin href="/assets/naive-ui-62663ad7.js">
<link rel="modulepreload" crossorigin href="/assets/@vicons-d502290a.js"> <link rel="modulepreload" crossorigin href="/assets/@vicons-b553c29f.js">
<link rel="stylesheet" href="/assets/index-c5cff9e7.css"> <link rel="stylesheet" href="/assets/index-c5cff9e7.css">
<link rel="stylesheet" href="/assets/vfonts-7afd136d.css"> <link rel="stylesheet" href="/assets/vfonts-7afd136d.css">
</head> </head>

@ -143,6 +143,17 @@ export const stickPost = (
}); });
}; };
/** 设为亮点/取消亮点动态 */
export const highlightPost = (
data: NetParams.PostHighlightPost
): Promise<NetReq.PostHighlightPost> => {
return request({
method: "post",
url: "/v1/post/highlight",
data,
});
};
/** 置顶/取消置顶动态 */ /** 置顶/取消置顶动态 */
export const visibilityPost = ( export const visibilityPost = (
data: NetParams.PostVisibilityPost data: NetParams.PostVisibilityPost

@ -110,6 +110,21 @@
negative-text="取消" negative-text="取消"
@positive-click="execStickAction" @positive-click="execStickAction"
/> />
<!-- -->
<n-modal
v-model:show="showHighlightModal"
:mask-closable="false"
preset="dialog"
title="提示"
:content="
'' +
(post.is_essence ? '' : '') +
''
"
positive-text="确认"
negative-text="取消"
@positive-click="execHighlightAction"
/>
<!-- --> <!-- -->
<n-modal <n-modal
v-model:show="showVisibilityModal" v-model:show="showVisibilityModal"
@ -204,7 +219,9 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, computed } from 'vue'; import { h, ref, onMounted, computed } from 'vue';
import type { Component } from 'vue'
import { NIcon } from 'naive-ui'
import { useStore } from 'vuex'; import { useStore } from 'vuex';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { formatPrettyTime } from '@/utils/formatTime'; import { formatPrettyTime } from '@/utils/formatTime';
@ -216,6 +233,9 @@ import {
BookmarkOutline, BookmarkOutline,
ShareSocialOutline, ShareSocialOutline,
ChatboxOutline, ChatboxOutline,
EyeOutline,
FlameOutline,
Pencil as EditIcon,
} from '@vicons/ionicons5'; } from '@vicons/ionicons5';
import { MoreHorizFilled } from '@vicons/material'; import { MoreHorizFilled } from '@vicons/material';
import { import {
@ -226,6 +246,7 @@ import {
deletePost, deletePost,
lockPost, lockPost,
stickPost, stickPost,
highlightPost,
visibilityPost visibilityPost
} from '@/api/post'; } from '@/api/post';
import type { DropdownOption } from 'naive-ui'; import type { DropdownOption } from 'naive-ui';
@ -245,6 +266,7 @@ const props = withDefaults(
const showDelModal = ref(false); const showDelModal = ref(false);
const showLockModal = ref(false); const showLockModal = ref(false);
const showStickModal = ref(false); const showStickModal = ref(false);
const showHighlightModal = ref(false);
const showVisibilityModal = ref(false); const showVisibilityModal = ref(false);
const loading = ref(false); const loading = ref(false);
const tempVisibility = ref<VisibilityEnum>(VisibilityEnum.PUBLIC); const tempVisibility = ref<VisibilityEnum>(VisibilityEnum.PUBLIC);
@ -295,22 +317,33 @@ const post = computed({
}, },
}); });
const renderIcon = (icon: Component) => {
return () => {
return h(NIcon, null, {
default: () => h(icon)
})
}
}
const adminOptions = computed(() => { const adminOptions = computed(() => {
let options: DropdownOption[] = [ let options: DropdownOption[] = [
{ {
label: '', label: '',
key: 'delete', key: 'delete',
icon: renderIcon(EditIcon)
}, },
]; ];
if (post.value.is_lock === 0) { if (post.value.is_lock === 0) {
options.push({ options.push({
label: '', label: '',
key: 'lock', key: 'lock',
icon: renderIcon(EditIcon)
}); });
} else { } else {
options.push({ options.push({
label: '', label: '',
key: 'unlock', key: 'unlock',
icon: renderIcon(EditIcon)
}); });
} }
if (store.state.userInfo.is_admin) { if (store.state.userInfo.is_admin) {
@ -318,39 +351,57 @@ const adminOptions = computed(() => {
options.push({ options.push({
label: '', label: '',
key: 'stick', key: 'stick',
icon: renderIcon(EditIcon)
}); });
} else { } else {
options.push({ options.push({
label: '', label: '',
key: 'unstick', key: 'unstick',
icon: renderIcon(EditIcon)
}); });
} }
} }
if (post.value.is_essence === 0) {
options.push({
label: '',
key: 'highlight',
icon: renderIcon(FlameOutline)
});
} else {
options.push({
label: '',
key: 'unhighlight',
icon: renderIcon(FlameOutline)
});
}
if (post.value.visibility === VisibilityEnum.PUBLIC) { if (post.value.visibility === VisibilityEnum.PUBLIC) {
options.push({ options.push({
label: '', label: '',
key: 'vpublic', key: 'vpublic',
icon: renderIcon(EyeOutline),
children: [ children: [
{ label: '', key: 'vprivate' } { label: '', key: 'vprivate', icon: renderIcon(EditIcon)}
, { label: '', key: 'vfriend' } , { label: '', key: 'vfriend', icon: renderIcon(EditIcon) }
] ]
}) })
} else if (post.value.visibility === VisibilityEnum.PRIVATE) { } else if (post.value.visibility === VisibilityEnum.PRIVATE) {
options.push({ options.push({
label: '', label: '',
key: 'vprivate', key: 'vprivate',
icon: renderIcon(EyeOutline),
children: [ children: [
{ label: '', key: 'vpublic' } { label: '', key: 'vpublic', icon: renderIcon(EditIcon) }
, { label: '', key: 'vfriend' } , { label: '', key: 'vfriend', icon: renderIcon(EditIcon) }
] ]
}) })
} else { } else {
options.push({ options.push({
label: '', label: '',
key: 'vfriend', key: 'vfriend',
icon: renderIcon(EyeOutline),
children: [ children: [
{ label: '', key: 'vpublic' } { label: '', key: 'vpublic', icon: renderIcon(EditIcon) }
, { label: '', key: 'vprivate' } , { label: '', key: 'vprivate', icon: renderIcon(EditIcon) }
] ]
}) })
} }
@ -392,7 +443,7 @@ const doClickText = (e: MouseEvent, id: number) => {
goPostDetail(id); goPostDetail(id);
}; };
const handlePostAction = ( const handlePostAction = (
item: 'delete' | 'lock' | 'unlock' | 'stick' | 'unstick' | 'vpublic' | 'vprivate' | 'vfriend' item: 'delete' | 'lock' | 'unlock' | 'stick' | 'unstick' | 'highlight' | 'unhighlight' | 'vpublic' | 'vprivate' | 'vfriend'
) => { ) => {
switch (item) { switch (item) {
case 'delete': case 'delete':
@ -406,6 +457,10 @@ const handlePostAction = (
case 'unstick': case 'unstick':
showStickModal.value = true; showStickModal.value = true;
break; break;
case 'highlight':
case 'unhighlight':
showHighlightModal.value = true;
break;
case 'vpublic': case 'vpublic':
tempVisibility.value = 0; tempVisibility.value = 0;
showVisibilityModal.value = true; showVisibilityModal.value = true;
@ -470,6 +525,22 @@ const execStickAction = () => {
loading.value = false; loading.value = false;
}); });
}; };
const execHighlightAction = () => {
highlightPost({
id: post.value.id,
})
.then((res) => {
emit('reload');
if (res.highlight_status === 1) {
window.$message.success('');
} else {
window.$message.success('');
}
})
.catch((err) => {
loading.value = false;
});
};
const execVisibilityAction = () => { const execVisibilityAction = () => {
visibilityPost({ visibilityPost({
id: post.value.id, id: post.value.id,

@ -142,6 +142,10 @@ declare module NetParams {
id: number; id: number;
} }
interface PostHighlightPost {
id: number;
}
interface PostVisibilityPost { interface PostVisibilityPost {
id: number; id: number;
/** 可见性0为公开1为私密2为好友可见 */ /** 可见性0为公开1为私密2为好友可见 */

@ -118,6 +118,11 @@ declare module NetReq {
top_status: 0 | 1; top_status: 0 | 1;
} }
interface PostHighlightPost {
/** 置顶状态0为未亮点1为亮点 */
highlight_status: 0 | 1;
}
interface PostVisibilityPost { interface PostVisibilityPost {
/** 可见性0为公开1为私密2为好友可见 */ /** 可见性0为公开1为私密2为好友可见 */
visibility_status: import("@/utils/IEnum").VisibilityEnum; visibility_status: import("@/utils/IEnum").VisibilityEnum;

@ -23,6 +23,7 @@
<n-tabs class="profile-tabs-wrap" type="line" animated @update:value="changeTab"> <n-tabs class="profile-tabs-wrap" type="line" animated @update:value="changeTab">
<n-tab-pane name="post" tab="泡泡"> </n-tab-pane> <n-tab-pane name="post" tab="泡泡"> </n-tab-pane>
<n-tab-pane name="comment" tab="评论"> </n-tab-pane> <n-tab-pane name="comment" tab="评论"> </n-tab-pane>
<n-tab-pane name="highlight" tab="亮点"> </n-tab-pane>
<n-tab-pane name="media" tab="图文"> </n-tab-pane> <n-tab-pane name="media" tab="图文"> </n-tab-pane>
<n-tab-pane name="star" tab="喜欢"> </n-tab-pane> <n-tab-pane name="star" tab="喜欢"> </n-tab-pane>
</n-tabs> </n-tabs>
@ -69,9 +70,10 @@ const route = useRoute();
const loading = ref(false); const loading = ref(false);
const list = ref<Item.PostProps[]>([]); const list = ref<Item.PostProps[]>([]);
const pageType = ref<"post" | "comment" | "media" | "star">('post'); const pageType = ref<"post" | "comment" | "highlight" |"media" | "star">('post');
const postPage = ref(+(route.query.p as string) || 1); const postPage = ref(+(route.query.p as string) || 1);
const commentPage = ref(1) const commentPage = ref(1)
const highlightPage = ref(1)
const mediaPage = ref(1) const mediaPage = ref(1)
const starPage = ref(1); const starPage = ref(1);
const page = ref(+(route.query.p as string) || 1); const page = ref(+(route.query.p as string) || 1);
@ -86,6 +88,9 @@ const loadPage = () => {
case "comment": case "comment":
loadCommentPosts(); loadCommentPosts();
break; break;
case "highlight":
loadHighlightPosts();
break;
case "media": case "media":
loadMediaPosts(); loadMediaPosts();
break; break;
@ -132,6 +137,25 @@ const loadCommentPosts = () => {
loading.value = false; loading.value = false;
}); });
}; };
const loadHighlightPosts = () => {
loading.value = true;
getUserPosts({
username: store.state.userInfo.username,
style: "highlight",
page: page.value,
page_size: pageSize.value,
})
.then((rsp) => {
loading.value = false;
list.value = rsp.list || [];
totalPage.value = Math.ceil(rsp.pager.total_rows / pageSize.value);
window.scrollTo(0, 0);
})
.catch((err) => {
list.value = []
loading.value = false;
});
};
const loadMediaPosts = () => { const loadMediaPosts = () => {
loading.value = true; loading.value = true;
getUserPosts({ getUserPosts({
@ -170,7 +194,7 @@ const loadStarPosts = () => {
loading.value = false; loading.value = false;
}); });
}; };
const changeTab = (tab: "post" | "comment" | "media" | "star") => { const changeTab = (tab: "post" | "comment" | "highlight" | "media" | "star") => {
pageType.value = tab; pageType.value = tab;
switch(pageType.value) { switch(pageType.value) {
case "post": case "post":
@ -181,6 +205,10 @@ const changeTab = (tab: "post" | "comment" | "media" | "star") => {
page.value = commentPage.value page.value = commentPage.value
loadCommentPosts(); loadCommentPosts();
break; break;
case "highlight":
page.value = highlightPage.value
loadHighlightPosts();
break;
case "media": case "media":
page.value = mediaPage.value page.value = mediaPage.value
loadMediaPosts(); loadMediaPosts();
@ -202,6 +230,10 @@ const updatePage = (p: number) => {
commentPage.value = page.value commentPage.value = page.value
loadCommentPosts(); loadCommentPosts();
break; break;
case "highlight":
highlightPage.value = page.value
loadHighlightPosts();
break;
case "media": case "media":
mediaPage.value = page.value mediaPage.value = page.value
loadMediaPosts(); loadMediaPosts();

@ -49,6 +49,7 @@
<n-tabs class="profile-tabs-wrap" type="line" animated @update:value="changeTab"> <n-tabs class="profile-tabs-wrap" type="line" animated @update:value="changeTab">
<n-tab-pane name="post" tab="泡泡"> </n-tab-pane> <n-tab-pane name="post" tab="泡泡"> </n-tab-pane>
<n-tab-pane name="comment" tab="评论"> </n-tab-pane> <n-tab-pane name="comment" tab="评论"> </n-tab-pane>
<n-tab-pane name="highlight" tab="亮点"> </n-tab-pane>
<n-tab-pane name="media" tab="图文"> </n-tab-pane> <n-tab-pane name="media" tab="图文"> </n-tab-pane>
<n-tab-pane name="star" tab="喜欢"> </n-tab-pane> <n-tab-pane name="star" tab="喜欢"> </n-tab-pane>
</n-tabs> </n-tabs>
@ -111,9 +112,10 @@ const showAddFriendWhisper = ref(false);
const list = ref<Item.PostProps[]>([]); const list = ref<Item.PostProps[]>([]);
const username = ref(route.query.username || ''); const username = ref(route.query.username || '');
const page = ref(+(route.query.p as string) || 1); const page = ref(+(route.query.p as string) || 1);
const pageType = ref<"post" | "comment" | "media" | "star">('post'); const pageType = ref<"post" | "comment" | "highlight" | "media" | "star">('post');
const postPage = ref(+(route.query.p as string) || 1); const postPage = ref(+(route.query.p as string) || 1);
const commentPage = ref(1) const commentPage = ref(1)
const highlightPage = ref(1)
const mediaPage = ref(1) const mediaPage = ref(1)
const starPage = ref(1); const starPage = ref(1);
const pageSize = ref(20); const pageSize = ref(20);
@ -127,6 +129,9 @@ const loadPage = () => {
case "comment": case "comment":
loadCommentPosts(); loadCommentPosts();
break; break;
case "highlight":
loadHighlightPosts();
break;
case "media": case "media":
loadMediaPosts(); loadMediaPosts();
break; break;
@ -173,6 +178,25 @@ const loadCommentPosts = () => {
loading.value = false; loading.value = false;
}); });
}; };
const loadHighlightPosts = () => {
loading.value = true;
getUserPosts({
username: username.value as string,
style: "highlight",
page: page.value,
page_size: pageSize.value,
})
.then((rsp) => {
loading.value = false;
list.value = rsp.list || [];
totalPage.value = Math.ceil(rsp.pager.total_rows / pageSize.value);
window.scrollTo(0, 0);
})
.catch((err) => {
list.value = []
loading.value = false;
});
};
const loadMediaPosts = () => { const loadMediaPosts = () => {
loading.value = true; loading.value = true;
getUserPosts({ getUserPosts({
@ -211,7 +235,7 @@ const loadStarPosts = () => {
loading.value = false; loading.value = false;
}); });
}; };
const changeTab = (tab: "post" | "comment" | "media" | "star") => { const changeTab = (tab: "post" | "comment" | "highlight" | "media" | "star") => {
pageType.value = tab; pageType.value = tab;
switch(pageType.value) { switch(pageType.value) {
case "post": case "post":
@ -222,6 +246,10 @@ const changeTab = (tab: "post" | "comment" | "media" | "star") => {
page.value = commentPage.value page.value = commentPage.value
loadCommentPosts(); loadCommentPosts();
break; break;
case "highlight":
page.value = highlightPage.value
loadHighlightPosts();
break;
case "media": case "media":
page.value = mediaPage.value page.value = mediaPage.value
loadMediaPosts(); loadMediaPosts();
@ -264,6 +292,10 @@ const updatePage = (p: number) => {
commentPage.value = page.value commentPage.value = page.value
loadCommentPosts(); loadCommentPosts();
break; break;
case "highlight":
highlightPage.value = page.value
loadHighlightPosts();
break;
case "media": case "media":
mediaPage.value = page.value mediaPage.value = page.value
loadMediaPosts(); loadMediaPosts();

Loading…
Cancel
Save