@fecommunity/reactpress-toolkit 1.0.0-beta.1 → 1.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/README.md +405 -0
  2. package/dist/api/Article.d.ts +44 -29
  3. package/dist/api/Article.js +42 -31
  4. package/dist/api/Auth.d.ts +11 -6
  5. package/dist/api/Auth.js +10 -8
  6. package/dist/api/Category.d.ts +20 -13
  7. package/dist/api/Category.js +18 -15
  8. package/dist/api/Comment.d.ts +22 -14
  9. package/dist/api/Comment.js +20 -16
  10. package/dist/api/File.d.ts +16 -10
  11. package/dist/api/File.js +14 -12
  12. package/dist/api/{http-client.d.ts → HttpClient.d.ts} +2 -2
  13. package/dist/api/{http-client.js → HttpClient.js} +4 -2
  14. package/dist/api/Knowledge.d.ts +29 -19
  15. package/dist/api/Knowledge.js +27 -22
  16. package/dist/api/Page.d.ts +23 -15
  17. package/dist/api/Page.js +21 -17
  18. package/dist/api/Search.d.ts +12 -7
  19. package/dist/api/Search.js +11 -9
  20. package/dist/api/Setting.d.ts +10 -6
  21. package/dist/api/Setting.js +8 -8
  22. package/dist/api/Smtp.d.ts +14 -9
  23. package/dist/api/Smtp.js +12 -11
  24. package/dist/api/Tag.d.ts +22 -14
  25. package/dist/api/Tag.js +20 -16
  26. package/dist/api/User.d.ts +15 -8
  27. package/dist/api/User.js +13 -13
  28. package/dist/api/View.d.ts +19 -12
  29. package/dist/api/View.js +17 -14
  30. package/dist/api/index.d.ts +13 -18
  31. package/dist/api/index.js +28 -41
  32. package/dist/api/instance.d.ts +47 -0
  33. package/dist/api/instance.js +71 -0
  34. package/dist/config/env.d.ts +1 -0
  35. package/dist/config/env.js +93 -0
  36. package/dist/config/global.d.ts +34 -0
  37. package/dist/config/global.js +382 -0
  38. package/dist/config/i18n.d.ts +5 -0
  39. package/dist/config/i18n.js +47 -0
  40. package/dist/config/index.d.ts +14 -0
  41. package/dist/config/index.js +30 -0
  42. package/dist/index.d.ts +8 -9
  43. package/dist/index.js +20 -18
  44. package/dist/locales/en.json +97 -0
  45. package/dist/locales/zh.json +97 -0
  46. package/dist/types/index.d.ts +245 -1
  47. package/dist/types/index.js +10 -17
  48. package/dist/utils/index.d.ts +33 -2
  49. package/dist/utils/index.js +57 -18
  50. package/package.json +15 -6
  51. package/demos/simple.ts +0 -65
  52. package/dist/api/Admin.d.ts +0 -14
  53. package/dist/api/Admin.js +0 -32
  54. package/dist/api/All.d.ts +0 -14
  55. package/dist/api/All.js +0 -32
  56. package/dist/api/Archives.d.ts +0 -14
  57. package/dist/api/Archives.js +0 -32
  58. package/dist/api/Book.d.ts +0 -15
  59. package/dist/api/Book.js +0 -33
  60. package/dist/api/Chapter.d.ts +0 -15
  61. package/dist/api/Chapter.js +0 -33
  62. package/dist/api/Get.d.ts +0 -14
  63. package/dist/api/Get.js +0 -32
  64. package/dist/api/Github.d.ts +0 -14
  65. package/dist/api/Github.js +0 -32
  66. package/dist/api/Host.d.ts +0 -14
  67. package/dist/api/Host.js +0 -32
  68. package/dist/api/Id.d.ts +0 -284
  69. package/dist/api/Id.js +0 -422
  70. package/dist/api/Login.d.ts +0 -14
  71. package/dist/api/Login.js +0 -32
  72. package/dist/api/Password.d.ts +0 -15
  73. package/dist/api/Password.js +0 -33
  74. package/dist/api/Recommend.d.ts +0 -14
  75. package/dist/api/Recommend.js +0 -32
  76. package/dist/api/Register.d.ts +0 -15
  77. package/dist/api/Register.js +0 -33
  78. package/dist/api/Update.d.ts +0 -15
  79. package/dist/api/Update.js +0 -33
  80. package/dist/api/Upload.d.ts +0 -15
  81. package/dist/api/Upload.js +0 -33
  82. package/dist/api/Url.d.ts +0 -14
  83. package/dist/api/Url.js +0 -32
  84. package/dist/api/api-instance.d.ts +0 -39
  85. package/dist/api/api-instance.js +0 -46
  86. package/dist/api/httpClient.d.ts +0 -41
  87. package/dist/api/httpClient.js +0 -94
  88. package/dist/types/data-contracts.d.ts +0 -177
  89. package/dist/types/data-contracts.js +0 -12
  90. package/dist/utils/common.d.ts +0 -23
  91. package/dist/utils/common.js +0 -78
  92. package/dist/utils/http.d.ts +0 -3
  93. package/dist/utils/http.js +0 -47
  94. package/scripts/generate-api-types.js +0 -571
  95. package/scripts/generate-swagger.js +0 -47
  96. package/scripts/organize-api.js +0 -136
  97. package/src/api/Article.ts +0 -186
  98. package/src/api/Auth.ts +0 -54
  99. package/src/api/Category.ts +0 -82
  100. package/src/api/Comment.ts +0 -95
  101. package/src/api/File.ts +0 -69
  102. package/src/api/Knowledge.ts +0 -122
  103. package/src/api/Page.ts +0 -95
  104. package/src/api/Search.ts +0 -54
  105. package/src/api/Setting.ts +0 -43
  106. package/src/api/Smtp.ts +0 -56
  107. package/src/api/Tag.ts +0 -95
  108. package/src/api/User.ts +0 -72
  109. package/src/api/View.ts +0 -82
  110. package/src/api/api-instance.ts +0 -69
  111. package/src/api/httpClient.ts +0 -140
  112. package/src/api/index.ts +0 -25
  113. package/src/index.ts +0 -18
  114. package/src/types/data-contracts.ts +0 -198
  115. package/src/types/index.ts +0 -4
  116. package/src/utils/common.ts +0 -108
  117. package/src/utils/http.ts +0 -52
  118. package/src/utils/index.ts +0 -5
  119. package/test-final.js +0 -56
  120. package/test-import.js +0 -34
  121. package/tsconfig.json +0 -20
