Transaction Action of GS2-Lottery

Specification of verify/consume/acquire transaction actions

AcquireAction

Gs2Lottery:DrawByUserId

Drawing lots by specifying user IDs

Whether the action allows quantity specification: YES

Whether the action is reversible: NO

TypeDescription
namespaceNamestringNamespace name
lotteryNamestringLottery Model name
userIdstringSet #{userId} to replace the currently logged in user ID.
countintNumber of draws
configConfig[]Settings applied to the placeholder on the stamp sheet
timeOffsetTokenstringTime offset token
{
    "action": "Gs2Lottery:DrawByUserId",
    "request": {
        "namespaceName": "[string]Namespace name",
        "lotteryName": "[string]Lottery Model name",
        "userId": "[string]User ID",
        "count": "[int]Number of draws",
        "config": [
            {
                "key": "[string]Name",
                "value": "[string]Value"
            }
        ],
        "timeOffsetToken": "[string]Time offset token"
    }
}
action: Gs2Lottery:DrawByUserId
request:
  namespaceName: "[string]Namespace name"
  lotteryName: "[string]Lottery Model name"
  userId: "[string]User ID"
  count: "[int]Number of draws"
  config: 
    - key: "[string]Name"
      value: "[string]Value"
  timeOffsetToken: "[string]Time offset token"
transaction.service("lottery").acquire.draw_by_user_id({
    namespaceName="[string]Namespace name",
    lotteryName="[string]Lottery Model name",
    userId="[string]User ID",
    count="[int]Number of draws",
    config={
        {
            key="[string]Name",
            value="[string]Value"
        }
    },
    timeOffsetToken="[string]Time offset token",
})

Gs2Lottery:ResetBoxByUserId

Reset box with specified user ID

Whether the action allows quantity specification: NO

Whether the action is reversible: NO

TypeDescription
namespaceNamestringNamespace name
prizeTableNamestringName of prize table
userIdstringSet #{userId} to replace the currently logged in user ID.
timeOffsetTokenstringTime offset token
{
    "action": "Gs2Lottery:ResetBoxByUserId",
    "request": {
        "namespaceName": "[string]Namespace name",
        "prizeTableName": "[string]Name of prize table",
        "userId": "[string]User ID",
        "timeOffsetToken": "[string]Time offset token"
    }
}
action: Gs2Lottery:ResetBoxByUserId
request:
  namespaceName: "[string]Namespace name"
  prizeTableName: "[string]Name of prize table"
  userId: "[string]User ID"
  timeOffsetToken: "[string]Time offset token"
transaction.service("lottery").acquire.reset_box_by_user_id({
    namespaceName="[string]Namespace name",
    prizeTableName="[string]Name of prize table",
    userId="[string]User ID",
    timeOffsetToken="[string]Time offset token",
})