mirror of https://github.com/rocboss/paopao-ce
commit
5d133a3757
@ -0,0 +1,27 @@
|
||||
// Copyright 2023 ROC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package migrate
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/rocboss/paopao-ce/cmd"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func init() {
|
||||
migrateCmd := &cobra.Command{
|
||||
Use: "migrate",
|
||||
Short: "migrate database data",
|
||||
Long: "miegrate database data when paopao-ce upgrade",
|
||||
Run: migrateRun,
|
||||
}
|
||||
cmd.Register(migrateCmd)
|
||||
}
|
||||
|
||||
func migrateRun(_cmd *cobra.Command, _args []string) {
|
||||
// TODO: add some logic for migrate cmd feature
|
||||
fmt.Println("sorry, this feature is not implemented yet.")
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// Copyright 2023 ROC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var (
|
||||
rootCmd = &cobra.Command{
|
||||
Use: "paopao",
|
||||
Short: `an artistic "twitter like" community`,
|
||||
Long: `an artistic "twitter like" community`,
|
||||
}
|
||||
)
|
||||
|
||||
// Setup set root command name,short-describe, long-describe
|
||||
// return &cobra.Command to custom other options
|
||||
func Setup(use, short, long string) *cobra.Command {
|
||||
rootCmd.Use = use
|
||||
rootCmd.Short = short
|
||||
rootCmd.Long = long
|
||||
return rootCmd
|
||||
}
|
||||
|
||||
// Register add sub-command
|
||||
func Register(cmd *cobra.Command) {
|
||||
rootCmd.AddCommand(cmd)
|
||||
}
|
||||
|
||||
// Execute start application
|
||||
func Execute() {
|
||||
rootCmd.Execute()
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
// Copyright 2023 ROC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package serve
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/alimy/cfg"
|
||||
"github.com/fatih/color"
|
||||
"github.com/getsentry/sentry-go"
|
||||
"github.com/rocboss/paopao-ce/cmd"
|
||||
"github.com/rocboss/paopao-ce/internal"
|
||||
"github.com/rocboss/paopao-ce/internal/conf"
|
||||
"github.com/rocboss/paopao-ce/internal/service"
|
||||
"github.com/rocboss/paopao-ce/pkg/debug"
|
||||
"github.com/rocboss/paopao-ce/pkg/utils"
|
||||
"github.com/rocboss/paopao-ce/pkg/version"
|
||||
"github.com/sourcegraph/conc"
|
||||
"github.com/spf13/cobra"
|
||||
"go.uber.org/automaxprocs/maxprocs"
|
||||
)
|
||||
|
||||
var (
|
||||
noDefaultFeatures bool
|
||||
features []string
|
||||
)
|
||||
|
||||
func init() {
|
||||
serveCmd := &cobra.Command{
|
||||
Use: "serve",
|
||||
Short: "start paopao-ce server",
|
||||
Long: "start paopao-ce server",
|
||||
Run: serveRun,
|
||||
}
|
||||
|
||||
serveCmd.Flags().BoolVar(&noDefaultFeatures, "no-default-features", false, "whether not use default features")
|
||||
serveCmd.Flags().StringSliceVarP(&features, "features", "f", []string{}, "use special features")
|
||||
|
||||
cmd.Register(serveCmd)
|
||||
}
|
||||
|
||||
func deferFn() {
|
||||
if cfg.If("Sentry") {
|
||||
// Flush buffered events before the program terminates.
|
||||
sentry.Flush(2 * time.Second)
|
||||
}
|
||||
}
|
||||
|
||||
func serveRun(_cmd *cobra.Command, _args []string) {
|
||||
utils.PrintHelloBanner(version.VersionInfo())
|
||||
|
||||
// set maxprocs automatic
|
||||
maxprocs.Set(maxprocs.Logger(log.Printf))
|
||||
|
||||
// initial configure
|
||||
conf.Initial(features, noDefaultFeatures)
|
||||
internal.Initial()
|
||||
ss := service.MustInitService()
|
||||
if len(ss) < 1 {
|
||||
fmt.Fprintln(color.Output, "no service need start so just exit")
|
||||
return
|
||||
}
|
||||
|
||||
// do defer function
|
||||
defer deferFn()
|
||||
|
||||
// start pyroscope if need
|
||||
debug.StartPyroscope()
|
||||
|
||||
// start services
|
||||
wg := conc.NewWaitGroup()
|
||||
fmt.Fprintf(color.Output, "\nstarting run service...\n\n")
|
||||
service.Start(wg)
|
||||
|
||||
// graceful stop services
|
||||
wg.Go(func() {
|
||||
quit := make(chan os.Signal, 1)
|
||||
// kill (no param) default send syscall.SIGTERM
|
||||
// kill -2 is syscall.SIGINT
|
||||
// kill -9 is syscall.SIGKILL but can't be catch, so don't need add it
|
||||
signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)
|
||||
<-quit
|
||||
fmt.Fprintf(color.Output, "\nshutting down server...\n\n")
|
||||
service.Stop()
|
||||
})
|
||||
wg.Wait()
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
// Copyright 2023 ROC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/rocboss/paopao-ce/pkg/utils"
|
||||
"github.com/rocboss/paopao-ce/pkg/version"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func init() {
|
||||
versionCmd := &cobra.Command{
|
||||
Use: "version",
|
||||
Short: "show version information",
|
||||
Long: "show version information",
|
||||
Run: versionRun,
|
||||
}
|
||||
Register(versionCmd)
|
||||
}
|
||||
|
||||
func versionRun(_cmd *cobra.Command, _args []string) {
|
||||
utils.PrintHelloBanner(version.VersionInfo())
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 |
|
||||
| ----- | ----- | ----- | ----- | ----- | ----- |
|
||||
| 010| 北野 | 2022-12-10 | 2022-12-10 | v0.0 | 提议 |
|
||||
|
||||
### 关于Sqlx功能项的设计
|
||||
---- 这里写简要介绍 ----
|
||||
|
||||
### 场景
|
||||
|
||||
---- 这里描述在什么使用场景下会需要本提按 ----
|
||||
|
||||
### 需求
|
||||
|
||||
TODO-TL;DR...
|
||||
|
||||
### 方案
|
||||
|
||||
TODO
|
||||
|
||||
### 疑问
|
||||
|
||||
1. 如何开启这个功能?
|
||||
|
||||
TODO
|
||||
|
||||
### 更新记录
|
||||
#### v0.0(2022-12-10) - 北野
|
||||
* 初始文档, 先占个位置
|
@ -0,0 +1,13 @@
|
||||
// Copyright 2023 ROC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package cs
|
||||
|
||||
import "errors"
|
||||
|
||||
// internal core error variable for data logic implement.
|
||||
var (
|
||||
ErrNotImplemented = errors.New("not implemented")
|
||||
ErrNoPermission = errors.New("no permission")
|
||||
)
|
@ -0,0 +1,87 @@
|
||||
// Copyright 2023 ROC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package dbr
|
||||
|
||||
import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
)
|
||||
|
||||
type Following struct {
|
||||
*Model
|
||||
User *User `json:"-" gorm:"foreignKey:ID;references:FollowId"`
|
||||
UserId int64 `json:"user_id"`
|
||||
FollowId int64 `json:"friend_id"`
|
||||
}
|
||||
|
||||
func (f *Following) GetFollowing(db *gorm.DB, userId, followId int64) (*Following, error) {
|
||||
var following Following
|
||||
err := db.Omit("User").Unscoped().Where("user_id = ? AND follow_id = ?", userId, followId).First(&following).Error
|
||||
if err != nil {
|
||||
logrus.Debugf("Following.GetFollowing get following error:%s", err)
|
||||
return nil, err
|
||||
}
|
||||
return &following, nil
|
||||
}
|
||||
|
||||
func (f *Following) DelFollowing(db *gorm.DB, userId, followId int64) error {
|
||||
return db.Omit("User").Unscoped().Where("user_id = ? AND follow_id = ?", userId, followId).Delete(f).Error
|
||||
}
|
||||
|
||||
func (f *Following) ListFollows(db *gorm.DB, userId int64, limit int, offset int) (res []*Following, total int64, err error) {
|
||||
db = db.Model(f).Where("user_id=?", userId)
|
||||
if err = db.Count(&total).Error; err != nil {
|
||||
return
|
||||
}
|
||||
if offset >= 0 && limit > 0 {
|
||||
db = db.Offset(offset).Limit(limit)
|
||||
}
|
||||
db.Joins("User").Order(clause.OrderByColumn{Column: clause.Column{Table: "User", Name: "nickname"}, Desc: false})
|
||||
if err = db.Find(&res).Error; err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (f *Following) ListFollowingIds(db *gorm.DB, userId int64, limit, offset int) (ids []int64, total int64, err error) {
|
||||
db = db.Model(f).Where("follow_id=?", userId)
|
||||
if err = db.Count(&total).Error; err != nil {
|
||||
return
|
||||
}
|
||||
if offset >= 0 && limit > 0 {
|
||||
db = db.Offset(offset).Limit(limit)
|
||||
}
|
||||
if err = db.Omit("User").Select("user_id").Find(&ids).Error; err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (f *Following) FollowCount(db *gorm.DB, userId int64) (follows int64, followings int64, err error) {
|
||||
if err = db.Model(f).Where("user_id=?", userId).Count(&follows).Error; err != nil {
|
||||
return
|
||||
}
|
||||
if err = db.Model(f).Where("follow_id=?", userId).Count(&followings).Error; err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (s *Following) IsFollow(db *gorm.DB, userId int64, followId int64) bool {
|
||||
if _, err := s.GetFollowing(db, userId, followId); err == nil {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (f *Following) Create(db *gorm.DB) (*Following, error) {
|
||||
err := db.Omit("User").Create(f).Error
|
||||
return f, err
|
||||
}
|
||||
|
||||
func (c *Following) UpdateInUnscoped(db *gorm.DB) error {
|
||||
return db.Unscoped().Omit("User").Save(c).Error
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
// Copyright 2023 ROC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package jinzhu
|
||||
|
||||
import (
|
||||
"github.com/rocboss/paopao-ce/internal/core"
|
||||
"github.com/rocboss/paopao-ce/internal/core/ms"
|
||||
"github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
|
||||
"github.com/sirupsen/logrus"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
var (
|
||||
_ core.FollowingManageService = (*followingManageSrv)(nil)
|
||||
)
|
||||
|
||||
type followingManageSrv struct {
|
||||
db *gorm.DB
|
||||
f *dbr.Following
|
||||
u *dbr.User
|
||||
}
|
||||
|
||||
func newFollowingManageService(db *gorm.DB) core.FollowingManageService {
|
||||
return &followingManageSrv{
|
||||
db: db,
|
||||
f: &dbr.Following{},
|
||||
u: &dbr.User{},
|
||||
}
|
||||
}
|
||||
|
||||
func (s *followingManageSrv) FollowUser(userId int64, followId int64) error {
|
||||
if _, err := s.f.GetFollowing(s.db, userId, followId); err != nil {
|
||||
following := &dbr.Following{
|
||||
UserId: userId,
|
||||
FollowId: followId,
|
||||
}
|
||||
if _, err = following.Create(s.db); err != nil {
|
||||
logrus.Errorf("contactManageSrv.fetchOrNewContact create new contact err:%s", err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *followingManageSrv) UnfollowUser(userId int64, followId int64) error {
|
||||
return s.f.DelFollowing(s.db, userId, followId)
|
||||
}
|
||||
|
||||
func (s *followingManageSrv) ListFollows(userId int64, limit, offset int) (*ms.ContactList, error) {
|
||||
follows, totoal, err := s.f.ListFollows(s.db, userId, limit, offset)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
res := &ms.ContactList{
|
||||
Total: totoal,
|
||||
}
|
||||
for _, f := range follows {
|
||||
res.Contacts = append(res.Contacts, ms.ContactItem{
|
||||
UserId: f.User.ID,
|
||||
Username: f.User.Username,
|
||||
Nickname: f.User.Nickname,
|
||||
Avatar: f.User.Avatar,
|
||||
IsFollow: true,
|
||||
})
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func (s *followingManageSrv) ListFollowings(userId int64, limit, offset int) (*ms.ContactList, error) {
|
||||
followingIds, totoal, err := s.f.ListFollowingIds(s.db, userId, limit, offset)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
followings, err := s.u.ListUserInfoById(s.db, followingIds)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
res := &ms.ContactList{
|
||||
Total: totoal,
|
||||
}
|
||||
for _, user := range followings {
|
||||
res.Contacts = append(res.Contacts, ms.ContactItem{
|
||||
UserId: user.ID,
|
||||
Username: user.Username,
|
||||
Nickname: user.Nickname,
|
||||
Avatar: user.Avatar,
|
||||
IsFollow: s.IsFollow(userId, user.ID),
|
||||
})
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func (s *followingManageSrv) GetFollowCount(userId int64) (int64, int64, error) {
|
||||
return s.f.FollowCount(s.db, userId)
|
||||
}
|
||||
|
||||
func (s *followingManageSrv) IsFollow(userId int64, followId int64) bool {
|
||||
if _, err := s.f.GetFollowing(s.db, userId, followId); err == nil {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
// Copyright 2023 ROC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Package joint provider some common base type or logic for model define.
|
||||
|
||||
package joint
|
||||
|
||||
type BasePageInfo struct {
|
||||
Page int `form:"-" binding:"-"`
|
||||
PageSize int `form:"-" binding:"-"`
|
||||
}
|
||||
|
||||
func (r *BasePageInfo) SetPageInfo(page int, pageSize int) {
|
||||
r.Page, r.PageSize = page, pageSize
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
ALTER TABLE `p_post_content` MODIFY COLUMN `content` varchar(65535) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '内容';
|
||||
ALTER TABLE `p_comment_content` MODIFY COLUMN `content` varchar(65535) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '内容';
|
||||
ALTER TABLE `p_comment_reply` MODIFY COLUMN `content` varchar(65535) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '内容';
|
||||
ALTER TABLE `p_post_content` MODIFY COLUMN `content` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '内容';
|
||||
ALTER TABLE `p_comment_content` MODIFY COLUMN `content` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '内容';
|
||||
ALTER TABLE `p_comment_reply` MODIFY COLUMN `content` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '内容';
|
||||
|
@ -0,0 +1,5 @@
|
||||
DROP VIEW IF EXISTS p_post_by_media;
|
||||
DROP VIEW IF EXISTS p_post_by_comment;
|
||||
|
||||
|
||||
|
@ -0,0 +1,32 @@
|
||||
CREATE VIEW p_post_by_media AS
|
||||
SELECT post.*
|
||||
FROM
|
||||
( SELECT DISTINCT post_id FROM p_post_content WHERE ( TYPE = 3 OR TYPE = 4 OR TYPE = 7 OR TYPE = 8 ) AND is_del = 0 ) media
|
||||
JOIN p_post post ON media.post_id = post.ID
|
||||
WHERE
|
||||
post.is_del = 0;
|
||||
|
||||
CREATE VIEW p_post_by_comment AS
|
||||
SELECT P.*, C.user_id comment_user_id
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
post_id,
|
||||
user_id
|
||||
FROM
|
||||
p_comment
|
||||
WHERE
|
||||
is_del = 0 UNION
|
||||
SELECT
|
||||
post_id,
|
||||
reply.user_id user_id
|
||||
FROM
|
||||
p_comment_reply reply
|
||||
JOIN p_comment COMMENT ON reply.comment_id = COMMENT.ID
|
||||
WHERE
|
||||
reply.is_del = 0
|
||||
AND COMMENT.is_del = 0
|
||||
)
|
||||
C JOIN p_post P ON C.post_id = P.ID
|
||||
WHERE
|
||||
P.is_del = 0;
|
@ -0,0 +1 @@
|
||||
DROP TABLE IF EXISTS `p_following`;
|
@ -0,0 +1,11 @@
|
||||
CREATE TABLE `p_following` (
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
||||
`user_id` bigint unsigned NOT NULL,
|
||||
`follow_id` bigint unsigned NOT NULL,
|
||||
`is_del` tinyint NOT NULL DEFAULT 0, -- 是否删除, 0否, 1是
|
||||
`created_on` bigint unsigned NOT NULL DEFAULT '0',
|
||||
`modified_on` bigint unsigned NOT NULL DEFAULT '0',
|
||||
`deleted_on` bigint unsigned NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_following_user_follow` (`user_id`,`follow_id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
@ -0,0 +1,5 @@
|
||||
DROP VIEW IF EXISTS p_post_by_media;
|
||||
DROP VIEW IF EXISTS p_post_by_comment;
|
||||
|
||||
|
||||
|
@ -0,0 +1,32 @@
|
||||
CREATE VIEW p_post_by_media AS
|
||||
SELECT post.*
|
||||
FROM
|
||||
( SELECT DISTINCT post_id FROM p_post_content WHERE ( TYPE = 3 OR TYPE = 4 OR TYPE = 7 OR TYPE = 8 ) AND is_del = 0 ) media
|
||||
JOIN p_post post ON media.post_id = post.ID
|
||||
WHERE
|
||||
post.is_del = 0;
|
||||
|
||||
CREATE VIEW p_post_by_comment AS
|
||||
SELECT P.*, C.user_id comment_user_id
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
post_id,
|
||||
user_id
|
||||
FROM
|
||||
p_comment
|
||||
WHERE
|
||||
is_del = 0 UNION
|
||||
SELECT
|
||||
post_id,
|
||||
reply.user_id user_id
|
||||
FROM
|
||||
p_comment_reply reply
|
||||
JOIN p_comment COMMENT ON reply.comment_id = COMMENT.ID
|
||||
WHERE
|
||||
reply.is_del = 0
|
||||
AND COMMENT.is_del = 0
|
||||
)
|
||||
C JOIN p_post P ON C.post_id = P.ID
|
||||
WHERE
|
||||
P.is_del = 0;
|
@ -0,0 +1 @@
|
||||
DROP TABLE IF EXISTS p_following;
|
@ -0,0 +1,10 @@
|
||||
CREATE TABLE p_following (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
user_id BIGINT NOT NULL,
|
||||
follow_id BIGINT NOT NULL,
|
||||
is_del SMALLINT NOT NULL DEFAULT 0, -- 是否删除, 0否, 1是
|
||||
created_on BIGINT NOT NULL DEFAULT 0,
|
||||
modified_on BIGINT NOT NULL DEFAULT 0,
|
||||
deleted_on BIGINT NOT NULL DEFAULT 0
|
||||
);
|
||||
CREATE INDEX idx_following_user_follow ON p_following USING btree (user_id, follow_id);
|
@ -0,0 +1,5 @@
|
||||
DROP VIEW IF EXISTS p_post_by_media;
|
||||
DROP VIEW IF EXISTS p_post_by_comment;
|
||||
|
||||
|
||||
|
@ -0,0 +1,32 @@
|
||||
CREATE VIEW p_post_by_media AS
|
||||
SELECT post.*
|
||||
FROM
|
||||
( SELECT DISTINCT post_id FROM p_post_content WHERE ( TYPE = 3 OR TYPE = 4 OR TYPE = 7 OR TYPE = 8 ) AND is_del = 0 ) media
|
||||
JOIN p_post post ON media.post_id = post.ID
|
||||
WHERE
|
||||
post.is_del = 0;
|
||||
|
||||
CREATE VIEW p_post_by_comment AS
|
||||
SELECT P.*, C.user_id comment_user_id
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
post_id,
|
||||
user_id
|
||||
FROM
|
||||
p_comment
|
||||
WHERE
|
||||
is_del = 0 UNION
|
||||
SELECT
|
||||
post_id,
|
||||
reply.user_id user_id
|
||||
FROM
|
||||
p_comment_reply reply
|
||||
JOIN p_comment COMMENT ON reply.comment_id = COMMENT.ID
|
||||
WHERE
|
||||
reply.is_del = 0
|
||||
AND COMMENT.is_del = 0
|
||||
)
|
||||
C JOIN p_post P ON C.post_id = P.ID
|
||||
WHERE
|
||||
P.is_del = 0;
|
@ -0,0 +1 @@
|
||||
DROP TABLE IF EXISTS "p_following";
|
@ -0,0 +1,15 @@
|
||||
CREATE TABLE "p_following" (
|
||||
"id" integer NOT NULL,
|
||||
"user_id" integer NOT NULL,
|
||||
"follow_id" integer NOT NULL,
|
||||
"is_del" integer NOT NULL,
|
||||
"created_on" integer NOT NULL,
|
||||
"modified_on" integer NOT NULL,
|
||||
"deleted_on" integer NOT NULL,
|
||||
PRIMARY KEY ("id")
|
||||
);
|
||||
CREATE INDEX "idx_following_user_follow"
|
||||
ON "p_following" (
|
||||
"user_id" ASC,
|
||||
"follow_id" ASC
|
||||
);
|
@ -1 +1 @@
|
||||
import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-18d4a8d3.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-08d8af97.js";import"./vuex-473b3783.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./@vicons-6332ad63.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-32d416c3.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-152c5794.js";import"./vuex-473b3783.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./@vicons-0524c43e.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-41befd31.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-18d4a8d3.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-08d8af97.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./@vicons-6332ad63.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-d2e839d6.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-32d416c3.js";import{u as V}from"./vuex-473b3783.js";import{b as z}from"./vue-router-b8e3382f.js";import{a as A}from"./formatTime-4210fcd1.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-152c5794.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./@vicons-0524c43e.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 N,a as P}from"./post-item.vue_vue_type_style_index_0_lang-25504051.js";import{_ as S}from"./post-skeleton-d2e839d6.js";import{_ as V}from"./main-nav.vue_vue_type_style_index_0_lang-32d416c3.js";import{u as $}from"./vuex-473b3783.js";import{b as I}from"./vue-router-b8e3382f.js";import{N as R,_ as j}from"./index-152c5794.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 L,H as O}from"./naive-ui-62663ad7.js";import"./content-ff44e340.js";import"./@vicons-0524c43e.js";import"./paopao-video-player-aa5e8b3f.js";import"./formatTime-4210fcd1.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=q({__name:"Collection",setup(W){const m=$(),y=I(),_=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=V,b=S,x=L,z=N,d=O,B=P,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",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=j(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-3baf8ba8.js";import{_ as V}from"./post-skeleton-41befd31.js";import{_ as $}from"./main-nav.vue_vue_type_style_index_0_lang-18d4a8d3.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-08d8af97.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-91ba374b.js";import"./@vicons-6332ad63.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{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-08d8af97.js";import{_ as G}from"./post-skeleton-41befd31.js";import{_ as H}from"./main-nav.vue_vue_type_style_index_0_lang-18d4a8d3.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-6332ad63.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};
|
@ -0,0 +1 @@
|
||||
.contact-item[data-v-0f1bf4ae]{display:flex;width:100%;padding:12px 16px}.contact-item[data-v-0f1bf4ae]:hover{background:#f7f9f9;cursor:pointer}.contact-item .avatar[data-v-0f1bf4ae]{width:55px}.contact-item .base-info[data-v-0f1bf4ae]{position:relative;width:calc(100% - 55px)}.contact-item .base-info .username[data-v-0f1bf4ae]{line-height:16px;font-size:16px}.contact-item .base-info .uid[data-v-0f1bf4ae]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.dark .contact-item[data-v-0f1bf4ae]{background-color:#101014bf}.dark .contact-item[data-v-0f1bf4ae]:hover{background:#18181c}.pagination-wrap[data-v-3b2bf978]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-3b2bf978],.dark .empty-wrap[data-v-3b2bf978],.dark .skeleton-wrap[data-v-3b2bf978]{background-color:#101014bf}
|
@ -1 +0,0 @@
|
||||
.contact-item[data-v-08ee9b2e]{display:flex;width:100%;padding:12px 16px}.contact-item[data-v-08ee9b2e]:hover{background:#f7f9f9;cursor:pointer}.contact-item .avatar[data-v-08ee9b2e]{width:55px}.contact-item .base-info[data-v-08ee9b2e]{position:relative;width:calc(100% - 55px)}.contact-item .base-info .username[data-v-08ee9b2e]{line-height:16px;font-size:16px}.contact-item .base-info .uid[data-v-08ee9b2e]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.dark .contact-item[data-v-08ee9b2e]{background-color:#101014bf}.dark .contact-item[data-v-08ee9b2e]:hover{background:#18181c}.pagination-wrap[data-v-3b2bf978]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-3b2bf978],.dark .empty-wrap[data-v-3b2bf978],.dark .skeleton-wrap[data-v-3b2bf978]{background-color:#101014bf}
|
@ -0,0 +1 @@
|
||||
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 Q,I as T,H as j}from"./naive-ui-62663ad7.js";import{_ as b,Q as E}from"./index-152c5794.js";import{_ as G}from"./post-skeleton-d2e839d6.js";import{_ as H}from"./main-nav.vue_vue_type_style_index_0_lang-32d416c3.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-0524c43e.js";/* empty css */const O={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:{s: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",O,[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-0f1bf4ae"]]),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=Q;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};
|
@ -0,0 +1 @@
|
||||
import{u as j,b as E}from"./vue-router-b8e3382f.js";import{d as q,o as s,c as l,a as _,V as o,M as h,r as c,j as G,_ as F,a1 as y,O as $,F as U,a4 as H,Q as L}from"./@vue-e0e89260.js";import{o as O,F as Q,G as A,f as J,g as K,I as W,H as X}from"./naive-ui-62663ad7.js";import{_ as z,R as Y,S as Z}from"./index-152c5794.js";import{_ as ee}from"./post-skeleton-d2e839d6.js";import{_ as oe}from"./main-nav.vue_vue_type_style_index_0_lang-32d416c3.js";import{u as te}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-0524c43e.js";/* empty css */const ne={class:"avatar"},ae={class:"base-info"},se={class:"username"},le={class:"uid"},_e=q({__name:"follow-item",props:{contact:{}},setup(I){const v=j(),u=e=>{v.push({name:"user",query:{s:e}})};return(e,t)=>{const g=O;return s(),l("div",{class:"follow-item",onClick:t[0]||(t[0]=f=>u(e.contact.username))},[_("div",ne,[o(g,{size:"large",src:e.contact.avatar},null,8,["src"])]),_("div",ae,[_("div",se,[_("strong",null,h(e.contact.nickname),1),_("span",null," @"+h(e.contact.username),1)]),_("div",le,"UID. "+h(e.contact.user_id),1)])])}}});const ue=z(_e,[["__scopeId","data-v-6e07cba3"]]),ce={key:0,class:"skeleton-wrap"},ie={key:1},re={key:0,class:"empty-wrap"},pe={key:0,class:"pagination-wrap"},me=q({__name:"Following",setup(I){const v=te(),u=E(),e=c(!1),t=c([]),g=u.query.n||"粉丝详情",f=u.query.s||"",r=c(u.query.t||"follows"),p=c(+u.query.p||1),i=c(20),m=c(0),T=a=>{p.value=a,w()},B=a=>{r.value=a,w()},w=()=>{r.value==="follows"?C(f):r.value==="followings"&&M(f)},C=(a,d=!1)=>{t.value.length===0&&(e.value=!0),Y({username:a,page:p.value,page_size:i.value}).then(n=>{e.value=!1,t.value=n.list||[],m.value=Math.ceil(n.pager.total_rows/i.value),d&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(n=>{e.value=!1})},M=(a,d=!1)=>{t.value.length===0&&(e.value=!0),Z({username:a,page:p.value,page_size:i.value}).then(n=>{e.value=!1,t.value=n.list||[],m.value=Math.ceil(n.pager.total_rows/i.value),d&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(n=>{e.value=!1})};return G(()=>{w()}),(a,d)=>{const n=oe,k=J,P=K,R=ee,S=W,V=ue,N=X,x=Q,D=A;return s(),l(U,null,[_("div",null,[o(n,{title:F(g),back:!0},null,8,["title"]),o(x,{class:"main-content-wrap",bordered:""},{default:y(()=>[o(P,{type:"line",animated:"","default-value":r.value,"onUpdate:value":B},{default:y(()=>[o(k,{name:"follows",tab:"正在关注"}),o(k,{name:"followings",tab:"我的粉丝"})]),_:1},8,["default-value"]),e.value?(s(),l("div",ce,[o(R,{num:i.value},null,8,["num"])])):(s(),l("div",ie,[t.value.length===0?(s(),l("div",re,[o(S,{size:"large",description:"暂无数据"})])):$("",!0),(s(!0),l(U,null,H(t.value,b=>(s(),L(N,{key:b.user_id},{default:y(()=>[o(V,{contact:b},null,8,["contact"])]),_:2},1024))),128))]))]),_:1})]),m.value>0?(s(),l("div",pe,[o(D,{page:p.value,"onUpdate:page":T,"page-slot":F(v).state.collapsedRight?5:8,"page-count":m.value},null,8,["page","page-slot","page-count"])])):$("",!0)],64)}}});const Ne=z(me,[["__scopeId","data-v-1f0f223d"]]);export{Ne as default};
|
@ -0,0 +1 @@
|
||||
.follow-item[data-v-6e07cba3]{display:flex;width:100%;padding:12px 16px}.follow-item[data-v-6e07cba3]:hover{background:#f7f9f9;cursor:pointer}.follow-item .avatar[data-v-6e07cba3]{width:55px}.follow-item .base-info[data-v-6e07cba3]{position:relative;width:calc(100% - 55px)}.follow-item .base-info .username[data-v-6e07cba3]{line-height:16px;font-size:16px}.follow-item .base-info .uid[data-v-6e07cba3]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.dark .follow-item[data-v-6e07cba3]{background-color:#101014bf}.dark .follow-item[data-v-6e07cba3]:hover{background:#18181c}.main-content-wrap[data-v-1f0f223d]{padding:20px}.pagination-wrap[data-v-1f0f223d]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-1f0f223d],.dark .empty-wrap[data-v-1f0f223d],.dark .skeleton-wrap[data-v-1f0f223d]{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
@ -0,0 +1 @@
|
||||
.message-item[data-v-07fc447f]{padding:16px}.message-item.unread[data-v-07fc447f]{background:#fcfffc}.message-item .sender-wrap[data-v-07fc447f]{display:flex;align-items:center}.message-item .sender-wrap .username[data-v-07fc447f]{opacity:.75;font-size:14px}.message-item .timestamp[data-v-07fc447f]{opacity:.75;font-size:12px;display:flex;align-items:center}.message-item .timestamp .timestamp-txt[data-v-07fc447f]{margin-left:6px}.message-item .brief-wrap[data-v-07fc447f]{margin-top:10px}.message-item .brief-wrap .brief-content[data-v-07fc447f],.message-item .brief-wrap .whisper-content-wrap[data-v-07fc447f],.message-item .brief-wrap .requesting-friend-wrap[data-v-07fc447f]{display:flex;width:100%}.message-item .view-link[data-v-07fc447f]{margin-left:8px;display:flex;align-items:center}.message-item .status-info[data-v-07fc447f]{margin-left:8px;align-items:center}.dark .message-item[data-v-07fc447f]{background-color:#101014bf}.dark .message-item.unread[data-v-07fc447f]{background:#0f180b}.dark .message-item .brief-wrap[data-v-07fc447f]{background-color:#18181c}.skeleton-item[data-v-01d2e871]{padding:12px;display:flex}.skeleton-item .content[data-v-01d2e871]{width:100%}.dark .skeleton-item[data-v-01d2e871]{background-color:#101014bf}.pagination-wrap[data-v-4e7b1342]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .empty-wrap[data-v-4e7b1342],.dark .messages-wrap[data-v-4e7b1342],.dark .pagination-wrap[data-v-4e7b1342]{background-color:#101014bf}
|
@ -1 +0,0 @@
|
||||
.message-item[data-v-4a0e27fa]{padding:16px}.message-item.unread[data-v-4a0e27fa]{background:#fcfffc}.message-item .sender-wrap[data-v-4a0e27fa]{display:flex;align-items:center}.message-item .sender-wrap .username[data-v-4a0e27fa]{opacity:.75;font-size:14px}.message-item .timestamp[data-v-4a0e27fa]{opacity:.75;font-size:12px;display:flex;align-items:center}.message-item .timestamp .timestamp-txt[data-v-4a0e27fa]{margin-left:6px}.message-item .brief-wrap[data-v-4a0e27fa]{margin-top:10px}.message-item .brief-wrap .brief-content[data-v-4a0e27fa],.message-item .brief-wrap .whisper-content-wrap[data-v-4a0e27fa],.message-item .brief-wrap .requesting-friend-wrap[data-v-4a0e27fa]{display:flex;width:100%}.message-item .view-link[data-v-4a0e27fa]{margin-left:8px;display:flex;align-items:center}.message-item .status-info[data-v-4a0e27fa]{margin-left:8px;align-items:center}.dark .message-item[data-v-4a0e27fa]{background-color:#101014bf}.dark .message-item.unread[data-v-4a0e27fa]{background:#0f180b}.dark .message-item .brief-wrap[data-v-4a0e27fa]{background-color:#18181c}.skeleton-item[data-v-01d2e871]{padding:12px;display:flex}.skeleton-item .content[data-v-01d2e871]{width:100%}.dark .skeleton-item[data-v-01d2e871]{background-color:#101014bf}.pagination-wrap[data-v-4e7b1342]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .empty-wrap[data-v-4e7b1342],.dark .messages-wrap[data-v-4e7b1342],.dark .pagination-wrap[data-v-4e7b1342]{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
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-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}
|
@ -0,0 +1 @@
|
||||
.profile-baseinfo[data-v-79a284ce]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-79a284ce]{width:72px}.profile-baseinfo .base-info[data-v-79a284ce]{position:relative;margin-left:12px;width:calc(100% - 84px)}.profile-baseinfo .base-info .username[data-v-79a284ce]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .userinfo[data-v-79a284ce]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .userinfo .info-item[data-v-79a284ce]{margin-right:12px}.profile-baseinfo .base-info .top-tag[data-v-79a284ce]{transform:scale(.75)}.profile-tabs-wrap[data-v-79a284ce]{padding:0 16px}.pagination-wrap[data-v-79a284ce]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .profile-wrap[data-v-79a284ce],.dark .pagination-wrap[data-v-79a284ce]{background-color:#101014bf}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue