JX3BOX / jx3box-comment-ui

Comment vue component
0 stars 1 forks source link

评论组件优化 #7

Closed iRuxu closed 3 years ago

iRuxu commented 3 years ago

image

为实现团队留言板功能,考虑一下评论的延展性 可以传递一个参数,有对应的评论时,则短消息发送给对应的人。

团队格式的模板为: 你的团队留言板有一条新的留言。

flyflyknife commented 3 years ago
  1. 该留言板在哪个板块使用, 2.留言有多条时,即变成了一个类似 评论列表,这个列表关联的关联的是一个team_id 还是 类似post id?
  2. 评论列表是否有权限要求?仅仅团员可见?
iRuxu commented 3 years ago

Q1.团队主页 https://www.jx3box.com/team/#/org/view/483 用来给团队留言或点评这个团队 Q2.一个团队可以理解成就是一篇文章,team_id Q3.不做查看权限了,但是团队创始人有删除的权利

flyflyknife commented 3 years ago
  1. 看上面的UI,只有团长才能发评论?
  2. 如果允许其他人发表评论 【非团长】短消息发送给对应的人,对应的人是指?
    • 队员发评论?消息发给队长?
    • 非团队内人员发评论,消息发给队长?
    • 团长发评论,消息发送给队员?【但是现在没有一个表记录了团队与队员的关系】
iRuxu commented 3 years ago

Q1.不用管图,评论是任何人可以发,相当于别人来点评这个团队,或者询问这个团队一些事情。团队创建人就是这个帖子的作者。 Q2.没有那么复杂,就是怎么来设定,知道这个短消息是发给某个人。比如这里,是发给团队创建人。如果还有些别的栏目,是希望发给另外的人,怎么实现,比如剑三百科,就希望发给百科词条的创建人。 https://www.jx3box.com/wiki/#/

flyflyknife commented 3 years ago

通过设置

// 通过设置 category来支持发送不同的消息。
<Comment id="100" category="post" />
<Comment id="100" category="wiki" />
<Comment id="100" category="team" />

每增加一种类型,如果需要发送消息给对应的创建者 ,需要更新代码一次,因为每种类型的获取创建者的表都不一致

由于每种评论都需要进行点击跳转:请确认每种类型的message相关字段的值

类型 source_id source_type type subtype 消息模板
post id 的值 根据post id查询数据得到的type comment comment_post %s 评论了你的文章
wiki id 的值 ? ? ? ?
team id 的值 org team comment_org 你的团队有一条新的留言
iRuxu commented 3 years ago

wiki等下个月再弄,可能需要重构。 team见上表

iRuxu commented 3 years ago

新增一种评论类型

类型 source_id source_type type subtype 消息模板
collection id 的值 collection collection comment_collection 你的小册有一条新的评论

通知的用户为 jx3box/post_collections表的user_id字段,传入的id对应该表的id

iRuxu commented 3 years ago

新增一种评论类型

类型 source_id source_type type subtype 消息模板
item_plan id 的值 item_plan item_plan comment_item_plan 你的清单有一条新的评论

通知的用户为jx3box_helper/helper_item_plans表的user_id字段,传入的id对应该表的id

flyflyknife commented 3 years ago

新增一种评论类型

类型 source_id source_type type subtype 消息模板 item_plan id 的值 item_plan item_plan comment_item_plan 你的清单有一条新的评论 通知的用户为jx3box_helper/helper_item_plans表的user_id字段,传入的id对应该表的id

我没有jx3box_helper的权限。

或者给我一个线上接口 让我可以根据id 会哦去到 user_id的值。 避免跨库读取

iRuxu commented 3 years ago

item类型 通过接口 https://github.com/JX3BOX/apidocs/blob/master/helper/post.md 直接根据id查询得到作者的uid,然后直接操作message表,不再去查helper库。

flyflyknife commented 3 years ago

item类型 通过接口 https://github.com/JX3BOX/apidocs/blob/master/helper/post.md 直接根据id查询得到作者的uid,然后直接操作message表,不再去查helper库。

需求已完成 待测试