| POST | /document/create |
|---|
import 'package:servicestack/servicestack.dart';
class CreateDocumentResponse implements IResponseRequest, IConvertible
{
int? id;
int? code;
String? message;
CreateDocumentResponse({this.id,this.code,this.message});
CreateDocumentResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
code = json['code'];
message = json['message'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'code': code,
'message': message
};
getTypeName() => "CreateDocumentResponse";
TypeContext? context = _ctx;
}
/**
* Tạo văn bản
*/
class CreateDocumentRequest implements IConvertible
{
String? title;
String? documentCode;
String? description;
int? documentPolicyId;
int? mainId;
int? scopeType;
CreateDocumentRequest({this.title,this.documentCode,this.description,this.documentPolicyId,this.mainId,this.scopeType});
CreateDocumentRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
title = json['title'];
documentCode = json['documentCode'];
description = json['description'];
documentPolicyId = json['documentPolicyId'];
mainId = json['mainId'];
scopeType = json['scopeType'];
return this;
}
Map<String, dynamic> toJson() => {
'title': title,
'documentCode': documentCode,
'description': description,
'documentPolicyId': documentPolicyId,
'mainId': mainId,
'scopeType': scopeType
};
getTypeName() => "CreateDocumentRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'etc_api.vsmlab.vn', types: <String, TypeInfo> {
'CreateDocumentResponse': TypeInfo(TypeOf.Class, create:() => CreateDocumentResponse()),
'CreateDocumentRequest': TypeInfo(TypeOf.Class, create:() => CreateDocumentRequest()),
});
Dart CreateDocumentRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /document/create HTTP/1.1
Host: etc-api.vsmlab.vn
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
title: String,
documentCode: String,
description: String,
documentPolicyId: 0,
mainId: 0,
scopeType: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
id: 0,
code: 0,
message: String
}