chore: 更新openapi
This commit is contained in:
parent
b8e50a9511
commit
33ef6e7d20
33
src/services/hebi/commentController.ts
Normal file
33
src/services/hebi/commentController.ts
Normal file
@ -0,0 +1,33 @@
|
||||
// @ts-ignore
|
||||
/* eslint-disable */
|
||||
import { request } from '@umijs/max';
|
||||
|
||||
/** getCommentListByPostId GET /api/comment/comments */
|
||||
export async function getCommentListByPostIdUsingGet(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.getCommentListByPostIdUsingGETParams,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.BaseResponseListCommentVO_>('/api/comment/comments', {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** addComment POST /api/comment/sendcomment */
|
||||
export async function addCommentUsingPost(
|
||||
body: API.CommentAddRequest,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.BaseResponseLong_>('/api/comment/sendcomment', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
@ -3,6 +3,7 @@
|
||||
// API 更新时间:
|
||||
// API 唯一标识:
|
||||
import * as chartController from './chartController';
|
||||
import * as commentController from './commentController';
|
||||
import * as fileController from './fileController';
|
||||
import * as postController from './postController';
|
||||
import * as postFavourController from './postFavourController';
|
||||
@ -11,6 +12,7 @@ import * as queueController from './queueController';
|
||||
import * as userController from './userController';
|
||||
export default {
|
||||
chartController,
|
||||
commentController,
|
||||
fileController,
|
||||
postController,
|
||||
postFavourController,
|
||||
|
24
src/services/hebi/typings.d.ts
vendored
24
src/services/hebi/typings.d.ts
vendored
@ -34,6 +34,12 @@ declare namespace API {
|
||||
message?: string;
|
||||
};
|
||||
|
||||
type BaseResponseListCommentVO_ = {
|
||||
code?: number;
|
||||
data?: CommentVO[];
|
||||
message?: string;
|
||||
};
|
||||
|
||||
type BaseResponseListInt_ = {
|
||||
code?: number;
|
||||
data?: number[];
|
||||
@ -181,6 +187,18 @@ declare namespace API {
|
||||
userId?: number;
|
||||
};
|
||||
|
||||
type CommentAddRequest = {
|
||||
content?: string;
|
||||
postId?: number;
|
||||
};
|
||||
|
||||
type CommentVO = {
|
||||
content?: string;
|
||||
createTime?: string;
|
||||
userAvatar?: string;
|
||||
userName?: string;
|
||||
};
|
||||
|
||||
type DeleteRequest = {
|
||||
id?: number;
|
||||
};
|
||||
@ -202,6 +220,11 @@ declare namespace API {
|
||||
id?: number;
|
||||
};
|
||||
|
||||
type getCommentListByPostIdUsingGETParams = {
|
||||
/** postId */
|
||||
postId: number;
|
||||
};
|
||||
|
||||
type getPostVOByIdUsingGETParams = {
|
||||
/** id */
|
||||
id?: number;
|
||||
@ -302,6 +325,7 @@ declare namespace API {
|
||||
createTime?: string;
|
||||
favourNum?: number;
|
||||
id?: number;
|
||||
isDelete?: number;
|
||||
tags?: string;
|
||||
thumbNum?: number;
|
||||
title?: string;
|
||||
|
Loading…
x
Reference in New Issue
Block a user