updated comment

This commit is contained in:
landaiqing
2024-09-24 01:14:50 +08:00
parent 74dc2b36c8
commit a5624466ae
8 changed files with 668 additions and 314 deletions

View File

@@ -13,6 +13,7 @@ export const commentSubmitApi = (params: any) => {
author: params.author,
},
{
name: 'comment-submit',
meta: {
ignoreToken: false,
},
@@ -34,6 +35,7 @@ export const replySubmitApi = (params: any) => {
author: params.author,
},
{
name: 'reply-submit',
meta: {
ignoreToken: false,
},
@@ -52,7 +54,59 @@ export const commentListApi = (params: any) => {
topic_id: params.topic_id,
},
{
cacheFor: 1000 * 60 * 60 * 24 * 7, // 7天缓存
cacheFor: {
expire: 60 * 60 * 24 * 7,
mode: "restore",
}, // 7天缓存
hitSource: "comment-submit",
meta: {
ignoreToken: false,
},
}
);
};
/**
* @description 评论列表
* @param params
*/
export const replyListApi = (params: any) => {
return service.Post('/api/auth/reply/list', {
page: params.page,
size: params.size,
comment_id: params.comment_id,
topic_id: params.topic_id,
},
{
cacheFor: {
expire: 60 * 60 * 24 * 7,
mode: "restore",
}, // 7天缓存
hitSource: ["reply-submit", "reply-reply-submit"],
meta: {
ignoreToken: false,
},
}
);
};
/**
* @description 回复的回复提交
* @param params
*/
export const replyReplySubmitApi = (params: any) => {
return service.Post('/api/auth/reply/reply/submit', {
user_id: params.user_id,
content: params.content,
images: params.images,
topic_id: params.topic_id,
reply_to_user: params.reply_to_user,
reply_to: params.reply_to,
reply_id: params.reply_id,
reply_user: params.reply_user,
author: params.author,
},
{
name: 'reply-reply-submit',
meta: {
ignoreToken: false,
},