@@ -11,31 +11,30 @@
11
11
  */
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.Article = void 0;
14
- const httpClient_1 = require("./httpClient");
15
- class Article extends httpClient_1.HttpClient {
16
- constructor() {
17
- super(...arguments);
14
+ class Article {
15
+ constructor(http) {
18
16
  /**
19
17
  * No description
20
18
  *
21
19
  * @tags Article
22
- * @name create
20
+ * @name ArticleControllerCreate
23
21
  * @request POST:/article
22
+ * @response `200` `IArticleControllerCreateData` 创建文章
24
23
  */
25
- this.create = (params = {}) => this.request({
24
+ this.create = (params = {}) => this.http.request({
26
25
  path: `/article`,
27
26
  method: 'POST',
28
- format: 'json',
29
27
  ...params,
30
28
  });
31
29
  /**
32
30
  * No description
33
31
  *
34
32
  * @tags Article
35
- * @name findAll
33
+ * @name ArticleControllerFindAll
36
34
  * @request GET:/article
35
+ * @response `200` `IArticleControllerFindAllData`
37
36
  */
38
- this.findAll = (params = {}) => this.request({
37
+ this.findAll = (params = {}) => this.http.request({
39
38
  path: `/article`,
40
39
  method: 'GET',
41
40
  ...params,
@@ -44,10 +43,11 @@ class Article extends httpClient_1.HttpClient {
44
43
  * No description
45
44
  *
46
45
  * @tags Article
47
- * @name findByCategory
46
+ * @name ArticleControllerFindArticlesByCategory
48
47
  * @request GET:/article/category/{id}
48
+ * @response `200` `IArticleControllerFindArticlesByCategoryData`
49
49
  */
50
- this.findByCategory = (id, params = {}) => this.request({
50
+ this.findArticlesByCategory = (id, params = {}) => this.http.request({
51
51
  path: `/article/category/${id}`,
52
52
  method: 'GET',
53
53
  ...params,
@@ -56,10 +56,11 @@ class Article extends httpClient_1.HttpClient {
56
56
  * No description
57
57
  *
58
58
  * @tags Article
59
- * @name findByTag
59
+ * @name ArticleControllerFindArticlesByTag
60
60
  * @request GET:/article/tag/{id}
61
+ * @response `200` `IArticleControllerFindArticlesByTagData`
61
62
  */
62
- this.findByTag = (id, params = {}) => this.request({
63
+ this.findArticlesByTag = (id, params = {}) => this.http.request({
63
64
  path: `/article/tag/${id}`,
64
65
  method: 'GET',
65
66
  ...params,
@@ -68,10 +69,11 @@ class Article extends httpClient_1.HttpClient {
68
69
  * No description
69
70
  *
70
71
  * @tags Article
71
- * @name getRecommendations
72
+ * @name ArticleControllerGetRecommendArticles
72
73
  * @request GET:/article/all/recommend
74
+ * @response `200` `IArticleControllerGetRecommendArticlesData`
73
75
  */
74
- this.getRecommendations = (params = {}) => this.request({
76
+ this.getRecommendArticles = (params = {}) => this.http.request({
75
77
  path: `/article/all/recommend`,
76
78
  method: 'GET',
77
79
  ...params,
@@ -80,10 +82,11 @@ class Article extends httpClient_1.HttpClient {
80
82
  * No description
81
83
  *
82
84
  * @tags Article
83
- * @name getArchives
85
+ * @name ArticleControllerGetArchives
84
86
  * @request GET:/article/archives
87
+ * @response `200` `IArticleControllerGetArchivesData`
85
88
  */
86
- this.getArchives = (params = {}) => this.request({
89
+ this.getArchives = (params = {}) => this.http.request({
87
90
  path: `/article/archives`,
88
91
  method: 'GET',
89
92
  ...params,
@@ -92,10 +95,11 @@ class Article extends httpClient_1.HttpClient {
92
95
  * No description
93
96
  *
94
97
  * @tags Article
95
- * @name recommend
98
+ * @name ArticleControllerRecommend
96
99
  * @request GET:/article/recommend
100
+ * @response `200` `IArticleControllerRecommendData`
97
101
  */
98
- this.recommend = (params = {}) => this.request({
102
+ this.recommend = (params = {}) => this.http.request({
99
103
  path: `/article/recommend`,
100
104
  method: 'GET',
101
105
  ...params,
@@ -104,10 +108,11 @@ class Article extends httpClient_1.HttpClient {
104
108
  * No description
105
109
  *
106
110
  * @tags Article
107
- * @name findById
111
+ * @name ArticleControllerFindById
108
112
  * @request GET:/article/{id}
113
+ * @response `200` `IArticleControllerFindByIdData`
109
114
  */
110
- this.findById = (id, params = {}) => this.request({
115
+ this.findById = (id, params = {}) => this.http.request({
111
116
  path: `/article/${id}`,
112
117
  method: 'GET',
113
118
  ...params,
@@ -116,10 +121,11 @@ class Article extends httpClient_1.HttpClient {
116
121
  * No description
117
122
  *
118
123
  * @tags Article
119
- * @name updateById
124
+ * @name ArticleControllerUpdateById
120
125
  * @request PATCH:/article/{id}
126
+ * @response `200` `IArticleControllerUpdateByIdData`
121
127
  */
122
- this.updateById = (id, params = {}) => this.request({
128
+ this.updateById = (id, params = {}) => this.http.request({
123
129
  path: `/article/${id}`,
124
130
  method: 'PATCH',
125
131
  ...params,
@@ -128,10 +134,11 @@ class Article extends httpClient_1.HttpClient {
128
134
  * No description
129
135
  *
130
136
  * @tags Article
131
- * @name deleteById
137
+ * @name ArticleControllerDeleteById
132
138
  * @request DELETE:/article/{id}
139
+ * @response `200` `IArticleControllerDeleteByIdData`
133
140
  */
134
- this.deleteById = (id, params = {}) => this.request({
141
+ this.deleteById = (id, params = {}) => this.http.request({
135
142
  path: `/article/${id}`,
136
143
  method: 'DELETE',
137
144
  ...params,
@@ -140,10 +147,11 @@ class Article extends httpClient_1.HttpClient {
140
147
  * No description
141
148
  *
142
149
  * @tags Article
143
- * @name checkPassword
150
+ * @name ArticleControllerCheckPassword
144
151
  * @request POST:/article/{id}/checkPassword
152
+ * @response `200` `IArticleControllerCheckPasswordData`
145
153
  */
146
- this.checkPassword = (id, params = {}) => this.request({
154
+ this.checkPassword = (id, params = {}) => this.http.request({
147
155
  path: `/article/${id}/checkPassword`,
148
156
  method: 'POST',
149
157
  ...params,
@@ -152,10 +160,11 @@ class Article extends httpClient_1.HttpClient {
152
160
  * No description
153
161
  *
154
162
  * @tags Article
155
- * @name updateViews
163
+ * @name ArticleControllerUpdateViewsById
156
164
  * @request POST:/article/{id}/views
165
+ * @response `200` `IArticleControllerUpdateViewsByIdData`
157
166
  */
158
- this.updateViews = (id, params = {}) => this.request({
167
+ this.updateViewsById = (id, params = {}) => this.http.request({
159
168
  path: `/article/${id}/views`,
160
169
  method: 'POST',
161
170
  ...params,
@@ -164,14 +173,16 @@ class Article extends httpClient_1.HttpClient {
164
173
  * No description
165
174
  *
166
175
  * @tags Article
167
- * @name updateLikes
176
+ * @name ArticleControllerUpdateLikesById
168
177
  * @request POST:/article/{id}/likes
178
+ * @response `200` `IArticleControllerUpdateLikesByIdData`
169
179
  */
170
- this.updateLikes = (id, params = {}) => this.request({
180
+ this.updateLikesById = (id, params = {}) => this.http.request({
171
181
  path: `/article/${id}/likes`,
172
182
  method: 'POST',
173
183
  ...params,
174
184
  });
185
+ this.http = http;
175
186
  }
176
187
  }
177
188
  exports.Article = Article;
@@ -1,27 +1,32 @@
1
- import { HttpClient, RequestParams } from './httpClient';
2
- export declare class Auth<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
1
+ import { HttpClient, RequestParams } from './HttpClient';
2
+ export declare class Auth<SecurityDataType = unknown> {
3
+ http: HttpClient<SecurityDataType>;
4
+ constructor(http: HttpClient<SecurityDataType>);
3
5
  /**
4
6
  * No description
5
7
  *
6
8
  * @tags Auth
7
9
  * @name AuthControllerLogin
8
10
  * @request POST:/auth/login
11
+ * @response `200` `IAuthControllerLoginData`
9
12
  */
10
- authControllerLogin: (params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
13
+ login: (params?: RequestParams) => Promise<any>;
11
14
  /**
12
15
  * No description
13
16
  *
14
17
  * @tags Auth
15
- * @name createBook
18
+ * @name AuthControllerCreateBook
16
19
  * @request POST:/auth/admin
20
+ * @response `201` `IAuthControllerCreateBookData`
17
21
  */
18
- createBook: (params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
22
+ createBook: (params?: RequestParams) => Promise<any>;
19
23
  /**
20
24
  * No description
21
25
  *
22
26
  * @tags Auth
23
27
  * @name AuthControllerLoginWithGithub
24
28
  * @request POST:/auth/github
29
+ * @response `201` `IAuthControllerLoginWithGithubData`
25
30
  */
26
- authControllerLoginWithGithub: (params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
31
+ loginWithGithub: (params?: RequestParams) => Promise<any>;
27
32
  }
package/dist/api/Auth.js CHANGED
@@ -11,18 +11,17 @@
11
11
  */
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.Auth = void 0;
14
- const httpClient_1 = require("./httpClient");
15
- class Auth extends httpClient_1.HttpClient {
16
- constructor() {
17
- super(...arguments);
14
+ class Auth {
15
+ constructor(http) {
18
16
  /**
19
17
  * No description
20
18
  *
21
19
  * @tags Auth
22
20
  * @name AuthControllerLogin
23
21
  * @request POST:/auth/login
22
+ * @response `200` `IAuthControllerLoginData`
24
23
  */
25
- this.authControllerLogin = (params = {}) => this.request({
24
+ this.login = (params = {}) => this.http.request({
26
25
  path: `/auth/login`,
27
26
  method: 'POST',
28
27
  ...params,
@@ -31,10 +30,11 @@ class Auth extends httpClient_1.HttpClient {
31
30
  * No description
32
31
  *
33
32
  * @tags Auth
34
- * @name createBook
33
+ * @name AuthControllerCreateBook
35
34
  * @request POST:/auth/admin
35
+ * @response `201` `IAuthControllerCreateBookData`
36
36
  */
37
- this.createBook = (params = {}) => this.request({
37
+ this.createBook = (params = {}) => this.http.request({
38
38
  path: `/auth/admin`,
39
39
  method: 'POST',
40
40
  ...params,
@@ -45,12 +45,14 @@ class Auth extends httpClient_1.HttpClient {
45
45
  * @tags Auth
46
46
  * @name AuthControllerLoginWithGithub
47
47
  * @request POST:/auth/github
48
+ * @response `201` `IAuthControllerLoginWithGithubData`
48
49
  */
49
- this.authControllerLoginWithGithub = (params = {}) => this.request({
50
+ this.loginWithGithub = (params = {}) => this.http.request({
50
51
  path: `/auth/github`,
51
52
  method: 'POST',
52
53
  ...params,
53
54
  });
55
+ this.http = http;
54
56
  }
55
57
  }
56
58
  exports.Auth = Auth;
@@ -1,44 +1,51 @@
1
- import { ICategory } from '../types/data-contracts';
2
- import { HttpClient, RequestParams } from './httpClient';
3
- export declare class Category<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
1
+ import { ICategoryControllerCreateData } from '../types';
2
+ import { HttpClient, RequestParams } from './HttpClient';
3
+ export declare class Category<SecurityDataType = unknown> {
4
+ http: HttpClient<SecurityDataType>;
5
+ constructor(http: HttpClient<SecurityDataType>);
4
6
  /**
5
7
  * No description
6
8
  *
7
9
  * @tags Category
8
- * @name create
10
+ * @name CategoryControllerCreate
9
11
  * @request POST:/category
12
+ * @response `200` `ICategoryControllerCreateData` 添加分类
10
13
  */
11
- create: (params?: RequestParams) => Promise<import("axios").AxiosResponse<ICategory[], any, {}>>;
14
+ create: (params?: RequestParams) => Promise<ICategoryControllerCreateData>;
12
15
  /**
13
16
  * No description
14
17
  *
15
18
  * @tags Category
16
- * @name findAll
19
+ * @name CategoryControllerFindAll
17
20
  * @request GET:/category
21
+ * @response `200` `ICategoryControllerFindAllData`
18
22
  */
19
- findAll: (params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
23
+ findAll: (params?: RequestParams) => Promise<any>;
20
24
  /**
21
25
  * No description
22
26
  *
23
27
  * @tags Category
24
- * @name findById
28
+ * @name CategoryControllerFindById
25
29
  * @request GET:/category/{id}
30
+ * @response `200` `ICategoryControllerFindByIdData`
26
31
  */
27
- findById: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
32
+ findById: (id: string, params?: RequestParams) => Promise<any>;
28
33
  /**
29
34
  * No description
30
35
  *
31
36
  * @tags Category
32
- * @name updateById
37
+ * @name CategoryControllerUpdateById
33
38
  * @request PATCH:/category/{id}
39
+ * @response `200` `ICategoryControllerUpdateByIdData`
34
40
  */
35
- updateById: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
41
+ updateById: (id: string, params?: RequestParams) => Promise<any>;
36
42
  /**
37
43
  * No description
38
44
  *
39
45
  * @tags Category
40
- * @name deleteById
46
+ * @name CategoryControllerDeleteById
41
47
  * @request DELETE:/category/{id}
48
+ * @response `200` `ICategoryControllerDeleteByIdData`
42
49
  */
43
- deleteById: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
50
+ deleteById: (id: string, params?: RequestParams) => Promise<any>;
44
51
  }
@@ -11,31 +11,30 @@
11
11
  */
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.Category = void 0;
14
- const httpClient_1 = require("./httpClient");
15
- class Category extends httpClient_1.HttpClient {
16
- constructor() {
17
- super(...arguments);
14
+ class Category {
15
+ constructor(http) {
18
16
  /**
19
17
  * No description
20
18
  *
21
19
  * @tags Category
22
- * @name create
20
+ * @name CategoryControllerCreate
23
21
  * @request POST:/category
22
+ * @response `200` `ICategoryControllerCreateData` 添加分类
24
23
  */
25
- this.create = (params = {}) => this.request({
24
+ this.create = (params = {}) => this.http.request({
26
25
  path: `/category`,
27
26
  method: 'POST',
28
- format: 'json',
29
27
  ...params,
30
28
  });
31
29
  /**
32
30
  * No description
33
31
  *
34
32
  * @tags Category
35
- * @name findAll
33
+ * @name CategoryControllerFindAll
36
34
  * @request GET:/category
35
+ * @response `200` `ICategoryControllerFindAllData`
37
36
  */
38
- this.findAll = (params = {}) => this.request({
37
+ this.findAll = (params = {}) => this.http.request({
39
38
  path: `/category`,
40
39
  method: 'GET',
41
40
  ...params,
@@ -44,10 +43,11 @@ class Category extends httpClient_1.HttpClient {
44
43
  * No description
45
44
  *
46
45
  * @tags Category
47
- * @name findById
46
+ * @name CategoryControllerFindById
48
47
  * @request GET:/category/{id}
48
+ * @response `200` `ICategoryControllerFindByIdData`
49
49
  */
50
- this.findById = (id, params = {}) => this.request({
50
+ this.findById = (id, params = {}) => this.http.request({
51
51
  path: `/category/${id}`,
52
52
  method: 'GET',
53
53
  ...params,
@@ -56,10 +56,11 @@ class Category extends httpClient_1.HttpClient {
56
56
  * No description
57
57
  *
58
58
  * @tags Category
59
- * @name updateById
59
+ * @name CategoryControllerUpdateById
60
60
  * @request PATCH:/category/{id}
61
+ * @response `200` `ICategoryControllerUpdateByIdData`
61
62
  */
62
- this.updateById = (id, params = {}) => this.request({
63
+ this.updateById = (id, params = {}) => this.http.request({
63
64
  path: `/category/${id}`,
64
65
  method: 'PATCH',
65
66
  ...params,
@@ -68,14 +69,16 @@ class Category extends httpClient_1.HttpClient {
68
69
  * No description
69
70
  *
70
71
  * @tags Category
71
- * @name deleteById
72
+ * @name CategoryControllerDeleteById
72
73
  * @request DELETE:/category/{id}
74
+ * @response `200` `ICategoryControllerDeleteByIdData`
73
75
  */
74
- this.deleteById = (id, params = {}) => this.request({
76
+ this.deleteById = (id, params = {}) => this.http.request({
75
77
  path: `/category/${id}`,
76
78
  method: 'DELETE',
77
79
  ...params,
78
80
  });
81
+ this.http = http;
79
82
  }
80
83
  }
81
84
  exports.Category = Category;
@@ -1,52 +1,60 @@
1
- import { IComment } from '../types/data-contracts';
2
- import { HttpClient, RequestParams } from './httpClient';
3
- export declare class Comment<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
1
+ import { ICommentControllerCreateData } from '../types';
2
+ import { HttpClient, RequestParams } from './HttpClient';
3
+ export declare class Comment<SecurityDataType = unknown> {
4
+ http: HttpClient<SecurityDataType>;
5
+ constructor(http: HttpClient<SecurityDataType>);
4
6
  /**
5
7
  * No description
6
8
  *
7
9
  * @tags Comment
8
- * @name create
10
+ * @name CommentControllerCreate
9
11
  * @request POST:/comment
12
+ * @response `200` `ICommentControllerCreateData` 创建评论
10
13
  */
11
- create: (params?: RequestParams) => Promise<import("axios").AxiosResponse<IComment[], any, {}>>;
14
+ create: (params?: RequestParams) => Promise<ICommentControllerCreateData>;
12
15
  /**
13
16
  * No description
14
17
  *
15
18
  * @tags Comment
16
- * @name findAll
19
+ * @name CommentControllerFindAll
17
20
  * @request GET:/comment
21
+ * @response `200` `ICommentControllerFindAllData`
18
22
  */
19
- findAll: (params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
23
+ findAll: (params?: RequestParams) => Promise<any>;
20
24
  /**
21
25
  * No description
22
26
  *
23
27
  * @tags Comment
24
- * @name findById
28
+ * @name CommentControllerFindById
25
29
  * @request GET:/comment/{id}
30
+ * @response `200` `ICommentControllerFindByIdData`
26
31
  */
27
- findById: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
32
+ findById: (id: string, params?: RequestParams) => Promise<any>;
28
33
  /**
29
34
  * No description
30
35
  *
31
36
  * @tags Comment
32
- * @name updateById
37
+ * @name CommentControllerUpdateById
33
38
  * @request PATCH:/comment/{id}
39
+ * @response `200` `ICommentControllerUpdateByIdData`
34
40
  */
35
- updateById: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
41
+ updateById: (id: string, params?: RequestParams) => Promise<any>;
36
42
  /**
37
43
  * No description
38
44
  *
39
45
  * @tags Comment
40
- * @name deleteById
46
+ * @name CommentControllerDeleteById
41
47
  * @request DELETE:/comment/{id}
48
+ * @response `200` `ICommentControllerDeleteByIdData`
42
49
  */
43
- deleteById: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
50
+ deleteById: (id: string, params?: RequestParams) => Promise<any>;
44
51
  /**
45
52
  * No description
46
53
  *
47
54
  * @tags Comment
48
55
  * @name CommentControllerGetArticleComments
49
56
  * @request GET:/comment/host/{hostId}
57
+ * @response `200` `ICommentControllerGetArticleCommentsData`
50
58
  */
51
- commentControllerGetArticleComments: (hostId: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
59
+ getArticleComments: (hostId: string, params?: RequestParams) => Promise<any>;
52
60
  }
@@ -11,31 +11,30 @@
11
11
  */
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.Comment = void 0;
14
- const httpClient_1 = require("./httpClient");
15
- class Comment extends httpClient_1.HttpClient {
16
- constructor() {
17
- super(...arguments);
14
+ class Comment {
15
+ constructor(http) {
18
16
  /**
19
17
  * No description
20
18
  *
21
19
  * @tags Comment
22
- * @name create
20
+ * @name CommentControllerCreate
23
21
  * @request POST:/comment
22
+ * @response `200` `ICommentControllerCreateData` 创建评论
24
23
  */
25
- this.create = (params = {}) => this.request({
24
+ this.create = (params = {}) => this.http.request({
26
25
  path: `/comment`,
27
26
  method: 'POST',
28
- format: 'json',
29
27
  ...params,
30
28
  });
31
29
  /**
32
30
  * No description
33
31
  *
34
32
  * @tags Comment
35
- * @name findAll
33
+ * @name CommentControllerFindAll
36
34
  * @request GET:/comment
35
+ * @response `200` `ICommentControllerFindAllData`
37
36
  */
38
- this.findAll = (params = {}) => this.request({
37
+ this.findAll = (params = {}) => this.http.request({
39
38
  path: `/comment`,
40
39
  method: 'GET',
41
40
  ...params,
@@ -44,10 +43,11 @@ class Comment extends httpClient_1.HttpClient {
44
43
  * No description
45
44
  *
46
45
  * @tags Comment
47
- * @name findById
46
+ * @name CommentControllerFindById
48
47
  * @request GET:/comment/{id}
48
+ * @response `200` `ICommentControllerFindByIdData`
49
49
  */
50
- this.findById = (id, params = {}) => this.request({
50
+ this.findById = (id, params = {}) => this.http.request({
51
51
  path: `/comment/${id}`,
52
52
  method: 'GET',
53
53
  ...params,
@@ -56,10 +56,11 @@ class Comment extends httpClient_1.HttpClient {
56
56
  * No description
57
57
  *
58
58
  * @tags Comment
59
- * @name updateById
59
+ * @name CommentControllerUpdateById
60
60
  * @request PATCH:/comment/{id}
61
+ * @response `200` `ICommentControllerUpdateByIdData`
61
62
  */
62
- this.updateById = (id, params = {}) => this.request({
63
+ this.updateById = (id, params = {}) => this.http.request({
63
64
  path: `/comment/${id}`,
64
65
  method: 'PATCH',
65
66
  ...params,
@@ -68,10 +69,11 @@ class Comment extends httpClient_1.HttpClient {
68
69
  * No description
69
70
  *
70
71
  * @tags Comment
71
- * @name deleteById
72
+ * @name CommentControllerDeleteById
72
73
  * @request DELETE:/comment/{id}
74
+ * @response `200` `ICommentControllerDeleteByIdData`
73
75
  */
74
- this.deleteById = (id, params = {}) => this.request({
76
+ this.deleteById = (id, params = {}) => this.http.request({
75
77
  path: `/comment/${id}`,
76
78
  method: 'DELETE',
77
79
  ...params,
@@ -82,12 +84,14 @@ class Comment extends httpClient_1.HttpClient {
82
84
  * @tags Comment
83
85
  * @name CommentControllerGetArticleComments
84
86
  * @request GET:/comment/host/{hostId}
87
+ * @response `200` `ICommentControllerGetArticleCommentsData`
85
88
  */
86
- this.commentControllerGetArticleComments = (hostId, params = {}) => this.request({
89
+ this.getArticleComments = (hostId, params = {}) => this.http.request({
87
90
  path: `/comment/host/${hostId}`,
88
91
  method: 'GET',
89
92
  ...params,
90
93
  });
94
+ this.http = http;
91
95
  }
92
96
  }
93
97
  exports.Comment = Comment;
@@ -1,36 +1,42 @@
1
- import { IFile } from '../types/data-contracts';
2
- import { HttpClient, RequestParams } from './httpClient';
3
- export declare class File<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
1
+ import { IFileControllerUploadFileData } from '../types';
2
+ import { HttpClient, RequestParams } from './HttpClient';
3
+ export declare class File<SecurityDataType = unknown> {
4
+ http: HttpClient<SecurityDataType>;
5
+ constructor(http: HttpClient<SecurityDataType>);
4
6
  /**
5
7
  * No description
6
8
  *
7
9
  * @tags File
8
10
  * @name FileControllerUploadFile
9
11
  * @request POST:/file/upload
12
+ * @response `200` `IFileControllerUploadFileData` 上传文件
10
13
  */
11
- fileControllerUploadFile: (params?: RequestParams) => Promise<import("axios").AxiosResponse<IFile[], any, {}>>;
14
+ uploadFile: (params?: RequestParams) => Promise<IFileControllerUploadFileData>;
12
15
  /**
13
16
  * No description
14
17
  *
15
18
  * @tags File
16
- * @name findAll
19
+ * @name FileControllerFindAll
17
20
  * @request GET:/file
21
+ * @response `200` `IFileControllerFindAllData`
18
22
  */
19
- findAll: (params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
23
+ findAll: (params?: RequestParams) => Promise<any>;
20
24
  /**
21
25
  * No description
22
26
  *
23
27
  * @tags File
24
- * @name findById
28
+ * @name FileControllerFindById
25
29
  * @request GET:/file/{id}
30
+ * @response `200` `IFileControllerFindByIdData`
26
31
  */
27
- findById: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
32
+ findById: (id: string, params?: RequestParams) => Promise<any>;
28
33
  /**
29
34
  * No description
30
35
  *
31
36
  * @tags File
32
- * @name deleteById
37
+ * @name FileControllerDeleteById
33
38
  * @request DELETE:/file/{id}
39
+ * @response `200` `IFileControllerDeleteByIdData`
34
40
  */
35
- deleteById: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
41
+ deleteById: (id: string, params?: RequestParams) => Promise<any>;
36
42
  }