99 * ---------------------------------------------------------------
1010 */
1111
12- import {
13- checkPasswordData ,
14- createData ,
15- deleteByIdData ,
16- findAllData ,
17- findArticlesByCategoryData ,
18- findArticlesByTagData ,
19- findByIdData ,
20- getArchivesData ,
21- getRecommendArticlesData ,
22- recommendData ,
23- updateByIdData ,
24- updateLikesByIdData ,
25- updateViewsByIdData ,
26- } from '../types/data-contracts' ;
12+ import { IArticle } from '../types/data-contracts' ;
2713import { HttpClient , RequestParams } from './HttpClient' ;
2814
2915export class Article < SecurityDataType = unknown > extends HttpClient < SecurityDataType > {
@@ -33,12 +19,12 @@ export class Article<SecurityDataType = unknown> extends HttpClient<SecurityData
3319 * @tags Article
3420 * @name create
3521 * @request POST:/article
36- * @response `200` `createData` 创建文章
3722 */
3823 create = ( params : RequestParams = { } ) =>
39- this . request < createData , any > ( {
24+ this . request < IArticle [ ] , any > ( {
4025 path : `/article` ,
4126 method : 'POST' ,
27+ format : 'json' ,
4228 ...params ,
4329 } ) ;
4430 /**
@@ -47,10 +33,9 @@ export class Article<SecurityDataType = unknown> extends HttpClient<SecurityData
4733 * @tags Article
4834 * @name findAll
4935 * @request GET:/article
50- * @response `200` `findAllData`
5136 */
5237 findAll = ( params : RequestParams = { } ) =>
53- this . request < findAllData , any > ( {
38+ this . request < void , any > ( {
5439 path : `/article` ,
5540 method : 'GET' ,
5641 ...params ,
@@ -61,10 +46,9 @@ export class Article<SecurityDataType = unknown> extends HttpClient<SecurityData
6146 * @tags Article
6247 * @name findArticlesByCategory
6348 * @request GET:/article/category/{id}
64- * @response `200` `findArticlesByCategoryData`
6549 */
6650 findArticlesByCategory = ( id : string , params : RequestParams = { } ) =>
67- this . request < findArticlesByCategoryData , any > ( {
51+ this . request < void , any > ( {
6852 path : `/article/category/${ id } ` ,
6953 method : 'GET' ,
7054 ...params ,
@@ -75,10 +59,9 @@ export class Article<SecurityDataType = unknown> extends HttpClient<SecurityData
7559 * @tags Article
7660 * @name findArticlesByTag
7761 * @request GET:/article/tag/{id}
78- * @response `200` `findArticlesByTagData`
7962 */
8063 findArticlesByTag = ( id : string , params : RequestParams = { } ) =>
81- this . request < findArticlesByTagData , any > ( {
64+ this . request < void , any > ( {
8265 path : `/article/tag/${ id } ` ,
8366 method : 'GET' ,
8467 ...params ,
@@ -89,10 +72,9 @@ export class Article<SecurityDataType = unknown> extends HttpClient<SecurityData
8972 * @tags Article
9073 * @name getRecommendArticles
9174 * @request GET:/article/all/recommend
92- * @response `200` `getRecommendArticlesData`
9375 */
9476 getRecommendArticles = ( params : RequestParams = { } ) =>
95- this . request < getRecommendArticlesData , any > ( {
77+ this . request < void , any > ( {
9678 path : `/article/all/recommend` ,
9779 method : 'GET' ,
9880 ...params ,
@@ -103,10 +85,9 @@ export class Article<SecurityDataType = unknown> extends HttpClient<SecurityData
10385 * @tags Article
10486 * @name getArchives
10587 * @request GET:/article/archives
106- * @response `200` `getArchivesData`
10788 */
10889 getArchives = ( params : RequestParams = { } ) =>
109- this . request < getArchivesData , any > ( {
90+ this . request < void , any > ( {
11091 path : `/article/archives` ,
11192 method : 'GET' ,
11293 ...params ,
@@ -117,10 +98,9 @@ export class Article<SecurityDataType = unknown> extends HttpClient<SecurityData
11798 * @tags Article
11899 * @name recommend
119100 * @request GET:/article/recommend
120- * @response `200` `recommendData`
121101 */
122102 recommend = ( params : RequestParams = { } ) =>
123- this . request < recommendData , any > ( {
103+ this . request < void , any > ( {
124104 path : `/article/recommend` ,
125105 method : 'GET' ,
126106 ...params ,
@@ -131,10 +111,9 @@ export class Article<SecurityDataType = unknown> extends HttpClient<SecurityData
131111 * @tags Article
132112 * @name findById
133113 * @request GET:/article/{id}
134- * @response `200` `findByIdData`
135114 */
136115 findById = ( id : string , params : RequestParams = { } ) =>
137- this . request < findByIdData , any > ( {
116+ this . request < void , any > ( {
138117 path : `/article/${ id } ` ,
139118 method : 'GET' ,
140119 ...params ,
@@ -145,10 +124,9 @@ export class Article<SecurityDataType = unknown> extends HttpClient<SecurityData
145124 * @tags Article
146125 * @name updateById
147126 * @request PATCH:/article/{id}
148- * @response `200` `updateByIdData`
149127 */
150128 updateById = ( id : string , params : RequestParams = { } ) =>
151- this . request < updateByIdData , any > ( {
129+ this . request < void , any > ( {
152130 path : `/article/${ id } ` ,
153131 method : 'PATCH' ,
154132 ...params ,
@@ -159,10 +137,9 @@ export class Article<SecurityDataType = unknown> extends HttpClient<SecurityData
159137 * @tags Article
160138 * @name deleteById
161139 * @request DELETE:/article/{id}
162- * @response `200` `deleteByIdData`
163140 */
164141 deleteById = ( id : string , params : RequestParams = { } ) =>
165- this . request < deleteByIdData , any > ( {
142+ this . request < void , any > ( {
166143 path : `/article/${ id } ` ,
167144 method : 'DELETE' ,
168145 ...params ,
@@ -173,10 +150,9 @@ export class Article<SecurityDataType = unknown> extends HttpClient<SecurityData
173150 * @tags Article
174151 * @name checkPassword
175152 * @request POST:/article/{id}/checkPassword
176- * @response `200` `checkPasswordData`
177153 */
178154 checkPassword = ( id : string , params : RequestParams = { } ) =>
179- this . request < checkPasswordData , any > ( {
155+ this . request < void , any > ( {
180156 path : `/article/${ id } /checkPassword` ,
181157 method : 'POST' ,
182158 ...params ,
@@ -187,10 +163,9 @@ export class Article<SecurityDataType = unknown> extends HttpClient<SecurityData
187163 * @tags Article
188164 * @name updateViewsById
189165 * @request POST:/article/{id}/views
190- * @response `200` `updateViewsByIdData`
191166 */
192167 updateViewsById = ( id : string , params : RequestParams = { } ) =>
193- this . request < updateViewsByIdData , any > ( {
168+ this . request < void , any > ( {
194169 path : `/article/${ id } /views` ,
195170 method : 'POST' ,
196171 ...params ,
@@ -201,10 +176,9 @@ export class Article<SecurityDataType = unknown> extends HttpClient<SecurityData
201176 * @tags Article
202177 * @name updateLikesById
203178 * @request POST:/article/{id}/likes
204- * @response `200` `updateLikesByIdData`
205179 */
206180 updateLikesById = ( id : string , params : RequestParams = { } ) =>
207- this . request < updateLikesByIdData , any > ( {
181+ this . request < void , any > ( {
208182 path : `/article/${ id } /likes` ,
209183 method : 'POST' ,
210184 ...params ,
0 commit comments