@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
package/dist/api/File.js CHANGED
@@ -11,31 +11,30 @@
11
11
  */
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.File = void 0;
14
- const httpClient_1 = require("./httpClient");
15
- class File extends httpClient_1.HttpClient {
16
- constructor() {
17
- super(...arguments);
14
+ class File {
15
+ constructor(http) {
18
16
  /**
19
17
  * No description
20
18
  *
21
19
  * @tags File
22
20
  * @name FileControllerUploadFile
23
21
  * @request POST:/file/upload
22
+ * @response `200` `IFileControllerUploadFileData` 上传文件
24
23
  */
25
- this.fileControllerUploadFile = (params = {}) => this.request({
24
+ this.uploadFile = (params = {}) => this.http.request({
26
25
  path: `/file/upload`,
27
26
  method: 'POST',
28
- format: 'json',
29
27
  ...params,
30
28
  });
31
29
  /**
32
30
  * No description
33
31
  *
34
32
  * @tags File
35
- * @name findAll
33
+ * @name FileControllerFindAll
36
34
  * @request GET:/file
35
+ * @response `200` `IFileControllerFindAllData`
37
36
  */
38
- this.findAll = (params = {}) => this.request({
37
+ this.findAll = (params = {}) => this.http.request({
39
38
  path: `/file`,
40
39
  method: 'GET',
41
40
  ...params,
@@ -44,10 +43,11 @@ class File extends httpClient_1.HttpClient {
44
43
  * No description
45
44
  *
46
45
  * @tags File
47
- * @name findById
46
+ * @name FileControllerFindById
48
47
  * @request GET:/file/{id}
48
+ * @response `200` `IFileControllerFindByIdData`
49
49
  */
50
- this.findById = (id, params = {}) => this.request({
50
+ this.findById = (id, params = {}) => this.http.request({
51
51
  path: `/file/${id}`,
52
52
  method: 'GET',
53
53
  ...params,
@@ -56,14 +56,16 @@ class File extends httpClient_1.HttpClient {
56
56
  * No description
57
57
  *
58
58
  * @tags File
59
- * @name deleteById
59
+ * @name FileControllerDeleteById
60
60
  * @request DELETE:/file/{id}
61
+ * @response `200` `IFileControllerDeleteByIdData`
61
62
  */
62
- this.deleteById = (id, params = {}) => this.request({
63
+ this.deleteById = (id, params = {}) => this.http.request({
63
64
  path: `/file/${id}`,
64
65
  method: 'DELETE',
65
66
  ...params,
66
67
  });
68
+ this.http = http;
67
69
  }
68
70
  }
69
71
  exports.File = File;
@@ -1,4 +1,4 @@
1
- import { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from 'axios';
1
+ import { AxiosInstance, AxiosRequestConfig, ResponseType } from 'axios';
2
2
  export declare type QueryParamsType = Record<string | number, any>;
3
3
  export interface FullRequestParams extends Omit<AxiosRequestConfig, 'data' | 'params' | 'url' | 'responseType'> {
4
4
  /** set parameter to `true` for call `securityWorker` for this request */
@@ -37,5 +37,5 @@ export declare class HttpClient<SecurityDataType = unknown> {
37
37
  protected mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig;
38
38
  protected stringifyFormItem(formItem: unknown): string;
39
39
  protected createFormData(input: Record<string, unknown>): FormData;
40
- request: <T = any, _E = any>({ secure, path, type, query, format, body, ...params }: FullRequestParams) => Promise<AxiosResponse<T, any, {}>>;
40
+ request: <T = any, _E = any>({ secure, path, type, query, format, body, ...params }: FullRequestParams) => Promise<T>;
41
41
  }
@@ -41,7 +41,8 @@ class HttpClient {
41
41
  if (type === ContentType.Text && body && body !== null && typeof body !== 'string') {
42
42
  body = JSON.stringify(body);
43
43
  }
44
- return this.instance.request({
44
+ return this.instance
45
+ .request({
45
46
  ...requestParams,
46
47
  headers: {
47
48
  ...(requestParams.headers || {}),
@@ -51,7 +52,8 @@ class HttpClient {
51
52
  responseType: responseFormat,
52
53
  data: body,
53
54
  url: path,
54
- });
55
+ })
56
+ .then((response) => response.data);
55
57
  };
56
58
  this.instance = axios_1.default.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || 'http://localhost:3002' });
57
59
  this.secure = secure;
@@ -1,68 +1,78 @@
1
- import { IKnowledge } from '../types/data-contracts';
2
- import { HttpClient, RequestParams } from './httpClient';
3
- export declare class Knowledge<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
1
+ import { IKnowledgeControllerCreateBookData, IKnowledgeControllerCreateChapterData } from '../types';
2
+ import { HttpClient, RequestParams } from './HttpClient';
3
+ export declare class Knowledge<SecurityDataType = unknown> {
4
+ http: HttpClient<SecurityDataType>;
5
+ constructor(http: HttpClient<SecurityDataType>);
4
6
  /**
5
7
  * No description
6
8
  *
7
9
  * @tags Knowledge
8
- * @name createBook
10
+ * @name KnowledgeControllerCreateBook
9
11
  * @request POST:/Knowledge/book
12
+ * @response `200` `IKnowledgeControllerCreateBookData` 创建知识库
10
13
  */
11
- createBook: (params?: RequestParams) => Promise<import("axios").AxiosResponse<IKnowledge[], any, {}>>;
14
+ createBook: (params?: RequestParams) => Promise<IKnowledgeControllerCreateBookData>;
12
15
  /**
13
16
  * No description
14
17
  *
15
18
  * @tags Knowledge
16
- * @name createChapter
19
+ * @name KnowledgeControllerCreateChapter
17
20
  * @request POST:/Knowledge/chapter
21
+ * @response `200` `IKnowledgeControllerCreateChapterData` 创建知识章节
18
22
  */
19
- createChapter: (params?: RequestParams) => Promise<import("axios").AxiosResponse<IKnowledge[], any, {}>>;
23
+ createChapter: (params?: RequestParams) => Promise<IKnowledgeControllerCreateChapterData>;
20
24
  /**
21
25
  * No description
22
26
  *
23
27
  * @tags Knowledge
24
- * @name deleteById
28
+ * @name KnowledgeControllerDeleteById
25
29
  * @request DELETE:/Knowledge/{id}
30
+ * @response `200` `IKnowledgeControllerDeleteByIdData`
26
31
  */
27
- deleteById: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
32
+ deleteById: (id: string, params?: RequestParams) => Promise<any>;
28
33
  /**
29
34
  * No description
30
35
  *
31
36
  * @tags Knowledge
32
- * @name updateById
37
+ * @name KnowledgeControllerUpdateById
33
38
  * @request PATCH:/Knowledge/{id}
39
+ * @response `200` `IKnowledgeControllerUpdateByIdData`
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 Knowledge
40
- * @name findById
46
+ * @name KnowledgeControllerFindById
41
47
  * @request GET:/Knowledge/{id}
48
+ * @response `200` `IKnowledgeControllerFindByIdData`
42
49
  */
43
- findById: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
50
+ findById: (id: string, params?: RequestParams) => Promise<any>;
44
51
  /**
45
52
  * No description
46
53
  *
47
54
  * @tags Knowledge
48
- * @name findAll
55
+ * @name KnowledgeControllerFindAll
49
56
  * @request GET:/Knowledge
57
+ * @response `200` `IKnowledgeControllerFindAllData`
50
58
  */
51
- findAll: (params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
59
+ findAll: (params?: RequestParams) => Promise<any>;
52
60
  /**
53
61
  * No description
54
62
  *
55
63
  * @tags Knowledge
56
- * @name updateViews
64
+ * @name KnowledgeControllerUpdateViewsById
57
65
  * @request POST:/Knowledge/{id}/views
66
+ * @response `200` `IKnowledgeControllerUpdateViewsByIdData`
58
67
  */
59
- updateViews: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
68
+ updateViewsById: (id: string, params?: RequestParams) => Promise<any>;
60
69
  /**
61
70
  * No description
62
71
  *
63
72
  * @tags Knowledge
64
- * @name updateLikes
73
+ * @name KnowledgeControllerUpdateLikesById
65
74
  * @request POST:/Knowledge/{id}/likes
75
+ * @response `200` `IKnowledgeControllerUpdateLikesByIdData`
66
76
  */
67
- updateLikes: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
77
+ updateLikesById: (id: string, params?: RequestParams) => Promise<any>;
68
78
  }
@@ -11,44 +11,43 @@
11
11
  */
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.Knowledge = void 0;
14
- const httpClient_1 = require("./httpClient");
15
- class Knowledge extends httpClient_1.HttpClient {
16
- constructor() {
17
- super(...arguments);
14
+ class Knowledge {
15
+ constructor(http) {
18
16
  /**
19
17
  * No description
20
18
  *
21
19
  * @tags Knowledge
22
- * @name createBook
20
+ * @name KnowledgeControllerCreateBook
23
21
  * @request POST:/Knowledge/book
22
+ * @response `200` `IKnowledgeControllerCreateBookData` 创建知识库
24
23
  */
25
- this.createBook = (params = {}) => this.request({
24
+ this.createBook = (params = {}) => this.http.request({
26
25
  path: `/Knowledge/book`,
27
26
  method: 'POST',
28
- format: 'json',
29
27
  ...params,
30
28
  });
31
29
  /**
32
30
  * No description
33
31
  *
34
32
  * @tags Knowledge
35
- * @name createChapter
33
+ * @name KnowledgeControllerCreateChapter
36
34
  * @request POST:/Knowledge/chapter
35
+ * @response `200` `IKnowledgeControllerCreateChapterData` 创建知识章节
37
36
  */
38
- this.createChapter = (params = {}) => this.request({
37
+ this.createChapter = (params = {}) => this.http.request({
39
38
  path: `/Knowledge/chapter`,
40
39
  method: 'POST',
41
- format: 'json',
42
40
  ...params,
43
41
  });
44
42
  /**
45
43
  * No description
46
44
  *
47
45
  * @tags Knowledge
48
- * @name deleteById
46
+ * @name KnowledgeControllerDeleteById
49
47
  * @request DELETE:/Knowledge/{id}
48
+ * @response `200` `IKnowledgeControllerDeleteByIdData`
50
49
  */
51
- this.deleteById = (id, params = {}) => this.request({
50
+ this.deleteById = (id, params = {}) => this.http.request({
52
51
  path: `/Knowledge/${id}`,
53
52
  method: 'DELETE',
54
53
  ...params,
@@ -57,10 +56,11 @@ class Knowledge extends httpClient_1.HttpClient {
57
56
  * No description
58
57
  *
59
58
  * @tags Knowledge
60
- * @name updateById
59
+ * @name KnowledgeControllerUpdateById
61
60
  * @request PATCH:/Knowledge/{id}
61
+ * @response `200` `IKnowledgeControllerUpdateByIdData`
62
62
  */
63
- this.updateById = (id, params = {}) => this.request({
63
+ this.updateById = (id, params = {}) => this.http.request({
64
64
  path: `/Knowledge/${id}`,
65
65
  method: 'PATCH',
66
66
  ...params,
@@ -69,10 +69,11 @@ class Knowledge extends httpClient_1.HttpClient {
69
69
  * No description
70
70
  *
71
71
  * @tags Knowledge
72
- * @name findById
72
+ * @name KnowledgeControllerFindById
73
73
  * @request GET:/Knowledge/{id}
74
+ * @response `200` `IKnowledgeControllerFindByIdData`
74
75
  */
75
- this.findById = (id, params = {}) => this.request({
76
+ this.findById = (id, params = {}) => this.http.request({
76
77
  path: `/Knowledge/${id}`,
77
78
  method: 'GET',
78
79
  ...params,
@@ -81,10 +82,11 @@ class Knowledge extends httpClient_1.HttpClient {
81
82
  * No description
82
83
  *
83
84
  * @tags Knowledge
84
- * @name findAll
85
+ * @name KnowledgeControllerFindAll
85
86
  * @request GET:/Knowledge
87
+ * @response `200` `IKnowledgeControllerFindAllData`
86
88
  */
87
- this.findAll = (params = {}) => this.request({
89
+ this.findAll = (params = {}) => this.http.request({
88
90
  path: `/Knowledge`,
89
91
  method: 'GET',
90
92
  ...params,
@@ -93,10 +95,11 @@ class Knowledge extends httpClient_1.HttpClient {
93
95
  * No description
94
96
  *
95
97
  * @tags Knowledge
96
- * @name updateViews
98
+ * @name KnowledgeControllerUpdateViewsById
97
99
  * @request POST:/Knowledge/{id}/views
100
+ * @response `200` `IKnowledgeControllerUpdateViewsByIdData`
98
101
  */
99
- this.updateViews = (id, params = {}) => this.request({
102
+ this.updateViewsById = (id, params = {}) => this.http.request({
100
103
  path: `/Knowledge/${id}/views`,
101
104
  method: 'POST',
102
105
  ...params,
@@ -105,14 +108,16 @@ class Knowledge extends httpClient_1.HttpClient {
105
108
  * No description
106
109
  *
107
110
  * @tags Knowledge
108
- * @name updateLikes
111
+ * @name KnowledgeControllerUpdateLikesById
109
112
  * @request POST:/Knowledge/{id}/likes
113
+ * @response `200` `IKnowledgeControllerUpdateLikesByIdData`
110
114
  */
111
- this.updateLikes = (id, params = {}) => this.request({
115
+ this.updateLikesById = (id, params = {}) => this.http.request({
112
116
  path: `/Knowledge/${id}/likes`,
113
117
  method: 'POST',
114
118
  ...params,
115
119
  });
120
+ this.http = http;
116
121
  }
117
122
  }
118
123
  exports.Knowledge = Knowledge;
@@ -1,52 +1,60 @@
1
- import { IPage } from '../types/data-contracts';
2
- import { HttpClient, RequestParams } from './httpClient';
3
- export declare class Page<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
1
+ import { IPageControllerCreateData } from '../types';
2
+ import { HttpClient, RequestParams } from './HttpClient';
3
+ export declare class Page<SecurityDataType = unknown> {
4
+ http: HttpClient<SecurityDataType>;
5
+ constructor(http: HttpClient<SecurityDataType>);
4
6
  /**
5
7
  * No description
6
8
  *
7
9
  * @tags Page
8
- * @name create
10
+ * @name PageControllerCreate
9
11
  * @request POST:/page
12
+ * @response `200` `IPageControllerCreateData` 创建页面
10
13
  */
11
- create: (params?: RequestParams) => Promise<import("axios").AxiosResponse<IPage[], any, {}>>;
14
+ create: (params?: RequestParams) => Promise<IPageControllerCreateData>;
12
15
  /**
13
16
  * No description
14
17
  *
15
18
  * @tags Page
16
- * @name findAll
19
+ * @name PageControllerFindAll
17
20
  * @request GET:/page
21
+ * @response `200` `IPageControllerFindAllData`
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 Page
24
- * @name findById
28
+ * @name PageControllerFindById
25
29
  * @request GET:/page/{id}
30
+ * @response `200` `IPageControllerFindByIdData`
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 Page
32
- * @name updateById
37
+ * @name PageControllerUpdateById
33
38
  * @request PATCH:/page/{id}
39
+ * @response `200` `IPageControllerUpdateByIdData`
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 Page
40
- * @name deleteById
46
+ * @name PageControllerDeleteById
41
47
  * @request DELETE:/page/{id}
48
+ * @response `200` `IPageControllerDeleteByIdData`
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 Page
48
- * @name updateViews
55
+ * @name PageControllerUpdateViewsById
49
56
  * @request POST:/page/{id}/views
57
+ * @response `200` `IPageControllerUpdateViewsByIdData`
50
58
  */
51
- updateViews: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
59
+ updateViewsById: (id: string, params?: RequestParams) => Promise<any>;
52
60
  }
package/dist/api/Page.js CHANGED
@@ -11,31 +11,30 @@
11
11
  */
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.Page = void 0;
14
- const httpClient_1 = require("./httpClient");
15
- class Page extends httpClient_1.HttpClient {
16
- constructor() {
17
- super(...arguments);
14
+ class Page {
15
+ constructor(http) {
18
16
  /**
19
17
  * No description
20
18
  *
21
19
  * @tags Page
22
- * @name create
20
+ * @name PageControllerCreate
23
21
  * @request POST:/page
22
+ * @response `200` `IPageControllerCreateData` 创建页面
24
23
  */
25
- this.create = (params = {}) => this.request({
24
+ this.create = (params = {}) => this.http.request({
26
25
  path: `/page`,
27
26
  method: 'POST',
28
- format: 'json',
29
27
  ...params,
30
28
  });
31
29
  /**
32
30
  * No description
33
31
  *
34
32
  * @tags Page
35
- * @name findAll
33
+ * @name PageControllerFindAll
36
34
  * @request GET:/page
35
+ * @response `200` `IPageControllerFindAllData`
37
36
  */
38
- this.findAll = (params = {}) => this.request({
37
+ this.findAll = (params = {}) => this.http.request({
39
38
  path: `/page`,
40
39
  method: 'GET',
41
40
  ...params,
@@ -44,10 +43,11 @@ class Page extends httpClient_1.HttpClient {
44
43
  * No description
45
44
  *
46
45
  * @tags Page
47
- * @name findById
46
+ * @name PageControllerFindById
48
47
  * @request GET:/page/{id}
48
+ * @response `200` `IPageControllerFindByIdData`
49
49
  */
50
- this.findById = (id, params = {}) => this.request({
50
+ this.findById = (id, params = {}) => this.http.request({
51
51
  path: `/page/${id}`,
52
52
  method: 'GET',
53
53
  ...params,
@@ -56,10 +56,11 @@ class Page extends httpClient_1.HttpClient {
56
56
  * No description
57
57
  *
58
58
  * @tags Page
59
- * @name updateById
59
+ * @name PageControllerUpdateById
60
60
  * @request PATCH:/page/{id}
61
+ * @response `200` `IPageControllerUpdateByIdData`
61
62
  */
62
- this.updateById = (id, params = {}) => this.request({
63
+ this.updateById = (id, params = {}) => this.http.request({
63
64
  path: `/page/${id}`,
64
65
  method: 'PATCH',
65
66
  ...params,
@@ -68,10 +69,11 @@ class Page extends httpClient_1.HttpClient {
68
69
  * No description
69
70
  *
70
71
  * @tags Page
71
- * @name deleteById
72
+ * @name PageControllerDeleteById
72
73
  * @request DELETE:/page/{id}
74
+ * @response `200` `IPageControllerDeleteByIdData`
73
75
  */
74
- this.deleteById = (id, params = {}) => this.request({
76
+ this.deleteById = (id, params = {}) => this.http.request({
75
77
  path: `/page/${id}`,
76
78
  method: 'DELETE',
77
79
  ...params,
@@ -80,14 +82,16 @@ class Page extends httpClient_1.HttpClient {
80
82
  * No description
81
83
  *
82
84
  * @tags Page
83
- * @name updateViews
85
+ * @name PageControllerUpdateViewsById
84
86
  * @request POST:/page/{id}/views
87
+ * @response `200` `IPageControllerUpdateViewsByIdData`
85
88
  */
86
- this.updateViews = (id, params = {}) => this.request({
89
+ this.updateViewsById = (id, params = {}) => this.http.request({
87
90
  path: `/page/${id}/views`,
88
91
  method: 'POST',
89
92
  ...params,
90
93
  });
94
+ this.http = http;
91
95
  }
92
96
  }
93
97
  exports.Page = Page;
@@ -1,27 +1,32 @@
1
- import { HttpClient, RequestParams } from './httpClient';
2
- export declare class Search<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
1
+ import { HttpClient, RequestParams } from './HttpClient';
2
+ export declare class Search<SecurityDataType = unknown> {
3
+ http: HttpClient<SecurityDataType>;
4
+ constructor(http: HttpClient<SecurityDataType>);
3
5
  /**
4
6
  * No description
5
7
  *
6
8
  * @tags Search
7
9
  * @name SearchControllerSearchArticle
8
10
  * @request GET:/search/article
11
+ * @response `200` `ISearchControllerSearchArticleData`
9
12
  */
10
- searchControllerSearchArticle: (params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
13
+ searchArticle: (params?: RequestParams) => Promise<any>;
11
14
  /**
12
15
  * No description
13
16
  *
14
17
  * @tags Search
15
- * @name findAll
18
+ * @name SearchControllerFindAll
16
19
  * @request GET:/search
20
+ * @response `200` `ISearchControllerFindAllData`
17
21
  */
18
- findAll: (params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
22
+ findAll: (params?: RequestParams) => Promise<any>;
19
23
  /**
20
24
  * No description
21
25
  *
22
26
  * @tags Search
23
- * @name deleteById
27
+ * @name SearchControllerDeleteById
24
28
  * @request DELETE:/search/{id}
29
+ * @response `200` `ISearchControllerDeleteByIdData`
25
30
  */
26
- deleteById: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
31
+ deleteById: (id: string, params?: RequestParams) => Promise<any>;
27
32
  }
@@ -11,18 +11,17 @@
11
11
  */
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.Search = void 0;
14
- const httpClient_1 = require("./httpClient");
15
- class Search extends httpClient_1.HttpClient {
16
- constructor() {
17
- super(...arguments);
14
+ class Search {
15
+ constructor(http) {
18
16
  /**
19
17
  * No description
20
18
  *
21
19
  * @tags Search
22
20
  * @name SearchControllerSearchArticle
23
21
  * @request GET:/search/article
22
+ * @response `200` `ISearchControllerSearchArticleData`
24
23
  */
25
- this.searchControllerSearchArticle = (params = {}) => this.request({
24
+ this.searchArticle = (params = {}) => this.http.request({
26
25
  path: `/search/article`,
27
26
  method: 'GET',
28
27
  ...params,
@@ -31,10 +30,11 @@ class Search extends httpClient_1.HttpClient {
31
30
  * No description
32
31
  *
33
32
  * @tags Search
34
- * @name findAll
33
+ * @name SearchControllerFindAll
35
34
  * @request GET:/search
35
+ * @response `200` `ISearchControllerFindAllData`
36
36
  */
37
- this.findAll = (params = {}) => this.request({
37
+ this.findAll = (params = {}) => this.http.request({
38
38
  path: `/search`,
39
39
  method: 'GET',
40
40
  ...params,
@@ -43,14 +43,16 @@ class Search extends httpClient_1.HttpClient {
43
43
  * No description
44
44
  *
45
45
  * @tags Search
46
- * @name deleteById
46
+ * @name SearchControllerDeleteById
47
47
  * @request DELETE:/search/{id}
48
+ * @response `200` `ISearchControllerDeleteByIdData`
48
49
  */
49
- this.deleteById = (id, params = {}) => this.request({
50
+ this.deleteById = (id, params = {}) => this.http.request({
50
51
  path: `/search/${id}`,
51
52
  method: 'DELETE',
52
53
  ...params,
53
54
  });
55
+ this.http = http;
54
56
  }
55
57
  }
56
58
  exports.Search = Search;
@@ -1,20 +1,24 @@
1
- import { ISetting } from '../types/data-contracts';
2
- import { HttpClient, RequestParams } from './httpClient';
3
- export declare class Setting<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
1
+ import { ISettingControllerUpdateData } from '../types';
2
+ import { HttpClient, RequestParams } from './HttpClient';
3
+ export declare class Setting<SecurityDataType = unknown> {
4
+ http: HttpClient<SecurityDataType>;
5
+ constructor(http: HttpClient<SecurityDataType>);
4
6
  /**
5
7
  * No description
6
8
  *
7
9
  * @tags Setting
8
10
  * @name SettingControllerUpdate
9
11
  * @request POST:/setting
12
+ * @response `200` `ISettingControllerUpdateData` 更新设置
10
13
  */
11
- settingControllerUpdate: (params?: RequestParams) => Promise<import("axios").AxiosResponse<ISetting[], any, {}>>;
14
+ update: (params?: RequestParams) => Promise<ISettingControllerUpdateData>;
12
15
  /**
13
16
  * No description
14
17
  *
15
18
  * @tags Setting
16
- * @name findAll
19
+ * @name SettingControllerFindAll
17
20
  * @request POST:/setting/get
21
+ * @response `200` `ISettingControllerFindAllData`
18
22
  */
19
- findAll: (params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
23
+ findAll: (params?: RequestParams) => Promise<any>;
20
24
  }