| POST | /login |
|---|
import 'package:servicestack/servicestack.dart';
class LoginRequest implements IConvertible
{
String? userName;
String? password;
LoginRequest({this.userName,this.password});
LoginRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
userName = json['userName'];
password = json['password'];
return this;
}
Map<String, dynamic> toJson() => {
'userName': userName,
'password': password
};
getTypeName() => "LoginRequest";
TypeContext? context = _ctx;
}
class GameResponse implements IConvertible
{
int? id;
String? name;
String? identifier;
String? linkHomePage;
String? linkDownload;
String? linkFanPage;
String? icon;
GameResponse({this.id,this.name,this.identifier,this.linkHomePage,this.linkDownload,this.linkFanPage,this.icon});
GameResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
identifier = json['identifier'];
linkHomePage = json['linkHomePage'];
linkDownload = json['linkDownload'];
linkFanPage = json['linkFanPage'];
icon = json['icon'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'name': name,
'identifier': identifier,
'linkHomePage': linkHomePage,
'linkDownload': linkDownload,
'linkFanPage': linkFanPage,
'icon': icon
};
getTypeName() => "GameResponse";
TypeContext? context = _ctx;
}
class BaseResponse<List> implements IResponseRequest, IConvertible
{
int? code;
String? message;
List<GameResponse>? data;
BaseResponse({this.code,this.message,this.data});
BaseResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
code = json['code'];
message = json['message'];
data = JsonConverters.fromJson(json['data'],'List<GameResponse>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'code': code,
'message': message,
'data': JsonConverters.toJson(data,'List<GameResponse>',context!)
};
getTypeName() => "BaseResponse<$List`1>";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'tanchinhdo_api_sandbox.adnx.vn', types: <String, TypeInfo> {
'LoginRequest': TypeInfo(TypeOf.Class, create:() => LoginRequest()),
'GameResponse': TypeInfo(TypeOf.Class, create:() => GameResponse()),
'BaseResponse<List>': TypeInfo(TypeOf.Class, create:() => BaseResponse<List>()),
'List<GameResponse>': TypeInfo(TypeOf.Class, create:() => <GameResponse>[]),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /login HTTP/1.1
Host: tanchinhdo-api-sandbox.adnx.vn
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<LoginRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/adnx.tanchinhdo.api.ServiceModel">
<Password>String</Password>
<UserName>String</UserName>
</LoginRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<BaseResponseOfLoginResponseFGO_SoS8X xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/adnx.tanchinhdo.api.ServiceModel">
<Code>0</Code>
<Data>
<Permissions xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:string>String</d3p1:string>
</Permissions>
<Roles xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:string>String</d3p1:string>
</Roles>
<Token>String</Token>
<UserId>0</UserId>
<UserName>String</UserName>
</Data>
<Message>String</Message>
</BaseResponseOfLoginResponseFGO_SoS8X>