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

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 (124) hide show
  1. package/README.md +190 -0
  2. package/dist/Article.d.ts +121 -0
  3. package/dist/Article.js +189 -0
  4. package/dist/Auth.d.ts +30 -0
  5. package/dist/Auth.js +59 -0
  6. package/dist/Category.d.ts +49 -0
  7. package/dist/Category.js +85 -0
  8. package/dist/Comment.d.ts +58 -0
  9. package/dist/Comment.js +98 -0
  10. package/dist/File.d.ts +40 -0
  11. package/dist/File.js +72 -0
  12. package/dist/HttpClient.d.ts +41 -0
  13. package/dist/HttpClient.js +94 -0
  14. package/dist/Knowledge.d.ts +76 -0
  15. package/dist/Knowledge.js +124 -0
  16. package/dist/Page.d.ts +58 -0
  17. package/dist/Page.js +98 -0
  18. package/dist/Search.d.ts +30 -0
  19. package/dist/Search.js +59 -0
  20. package/dist/Setting.d.ts +22 -0
  21. package/dist/Setting.js +46 -0
  22. package/dist/Smtp.d.ts +31 -0
  23. package/dist/Smtp.js +59 -0
  24. package/dist/Tag.d.ts +58 -0
  25. package/dist/Tag.js +98 -0
  26. package/dist/User.d.ts +41 -0
  27. package/dist/User.js +73 -0
  28. package/dist/View.d.ts +49 -0
  29. package/dist/View.js +85 -0
  30. package/dist/api/ApiInstance.d.ts +39 -0
  31. package/dist/api/ApiInstance.js +46 -0
  32. package/dist/api/Article.d.ts +11 -11
  33. package/dist/api/Article.js +12 -12
  34. package/dist/api/ArticleRoute.d.ts +201 -0
  35. package/dist/api/ArticleRoute.js +12 -0
  36. package/dist/api/Auth.d.ts +5 -5
  37. package/dist/api/Auth.js +6 -6
  38. package/dist/api/AuthRoute.d.ts +44 -0
  39. package/dist/api/AuthRoute.js +12 -0
  40. package/dist/api/Category.d.ts +1 -1
  41. package/dist/api/Category.js +2 -2
  42. package/dist/api/CategoryRoute.d.ts +79 -0
  43. package/dist/api/CategoryRoute.js +12 -0
  44. package/dist/api/Comment.d.ts +3 -3
  45. package/dist/api/Comment.js +4 -4
  46. package/dist/api/CommentRoute.d.ts +95 -0
  47. package/dist/api/CommentRoute.js +12 -0
  48. package/dist/api/File.d.ts +3 -3
  49. package/dist/api/File.js +4 -4
  50. package/dist/api/FileRoute.d.ts +63 -0
  51. package/dist/api/FileRoute.js +12 -0
  52. package/dist/api/Knowledge.d.ts +5 -5
  53. package/dist/api/Knowledge.js +6 -6
  54. package/dist/api/KnowledgeRoute.d.ts +125 -0
  55. package/dist/api/KnowledgeRoute.js +12 -0
  56. package/dist/api/Page.d.ts +3 -3
  57. package/dist/api/Page.js +4 -4
  58. package/dist/api/PageRoute.d.ts +95 -0
  59. package/dist/api/PageRoute.js +12 -0
  60. package/dist/api/Search.d.ts +3 -3
  61. package/dist/api/Search.js +4 -4
  62. package/dist/api/SearchRoute.d.ts +46 -0
  63. package/dist/api/SearchRoute.js +12 -0
  64. package/dist/api/Setting.d.ts +3 -3
  65. package/dist/api/Setting.js +4 -4
  66. package/dist/api/SettingRoute.d.ts +31 -0
  67. package/dist/api/SettingRoute.js +12 -0
  68. package/dist/api/Smtp.d.ts +1 -1
  69. package/dist/api/Smtp.js +2 -2
  70. package/dist/api/SmtpRoute.d.ts +47 -0
  71. package/dist/api/SmtpRoute.js +12 -0
  72. package/dist/api/Tag.d.ts +3 -3
  73. package/dist/api/Tag.js +4 -4
  74. package/dist/api/TagRoute.d.ts +95 -0
  75. package/dist/api/TagRoute.js +12 -0
  76. package/dist/api/User.d.ts +7 -7
  77. package/dist/api/User.js +8 -8
  78. package/dist/api/UserRoute.d.ts +60 -0
  79. package/dist/api/UserRoute.js +12 -0
  80. package/dist/api/View.d.ts +3 -3
  81. package/dist/api/View.js +4 -4
  82. package/dist/api/ViewRoute.d.ts +77 -0
  83. package/dist/api/ViewRoute.js +12 -0
  84. package/dist/api/httpClient.d.ts +1 -0
  85. package/dist/api/httpClient.js +1 -0
  86. package/dist/api/index.d.ts +5 -5
  87. package/dist/api/index.js +6 -7
  88. package/dist/data-contracts.d.ts +245 -0
  89. package/dist/data-contracts.js +12 -0
  90. package/dist/index.d.ts +5 -9
  91. package/dist/index.js +14 -15
  92. package/dist/utils/common.d.ts +1 -3
  93. package/dist/utils/common.js +5 -31
  94. package/dist/utils/http.js +4 -6
  95. package/package.json +5 -3
  96. package/demos/simple.ts +0 -65
  97. package/scripts/generate-api-types.js +0 -571
  98. package/scripts/generate-swagger.js +0 -47
  99. package/scripts/organize-api.js +0 -136
  100. package/src/api/Article.ts +0 -186
  101. package/src/api/Auth.ts +0 -54
  102. package/src/api/Category.ts +0 -82
  103. package/src/api/Comment.ts +0 -95
  104. package/src/api/File.ts +0 -69
  105. package/src/api/Knowledge.ts +0 -122
  106. package/src/api/Page.ts +0 -95
  107. package/src/api/Search.ts +0 -54
  108. package/src/api/Setting.ts +0 -43
  109. package/src/api/Smtp.ts +0 -56
  110. package/src/api/Tag.ts +0 -95
  111. package/src/api/User.ts +0 -72
  112. package/src/api/View.ts +0 -82
  113. package/src/api/api-instance.ts +0 -69
  114. package/src/api/httpClient.ts +0 -140
  115. package/src/api/index.ts +0 -25
  116. package/src/index.ts +0 -18
  117. package/src/types/data-contracts.ts +0 -198
  118. package/src/types/index.ts +0 -4
  119. package/src/utils/common.ts +0 -108
  120. package/src/utils/http.ts +0 -52
  121. package/src/utils/index.ts +0 -5
  122. package/test-final.js +0 -56
  123. package/test-import.js +0 -34
  124. package/tsconfig.json +0 -20
package/dist/User.d.ts ADDED
@@ -0,0 +1,41 @@
1
+ import { IUserControllerFindAllData, IUserControllerRegisterData, IUserControllerUpdateData, IUserControllerUpdatePasswordData } from './data-contracts';
2
+ import { HttpClient, RequestParams } from './HttpClient';
3
+ export declare class User<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
4
+ /**
5
+ * No description
6
+ *
7
+ * @tags User
8
+ * @name UserControllerFindAll
9
+ * @request GET:/user
10
+ * @response `200` `IUserControllerFindAllData` 获取用户列表
11
+ * @response `403` `void` 无权获取用户列表
12
+ */
13
+ userControllerFindAll: (params?: RequestParams) => Promise<import("axios").AxiosResponse<IUserControllerFindAllData, any, {}>>;
14
+ /**
15
+ * No description
16
+ *
17
+ * @tags User
18
+ * @name UserControllerRegister
19
+ * @request POST:/user/register
20
+ * @response `201` `IUserControllerRegisterData` 创建用户
21
+ */
22
+ userControllerRegister: (params?: RequestParams) => Promise<import("axios").AxiosResponse<IUserControllerRegisterData, any, {}>>;
23
+ /**
24
+ * No description
25
+ *
26
+ * @tags User
27
+ * @name UserControllerUpdate
28
+ * @request POST:/user/update
29
+ * @response `200` `IUserControllerUpdateData` 更新用户成功
30
+ */
31
+ userControllerUpdate: (params?: RequestParams) => Promise<import("axios").AxiosResponse<IUserControllerUpdateData, any, {}>>;
32
+ /**
33
+ * No description
34
+ *
35
+ * @tags User
36
+ * @name UserControllerUpdatePassword
37
+ * @request POST:/user/password
38
+ * @response `201` `IUserControllerUpdatePasswordData` 更新密码成功
39
+ */
40
+ userControllerUpdatePassword: (params?: RequestParams) => Promise<import("axios").AxiosResponse<IUserControllerUpdatePasswordData, any, {}>>;
41
+ }
package/dist/User.js ADDED
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ /* eslint-disable */
3
+ /* tslint:disable */
4
+ /*
5
+ * ---------------------------------------------------------------
6
+ * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
7
+ * ## ##
8
+ * ## AUTHOR: acacode ##
9
+ * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
10
+ * ---------------------------------------------------------------
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.User = void 0;
14
+ const HttpClient_1 = require("./HttpClient");
15
+ class User extends HttpClient_1.HttpClient {
16
+ constructor() {
17
+ super(...arguments);
18
+ /**
19
+ * No description
20
+ *
21
+ * @tags User
22
+ * @name UserControllerFindAll
23
+ * @request GET:/user
24
+ * @response `200` `IUserControllerFindAllData` 获取用户列表
25
+ * @response `403` `void` 无权获取用户列表
26
+ */
27
+ this.userControllerFindAll = (params = {}) => this.request({
28
+ path: `/user`,
29
+ method: 'GET',
30
+ ...params,
31
+ });
32
+ /**
33
+ * No description
34
+ *
35
+ * @tags User
36
+ * @name UserControllerRegister
37
+ * @request POST:/user/register
38
+ * @response `201` `IUserControllerRegisterData` 创建用户
39
+ */
40
+ this.userControllerRegister = (params = {}) => this.request({
41
+ path: `/user/register`,
42
+ method: 'POST',
43
+ ...params,
44
+ });
45
+ /**
46
+ * No description
47
+ *
48
+ * @tags User
49
+ * @name UserControllerUpdate
50
+ * @request POST:/user/update
51
+ * @response `200` `IUserControllerUpdateData` 更新用户成功
52
+ */
53
+ this.userControllerUpdate = (params = {}) => this.request({
54
+ path: `/user/update`,
55
+ method: 'POST',
56
+ ...params,
57
+ });
58
+ /**
59
+ * No description
60
+ *
61
+ * @tags User
62
+ * @name UserControllerUpdatePassword
63
+ * @request POST:/user/password
64
+ * @response `201` `IUserControllerUpdatePasswordData` 更新密码成功
65
+ */
66
+ this.userControllerUpdatePassword = (params = {}) => this.request({
67
+ path: `/user/password`,
68
+ method: 'POST',
69
+ ...params,
70
+ });
71
+ }
72
+ }
73
+ exports.User = User;
package/dist/View.d.ts ADDED
@@ -0,0 +1,49 @@
1
+ import { IViewControllerCreateData } from './data-contracts';
2
+ import { HttpClient, RequestParams } from './HttpClient';
3
+ export declare class View<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
4
+ /**
5
+ * No description
6
+ *
7
+ * @tags View
8
+ * @name ViewControllerCreate
9
+ * @request POST:/view
10
+ * @response `200` `IViewControllerCreateData` 访问记录添加成功
11
+ */
12
+ viewControllerCreate: (params?: RequestParams) => Promise<import("axios").AxiosResponse<IViewControllerCreateData, any, {}>>;
13
+ /**
14
+ * No description
15
+ *
16
+ * @tags View
17
+ * @name ViewControllerFindAll
18
+ * @request GET:/view
19
+ * @response `200` `IViewControllerFindAllData`
20
+ */
21
+ viewControllerFindAll: (params?: RequestParams) => Promise<import("axios").AxiosResponse<any, any, {}>>;
22
+ /**
23
+ * No description
24
+ *
25
+ * @tags View
26
+ * @name ViewControllerFindByUrl
27
+ * @request GET:/view/url
28
+ * @response `200` `IViewControllerFindByUrlData`
29
+ */
30
+ viewControllerFindByUrl: (params?: RequestParams) => Promise<import("axios").AxiosResponse<any, any, {}>>;
31
+ /**
32
+ * No description
33
+ *
34
+ * @tags View
35
+ * @name ViewControllerFindById
36
+ * @request GET:/view/{id}
37
+ * @response `200` `IViewControllerFindByIdData`
38
+ */
39
+ viewControllerFindById: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<any, any, {}>>;
40
+ /**
41
+ * No description
42
+ *
43
+ * @tags View
44
+ * @name ViewControllerDeleteById
45
+ * @request DELETE:/view/{id}
46
+ * @response `200` `IViewControllerDeleteByIdData`
47
+ */
48
+ viewControllerDeleteById: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<any, any, {}>>;
49
+ }
package/dist/View.js ADDED
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ /* eslint-disable */
3
+ /* tslint:disable */
4
+ /*
5
+ * ---------------------------------------------------------------
6
+ * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
7
+ * ## ##
8
+ * ## AUTHOR: acacode ##
9
+ * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
10
+ * ---------------------------------------------------------------
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.View = void 0;
14
+ const HttpClient_1 = require("./HttpClient");
15
+ class View extends HttpClient_1.HttpClient {
16
+ constructor() {
17
+ super(...arguments);
18
+ /**
19
+ * No description
20
+ *
21
+ * @tags View
22
+ * @name ViewControllerCreate
23
+ * @request POST:/view
24
+ * @response `200` `IViewControllerCreateData` 访问记录添加成功
25
+ */
26
+ this.viewControllerCreate = (params = {}) => this.request({
27
+ path: `/view`,
28
+ method: 'POST',
29
+ ...params,
30
+ });
31
+ /**
32
+ * No description
33
+ *
34
+ * @tags View
35
+ * @name ViewControllerFindAll
36
+ * @request GET:/view
37
+ * @response `200` `IViewControllerFindAllData`
38
+ */
39
+ this.viewControllerFindAll = (params = {}) => this.request({
40
+ path: `/view`,
41
+ method: 'GET',
42
+ ...params,
43
+ });
44
+ /**
45
+ * No description
46
+ *
47
+ * @tags View
48
+ * @name ViewControllerFindByUrl
49
+ * @request GET:/view/url
50
+ * @response `200` `IViewControllerFindByUrlData`
51
+ */
52
+ this.viewControllerFindByUrl = (params = {}) => this.request({
53
+ path: `/view/url`,
54
+ method: 'GET',
55
+ ...params,
56
+ });
57
+ /**
58
+ * No description
59
+ *
60
+ * @tags View
61
+ * @name ViewControllerFindById
62
+ * @request GET:/view/{id}
63
+ * @response `200` `IViewControllerFindByIdData`
64
+ */
65
+ this.viewControllerFindById = (id, params = {}) => this.request({
66
+ path: `/view/${id}`,
67
+ method: 'GET',
68
+ ...params,
69
+ });
70
+ /**
71
+ * No description
72
+ *
73
+ * @tags View
74
+ * @name ViewControllerDeleteById
75
+ * @request DELETE:/view/{id}
76
+ * @response `200` `IViewControllerDeleteByIdData`
77
+ */
78
+ this.viewControllerDeleteById = (id, params = {}) => this.request({
79
+ path: `/view/${id}`,
80
+ method: 'DELETE',
81
+ ...params,
82
+ });
83
+ }
84
+ }
85
+ exports.View = View;
@@ -0,0 +1,39 @@
1
+ import { HttpClientConfig } from './HttpClient';
2
+ import { Article } from './Article';
3
+ import { Auth } from './Auth';
4
+ import { Category } from './Category';
5
+ import { Comment } from './Comment';
6
+ import { File } from './File';
7
+ import { Knowledge } from './Knowledge';
8
+ import { Page } from './Page';
9
+ import { Search } from './Search';
10
+ import { Setting } from './Setting';
11
+ import { Smtp } from './Smtp';
12
+ import { Tag } from './Tag';
13
+ import { User } from './User';
14
+ import { View } from './View';
15
+ export interface ApiConfig<SecurityDataType = unknown> extends HttpClientConfig<SecurityDataType> {
16
+ }
17
+ export interface ApiInstance<SecurityDataType = unknown> {
18
+ article: Article<SecurityDataType>;
19
+ auth: Auth<SecurityDataType>;
20
+ category: Category<SecurityDataType>;
21
+ comment: Comment<SecurityDataType>;
22
+ file: File<SecurityDataType>;
23
+ knowledge: Knowledge<SecurityDataType>;
24
+ page: Page<SecurityDataType>;
25
+ search: Search<SecurityDataType>;
26
+ setting: Setting<SecurityDataType>;
27
+ smtp: Smtp<SecurityDataType>;
28
+ tag: Tag<SecurityDataType>;
29
+ user: User<SecurityDataType>;
30
+ view: View<SecurityDataType>;
31
+ }
32
+ /**
33
+ * 创建 API 实例
34
+ * @param config API 配置
35
+ * @returns API 实例对象
36
+ */
37
+ export declare function createApiInstance<SecurityDataType = unknown>(config?: ApiConfig<SecurityDataType>): ApiInstance<SecurityDataType>;
38
+ export declare const api: ApiInstance<unknown>;
39
+ export default api;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ // API 实例化文件
3
+ // 自动生成,请勿手动修改
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.api = exports.createApiInstance = void 0;
6
+ const HttpClient_1 = require("./HttpClient");
7
+ const Article_1 = require("./Article");
8
+ const Auth_1 = require("./Auth");
9
+ const Category_1 = require("./Category");
10
+ const Comment_1 = require("./Comment");
11
+ const File_1 = require("./File");
12
+ const Knowledge_1 = require("./Knowledge");
13
+ const Page_1 = require("./Page");
14
+ const Search_1 = require("./Search");
15
+ const Setting_1 = require("./Setting");
16
+ const Smtp_1 = require("./Smtp");
17
+ const Tag_1 = require("./Tag");
18
+ const User_1 = require("./User");
19
+ const View_1 = require("./View");
20
+ /**
21
+ * 创建 API 实例
22
+ * @param config API 配置
23
+ * @returns API 实例对象
24
+ */
25
+ function createApiInstance(config = {}) {
26
+ const httpClient = new HttpClient_1.HttpClient(config);
27
+ return {
28
+ article: new Article_1.Article(config),
29
+ auth: new Auth_1.Auth(config),
30
+ category: new Category_1.Category(config),
31
+ comment: new Comment_1.Comment(config),
32
+ file: new File_1.File(config),
33
+ knowledge: new Knowledge_1.Knowledge(config),
34
+ page: new Page_1.Page(config),
35
+ search: new Search_1.Search(config),
36
+ setting: new Setting_1.Setting(config),
37
+ smtp: new Smtp_1.Smtp(config),
38
+ tag: new Tag_1.Tag(config),
39
+ user: new User_1.User(config),
40
+ view: new View_1.View(config),
41
+ };
42
+ }
43
+ exports.createApiInstance = createApiInstance;
44
+ // 默认 API 实例
45
+ exports.api = createApiInstance();
46
+ exports.default = exports.api;
@@ -1,5 +1,5 @@
1
1
  import { IArticle } from '../types/data-contracts';
