Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add comment API #566

Closed
wants to merge 24 commits into from
Closed

feat: add comment API #566

wants to merge 24 commits into from

Conversation

L-time
Copy link

@L-time L-time commented May 27, 2024

为 Subject Post 和 Index Comment 增加了API与后端逻辑。

ref: #526

@L-time L-time changed the title feat: add comment API feat: add comment API #526 May 27, 2024
@L-time
Copy link
Author

L-time commented May 27, 2024

顺便请求一下.可否告知一下关于Mock的具体流程,以前一直都是直接本地跑所以对于Mock的自动生成有一点没懂(

@trim21
Copy link
Contributor

trim21 commented May 27, 2024

  • 补充Mock测试(我还没找到mockey怎么生成……)

task

server/Taskfile.yaml

Lines 88 to 91 in cedf850

mock:
desc: Generate Mocks.
deps:
- mock:all

@trim21
Copy link
Contributor

trim21 commented May 27, 2024

吐槽箱就是条目收藏的评论字段

@trim21
Copy link
Contributor

trim21 commented May 27, 2024

wip的话在标题里加上[WIP] 或者用draft

@L-time L-time changed the title feat: add comment API #526 feat: add comment API[WIP] #526 May 27, 2024
@L-time
Copy link
Author

L-time commented May 27, 2024

吐槽箱就是条目收藏的评论字段

好的,明白了

@trim21 trim21 changed the title feat: add comment API[WIP] #526 [WIP] feat: add comment API May 27, 2024
@Him188
Copy link

Him188 commented May 28, 2024

这是 #526, 可以链接一下?

refactor: refactor API routes with bangumi#526
@L-time
Copy link
Author

L-time commented May 29, 2024

@trim21 目前写的这几个API可以审一下吗?我对echo不怎么熟悉,怕写错(
以前是写gin的
然后顺带询问一下,所有的comment允许修改吗?

fix: fix comment's reply id
@L-time L-time changed the title [WIP] feat: add comment API feat: add comment API Jun 2, 2024
@L-time
Copy link
Author

L-time commented Jun 2, 2024

@trim21 好了

@trim21
Copy link
Contributor

trim21 commented Jun 2, 2024

暂时先不允许删除/修改评论吧,这个还有用户权限控制的问题

@trim21
Copy link
Contributor

trim21 commented Jun 2, 2024

先解决下冲突

@L-time
Copy link
Author

L-time commented Jun 6, 2024

image

修了,本地跑一遍fmt就交

@@ -56,13 +56,15 @@ require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534 // indirect
github.com/daixiang0/gci v0.13.4 // indirect
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个怎么变成依赖了,用golangci-lint

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我本地出了点问题,不变成依赖没办法运行,稍后去掉

web/handler/index/index.go Outdated Show resolved Hide resolved
web/handler/index/index.go Outdated Show resolved Hide resolved
web/handler/index/comment.go Outdated Show resolved Hide resolved
@L-time
Copy link
Author

L-time commented Jun 8, 2024

@trim21 可否开放一下bangumi.chii_subject_posts bangumi.chii_ep_comments 这两个表?我需要写测试XD

@trim21
Copy link
Contributor

trim21 commented Jun 8, 2024

啥叫开放一下,dev-env里面没有?还是什么其他情况?

@L-time
Copy link
Author

L-time commented Jun 8, 2024

啥叫开放一下,dev-env里面没有?还是什么其他情况?

里面没有任何测试数据

@L-time
Copy link
Author

L-time commented Jun 9, 2024

啥叫开放一下,dev-env里面没有?还是什么其他情况?

里面没有任何测试数据

没有数据,我没办法测试get方法,所以我现在也不知道怎么写测试

@trim21
Copy link
Contributor

trim21 commented Jun 9, 2024

啥叫开放一下,dev-env里面没有?还是什么其他情况?

里面没有任何测试数据

没有数据,我没办法测试get方法,所以我现在也不知道怎么写测试

等会我导出一下

@L-time
Copy link
Author

L-time commented Jun 9, 2024

啥叫开放一下,dev-env里面没有?还是什么其他情况?

里面没有任何测试数据

没有数据,我没办法测试get方法,所以我现在也不知道怎么写测试

等会我导出一下

好的,感谢您)

@L-time
Copy link
Author

L-time commented Jun 14, 2024

啥叫开放一下,dev-env里面没有?还是什么其他情况?

里面没有任何测试数据

没有数据,我没办法测试get方法,所以我现在也不知道怎么写测试

等会我导出一下

好的,感谢您)

询问一下好了嘛)

@trim21
Copy link
Contributor

trim21 commented Jun 16, 2024

bangumi.chii_subject_posts 应该是条目讨论帖?

@L-time
Copy link
Author

L-time commented Jun 17, 2024

bangumi.chii_subject_posts 应该是条目讨论帖?

对的

@trim21
Copy link
Contributor

trim21 commented Jun 17, 2024

bangumi.chii_subject_posts 应该是条目讨论帖?

对的

你找个沙盒条目发点讨论贴吧?现在几个沙盒条目都没有讨论贴,没什么数据可导出(

@L-time
Copy link
Author

L-time commented Jun 20, 2024

bangumi.chii_subject_posts 应该是条目讨论帖?

对的

你找个沙盒条目发点讨论贴吧?现在几个沙盒条目都没有讨论贴,没什么数据可导出(

沙盒条目可以给个导航嘛(

@trim21
Copy link
Contributor

trim21 commented Jun 20, 2024

bangumi.chii_subject_posts 应该是条目讨论帖?

对的

你找个沙盒条目发点讨论贴吧?现在几个沙盒条目都没有讨论贴,没什么数据可导出(

沙盒条目可以给个导航嘛(

https://bgm.tv/index/36778

@dt-robot
Copy link

dt-robot commented Jun 21, 2024

有个建议是提供分级评论的接口

  1. 默认对顶级评论进行分页查询。每个评论可以默认查出5条子级评论作为默认展示的子级评论。
  2. 根据消息id可以分页查询子级评论。

目前的接口混合多级评论进行分页,很难进行实际应用

@MisakaTAT MisakaTAT mentioned this pull request Jun 23, 2024
@trim21 trim21 closed this Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants