adnx.tanchinhdo.api

<back to all web services

SearchPostRequest

The following routes are available for this service:
GET/post/search
import 'package:servicestack/servicestack.dart';

class PagingRequest implements IConvertible
{
    int? page;
    int? limit;
    int? offSet;

    PagingRequest({this.page,this.limit,this.offSet});
    PagingRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        page = json['page'];
        limit = json['limit'];
        offSet = json['offSet'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'page': page,
        'limit': limit,
        'offSet': offSet
    };

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

class SearchPostRequest extends PagingRequest implements IConvertible
{
    String? searchTxt;

    SearchPostRequest({this.searchTxt});
    SearchPostRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class GameResponse implements IConvertible
{
    int? id;
    String? name;
    String? identifier;
    String? linkHomePage;
    String? linkDownload;
    String? linkFanPage;
    String? icon;

    GameResponse({this.id,this.name,this.identifier,this.linkHomePage,this.linkDownload,this.linkFanPage,this.icon});
    GameResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        name = json['name'];
        identifier = json['identifier'];
        linkHomePage = json['linkHomePage'];
        linkDownload = json['linkDownload'];
        linkFanPage = json['linkFanPage'];
        icon = json['icon'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'name': name,
        'identifier': identifier,
        'linkHomePage': linkHomePage,
        'linkDownload': linkDownload,
        'linkFanPage': linkFanPage,
        'icon': icon
    };

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

class BaseResponse<List> implements IResponseRequest, IConvertible
{
    int? code;
    String? message;
    List<GameResponse>? data;

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

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

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

    getTypeName() => "BaseResponse<$List`1>";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'tanchinhdo_api_sandbox.adnx.vn', types: <String, TypeInfo> {
    'PagingRequest': TypeInfo(TypeOf.Class, create:() => PagingRequest()),
    'SearchPostRequest': TypeInfo(TypeOf.Class, create:() => SearchPostRequest()),
    'GameResponse': TypeInfo(TypeOf.Class, create:() => GameResponse()),
    'BaseResponse<List>': TypeInfo(TypeOf.Class, create:() => BaseResponse<List>()),
    'List<GameResponse>': TypeInfo(TypeOf.Class, create:() => <GameResponse>[]),
});

Dart SearchPostRequest 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 /post/search HTTP/1.1 
Host: tanchinhdo-api-sandbox.adnx.vn 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<BaseResponseOfPostResponsed48BjkLW xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/adnx.tanchinhdo.api.ServiceModel">
  <Code>0</Code>
  <Data xmlns:d2p1="http://schemas.datacontract.org/2004/07/adnx.tanchinhdo.data.Models">
    <d2p1:Body>String</d2p1:Body>
    <d2p1:Category>
      <d2p1:Id>0</d2p1:Id>
      <d2p1:Name>String</d2p1:Name>
      <d2p1:Slug>String</d2p1:Slug>
    </d2p1:Category>
    <d2p1:CategoryId>0</d2p1:CategoryId>
    <d2p1:CreatedDate>0001-01-01T00:00:00</d2p1:CreatedDate>
    <d2p1:Description>String</d2p1:Description>
    <d2p1:Id>0</d2p1:Id>
    <d2p1:ImageUrl>String</d2p1:ImageUrl>
    <d2p1:IsPublished>false</d2p1:IsPublished>
    <d2p1:PublishedDate>0001-01-01T00:00:00</d2p1:PublishedDate>
    <d2p1:Slug>String</d2p1:Slug>
    <d2p1:Title>String</d2p1:Title>
    <d2p1:UpdatedDate>0001-01-01T00:00:00</d2p1:UpdatedDate>
    <d2p1:ViewCount>0</d2p1:ViewCount>
  </Data>
  <Message>String</Message>
</BaseResponseOfPostResponsed48BjkLW>