| Required role: | super-admin |
| GET | /document-reference/search |
|---|
import 'package:servicestack/servicestack.dart';
class PagingRequest implements IConvertible
{
int? page;
int? limit;
PagingRequest({this.page,this.limit});
PagingRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
page = json['page'];
limit = json['limit'];
return this;
}
Map<String, dynamic> toJson() => {
'page': page,
'limit': limit
};
getTypeName() => "PagingRequest";
TypeContext? context = _ctx;
}
class SearchDocumentReferenceRequest extends PagingRequest implements IConvertible
{
String? documentCode;
int? parentDocumentId;
String? title;
SearchDocumentReferenceRequest({this.documentCode,this.parentDocumentId,this.title});
SearchDocumentReferenceRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
documentCode = json['documentCode'];
parentDocumentId = json['parentDocumentId'];
title = json['title'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'documentCode': documentCode,
'parentDocumentId': parentDocumentId,
'title': title
});
getTypeName() => "SearchDocumentReferenceRequest";
TypeContext? context = _ctx;
}
class MongoObject implements IMongoModel, IConvertible
{
String? id;
MongoObject({this.id});
MongoObject.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = JsonConverters.fromJson(json['id'],'String',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': JsonConverters.toJson(id,'String',context!)
};
getTypeName() => "MongoObject";
TypeContext? context = _ctx;
}
class AuditLog extends MongoObject implements IEntityId, ICreated, IUpdate, IConvertible
{
String? userName;
int? userId;
int? documentId;
String? action;
String? description;
DateTime? createdDate;
DateTime? updatedDate;
String? ipAddress;
String? userAgent;
AuditLog({this.userName,this.userId,this.documentId,this.action,this.description,this.createdDate,this.updatedDate,this.ipAddress,this.userAgent});
AuditLog.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
userName = json['userName'];
userId = json['userId'];
documentId = json['documentId'];
action = json['action'];
description = json['description'];
createdDate = JsonConverters.fromJson(json['createdDate'],'DateTime',context!);
updatedDate = JsonConverters.fromJson(json['updatedDate'],'DateTime',context!);
ipAddress = json['ipAddress'];
userAgent = json['userAgent'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'userName': userName,
'userId': userId,
'documentId': documentId,
'action': action,
'description': description,
'createdDate': JsonConverters.toJson(createdDate,'DateTime',context!),
'updatedDate': JsonConverters.toJson(updatedDate,'DateTime',context!),
'ipAddress': ipAddress,
'userAgent': userAgent
});
getTypeName() => "AuditLog";
TypeContext? context = _ctx;
}
class Pagination implements IConvertible
{
int? total;
int? pages;
int? offset;
int? limit;
int? currentPage;
Pagination({this.total,this.pages,this.offset,this.limit,this.currentPage});
Pagination.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
total = json['total'];
pages = json['pages'];
offset = json['offset'];
limit = json['limit'];
currentPage = json['currentPage'];
return this;
}
Map<String, dynamic> toJson() => {
'total': total,
'pages': pages,
'offset': offset,
'limit': limit,
'currentPage': currentPage
};
getTypeName() => "Pagination";
TypeContext? context = _ctx;
}
class PageResponse<AuditLog> implements IResponseRequest, IConvertible
{
int? code;
String? message;
List<AuditLog>? data;
Pagination? pagination;
PageResponse({this.code,this.message,this.data,this.pagination});
PageResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
code = json['code'];
message = json['message'];
data = JsonConverters.fromJson(json['data'],'List<${runtimeGenericTypeDefs(this,[0]).join(",")}>',context!);
pagination = JsonConverters.fromJson(json['pagination'],'Pagination',context!);
return this;
}
Map<String, dynamic> toJson() => {
'code': code,
'message': message,
'data': JsonConverters.toJson(data,'List<AuditLog>',context!),
'pagination': JsonConverters.toJson(pagination,'Pagination',context!)
};
getTypeName() => "PageResponse<$AuditLog>";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'etc_api.vsmlab.vn', types: <String, TypeInfo> {
'PagingRequest': TypeInfo(TypeOf.Class, create:() => PagingRequest()),
'SearchDocumentReferenceRequest': TypeInfo(TypeOf.Class, create:() => SearchDocumentReferenceRequest()),
'MongoObject': TypeInfo(TypeOf.Class, create:() => MongoObject()),
'AuditLog': TypeInfo(TypeOf.Class, create:() => AuditLog()),
'Pagination': TypeInfo(TypeOf.Class, create:() => Pagination()),
'PageResponse<AuditLog>': TypeInfo(TypeOf.Class, create:() => PageResponse<AuditLog>()),
});
Dart SearchDocumentReferenceRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /document-reference/search HTTP/1.1 Host: etc-api.vsmlab.vn Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"code":0,"message":"String","data":[{"id":0,"parentDocumentId":0,"title":"String","documentCode":"String","referenceUrl":"String","description":"String"}],"pagination":null}