Giter VIP home page Giter VIP logo

treehole_next's People

Contributors

dependabot[bot] avatar fanaesar avatar forestwinger avatar fsy2001 avatar hasbai avatar jingyijun avatar linn3a avatar pinappleunderthesea avatar ppolariss avatar ryanhe312 avatar singularity-s0 avatar yujular avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

treehole_next's Issues

举报预设选项

此Issue搬运自飞书原《功能需求和bug修复建议》文档

备注
来自 Eric 同学:目前滥用举报的主要表现有:1)错把举报当回复(少数)2)举报的理由根本就不出自于社区公约3)辱骂管理员4)泄愤式举报。我的一个想法是,请求后端的同学把举报栏改成单选题的模式,限制用户只能从公约的条款中选择,而不是打字。这样可以解决前三者,也能够引导用户注意社区公约。
Zhuo:个人认为社区公约条目太多,不可能一一列举,建议选取几个作为备选项,并且提供自定义选项)

提出部门
社区运营部

添加 v2 hole API

仍然遵循 restful api,部分 API 兼容 V1,V2 是为了 V3 过度
返回 hole 时去掉 floors 字段,仅添加 first floor, last floor, 可以添加 is_favorite, 这里 hole 数据库结构和 返回的 hole response 结构必须分离,具体设计可以参考 backend 仓库
其他接口只在注册时添加一个对称的 v2 即可

Roadmap for v2.1

新功能

  • 权限管理
  • 消息存储
  • Floor 已修改字段
  • 站内信
  • 点赞点踩分离
  • 查看用户历史发言、回复
  • 锁定帖子,禁止回复
  • floor_favorite 添加 created_at 字段(收藏时间),支持根据 created_at 倒序返回结果
  • floor 任意楼高度查询

数据库优化

  • 联合索引优化 hole 查询性能
  • 合理添加 not null 优化索引性能
  • 添加 floor.ranking 存储窗口函数结果,提升查询性能

缓存优化

  • anonyname 缓存优化 (暂时不做)
  • 高回复数的 hole 的 floor 缓存优化 (暂时不做)
  • tag 缓存优化

其他优化

  • 手动 mention 解析

后端性能优化(长期)

  • 使用 pprof 查询性能瓶颈
  • 减少 reflect 使用
  • 引入对象池 sync.Pool 减少gc带来的内存抖动
  • Golang 1.20 之后引入 arena 手动管理内存

细节整理

  • tag.id 连续性问题
  • tag 个数和长度限制(10个)
  • tag 去除 created_at 和 updated_at 的 json serialization
  • 模型取消继承
  • floor 去除 storey 和 path 字段,添加 reply_to 字段。
  • floor 添加 ranking 字段和 (hole_id, ranking) 联合索引,提升查询性能。
  • hole 添加 first_floor_id 和 last_floor_id 字段,提升查询性能。 使用 (hole_id, ranking) 联合索引查询,减少一次连表查询。

更好的测试

  • 基于 GitHub Actions MySQL虚拟环境的集成测试
  • 更多的测试样例,可计算性的覆盖率测试

日志

  • ELK架构或者其他时序数据库的搭建(运维部分)
  • 管理员操作记录
  • 日活、月活
  • 用户的浏览记录、搜索记录

Bug修复

  • 点赞、取消点赞不返回 floor.mention

站内信

此Issue搬运自飞书原《功能需求和bug修复建议》文档

备注

提出部门
社区运营部

锁定帖子功能

Describe the feature

锁定 hole,禁止非管理员发帖和修改 tag

Describe how to implement it

What does this feature intend to do

有的时候帖子讨论的内容偏离主题了,就不适宜在这个帖子下继续讨论下去了

Additional context

用户查看自己发的楼层

Describe the feature

查询一个用户自己发的所有内容

Describe how to implement it

根据 user_id 查询 floor,需要支持分页和缓存

What does this feature intend to do

用户历史记录

Additional context

管理操作简化与数据库结构调整

希望实现一下需求:

  1. 管理员通过树洞界面直接实现解封,取代“数据库审批”模式
  2. 同一层内容在“用户处罚记录”中只显示一次(目前现状是,管理员通过“修改”功能修改标注时,该修改后的标注在“用户处罚记录”中显示多次;但DBeaver数据库中能够正确显示)
  3. 实现“删除处罚记录”。通过数据库结构调整实现处罚记录的软删除。

以上需求均不急需。优先级递减。

禁言功能迁移

Describe the feature

树洞内的禁言功能应在treehole微服务内实现,并提供查询禁言状态的接口。

Describe how to implement it

建立 ban 数据表,其中包含 user_id, expire_date, ban_division 三列。禁言时根据是否仍在禁言选择叠加或更新 expire_date。用户发言时查询其 expire_date 是否已到期判断是否允许其发言。

提供接口供用户查询其在各板块中的禁言状态。

提供接口供管理员提前解除禁言。

What does this feature intend to do

降低treehole微服务与auth和网关的耦合。

Additional context

test gitmaya

Describe the bug

To Reproduce

Expected behavior (Optional)

Screenshots (Optional)

Version

Additional context

