11import { request , toResponse } from '../request'
2+ import type { Posts } from '../types/api-responses'
23import type {
34 CreatePostOption ,
45 PaginationOption ,
56 PostType ,
67} from '../types/options'
7- import type { Posts } from '../types/api-responses'
88
99/**
1010 * 发送动态
11+ * @param type 动态类型
1112 * @param content 内容
1213 * @param options 其他选项
1314 */
@@ -30,6 +31,7 @@ export const create = <T = Posts.CreateResponse>(
3031
3132/**
3233 * 获取动态详情
34+ * @param type 动态类型
3335 * @param id 动态ID
3436 */
3537export const get = < T = Posts . GetResponse > ( type : PostType , id : string ) =>
@@ -41,9 +43,9 @@ export const get = <T = Posts.GetResponse>(type: PostType, id: string) =>
4143
4244/**
4345 * 分享动态
46+ * @param type 动态类型
4447 * @param id 动态ID
4548 * @param method 分享方式
46- * @returns
4749 */
4850export const share = < T = { } > ( type : PostType , id : string , method : string ) =>
4951 toResponse < T > (
@@ -57,6 +59,7 @@ export const share = <T = {}>(type: PostType, id: string, method: string) =>
5759
5860/**
5961 * 点赞动态
62+ * @param type 动态类型
6063 * @param id 动态ID
6164 */
6265export const like = < T = { } > ( type : PostType , id : string ) =>
@@ -68,6 +71,7 @@ export const like = <T = {}>(type: PostType, id: string) =>
6871
6972/**
7073 * 取消点赞动态
74+ * @param type 动态类型
7175 * @param id 动态ID
7276 */
7377export const unlike = < T = { } > ( type : PostType , id : string ) =>
@@ -79,6 +83,7 @@ export const unlike = <T = {}>(type: PostType, id: string) =>
7983
8084/**
8185 * 删除动态
86+ * @param type 动态类型
8287 * @param id 动态ID
8388 */
8489export const remove = < T = Posts . RemoveResponse > ( type : PostType , id : string ) =>
@@ -90,6 +95,7 @@ export const remove = <T = Posts.RemoveResponse>(type: PostType, id: string) =>
9095
9196/**
9297 * 获取点赞用户列表
98+ * @param type 动态类型
9399 * @param id 动态ID
94100 */
95101export const listLikedUsers = < T = Posts . ListLikedUsersResponse > (
@@ -109,6 +115,7 @@ export const listLikedUsers = <T = Posts.ListLikedUsersResponse>(
109115
110116/**
111117 * 隐藏动态(仅会员)
118+ * @param type 动态类型
112119 * @param id 动态ID
113120 */
114121export const hide = < T = Posts . HideResponse > ( type : PostType , id : string ) =>
@@ -120,6 +127,7 @@ export const hide = <T = Posts.HideResponse>(type: PostType, id: string) =>
120127
121128/**
122129 * 转为公开动态(仅会员)
130+ * @param type 动态类型
123131 * @param id 动态ID
124132 */
125133export const recover = < T = Posts . HideResponse > ( type : PostType , id : string ) =>
0 commit comments