🔥An artistic "twitter like" community built on gin+zinc+vue+ts 清新文艺微社区
MIT License
Bot releases are visible (Hide)
备注:发布版本中,使用如下命令构建paopao-ce: (go version go1.23.0 darwin/amd64)
./build-release.sh && ./build-image.sh
发布的二进制文件中只测试了paopao-ce-darwin_amd64,其余平台的未亲测,如有问题,请使用源码在自己平台下自行构建。
您可以使用如下命令启动一个测试实例尝鲜:
docker compose up -d
# visit http://localhost:8008 👀 paopao-ce
# visit http://localhost:8001 👀 RedisInsight
# visit http://localhost:7700 👀 Melisearch
使用All-In-One方式启动实例:
# 或者使用官方Image运行
docker run --name paopao-ce-allinone -d -p 8000:8008 -p 7700:7700 -v ./data/custom:/app/custom -v ./data/meili_data:/app/meili_data bitbus/paopao-ce:all-in-one-0.6-alpha
# 或者使用官方Image运行 + 自定义config.yaml
docker run --name paopao-ce-allinone -d -p 8000:8008 -p 7700:7700 -v ./config.yaml:/app/config.yaml -v ./data/custom:/app/custom -v ./data/meili_data:/app/meili_data bitbus/paopao-ce:all-in-one-0.6-alpha
注意在
config.yaml
中Meili.ApiKey
的值必须与容器中meili启动时设定的MEILI_MASTER_KEY
环境变量值相同,默认为paopao-meilisearch
. 可以在docker启动容器时通过-e MEILI_MASTER_KEY=<custom-key>
设置该值。
Published by alimy 8 months ago
备注:发布版本中,使用如下命令构建paopao-ce: (go version go1.22.0 darwin/amd64)
./build-release.sh && ./build-image.sh
发布的二进制文件中只测试了paopao-ce-darwin_amd64,其余平台的未亲测,如有问题,请使用源码在自己平台下自行构建。
您可以使用如下命令启动一个测试实例尝鲜:
docker compose up -d
# visit http://localhost:8008 👀 paopao-ce
# visit http://localhost:8001 👀 RedisInsight
# visit http://localhost:7700 👀 Melisearch
使用All-In-One方式启动实例:
# 或者使用官方Image运行
docker run --name paopao-ce-allinone -d -p 8000:8008 -p 7700:7700 -v ./data/custom:/app/custom -v ./data/meili_data:/app/meili_data bitbus/paopao-ce:all-in-one-0.6-alpha
# 或者使用官方Image运行 + 自定义config.yaml
docker run --name paopao-ce-allinone -d -p 8000:8008 -p 7700:7700 -v ./config.yaml:/app/config.yaml -v ./data/custom:/app/custom -v ./data/meili_data:/app/meili_data bitbus/paopao-ce:all-in-one-0.6-alpha
注意在
config.yaml
中Meili.ApiKey
的值必须与容器中meili启动时设定的MEILI_MASTER_KEY
环境变量值相同,默认为paopao-meilisearch
. 可以在docker启动容器时通过-e MEILI_MASTER_KEY=<custom-key>
设置该值。
Published by alimy 12 months ago
备注:发布版本中,使用如下命令构建paopao-ce: (go version go1.21.3 darwin/amd64)
./build-release.sh && ./build-image.sh
发布的二进制文件中只测试了paopao-ce-darwin_amd64,其余平台的未亲测,如有问题,请使用源码在自己平台下自行构建。
您可以使用如下命令启动一个测试实例尝鲜:
docker compose up -d
# visit http://localhost:8008 👀 paopao-ce
# visit http://localhost:8001 👀 RedisInsight
# visit http://localhost:7700 👀 Meilisearch
Published by alimy about 1 year ago
备注:发布版本中,使用如下命令构建paopao-ce: (go version go1.21.2 darwin/amd64)
./build-release.sh && ./build-image.sh
发布的二进制文件中只测试了paopao-ce-darwin_amd64,其余平台的未亲测,如有问题,请使用源码在自己平台下自行构建。
您可以使用如下命令启动一个测试实例尝鲜:
docker compose up -d
# visit http://localhost:8008 👀 paopao-ce
# visit http://localhost:8001 👀 RedisInsight
# visit http://localhost:7700 👀 Meilisearch
Published by alimy about 1 year ago
LoggerOpenObserve
feature use OpenObserve to collect log.#370LoggerOpenObserve
to conf.yaml
's Features
section to enable this feature like below:
# file config.yaml
...
Features:
Default: ["Base", "Postgres", "Meili", "LocalOSS", "LoggerOpenObserve", "BigCacheIndex", "web"]
LoggerOpenObserve: # 使用OpenObserve写日志
Host: 127.0.0.1:5080
Organization: paopao-ce
Stream: default
User: [email protected]
Password: tiFEI8UeJWuYA7kN
Secure: False
MinWorker: 5 # 最小后台工作者, 设置范围[5, 100], 默认5
MaxLogBuffer: 100 # 最大log缓存条数, 设置范围[10, 10000], 默认100
...
Friendship
feature support. To custom setup Friendship
use below configure in web/.env
or web/.env.local
# 功能特性开启
VITE_USE_FRIENDSHIP=true
# 模块开启
VITE_ENABLE_FRIENDS_BAR=true
scripts/migration/**/*_home_timeline.up.sql
):
CREATE TABLE `p_post_metric` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`post_id` bigint unsigned NOT NULL,
`rank_score` bigint unsigned NOT NULL DEFAULT 0,
`incentive_score` int unsigned NOT NULL DEFAULT 0,
`decay_factor` int unsigned NOT NULL DEFAULT 0,
`motivation_factor` int unsigned NOT NULL DEFAULT 0,
`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_post_metric_post_id_rank_score` (`post_id`,`rank_score`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
INSERT INTO p_post_metric (post_id, rank_score, created_on)
SELECT id AS post_id,
comment_count + upvote_count*2 + collection_count*4 AS rank_score,
created_on
FROM p_post
WHERE is_del=0;
-- 原来的可见性: 0公开 1私密 2好友可见 3关注可见
-- 现在的可见性: 0私密 10充电可见 20订阅可见 30保留 40保留 50好友可见 60关注可见 70保留 80保留 90公开
UPDATE p_post a, p_post b
SET a.visibility = (
CASE b.visibility
WHEN 0 THEN 90
WHEN 1 THEN 0
WHEN 2 THEN 50
WHEN 3 THEN 60
ELSE 0
END
)
WHERE a.ID = b.ID;
scripts/migration/**/*_comment_esence.up.sql
):
ALTER TABLE `p_comment` ADD COLUMN `is_essence` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '是否精选';
Metrics
to conf.yaml
's Features
section to enable this feature like below:
# file config.yaml
...
Features:
Default: ["Base", "Postgres", "Meili", "LocalOSS", "Metrics", "web"]
JobManager: # Cron Job理器的配置参数
MaxOnlineInterval: "@every 5m" # 更新最大在线人数,默认每5分钟更新一次
UpdateMetricsInterval: "@every 5m" # 更新Prometheus指标,默认每5分钟更新一次
MetricsServer: # Prometheus Metrics服务
RunMode: debug
HttpIp: 0.0.0.0
HttpPort: 6080
ReadTimeout: 60
WriteTimeout: 60
...
scripts/migration/**/*_rank_metrics.up.sql
):
ALTER TABLE `p_comment` ADD COLUMN `reply_count` int unsigned NOT NULL DEFAULT 0 COMMENT '回复数';
UPDATE p_comment comment
SET reply_count = (
SELECT count(*) FROM p_comment_reply reply WHERE reply.comment_id=comment.id AND reply.is_del=0
)
WHERE is_del=0;
CREATE TABLE `p_comment_metric` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`comment_id` bigint unsigned NOT NULL,
`rank_score` bigint unsigned NOT NULL DEFAULT 0,
`incentive_score` int unsigned NOT NULL DEFAULT 0,
`decay_factor` int unsigned NOT NULL DEFAULT 0,
`motivation_factor` int unsigned NOT NULL DEFAULT 0,
`is_del` tinyint NOT NULL DEFAULT 0,
`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_comment_metric_comment_id_rank_score` (`comment_id`, `rank_score`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
INSERT INTO p_comment_metric (comment_id, rank_score, created_on)
SELECT id AS comment_id,
reply_count*2 + thumbs_up_count*4 - thumbs_down_count AS rank_score,
created_on
FROM p_comment
WHERE is_del=0;
CREATE TABLE `p_user_metric` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint unsigned NOT NULL,
`tweets_count` int unsigned NOT NULL DEFAULT 0,
`latest_trends_on` bigint unsigned NOT NULL DEFAULT 0 COMMENT '最新动态时间',
`is_del` tinyint NOT NULL DEFAULT 0,
`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_user_metric_user_id_tweets_count_trends` (`user_id`, `tweets_count`, `latest_trends_on`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
INSERT INTO p_user_metric (user_id, tweets_count)
SELECT user_id, count(*) AS tweets_count
FROM p_post
WHERE is_del=0
GROUP BY user_id;
scripts/migration/**/*_user_relation.up.sql
):
CREATE VIEW p_user_relation AS
SELECT user_id, friend_id he_uid, 5 AS style
FROM p_contact WHERE status=2 AND is_del=0
UNION
SELECT user_id, follow_id he_uid, 10 AS style
FROM p_following WHERE is_del=0;
...
WebProfile:
UseFriendship: true # 前端是否使用好友体系
EnableTrendsBar: true # 广场页面是否开启动态条栏功能
EnableWallet: false # 是否开启钱包功能
AllowTweetAttachment: true # 是否允许推文附件
AllowTweetAttachmentPrice: true # 是否允许推文付费附件
AllowTweetVideo: true # 是否允许视频推文
AllowUserRegister: true # 是否允许用户注册
AllowPhoneBind: true # 是否允许手机绑定
DefaultTweetMaxLength: 2000 # 推文允许输入的最大长度, 默认2000字,值的范围需要查询后端支持的最大字数
TweetWebEllipsisSize: 400 # Web端推文作为feed显示的最长字数,默认400字
TweetMobileEllipsisSize: 300 # 移动端推文作为feed显示的最长字数,默认300字
DefaultTweetVisibility: friend # 推文可见性,默认好友可见 值: public/following/friend/private
DefaultMsgLoopInterval: 5000 # 拉取未读消息的间隔,单位:毫秒, 默认5000ms
CopyrightTop: "2023 paopao.info"
CopyrightLeft: "Roc's Me"
CopyrightLeftLink: ""
CopyrightRight: "泡泡(PaoPao)开源社区"
CopyrightRightLink: "https://www.paopao.info"
...
备注:发布版本中,使用如下命令构建paopao-ce: (go version go1.21.1 darwin/amd64)
./build-release.sh && ./build-image.sh
发布的二进制文件中只测试了paopao-ce-darwin_amd64,其余平台的未亲测,如有问题,请使用源码在自己平台下自行构建。
您可以使用如下命令启动一个测试实例尝鲜:
docker compose up -d
# visit http://localhost:8008 👀 paopao-ce
# visit http://localhost:8001 👀 RedisInsight
# visit http://localhost:7700 👀 Meilisearch
Published by alimy about 1 year ago
备注:发布版本中,使用如下命令构建paopao-ce: (go version go1.21.1 darwin/amd64)
./build-release.sh && ./build-image.sh
发布的二进制文件中只测试了paopao-ce-darwin_amd64,其余平台的未亲测,如有问题,请使用源码在自己平台下自行构建。
您可以使用如下命令启动一个测试实例尝鲜:
docker compose up -d
# visit http://localhost:8008 👀 paopao-ce
# visit http://localhost:8001 👀 RedisInsight
# visit http://localhost:7700 👀 Meilisearch
Published by alimy about 1 year ago
备注:发布版本中,使用如下命令构建paopao-ce: (go version go1.21.1 darwin/amd64)
./build-release.sh && ./build-image.sh
发布的二进制文件中只测试了paopao-ce-darwin_amd64,其余平台的未亲测,如有问题,请使用源码在自己平台下自行构建。
您可以使用如下命令启动一个测试实例尝鲜:
docker compose up -d
# visit http://localhost:8008 👀 paopao-ce
# visit http://localhost:8001 👀 RedisInsight
# visit http://localhost:7700 👀 Meilisearch
Published by alimy about 1 year ago
conf.yaml
file to custom web frontend features:
...
WebProfile:
UseFriendship: true # 前端是否使用好友体系
EnableTrendsBar: true # 广场页面是否开启动态条栏功能
EnableWallet: false # 是否开启钱包功能
AllowTweetAttachment: true # 是否允许推文附件
AllowTweetAttachmentPrice: true # 是否允许推文付费附件
AllowTweetVideo: true # 是否允许视频推文
AllowUserRegister: true # 是否允许用户注册
AllowPhoneBind: true # 是否允许手机绑定
DefaultTweetVisibility: friend # 推文可见性,默认好友可见 值: public/following/friend/private
DefaultMsgLoopInterval: 5000 # 拉取未读消息的间隔,单位:毫秒, 默认5000ms
CopyrightTop: "2023 paopao.info"
CopyrightLeft: "Roc's Me"
CopyrightLeftLink: ""
CopyrightRight: "泡泡(PaoPao)开源社区"
CopyrightRightLink: "https://www.paopao.info"
...
备注:发布版本中,使用如下命令构建paopao-ce: (go version go1.21.1 darwin/amd64)
./build-release.sh && ./build-image.sh
发布的二进制文件中只测试了paopao-ce-darwin_amd64,其余平台的未亲测,如有问题,请使用源码在自己平台下自行构建。
您可以使用如下命令启动一个测试实例尝鲜:
docker compose up -d
# visit http://localhost:8008 👀 paopao-ce
# visit http://localhost:8001 👀 RedisInsight
# visit http://localhost:7700 👀 Meilisearch
Published by alimy about 1 year ago
LoggerOpenObserve
feature use OpenObserve to collect log.#370LoggerOpenObserve
to conf.yaml
's Features
section to enable this feature like below:
# file config.yaml
...
Features:
Default: ["Base", "Postgres", "Meili", "LocalOSS", "LoggerOpenObserve", "BigCacheIndex", "web"]
LoggerOpenObserve: # 使用OpenObserve写日志
Host: 127.0.0.1:5080
Organization: paopao-ce
Stream: default
User: [email protected]
Password: tiFEI8UeJWuYA7kN
Secure: False
MinWorker: 5 # 最小后台工作者, 设置范围[5, 100], 默认5
MaxLogBuffer: 100 # 最大log缓存条数, 设置范围[10, 10000], 默认100
...
Friendship
feature support. To custom setup Friendship
use below configure in web/.env
or web/.env.local
# 功能特性开启
VITE_USE_FRIENDSHIP=true
# 模块开启
VITE_ENABLE_FRIENDS_BAR=true
scripts/migration/**/*_home_timeline.up.sql
):
CREATE TABLE `p_post_metric` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`post_id` bigint unsigned NOT NULL,
`rank_score` bigint unsigned NOT NULL DEFAULT 0,
`incentive_score` int unsigned NOT NULL DEFAULT 0,
`decay_factor` int unsigned NOT NULL DEFAULT 0,
`motivation_factor` int unsigned NOT NULL DEFAULT 0,
`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_post_metric_post_id_rank_score` (`post_id`,`rank_score`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
INSERT INTO p_post_metric (post_id, rank_score, created_on)
SELECT id AS post_id,
comment_count + upvote_count*2 + collection_count*4 AS rank_score,
created_on
FROM p_post
WHERE is_del=0;
-- 原来的可见性: 0公开 1私密 2好友可见 3关注可见
-- 现在的可见性: 0私密 10充电可见 20订阅可见 30保留 40保留 50好友可见 60关注可见 70保留 80保留 90公开
UPDATE p_post a, p_post b
SET a.visibility = (
CASE b.visibility
WHEN 0 THEN 90
WHEN 1 THEN 0
WHEN 2 THEN 50
WHEN 3 THEN 60
ELSE 0
END
)
WHERE a.ID = b.ID;
scripts/migration/**/*_comment_esence.up.sql
):
ALTER TABLE `p_comment` ADD COLUMN `is_essence` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '是否精选';
Metrics
to conf.yaml
's Features
section to enable this feature like below:
# file config.yaml
...
Features:
Default: ["Base", "Postgres", "Meili", "LocalOSS", "Metrics", "web"]
JobManager: # Cron Job理器的配置参数
MaxOnlineInterval: "@every 5m" # 更新最大在线人数,默认每5分钟更新一次
UpdateMetricsInterval: "@every 5m" # 更新Prometheus指标,默认每5分钟更新一次
MetricsServer: # Prometheus Metrics服务
RunMode: debug
HttpIp: 0.0.0.0
HttpPort: 6080
ReadTimeout: 60
WriteTimeout: 60
...
scripts/migration/**/*_rank_metrics.up.sql
):
ALTER TABLE `p_comment` ADD COLUMN `reply_count` int unsigned NOT NULL DEFAULT 0 COMMENT '回复数';
UPDATE p_comment comment
SET reply_count = (
SELECT count(*) FROM p_comment_reply reply WHERE reply.comment_id=comment.id AND reply.is_del=0
)
WHERE is_del=0;
CREATE TABLE `p_comment_metric` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`comment_id` bigint unsigned NOT NULL,
`rank_score` bigint unsigned NOT NULL DEFAULT 0,
`incentive_score` int unsigned NOT NULL DEFAULT 0,
`decay_factor` int unsigned NOT NULL DEFAULT 0,
`motivation_factor` int unsigned NOT NULL DEFAULT 0,
`is_del` tinyint NOT NULL DEFAULT 0,
`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_comment_metric_comment_id_rank_score` (`comment_id`, `rank_score`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
INSERT INTO p_comment_metric (comment_id, rank_score, created_on)
SELECT id AS comment_id,
reply_count*2 + thumbs_up_count*4 - thumbs_down_count AS rank_score,
created_on
FROM p_comment
WHERE is_del=0;
CREATE TABLE `p_user_metric` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint unsigned NOT NULL,
`tweets_count` int unsigned NOT NULL DEFAULT 0,
`latest_trends_on` bigint unsigned NOT NULL DEFAULT 0 COMMENT '最新动态时间',
`is_del` tinyint NOT NULL DEFAULT 0,
`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_user_metric_user_id_tweets_count_trends` (`user_id`, `tweets_count`, `latest_trends_on`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
INSERT INTO p_user_metric (user_id, tweets_count)
SELECT user_id, count(*) AS tweets_count
FROM p_post
WHERE is_del=0
GROUP BY user_id;
scripts/migration/**/*_user_relation.up.sql
):
CREATE VIEW p_user_relation AS
SELECT user_id, friend_id he_uid, 5 AS style
FROM p_contact WHERE status=2 AND is_del=0
UNION
SELECT user_id, follow_id he_uid, 10 AS style
FROM p_following WHERE is_del=0;
备注:发布版本中,使用如下命令构建paopao-ce: (go version go1.21.1 darwin/amd64)
./build-release.sh && ./build-image.sh
发布的二进制文件中只测试了paopao-ce-darwin_amd64,其余平台的未亲测,如有问题,请使用源码在自己平台下自行构建。
您可以使用如下命令启动一个测试实例尝鲜:
docker compose up -d
# visit http://localhost:8008 👀 paopao-ce
# visit http://localhost:8001 👀 RedisInsight
# visit http://localhost:8080 👀 phpMyAdmin
# visit http://localhost:7700 👀 Meilisearch
Published by alimy about 1 year ago
备注:发布版本中,使用如下命令构建paopao-ce: (go version go1.21.1 darwin/amd64)
./build-release.sh && ./build-image.sh
发布的二进制文件中只测试了paopao-ce-darwin_amd64,其余平台的未亲测,如有问题,请使用源码在自己平台下自行构建。
您可以使用如下命令启动一个测试实例尝鲜:
docker compose up -d
# visit http://localhost:8008 👀 paopao-ce
# visit http://localhost:8001 👀 RedisInsight
# visit http://localhost:8080 👀 phpMyAdmin
Published by alimy about 1 year ago
备注:发布版本中,使用如下命令构建paopao-ce: (go version go1.21.1 darwin/amd64)
./build-release.sh && ./build-image.sh
发布的二进制文件中只测试了paopao-ce-darwin_amd64,其余平台的未亲测,如有问题,请使用源码在自己平台下自行构建。
您可以使用如下命令启动一个测试实例尝鲜:
docker compose up -d
# visit http://localhost:8008 👀 paopao-ce
# visit http://localhost:8001 👀 RedisInsight
# visit http://localhost:8080 👀 phpMyAdmin
Published by alimy about 1 year ago
LoggerOpenObserve
feature use OpenObserve to collect log.#370LoggerOpenObserve
to conf.yaml
's Features
section to enable this feature like below:
# file config.yaml
...
Features:
Default: ["Base", "Postgres", "Meili", "LocalOSS", "LoggerOpenObserve", "BigCacheIndex", "web"]
LoggerOpenObserve: # 使用OpenObserve写日志
Host: 127.0.0.1:5080
Organization: paopao-ce
Stream: default
User: [email protected]
Password: tiFEI8UeJWuYA7kN
Secure: False
MinWorker: 5 # 最小后台工作者, 设置范围[5, 100], 默认5
MaxLogBuffer: 100 # 最大log缓存条数, 设置范围[10, 10000], 默认100
...
Friendship
feature support. To custom setup Friendship
use below configure in web/.env
or web/.env.local
# 功能特性开启
VITE_USE_FRIENDSHIP=true
# 模块开启
VITE_ENABLE_FRIENDS_BAR=true
scripts/migration/**/*_home_timeline.up.sql
):
CREATE TABLE `p_post_metric` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`post_id` bigint unsigned NOT NULL,
`rank_score` bigint unsigned NOT NULL DEFAULT 0,
`incentive_score` int unsigned NOT NULL DEFAULT 0,
`decay_factor` int unsigned NOT NULL DEFAULT 0,
`motivation_factor` int unsigned NOT NULL DEFAULT 0,
`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_post_metric_post_id_rank_score` (`post_id`,`rank_score`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
INSERT INTO p_post_metric (post_id, rank_score, created_on)
SELECT id AS post_id,
comment_count + upvote_count*2 + collection_count*4 AS rank_score,
created_on
FROM p_post
WHERE is_del=0;
-- 原来的可见性: 0公开 1私密 2好友可见 3关注可见
-- 现在的可见性: 0私密 10充电可见 20订阅可见 30保留 40保留 50好友可见 60关注可见 70保留 80保留 90公开
UPDATE p_post a, p_post b
SET a.visibility = (
CASE b.visibility
WHEN 0 THEN 90
WHEN 1 THEN 0
WHEN 2 THEN 50
WHEN 3 THEN 60
ELSE 0
END
)
WHERE a.ID = b.ID;
scripts/migration/**/*_comment_esence.up.sql
):
ALTER TABLE `p_comment` ADD COLUMN `is_essence` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '是否精选';
Metrics
to conf.yaml
's Features
section to enable this feature like below:
# file config.yaml
...
Features:
Default: ["Base", "Postgres", "Meili", "LocalOSS", "Metrics", "web"]
JobManager: # Cron Job理器的配置参数
MaxOnlineInterval: "@every 5m" # 更新最大在线人数,默认每5分钟更新一次
UpdateMetricsInterval: "@every 5m" # 更新Prometheus指标,默认每5分钟更新一次
MetricsServer: # Prometheus Metrics服务
RunMode: debug
HttpIp: 0.0.0.0
HttpPort: 6080
ReadTimeout: 60
WriteTimeout: 60
...
scripts/migration/**/*_rank_metrics.up.sql
):
ALTER TABLE `p_comment` ADD COLUMN `reply_count` int unsigned NOT NULL DEFAULT 0 COMMENT '回复数';
UPDATE p_comment comment
SET reply_count = (
SELECT count(*) FROM p_comment_reply reply WHERE reply.comment_id=comment.id AND reply.is_del=0
)
WHERE is_del=0;
CREATE TABLE `p_comment_metric` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`comment_id` bigint unsigned NOT NULL,
`rank_score` bigint unsigned NOT NULL DEFAULT 0,
`incentive_score` int unsigned NOT NULL DEFAULT 0,
`decay_factor` int unsigned NOT NULL DEFAULT 0,
`motivation_factor` int unsigned NOT NULL DEFAULT 0,
`is_del` tinyint NOT NULL DEFAULT 0,
`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_comment_metric_comment_id_rank_score` (`comment_id`, `rank_score`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
INSERT INTO p_comment_metric (comment_id, rank_score, created_on)
SELECT id AS comment_id,
reply_count*2 + thumbs_up_count*4 - thumbs_down_count AS rank_score,
created_on
FROM p_comment
WHERE is_del=0;
CREATE TABLE `p_user_metric` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint unsigned NOT NULL,
`tweets_count` int unsigned NOT NULL DEFAULT 0,
`latest_trends_on` bigint unsigned NOT NULL DEFAULT 0 COMMENT '最新动态时间',
`is_del` tinyint NOT NULL DEFAULT 0,
`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_user_metric_user_id_tweets_count_trends` (`user_id`, `tweets_count`, `latest_trends_on`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
INSERT INTO p_user_metric (user_id, tweets_count)
SELECT user_id, count(*) AS tweets_count
FROM p_post
WHERE is_del=0
GROUP BY user_id;
备注:发布版本中,使用如下命令构建paopao-ce: (go version go1.21.1 darwin/amd64)
./build-release.sh && ./build-image.sh
发布的二进制文件中只测试了paopao-ce-darwin_amd64,其余平台的未亲测,如有问题,请使用源码在自己平台下自行构建。
您可以使用如下命令启动一个测试实例尝鲜:
docker compose up -d
# visit http://localhost:8008 👀 paopao-ce
# visit http://localhost:8001 👀 RedisInsight
# visit http://localhost:8080 👀 phpMyAdmin
Published by alimy about 1 year ago
备注:发布版本中,使用如下命令构建paopao-ce: (go version go1.21.1 darwin/amd64)
./build-release.sh && ./build-image.sh
发布的二进制文件中只测试了paopao-ce-darwin_amd64,其余平台的未亲测,如有问题,请使用源码在自己平台下自行构建。
您可以使用如下命令启动一个测试实例尝鲜:
docker compose up -d
# visit http://localhost:8008 👀 paopao-ce
# visit http://localhost:8001 👀 RedisInsight
# visit http://localhost:8080 👀 phpMyAdmin
Published by alimy about 1 year ago
备注:发布版本中,使用如下命令构建paopao-ce: (go version go1.21.1 darwin/amd64)
./build-release.sh && ./build-image.sh
发布的二进制文件中只测试了paopao-ce-darwin_amd64,其余平台的未亲测,如有问题,请使用源码在自己平台下自行构建。
您可以使用如下命令启动一个测试实例尝鲜:
docker compose up -d
# visit http://localhost:8008 👀 paopao-ce
# visit http://localhost:8001 👀 RedisInsight
# visit http://localhost:8080 👀 phpMyAdmin
Published by alimy about 1 year ago
Metrics
to conf.yaml
's Features
section to enable this feature like below:
# file config.yaml
...
Features:
Default: ["Base", "Postgres", "Meili", "LocalOSS", "Metrics", "web"]
JobManager: # Cron Job管理器的配置参数
MaxOnlineInterval: "@every 5m" # 更新最大在线人数,默认每5分钟更新一次
UpdateMetricsInterval: "@every 5m" # 更新Prometheus指标,默认每5分钟更新一次
MetricsServer: # Prometheus Metrics服务
RunMode: debug
HttpIp: 0.0.0.0
HttpPort: 6080
ReadTimeout: 60
WriteTimeout: 60
...
scripts/migration/**/*_rank_metrics.up.sql
):
ALTER TABLE `p_comment` ADD COLUMN `reply_count` int unsigned NOT NULL DEFAULT 0 COMMENT '回复数';
UPDATE p_comment comment
SET reply_count = (
SELECT count(*) FROM p_comment_reply reply WHERE reply.comment_id=comment.id AND reply.is_del=0
)
WHERE is_del=0;
CREATE TABLE `p_comment_metric` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`comment_id` bigint unsigned NOT NULL,
`rank_score` bigint unsigned NOT NULL DEFAULT 0,
`incentive_score` int unsigned NOT NULL DEFAULT 0,
`decay_factor` int unsigned NOT NULL DEFAULT 0,
`motivation_factor` int unsigned NOT NULL DEFAULT 0,
`is_del` tinyint NOT NULL DEFAULT 0,
`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_comment_metric_comment_id_rank_score` (`comment_id`, `rank_score`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
INSERT INTO p_comment_metric (comment_id, rank_score, created_on)
SELECT id AS comment_id,
reply_count*2 + thumbs_up_count*4 - thumbs_down_count AS rank_score,
created_on
FROM p_comment
WHERE is_del=0;
CREATE TABLE `p_user_metric` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint unsigned NOT NULL,
`tweets_count` int unsigned NOT NULL DEFAULT 0,
`latest_trends_on` bigint unsigned NOT NULL DEFAULT 0 COMMENT '最新动态时间',
`is_del` tinyint NOT NULL DEFAULT 0,
`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_user_metric_user_id_tweets_count_trends` (`user_id`, `tweets_count`, `latest_trends_on`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
INSERT INTO p_user_metric (user_id, tweets_count)
SELECT user_id, count(*) AS tweets_count
FROM p_post
WHERE is_del=0
GROUP BY user_id;
备注:发布版本中,使用如下命令构建paopao-ce: (go version go1.21.1 darwin/amd64)
./build-release.sh && ./build-image.sh
发布的二进制文件中只测试了paopao-ce-darwin_amd64,其余平台的未亲测,如有问题,请使用源码在自己平台下自行构建。
您可以使用如下命令启动一个测试实例尝鲜:
docker compose up -d
# visit http://localhost:8008 👀 paopao-ce
# visit http://localhost:8001 👀 RedisInsight
# visit http://localhost:8080 👀 phpMyAdmin
Published by alimy about 1 year ago
备注:发布版本中,使用如下命令构建paopao-ce: (go version go1.21.1 darwin/amd64)
./build-release.sh && ./build-image.sh
发布的二进制文件中只测试了paopao-ce-darwin_amd64,其余平台的未亲测,如有问题,请使用源码在自己平台下自行构建。
您可以使用如下命令启动一个测试实例尝鲜:
docker compose up -d
# visit http://localhost:8008 👀 paopao-ce
# visit http://localhost:8001 👀 RedisInsight
# visit http://localhost:8080 👀 phpMyAdmin
Published by alimy about 1 year ago
备注:发布版本中,使用如下命令构建paopao-ce: (go version go1.21.1 darwin/amd64)
./build-release.sh && ./build-image.sh
发布的二进制文件中只测试了paopao-ce-darwin_amd64,其余平台的未亲测,如有问题,请使用源码在自己平台下自行构建。
您可以使用如下命令启动一个测试实例尝鲜:
docker compose up -d
# visit http://localhost:8008 👀 paopao-ce
# visit http://localhost:8001 👀 RedisInsight
# visit http://localhost:8080 👀 phpMyAdmin
Published by alimy about 1 year ago
备注:发布版本中,使用如下命令构建paopao-ce: (go version go1.21.1 darwin/amd64)
./build-release.sh && ./build-image.sh
发布的二进制文件中只测试了paopao-ce-darwin_amd64,其余平台的未亲测,如有问题,请使用源码在自己平台下自行构建。
您可以使用如下命令启动一个测试实例尝鲜:
docker compose up -d
# visit http://localhost:8008 👀 paopao-ce
# visit http://localhost:8001 👀 RedisInsight
# visit http://localhost:8080 👀 phpMyAdmin
Published by alimy about 1 year ago
scripts/migration/**/*_comment_esence.up.sql
): ALTER TABLE `p_comment` ADD COLUMN `is_essence` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '是否精选';
备注:发布版本中,使用如下命令构建paopao-ce: (go version go1.21.1 darwin/amd64)
./build-release.sh && ./build-image.sh
发布的二进制文件中只测试了paopao-ce-darwin_amd64,其余平台的未亲测,如有问题,请使用源码在自己平台下自行构建。
您可以使用如下命令启动一个测试实例尝鲜:
docker compose up -d
# visit http://localhost:8008 👀 paopao-ce
# visit http://localhost:8001 👀 RedisInsight
# visit http://localhost:8080 👀 phpMyAdmin
Published by alimy about 1 year ago
备注:发布版本中,使用如下命令构建paopao-ce: (go version go1.21.1 darwin/amd64)
./build-release.sh && ./build-image.sh
发布的二进制文件中只测试了paopao-ce-darwin_amd64,其余平台的未亲测,如有问题,请使用源码在自己平台下自行构建。
您可以使用如下命令启动一个测试实例尝鲜:
docker compose up -d
# visit http://localhost:8008 👀 paopao-ce
# visit http://localhost:8001 👀 RedisInsight
# visit http://localhost:8080 👀 phpMyAdmin