@devlearning/swagger-generator 1.0.23 → 1.0.24
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.
- package/autogen/identity/api/identity_api.dart +23 -22
- package/autogen/user_profile/api/user_profile_api.dart +12 -10
- package/dist/generators-writers/dart/api-dart-writer.js +5 -1
- package/dist/generators-writers/dart/templates/api.mustache +5 -3
- package/package.json +1 -1
- package/src/generators-writers/dart/api-dart-writer.ts +6 -1
- package/src/generators-writers/dart/templates/api.mustache +5 -3
|
@@ -16,9 +16,9 @@ class IdentityApi {
|
|
|
16
16
|
|
|
17
17
|
IdentityApi() : _dio = getIt<Dio>();
|
|
18
18
|
|
|
19
|
-
Future<AuthenticationToken> authAppToken(
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
Future<AuthenticationToken> authAppToken(
|
|
20
|
+
AuthAppAuthenticateCommand request
|
|
21
|
+
) async {
|
|
22
22
|
final response = await _dio.post(
|
|
23
23
|
'/identity/auth/app/token',
|
|
24
24
|
data: request.toJson(),
|
|
@@ -26,9 +26,9 @@ class IdentityApi {
|
|
|
26
26
|
return AuthenticationToken.fromJson(response.data);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
Future<AuthenticationToken> authUserToken(
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
Future<AuthenticationToken> authUserToken(
|
|
30
|
+
AuthUserAuthenticateCommand request
|
|
31
|
+
) async {
|
|
32
32
|
final response = await _dio.post(
|
|
33
33
|
'/identity/auth/user/token',
|
|
34
34
|
data: request.toJson(),
|
|
@@ -36,9 +36,9 @@ class IdentityApi {
|
|
|
36
36
|
return AuthenticationToken.fromJson(response.data);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
Future<AuthenticationToken> authRefreshToken(
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
Future<AuthenticationToken> authRefreshToken(
|
|
40
|
+
AuthRefreshTokenCommand request
|
|
41
|
+
) async {
|
|
42
42
|
final response = await _dio.post(
|
|
43
43
|
'/identity/auth/refresh-token',
|
|
44
44
|
data: request.toJson(),
|
|
@@ -46,9 +46,9 @@ class IdentityApi {
|
|
|
46
46
|
return AuthenticationToken.fromJson(response.data);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
Future<Result> authGenerateResetPasswordCode(
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
Future<Result> authGenerateResetPasswordCode(
|
|
50
|
+
AuthGenerateResetPasswordCodeCommand request
|
|
51
|
+
) async {
|
|
52
52
|
final response = await _dio.post(
|
|
53
53
|
'/identity/auth/generate-reset-password-code',
|
|
54
54
|
data: request.toJson(),
|
|
@@ -56,9 +56,9 @@ class IdentityApi {
|
|
|
56
56
|
return Result.fromJson(response.data);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
Future<Result> authResetPassword(
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
Future<Result> authResetPassword(
|
|
60
|
+
AuthResetPasswordCommand request
|
|
61
|
+
) async {
|
|
62
62
|
final response = await _dio.post(
|
|
63
63
|
'/identity/auth/reset-password',
|
|
64
64
|
data: request.toJson(),
|
|
@@ -66,9 +66,9 @@ class IdentityApi {
|
|
|
66
66
|
return Result.fromJson(response.data);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
Future<Result> authVerifyResetPasswordCode(
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
Future<Result> authVerifyResetPasswordCode(
|
|
70
|
+
AuthVerifyResetPasswordCodeCommand request
|
|
71
|
+
) async {
|
|
72
72
|
final response = await _dio.post(
|
|
73
73
|
'/identity/auth/verify-reset-password-code',
|
|
74
74
|
data: request.toJson(),
|
|
@@ -76,9 +76,9 @@ class IdentityApi {
|
|
|
76
76
|
return Result.fromJson(response.data);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
Future<Result> authActivate(
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
Future<Result> authActivate(
|
|
80
|
+
AuthActivateCommand request
|
|
81
|
+
) async {
|
|
82
82
|
final response = await _dio.post(
|
|
83
83
|
'/identity/auth/activate',
|
|
84
84
|
data: request.toJson(),
|
|
@@ -87,7 +87,8 @@ class IdentityApi {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
Future<AuthUserDto> authUserRead(
|
|
90
|
-
|
|
90
|
+
|
|
91
|
+
) async {
|
|
91
92
|
final response = await _dio.get(
|
|
92
93
|
'/identity/auth-user/read',
|
|
93
94
|
queryParameters: {
|
|
@@ -10,10 +10,11 @@ class UserProfileApi {
|
|
|
10
10
|
UserProfileApi() : _dio = getIt<Dio>();
|
|
11
11
|
|
|
12
12
|
Future<Result> userGeneralInfoTestRead(
|
|
13
|
+
|
|
13
14
|
String name,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
DateTime? date,
|
|
16
|
+
int? integer,
|
|
17
|
+
) async {
|
|
17
18
|
final response = await _dio.get(
|
|
18
19
|
'/user-profile/UserGeneralInfo/test/read',
|
|
19
20
|
queryParameters: {
|
|
@@ -26,8 +27,9 @@ class UserProfileApi {
|
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
Future<Result> userGeneralInfoTestList(
|
|
30
|
+
|
|
29
31
|
String name,
|
|
30
|
-
|
|
32
|
+
) async {
|
|
31
33
|
final response = await _dio.get(
|
|
32
34
|
'/user-profile/UserGeneralInfo/test/list',
|
|
33
35
|
queryParameters: {
|
|
@@ -37,9 +39,9 @@ class UserProfileApi {
|
|
|
37
39
|
return Result.fromJson(response.data);
|
|
38
40
|
}
|
|
39
41
|
|
|
40
|
-
Future<Result> userGeneralInfoTestSave(
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
Future<Result> userGeneralInfoTestSave(
|
|
43
|
+
TestSaveCommand request
|
|
44
|
+
) async {
|
|
43
45
|
final response = await _dio.post(
|
|
44
46
|
'/user-profile/UserGeneralInfo/test/save',
|
|
45
47
|
data: request.toJson(),
|
|
@@ -47,9 +49,9 @@ class UserProfileApi {
|
|
|
47
49
|
return Result.fromJson(response.data);
|
|
48
50
|
}
|
|
49
51
|
|
|
50
|
-
Future<Result> userGeneralInfoSave(
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
Future<Result> userGeneralInfoSave(
|
|
53
|
+
UserGeneralInfoSaveCommand request
|
|
54
|
+
) async {
|
|
53
55
|
final response = await _dio.post(
|
|
54
56
|
'/user-profile/UserGeneralInfo/save',
|
|
55
57
|
data: request.toJson(),
|
|
@@ -49,6 +49,10 @@ export class ApiDartWriter {
|
|
|
49
49
|
methodName = methodName.slice(tag.length);
|
|
50
50
|
methodName = Utils.toFirstLetterLowercase(methodName);
|
|
51
51
|
}
|
|
52
|
+
// console.debug(`\tAPI - ${apiName} - ${apiMethod}`);
|
|
53
|
+
if (methodName == "userGeneralInfoTestSave") {
|
|
54
|
+
debugger;
|
|
55
|
+
}
|
|
52
56
|
const endpoint = {
|
|
53
57
|
methodName: methodName,
|
|
54
58
|
httpMethod: api.method.toLowerCase(),
|
|
@@ -57,7 +61,7 @@ export class ApiDartWriter {
|
|
|
57
61
|
haveRequest: api.haveRequest,
|
|
58
62
|
requestType: requestType,
|
|
59
63
|
};
|
|
60
|
-
if (api.parameters && api.parameters.length > 0) {
|
|
64
|
+
if (api.parameters && api.parameters.length > 0 && !api.haveRequest) {
|
|
61
65
|
endpoint.queryParams = api.parameters
|
|
62
66
|
.map(p => ({
|
|
63
67
|
name: p.name,
|
|
@@ -10,10 +10,12 @@ class {{apiClassName}} {
|
|
|
10
10
|
{{apiClassName}}() : _dio = getIt<Dio>();
|
|
11
11
|
|
|
12
12
|
{{#endpoints}}
|
|
13
|
-
Future<{{responseType}}> {{methodName}}(
|
|
14
|
-
|
|
13
|
+
Future<{{responseType}}> {{methodName}}(
|
|
14
|
+
{{#haveRequest}}{{requestType}} request{{/haveRequest}}
|
|
15
|
+
{{#queryParams}}
|
|
15
16
|
{{type}}{{#nullable}}?{{/nullable}} {{name}},
|
|
16
|
-
|
|
17
|
+
{{/queryParams}}
|
|
18
|
+
) async {
|
|
17
19
|
final response = await _dio.{{httpMethod}}(
|
|
18
20
|
'{{{path}}}',
|
|
19
21
|
{{#haveRequest}}
|
package/package.json
CHANGED
|
@@ -96,6 +96,11 @@ export class ApiDartWriter {
|
|
|
96
96
|
methodName = Utils.toFirstLetterLowercase(methodName);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
// console.debug(`\tAPI - ${apiName} - ${apiMethod}`);
|
|
100
|
+
if (methodName == "userGeneralInfoTestSave") {
|
|
101
|
+
debugger
|
|
102
|
+
}
|
|
103
|
+
|
|
99
104
|
const endpoint = <EndpointDefinitionDart>{
|
|
100
105
|
methodName: methodName,
|
|
101
106
|
httpMethod: api.method.toLowerCase() as HttpMethodDart,
|
|
@@ -105,7 +110,7 @@ export class ApiDartWriter {
|
|
|
105
110
|
requestType: requestType,
|
|
106
111
|
};
|
|
107
112
|
|
|
108
|
-
if (api.parameters && api.parameters.length > 0) {
|
|
113
|
+
if (api.parameters && api.parameters.length > 0 && !api.haveRequest) {
|
|
109
114
|
endpoint.queryParams = api.parameters
|
|
110
115
|
.map(p => ({
|
|
111
116
|
name: p.name,
|
|
@@ -10,10 +10,12 @@ class {{apiClassName}} {
|
|
|
10
10
|
{{apiClassName}}() : _dio = getIt<Dio>();
|
|
11
11
|
|
|
12
12
|
{{#endpoints}}
|
|
13
|
-
Future<{{responseType}}> {{methodName}}(
|
|
14
|
-
|
|
13
|
+
Future<{{responseType}}> {{methodName}}(
|
|
14
|
+
{{#haveRequest}}{{requestType}} request{{/haveRequest}}
|
|
15
|
+
{{#queryParams}}
|
|
15
16
|
{{type}}{{#nullable}}?{{/nullable}} {{name}},
|
|
16
|
-
|
|
17
|
+
{{/queryParams}}
|
|
18
|
+
) async {
|
|
17
19
|
final response = await _dio.{{httpMethod}}(
|
|
18
20
|
'{{{path}}}',
|
|
19
21
|
{{#haveRequest}}
|