2
- import { HttpClient, RequestParams } from './httpClient';
2
+ import { HttpClient, RequestParams } from './HttpClient';
3
3
  export declare class Article<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
4
4
  /**
5
5
  * No description
@@ -21,26 +21,26 @@ export declare class Article<SecurityDataType = unknown> extends HttpClient<Secu
21
21
  * No description
22
22
  *
23
23
  * @tags Article
24
- * @name findByCategory
24
+ * @name findArticlesByCategory
25
25
  * @request GET:/article/category/{id}
26
26
  */
27
- findByCategory: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
27
+ findArticlesByCategory: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
28
28
  /**
29
29
  * No description
30
30
  *
31
31
  * @tags Article
32
- * @name findByTag
32
+ * @name findArticlesByTag
33
33
  * @request GET:/article/tag/{id}
34
34
  */
35
- findByTag: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
35
+ findArticlesByTag: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
36
36
  /**
37
37
  * No description
38
38
  *
39
39
  * @tags Article
40
- * @name getRecommendations
40
+ * @name getRecommendArticles
41
41
  * @request GET:/article/all/recommend
42
42
  */
43
- getRecommendations: (params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
43
+ getRecommendArticles: (params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
44
44
  /**
45
45
  * No description
46
46
  *
@@ -93,16 +93,16 @@ export declare class Article<SecurityDataType = unknown> extends HttpClient<Secu
93
93
  * No description
94
94
  *
95
95
  * @tags Article
96
- * @name updateViews
96
+ * @name updateViewsById
97
97
  * @request POST:/article/{id}/views
98
98
  */
99
- updateViews: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
99
+ updateViewsById: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
100
100
  /**
101
101
  * No description
102
102
  *
103
103
  * @tags Article
104
- * @name updateLikes
104
+ * @name updateLikesById
105
105
  * @request POST:/article/{id}/likes
106
106
  */
107
- updateLikes: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
107
+ updateLikesById: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
108
108
  }
@@ -11,8 +11,8 @@
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 {
14
+ const HttpClient_1 = require("./HttpClient");
15
+ class Article extends HttpClient_1.HttpClient {
16
16
  constructor() {
17
17
  super(...arguments);
18
18
  /**
@@ -44,10 +44,10 @@ class Article extends httpClient_1.HttpClient {
44
44
  * No description
45
45
  *
46
46
  * @tags Article
47
- * @name findByCategory
47
+ * @name findArticlesByCategory
48
48
  * @request GET:/article/category/{id}
49
49
  */
50
- this.findByCategory = (id, params = {}) => this.request({
50
+ this.findArticlesByCategory = (id, params = {}) => this.request({
51
51
  path: `/article/category/${id}`,
52
52
  method: 'GET',
53
53
  ...params,
@@ -56,10 +56,10 @@ class Article extends httpClient_1.HttpClient {
56
56
  * No description
57
57
  *
58
58
  * @tags Article
59
- * @name findByTag
59
+ * @name findArticlesByTag
60
60
  * @request GET:/article/tag/{id}
61
61
  */
62
- this.findByTag = (id, params = {}) => this.request({
62
+ this.findArticlesByTag = (id, params = {}) => this.request({
63
63
  path: `/article/tag/${id}`,
64
64
  method: 'GET',
65
65
  ...params,
@@ -68,10 +68,10 @@ class Article extends httpClient_1.HttpClient {
68
68
  * No description
69
69
  *
70
70
  * @tags Article
71
- * @name getRecommendations
71
+ * @name getRecommendArticles
72
72
  * @request GET:/article/all/recommend
73
73
  */
74
- this.getRecommendations = (params = {}) => this.request({
74
+ this.getRecommendArticles = (params = {}) => this.request({
75
75
  path: `/article/all/recommend`,
76
76
  method: 'GET',
77
77
  ...params,
@@ -152,10 +152,10 @@ class Article extends httpClient_1.HttpClient {
152
152
  * No description
153
153
  *
154
154
  * @tags Article
155
- * @name updateViews
155
+ * @name updateViewsById
156
156
  * @request POST:/article/{id}/views
157
157
  */
158
- this.updateViews = (id, params = {}) => this.request({
158
+ this.updateViewsById = (id, params = {}) => this.request({
159
159
  path: `/article/${id}/views`,
160
160
  method: 'POST',
161
161
  ...params,
@@ -164,10 +164,10 @@ class Article extends httpClient_1.HttpClient {
164
164
  * No description
165
165
  *
166
166
  * @tags Article
167
- * @name updateLikes
167
+ * @name updateLikesById
168
168
  * @request POST:/article/{id}/likes
169
169
  */
170
- this.updateLikes = (id, params = {}) => this.request({
170
+ this.updateLikesById = (id, params = {}) => this.request({
171
171
  path: `/article/${id}/likes`,
172
172
  method: 'POST',
173
173
  ...params,
@@ -0,0 +1,201 @@
1
+ import { IArticle } from '../types/data-contracts';
2
+ export declare namespace Article {
3
+ /**
4
+ * No description
5
+ * @tags Article
6
+ * @name create
7
+ * @request POST:/article
8
+ * @response `200` `(IArticle)[]` 创建文章
9
+ */
10
+ namespace create {
11
+ type RequestParams = {};
12
+ type RequestQuery = {};
13
+ type RequestBody = never;
14
+ type RequestHeaders = {};
15
+ type ResponseBody = IArticle[];
16
+ }
17
+ /**
18
+ * No description
19
+ * @tags Article
20
+ * @name findAll
21
+ * @request GET:/article
22
+ * @response `200` `void`
23
+ */
24
+ namespace findAll {
25
+ type RequestParams = {};
26
+ type RequestQuery = {};
27
+ type RequestBody = never;
28
+ type RequestHeaders = {};
29
+ type ResponseBody = void;
30
+ }
31
+ /**
32
+ * No description
33
+ * @tags Article
34
+ * @name findArticlesByCategory
35
+ * @request GET:/article/category/{id}
36
+ * @response `200` `void`
37
+ */
38
+ namespace findArticlesByCategory {
39
+ type RequestParams = {
40
+ id: string;
41
+ };
42
+ type RequestQuery = {};
43
+ type RequestBody = never;
44
+ type RequestHeaders = {};
45
+ type ResponseBody = void;
46
+ }
47
+ /**
48
+ * No description
49
+ * @tags Article
50
+ * @name findArticlesByTag
51
+ * @request GET:/article/tag/{id}
52
+ * @response `200` `void`
53
+ */
54
+ namespace findArticlesByTag {
55
+ type RequestParams = {
56
+ id: string;
57
+ };
58
+ type RequestQuery = {};
59
+ type RequestBody = never;
60
+ type RequestHeaders = {};
61
+ type ResponseBody = void;
62
+ }
63
+ /**
64
+ * No description
65
+ * @tags Article
66
+ * @name getRecommendArticles
67
+ * @request GET:/article/all/recommend
68
+ * @response `200` `void`
69
+ */
70
+ namespace getRecommendArticles {
71
+ type RequestParams = {};
72
+ type RequestQuery = {};
73
+ type RequestBody = never;
74
+ type RequestHeaders = {};
75
+ type ResponseBody = void;
76
+ }
77
+ /**
78
+ * No description
79
+ * @tags Article
80
+ * @name getArchives
81
+ * @request GET:/article/archives
82
+ * @response `200` `void`
83
+ */
84
+ namespace getArchives {
85
+ type RequestParams = {};
86
+ type RequestQuery = {};
87
+ type RequestBody = never;
88
+ type RequestHeaders = {};
89
+ type ResponseBody = void;
90
+ }
91
+ /**
92
+ * No description
93
+ * @tags Article
94
+ * @name recommend
95
+ * @request GET:/article/recommend
96
+ * @response `200` `void`
97
+ */
98
+ namespace recommend {
99
+ type RequestParams = {};
100
+ type RequestQuery = {};
101
+ type RequestBody = never;
102
+ type RequestHeaders = {};
103
+ type ResponseBody = void;
104
+ }
105
+ /**
106
+ * No description
107
+ * @tags Article
108
+ * @name findById
109
+ * @request GET:/article/{id}
110
+ * @response `200` `void`
111
+ */
112
+ namespace findById {
113
+ type RequestParams = {
114
+ id: string;
115
+ };
116
+ type RequestQuery = {};
117
+ type RequestBody = never;
118
+ type RequestHeaders = {};
119
+ type ResponseBody = void;
120
+ }
121
+ /**
122
+ * No description
123
+ * @tags Article
124
+ * @name updateById
125
+ * @request PATCH:/article/{id}
126
+ * @response `200` `void`
127
+ */
128
+ namespace updateById {
129
+ type RequestParams = {
130
+ id: string;
131
+ };
132
+ type RequestQuery = {};
133
+ type RequestBody = never;
134
+ type RequestHeaders = {};
135
+ type ResponseBody = void;
136
+ }
137
+ /**
138
+ * No description
139
+ * @tags Article
140
+ * @name deleteById
141
+ * @request DELETE:/article/{id}
142
+ * @response `200` `void`
143
+ */
144
+ namespace deleteById {
145
+ type RequestParams = {
146
+ id: string;
147
+ };
148
+ type RequestQuery = {};
149
+ type RequestBody = never;
150
+ type RequestHeaders = {};
151
+ type ResponseBody = void;
152
+ }
153
+ /**
154
+ * No description
155
+ * @tags Article
156
+ * @name checkPassword
157
+ * @request POST:/article/{id}/checkPassword
158
+ * @response `200` `void`
159
+ */
160
+ namespace checkPassword {
161
+ type RequestParams = {
162
+ id: string;
163
+ };
164
+ type RequestQuery = {};
165
+ type RequestBody = never;
166
+ type RequestHeaders = {};
167
+ type ResponseBody = void;
168
+ }
169
+ /**
170
+ * No description
171
+ * @tags Article
172
+ * @name updateViewsById
173
+ * @request POST:/article/{id}/views
174
+ * @response `200` `void`
175
+ */
176
+ namespace updateViewsById {
177
+ type RequestParams = {
178
+ id: string;
179
+ };
180
+ type RequestQuery = {};
181
+ type RequestBody = never;
182
+ type RequestHeaders = {};
183
+ type ResponseBody = void;
184
+ }
185
+ /**
186
+ * No description
187
+ * @tags Article
188
+ * @name updateLikesById
189
+ * @request POST:/article/{id}/likes
190
+ * @response `200` `void`
191
+ */
192
+ namespace updateLikesById {
193
+ type RequestParams = {
194
+ id: string;
195
+ };
196
+ type RequestQuery = {};
197
+ type RequestBody = never;
198
+ type RequestHeaders = {};
199
+ type ResponseBody = void;
200
+ }
201
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ /* eslint-disable */
3
+ /* tslint:disable */
4
+ /*
5
+ * ---------------------------------------------------------------
6
+ * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
7
+ * ## ##
8
+ * ## AUTHOR: acacode ##
9
+ * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
10
+ * ---------------------------------------------------------------
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });