| POST | /document/approve |
|---|
import 'package:servicestack/servicestack.dart';
class ApprovalResponse implements IResponseRequest, IConvertible
{
int? code;
String? message;
ApprovalResponse({this.code,this.message});
ApprovalResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
code = json['code'];
message = json['message'];
return this;
}
Map<String, dynamic> toJson() => {
'code': code,
'message': message
};
getTypeName() => "ApprovalResponse";
TypeContext? context = _ctx;
}
class DocumentApproveRequest implements IPost, IConvertible
{
int? documentId;
String? submitComment;
int? nextApproverId;
DateTime? dueDate;
DocumentApproveRequest({this.documentId,this.submitComment,this.nextApproverId,this.dueDate});
DocumentApproveRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
documentId = json['documentId'];
submitComment = json['submitComment'];
nextApproverId = json['nextApproverId'];
dueDate = JsonConverters.fromJson(json['dueDate'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'documentId': documentId,
'submitComment': submitComment,
'nextApproverId': nextApproverId,
'dueDate': JsonConverters.toJson(dueDate,'DateTime',context!)
};
getTypeName() => "DocumentApproveRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'etc_api.vsmlab.vn', types: <String, TypeInfo> {
'ApprovalResponse': TypeInfo(TypeOf.Class, create:() => ApprovalResponse()),
'DocumentApproveRequest': TypeInfo(TypeOf.Class, create:() => DocumentApproveRequest()),
});
Dart DocumentApproveRequest DTOs
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 /document/approve HTTP/1.1
Host: etc-api.vsmlab.vn
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<DocumentApproveRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/tvpl.api.ServiceModel">
<DocumentId>0</DocumentId>
<DueDate>0001-01-01T00:00:00</DueDate>
<NextApproverId>0</NextApproverId>
<SubmitComment>String</SubmitComment>
</DocumentApproveRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <ApprovalResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/tvpl.api.ServiceModel"> <Code>0</Code> <Message>String</Message> </ApprovalResponse>