efun.id.api

<back to all web services

LogGiftcodeRequest

Requires Authentication
The following routes are available for this service:
GET/api/v1/logs/giftcode
import 'package:servicestack/servicestack.dart';

class PagingRequest implements IConvertible
{
    int page = 0;
    int limit = 0;
    int offSet = 0;

    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 LogGiftcodeRequest extends PagingRequest implements IConvertible
{
    int gameId = 0;
    DateTime fromDate = DateTime(0);
    DateTime toDate = DateTime(0);

    LogGiftcodeRequest({this.gameId,this.fromDate,this.toDate});
    LogGiftcodeRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        gameId = json['gameId'];
        fromDate = JsonConverters.fromJson(json['fromDate'],'DateTime',context!);
        toDate = JsonConverters.fromJson(json['toDate'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'gameId': gameId,
        'fromDate': JsonConverters.toJson(fromDate,'DateTime',context!),
        'toDate': JsonConverters.toJson(toDate,'DateTime',context!)
    });

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

class ReceivedGiftcodeResponse implements IConvertible
{
    int eventId = 0;
    String eventName = "";
    String? eventUrl;
    String? description;
    String? iconUrl;
    String? label;
    String? labelColor;
    int eventType = 0;
    String? code;
    String? serverId;
    String? characterId;
    String? characterName;
    DateTime? startDate;
    DateTime? dueDate;
    DateTime? eventStartDate;
    DateTime? eventEndDate;
    DateTime createdDate = DateTime(0);
    bool isUsed;

    ReceivedGiftcodeResponse({this.eventId,this.eventName,this.eventUrl,this.description,this.iconUrl,this.label,this.labelColor,this.eventType,this.code,this.serverId,this.characterId,this.characterName,this.startDate,this.dueDate,this.eventStartDate,this.eventEndDate,this.createdDate,this.isUsed});
    ReceivedGiftcodeResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        eventId = json['eventId'];
        eventName = json['eventName'];
        eventUrl = json['eventUrl'];
        description = json['description'];
        iconUrl = json['iconUrl'];
        label = json['label'];
        labelColor = json['labelColor'];
        eventType = json['eventType'];
        code = json['code'];
        serverId = json['serverId'];
        characterId = json['characterId'];
        characterName = json['characterName'];
        startDate = JsonConverters.fromJson(json['startDate'],'DateTime',context!);
        dueDate = JsonConverters.fromJson(json['dueDate'],'DateTime',context!);
        eventStartDate = JsonConverters.fromJson(json['eventStartDate'],'DateTime',context!);
        eventEndDate = JsonConverters.fromJson(json['eventEndDate'],'DateTime',context!);
        createdDate = JsonConverters.fromJson(json['createdDate'],'DateTime',context!);
        isUsed = json['isUsed'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'eventId': eventId,
        'eventName': eventName,
        'eventUrl': eventUrl,
        'description': description,
        'iconUrl': iconUrl,
        'label': label,
        'labelColor': labelColor,
        'eventType': eventType,
        'code': code,
        'serverId': serverId,
        'characterId': characterId,
        'characterName': characterName,
        'startDate': JsonConverters.toJson(startDate,'DateTime',context!),
        'dueDate': JsonConverters.toJson(dueDate,'DateTime',context!),
        'eventStartDate': JsonConverters.toJson(eventStartDate,'DateTime',context!),
        'eventEndDate': JsonConverters.toJson(eventEndDate,'DateTime',context!),
        'createdDate': JsonConverters.toJson(createdDate,'DateTime',context!),
        'isUsed': isUsed
    };

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

class Pagination implements IConvertible
{
    int total = 0;
    int pages = 0;
    int offset = 0;
    int limit = 0;
    int currentPage = 0;

    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<T> implements IResponseRequest, IConvertible
{
    int code = 0;
    String message = "";
    List<ReceivedGiftcodeResponse> 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<ReceivedGiftcodeResponse>',context!);
        pagination = JsonConverters.fromJson(json['pagination'],'Pagination',context!);
        return this;
    }

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

    getTypeName() => "PageResponse<$T>";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'efun_id_api_sandbox.efun.vn', types: <String, TypeInfo> {
    'PagingRequest': TypeInfo(TypeOf.Class, create:() => PagingRequest()),
    'LogGiftcodeRequest': TypeInfo(TypeOf.Class, create:() => LogGiftcodeRequest()),
    'ReceivedGiftcodeResponse': TypeInfo(TypeOf.Class, create:() => ReceivedGiftcodeResponse()),
    'Pagination': TypeInfo(TypeOf.Class, create:() => Pagination()),
    'PageResponse<T>': TypeInfo(TypeOf.Class, create:() => PageResponse<T>()),
    'List<ReceivedGiftcodeResponse>': TypeInfo(TypeOf.Class, create:() => <ReceivedGiftcodeResponse>[]),
});

Dart LogGiftcodeRequest DTOs

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

HTTP + CSV

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

GET /api/v1/logs/giftcode HTTP/1.1 
Host: efun-id-api-sandbox.efun.vn 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"code":0,"message":"String","data":[{"userId":0,"userName":"String","vipPoint":0,"orderId":"String","exportCode":"String","giftCode":"String","gameId":0,"gameName":"String","serverId":0,"serverName":"String","packageId":0,"packageName":"String","characterId":"String","characterName":"String","payCode":0,"payMsg":"String","payDate":"0001-01-01T00:00:00.0000000+07:06","ipAddress":"String","userAgent":"String","signature":"String","responseData":"String","createdDate":"0001-01-01T00:00:00.0000000+07:06","updatedDate":"0001-01-01T00:00:00.0000000+07:06","id":"000000000000000000000000"}],"pagination":null}