| POST | /Signature |
|---|
import 'package:servicestack/servicestack.dart';
class SignatureRequest implements IConvertible
{
int? fileId;
int? originalFileId;
int? workflowId;
int? stepId;
int? subDocumentId;
SignatureRequest({this.fileId,this.originalFileId,this.workflowId,this.stepId,this.subDocumentId});
SignatureRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
fileId = json['fileId'];
originalFileId = json['originalFileId'];
workflowId = json['workflowId'];
stepId = json['stepId'];
subDocumentId = json['subDocumentId'];
return this;
}
Map<String, dynamic> toJson() => {
'fileId': fileId,
'originalFileId': originalFileId,
'workflowId': workflowId,
'stepId': stepId,
'subDocumentId': subDocumentId
};
getTypeName() => "SignatureRequest";
TypeContext? context = _ctx;
}
class BasicUploadedFile implements IConvertible
{
String? fileName;
String? filekey;
String? fileUrl;
String? checksum;
String? eTag;
int? fileSize;
BasicUploadedFile({this.fileName,this.filekey,this.fileUrl,this.checksum,this.eTag,this.fileSize});
BasicUploadedFile.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
fileName = json['fileName'];
filekey = json['filekey'];
fileUrl = json['fileUrl'];
checksum = json['checksum'];
eTag = json['eTag'];
fileSize = json['fileSize'];
return this;
}
Map<String, dynamic> toJson() => {
'fileName': fileName,
'filekey': filekey,
'fileUrl': fileUrl,
'checksum': checksum,
'eTag': eTag,
'fileSize': fileSize
};
getTypeName() => "BasicUploadedFile";
TypeContext? context = _ctx;
}
class UploadedFiles extends BasicUploadedFile implements IConvertible
{
int? id;
String? uploadedFile;
int? subDocumentId;
int? stepId;
int? code;
UploadedFiles({this.id,this.uploadedFile,this.subDocumentId,this.stepId,this.code});
UploadedFiles.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
id = json['id'];
uploadedFile = json['uploadedFile'];
subDocumentId = json['subDocumentId'];
stepId = json['stepId'];
code = json['code'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'id': id,
'uploadedFile': uploadedFile,
'subDocumentId': subDocumentId,
'stepId': stepId,
'code': code
});
getTypeName() => "UploadedFiles";
TypeContext? context = _ctx;
}
class DocumentSignLog implements IConvertible
{
int? id;
int? documentId;
int? subDocumentId;
int? stepId;
int? fileId;
// @StringLength(50)
String? signProvider;
// @StringLength(100)
String? certSerial;
bool? isSuccess;
// @StringLength(500)
String? signMessage;
int? signBy;
DateTime? signAt;
String? requestId;
int? originalFileId;
DateTime? effectBeginDate;
DateTime? effectEndDate;
DocumentSignLog({this.id,this.documentId,this.subDocumentId,this.stepId,this.fileId,this.signProvider,this.certSerial,this.isSuccess,this.signMessage,this.signBy,this.signAt,this.requestId,this.originalFileId,this.effectBeginDate,this.effectEndDate});
DocumentSignLog.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
documentId = json['documentId'];
subDocumentId = json['subDocumentId'];
stepId = json['stepId'];
fileId = json['fileId'];
signProvider = json['signProvider'];
certSerial = json['certSerial'];
isSuccess = json['isSuccess'];
signMessage = json['signMessage'];
signBy = json['signBy'];
signAt = JsonConverters.fromJson(json['signAt'],'DateTime',context!);
requestId = json['requestId'];
originalFileId = json['originalFileId'];
effectBeginDate = JsonConverters.fromJson(json['effectBeginDate'],'DateTime',context!);
effectEndDate = JsonConverters.fromJson(json['effectEndDate'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'documentId': documentId,
'subDocumentId': subDocumentId,
'stepId': stepId,
'fileId': fileId,
'signProvider': signProvider,
'certSerial': certSerial,
'isSuccess': isSuccess,
'signMessage': signMessage,
'signBy': signBy,
'signAt': JsonConverters.toJson(signAt,'DateTime',context!),
'requestId': requestId,
'originalFileId': originalFileId,
'effectBeginDate': JsonConverters.toJson(effectBeginDate,'DateTime',context!),
'effectEndDate': JsonConverters.toJson(effectEndDate,'DateTime',context!)
};
getTypeName() => "DocumentSignLog";
TypeContext? context = _ctx;
}
class SignatureResponse implements IResponseRequest, IConvertible
{
int? code;
String? message;
UploadedFiles? signedFile;
DocumentSignLog? signLog;
SignatureResponse({this.code,this.message,this.signedFile,this.signLog});
SignatureResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
code = json['code'];
message = json['message'];
signedFile = JsonConverters.fromJson(json['signedFile'],'UploadedFiles',context!);
signLog = JsonConverters.fromJson(json['signLog'],'DocumentSignLog',context!);
return this;
}
Map<String, dynamic> toJson() => {
'code': code,
'message': message,
'signedFile': JsonConverters.toJson(signedFile,'UploadedFiles',context!),
'signLog': JsonConverters.toJson(signLog,'DocumentSignLog',context!)
};
getTypeName() => "SignatureResponse";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'etc_api.vsmlab.vn', types: <String, TypeInfo> {
'SignatureRequest': TypeInfo(TypeOf.Class, create:() => SignatureRequest()),
'BasicUploadedFile': TypeInfo(TypeOf.Class, create:() => BasicUploadedFile()),
'UploadedFiles': TypeInfo(TypeOf.Class, create:() => UploadedFiles()),
'DocumentSignLog': TypeInfo(TypeOf.Class, create:() => DocumentSignLog()),
'SignatureResponse': TypeInfo(TypeOf.Class, create:() => SignatureResponse()),
});
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 /Signature HTTP/1.1
Host: etc-api.vsmlab.vn
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
fileId: 0,
originalFileId: 0,
workflowId: 0,
stepId: 0,
subDocumentId: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
code: 0,
message: String,
signedFile:
{
id: 0,
uploadedFile: String,
subDocumentId: 0,
stepId: 0,
code: 0,
fileName: String,
filekey: String,
fileUrl: String,
checksum: String,
eTag: String,
fileSize: 0
},
signLog:
{
id: 0,
documentId: 0,
subDocumentId: 0,
stepId: 0,
fileId: 0,
signProvider: String,
certSerial: String,
isSuccess: False,
signMessage: String,
signBy: 0,
requestId: 00000000000000000000000000000000,
originalFileId: 0,
effectBeginDate: "0001-01-01T00:00:00.0000000+07:06",
effectEndDate: "0001-01-01T00:00:00.0000000+07:06"
}
}