[Bug] 删除帖子后,应仅有管理员可修改帖子内容

目前客户端在用户自行删除帖子后不会立刻刷新(或者由于网络原因未能及时刷新),用户依然可以长按帖子选择编辑,修改删除后的默认文本(即「该内容被作者删除」)。

这可能会导致错误的行为,例如用户自行删除帖子后,将帖子内容修改为「该内容因 xxx(二级封禁)删除」,从而引发他人错误的认知。

应当在后端禁止对于已删除帖子的、非管理员来源的编辑。

一个用户对一个帖子只能举报一次

Describe the feature

一个用户对一个帖子只能举报一次

Describe how to implement it

插入时检查举报列表中有没有对应的 floor_id, user_id 组,如果没有再插入。

What does this feature intend to do

防止举报刷屏

test gitmaya

Describe the feature

Describe how to implement it

What does this feature intend to do

Additional context

[Feature request] 封禁举报用户

Transfer from DanXi-Dev/DanXi#204 .

此Issue搬运自飞书原《功能需求和bug修复建议》文档

备注
因为有人在举报区人身攻击管理、滥用举报等,希望限制其使用举报功能、或者封禁

提出部门
社区运营部

passkey

增加 passkey 登录功能

需要讨论的功能设计:屏蔽一个洞

此Issue搬运自飞书原《功能需求和bug修复建议》文档

备注
允许用户单洞屏蔽(但不能屏蔽某用户,因为可能会开盒)

提出部门
社区运营部

任意楼定位的懒加载

Describe the feature

前端如果需要跳转到任意楼层,需要加载整个洞,这对于高回复数的洞是不可取的。

Describe how to implement it

使用 floor.ranking 字段,加载对应楼的上下各 size 个楼,默认 size = 10;返回值中将包含最多 2 * size + 1 个楼。由于一个洞可能很小,一个楼的前后可能都不足 size 个楼,需要前端来判断加载位置。

select hole, ranking from floor where id = ?;
select * from floor where hold_id = ? and ranking between ? - size and ? + size;

What does this feature intend to do

对于高楼层的查询优化

Additional context

账户注销与重新注册

Describe the feature

[//]: # 账户注销后,将原有 user 表中的项标记为已删除,并将其 identifier 设为 null。新用户注册时,应当创建一个新的记录(即获得一个新的 user_id)

Additional context

[//]: # 账户注销时,应当检测是否还处于封禁期,以防通过注销重新注册的方式来解除禁言。

管理操作记录

Describe the feature

将所有管理操作记录在数据库。管理操作包括:删帖、禁言、编辑他人帖子。

Describe how to implement it

建立一个单独的数据库,按管理操作分成若干个表,记录相关属性。

无需实现查询API,直接给管理团队提供读取数据库的权限。

实体类的初步设计:

// 删贴
type AdminDeleteAction struct {
  FloorID  int
  Reason   string
  Content  string
  Operator int
}

// 禁言
type AdminBanAction struct {
  FloorID   int
  Content   int
  Operator  int
  Duration  int
}

// 编辑他人帖子
type AdminEditAction struct {
  FloorID     int
  Content     string
  EditContent string
  Operator    int
}

What does this feature intend to do

供管理团队内部审计使用。

Additional context

Refactor OpenTreeHole In Golang

For better performance, we decide to refactor OpenTreeHole in golang. This is a roadmap for the process.

Division

  • List
  • Get
  • Add
  • Modify
  • Delete
  • Docs
  • Tests
  • Permission

Tag

  • List
  • Get
  • Add
  • Modify
  • Delete
  • Docs
  • Tests
  • Permission

Hole

  • List in division
  • List by tag
  • Deprecated List API
  • Get
  • Add
  • Deprecated Add API
  • Modify
  • Delete
  • Docs
  • Tests
  • Permission
  • Notification

Floor

  • List
  • Deprecated List API
  • Get
  • Add
  • Deprecated Add API
  • Modify
  • Delete
  • Docs
  • Tests
  • Permission
  • Notification

Search

  • Search API (with elasticsearch)
  • sync mysql data to elasticsearch

User

  • Connect JWT
  • Tests

User Favorites

  • List
  • Get
  • Add
  • Modify
  • Delete
  • Docs
  • Tests
  • Permission

Report

  • List
  • Get
  • Add
  • Delete
  • Docs
  • Tests
  • Permission
  • Notification

Image

  • Upload
  • Docs
  • Tests

Notification

Better use a microservice

  • List
  • Get
  • Add
  • Delete (Mark as read)
  • Tests

Notification Token

  • Get
  • Add
  • Delete
  • Tests

[Feature Request] 锁定帖子

此Issue搬运自飞书原《功能需求和bug修复建议》文档

备注
主要是用来发禁止回复的公告。如果要开发这个的话,需要在第三版公约中同步说明一下

提出部门
社区运营部

投票功能

Describe the feature

树洞中加入投票功能,支持单选、多选、票数统计等

Describe how to implement it

建立 vote、vote_option 和 vote_option_user 表,vote 与 hole 一对一关联,在加载 hole 的时候把 vote 一并加载

What does this feature intend to do

实现投票功能

Additional context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.