tvpl.api

<back to all web services

SearchTemplateRequest

Requires Authentication
The following routes are available for this service:
GET/document-template/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 DocumentTemplate implements IConvertible
{
    int? id;
    // @required()
    String? title;

    String? description;
    bool? isActive;
    String? fileKey;
    String? fileUrl;
    String? fileName;
    int? fileSize;

    DocumentTemplate({this.id,this.title,this.description,this.isActive,this.fileKey,this.fileUrl,this.fileName,this.fileSize});
    DocumentTemplate.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        title = json['title'];
        description = json['description'];
        isActive = json['isActive'];
        fileKey = json['fileKey'];
        fileUrl = json['fileUrl'];
        fileName = json['fileName'];
        fileSize = json['fileSize'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'title': title,
        'description': description,
        'isActive': isActive,
        'fileKey': fileKey,
        'fileUrl': fileUrl,
        'fileName': fileName,
        'fileSize': fileSize
    };

    getTypeName() => "DocumentTemplate";
    TypeContext? context = _ctx;
}

class SearchDocumentTemplateResponse implements IResponseRequest, IConvertible
{
    int? code;
    String? message;
    List<DocumentTemplate>? data;
    int? totalCount;

    SearchDocumentTemplateResponse({this.code,this.message,this.data,this.totalCount});
    SearchDocumentTemplateResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        code = json['code'];
        message = json['message'];
        data = JsonConverters.fromJson(json['data'],'List<DocumentTemplate>',context!);
        totalCount = json['totalCount'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'code': code,
        'message': message,
        'data': JsonConverters.toJson(data,'List<DocumentTemplate>',context!),
        'totalCount': totalCount
    };

    getTypeName() => "SearchDocumentTemplateResponse";
    TypeContext? context = _ctx;
}

class SearchTemplateRequest extends PagingRequest implements IConvertible
{
    String? title;
    bool? isActive;

    SearchTemplateRequest({this.title,this.isActive});
    SearchTemplateRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        title = json['title'];
        isActive = json['isActive'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'title': title,
        'isActive': isActive
    });

    getTypeName() => "SearchTemplateRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'qlcn_api.vsmlab.vn', types: <String, TypeInfo> {
    'PagingRequest': TypeInfo(TypeOf.Class, create:() => PagingRequest()),
    'DocumentTemplate': TypeInfo(TypeOf.Class, create:() => DocumentTemplate()),
    'SearchDocumentTemplateResponse': TypeInfo(TypeOf.Class, create:() => SearchDocumentTemplateResponse()),
    'List<DocumentTemplate>': TypeInfo(TypeOf.Class, create:() => <DocumentTemplate>[]),
    'SearchTemplateRequest': TypeInfo(TypeOf.Class, create:() => SearchTemplateRequest()),
});

Dart SearchTemplateRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /document-template/search HTTP/1.1 
Host: qlcn-api.vsmlab.vn 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<SearchDocumentTemplateResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/tvpl.api.ServiceModel">
  <Code>0</Code>
  <Data xmlns:d2p1="http://schemas.datacontract.org/2004/07/tvpl.data.Models">
    <d2p1:DocumentTemplate>
      <d2p1:CreatedAt>0001-01-01T00:00:00</d2p1:CreatedAt>
      <d2p1:CreatedBy>0</d2p1:CreatedBy>
      <d2p1:Description>String</d2p1:Description>
      <d2p1:FileKey>String</d2p1:FileKey>
      <d2p1:FileName>String</d2p1:FileName>
      <d2p1:FileSize>0</d2p1:FileSize>
      <d2p1:FileUrl>String</d2p1:FileUrl>
      <d2p1:Id>0</d2p1:Id>
      <d2p1:IsActive>false</d2p1:IsActive>
      <d2p1:Title>String</d2p1:Title>
    </d2p1:DocumentTemplate>
  </Data>
  <Message>String</Message>
  <TotalCount>0</TotalCount>
</SearchDocumentTemplateResponse>