import Http from "@/utils/http";
// 投票, 数据列表 - 列表
export const getListHttp = (params) => {
    return Http.post("/api/lists", params);
};

// 详情数据 - 投票详情
export const detailsHttp = (query) => {
    return Http.post("/api/details", query);
};

// 详情数据 - 获取评论数据
export const commentListHttp = (params) => {
    // return Http.post("/api/comment/lists", params);
    return Http.get("https://api.gter.net/v2/api/forum/getCommentList", params);
};

// 评论相关 - 评论点赞
export const detailsLikeCommentHttp = (query) => {
    // return Http.post("/api/comment/like", query);
    return Http.postV2("https://api.gter.net/v2/api/forum/likeComment", query);
};

// 详情数据 - 获取子评论数据
export const detailsChildCommentListHttp = (query) => {
    // return Http.post("/api/comment/childrenList", query);
    return Http.postV2("https://api.gter.net/v2/api/forum/childrenList", query);
};

// 详情数据 - 提交评论
export const detailsSubmitommentListHttp = (query) => {
    // return Http.post("/api/comment/submit", query);
    return Http.postV2("https://api.gter.net/v2/api/forum/postComment", query);
};

// 详情数据 - 提交评论
export const commentsEditSubmit = (query) => {
    return Http.postV2("https://api.gter.net/v2/api/forum/postCommentEdit", query);
};

// 发布相关 - 发布问题初始化,编辑
export const publishInitHttp = (query) => {
    return Http.post("/api/publish", query);
};

// 发布相关 - 提交
export const publishSubmitHttp = (query) => {
    return Http.post("/api/publish/submit", query);
};

// 发布相关 - 更改匿名状态
export const changeAnonymousHttp = (query) => {
    return Http.post("/api/publish/changeAnonymous", query);
};

// 发布相关 - 删除投票
export const deleteHttp = (query) => {
    return Http.post("/api/publish/delete", query);
};

// 操作-点赞
export const operateLikeHttp = (query) => {
    // return Http.post("/api/operate/like", query);
    return Http.postV2("https://api.gter.net/v2/api/forum/postTopicLike", query);
};

// 数据操作 - 收藏
export const operateCollectHttp = (query) => {
    // return Http.post("/api/operate/collect", query);
    return Http.postV2("https://api.gter.net/v2/api/forum/postTopicCollect", query);
};

// 数据操作 - 投票操作
export const operationCollectHttp = (query) => {
    return Http.post("/api/operate/operation", query);
};

// 数据操作 - 取消投票操作
export const unvoteCollectHttp = (query) => {
    return Http.post("/api/operate/unvote", query);
};

// 我的 - 用户信息
export const MyUserInfoHttp = (query) => {
    return Http.post("/api/user", query);
};

// 我的 - 我的发布的投票
export const MyUserPublishHttp = (query) => {
    return Http.post("/api/user/publish", query);
};

// 我的 - 用户相关 - 我参与
export const MyUserTakevoteHttp = (query) => {
    return Http.post("/api/user/takevote", query);
};

// 我的 - 删除收藏
export const MyUserDeleteCollectHttp = (query) => {
    return Http.post("/api/user/deleteCollect", query);
};

// 数据操作 - 收藏
export const MyUserCollectHttp = (query) => {
    return Http.post("/api/user/collect", query);
};

export const reportHttp = (query) => {
    return Http.postV2("https://api.gter.net/v2/api/forum/postTopicReport", query);
};

export const commentReportHttp = (query) => {
    return Http.postV2("https://api.gter.net/v2/api/forum/postCommentReport", query);
};

// 回应相关 - 回应列表
export const getRiposteHttp = (query) => {
    return Http.post("/api/riposte/riposteGet", query);
};

// 回应相关 - 回应提交
export const riposteSubmitHttp = (query) => {
    return Http.post("/api/riposte/riposteSubmit", query);
};

// 回应相关 - 回应详情
export const riposteDetailHttp = (query) => {
    return Http.post("/api/riposte/riposteDetail", query);
};

// 评论相关 - 上传图片
export const commonUploadHttp = (url, query) => Http.postV2(url, query);

export const commonUploadConfigHttp = (query) => {
    return Http.postV2("https://api.gter.net/v1/config/upload?type=comment", query);
};

// 评论相关 - 删除评论
export const commentDeleteHttp = (query) => {
    // return Http.post("/api/comment/commentDelete", query);
    return Http.postV2("https://api.gter.net/v2/api/forum/deleteComment", query);
};

// 详情数据 - 投票详情
export const topicDetailHttp = (query) => {
    return Http.get("https://api.gter.net/v2/api/forum/getTopicDetails", query);
};

export const topicRecommendHttp = (query) => {
    return Http.postV2("https://api.gter.net/v2/api/forum/setTopicRecommend", query);
};

export const topicEssenceHttp = (query) => {
    return Http.postV2("https://api.gter.net/v2/api/forum/setTopicBest", query);
};

export const topicDeleteHttp = (query) => {
    return Http.del("https://api.gter.net/v2/api/forum/deleteTopic", query);
};

export const topicHideHttp = (query) => {
    return Http.postV2("https://api.gter.net/v2/api/forum/setTopicHide", query);
};

export const topicgetOperationHttp = (query) => {
    return Http.postV2("https://api.gter.net/v2/api/forum/getTopicOperation", query);
};

export const getWConfigHttp = (query) => {
    return Http.get("https://api.gter.net/v2/api/config/website", query);
};
