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 Foundation
import ServiceStack

public class LogGiftcodeRequest : PagingRequest
{
    public var gameId:Int
    public var fromDate:Date
    public var toDate:Date

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case gameId
        case fromDate
        case toDate
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        gameId = try container.decodeIfPresent(Int.self, forKey: .gameId)
        fromDate = try container.decodeIfPresent(Date.self, forKey: .fromDate)
        toDate = try container.decodeIfPresent(Date.self, forKey: .toDate)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if gameId != nil { try container.encode(gameId, forKey: .gameId) }
        if fromDate != nil { try container.encode(fromDate, forKey: .fromDate) }
        if toDate != nil { try container.encode(toDate, forKey: .toDate) }
    }
}

public class PagingRequest : Codable
{
    public var page:Int
    public var limit:Int
    public var offSet:Int

    required public init(){}
}

public class PageResponse<T : Codable> : IResponseRequest, Codable
{
    public var code:Int
    public var message:String
    public var data:[ReceivedGiftcodeResponse] = []
    public var pagination:Pagination

    required public init(){}
}

public class ReceivedGiftcodeResponse : Codable
{
    public var eventId:Int
    public var eventName:String
    public var eventUrl:String
    public var Description:String
    public var iconUrl:String
    public var label:String
    public var labelColor:String
    public var eventType:Int
    public var code:String
    public var serverId:String
    public var characterId:String
    public var characterName:String
    public var startDate:Date?
    public var dueDate:Date?
    public var eventStartDate:Date?
    public var eventEndDate:Date?
    public var createdDate:Date
    public var isUsed:Bool

    required public init(){}
}

public class Pagination : Codable
{
    public var total:Int
    public var pages:Int
    public var offset:Int
    public var limit:Int
    public var currentPage:Int

    required public init(){}
}


Swift LogGiftcodeRequest DTOs

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

HTTP + OTHER

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/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
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}