Transaction Action of GS2-Limit

Specification of verify/consume/acquire transaction actions

VerifyAction

Gs2Limit:VerifyCounterByUserId

Verify counter value by user ID

Whether the action allows quantity specification: NO

TypeDescription
namespaceNamestringNamespace name
userIdstringUser ID
Set #{userId} to replace the currently logged in user ID.
limitNamestringName of limit model
counterNamestringCounter Name
verifyTypeString Enum
enum {
  “less”,
  “lessEqual”,
  “greater”,
  “greaterEqual”,
  “equal”,
  “notEqual”
}
Type of verification
Enumerator String DefinitionDescription
“less”Possession quantity is less than the specified value
“lessEqual”Possession quantity is less than or equal to the specified value
“greater”Possession quantity is greater than the specified value
“greaterEqual”Possession quantity is greater than or equal to the specified value
“equal”Possession quantity is equal to the specified value
“notEqual”Possession quantity is not equal to the specified value
countintcount value
multiplyValueSpecifyingQuantityboolWhether to multiply the value used for verification when specifying the quantity
timeOffsetTokenstringTime offset token
{
    "action": "Gs2Limit:VerifyCounterByUserId",
    "request": {
        "namespaceName": "[string]Namespace name",
        "userId": "[string]User ID",
        "limitName": "[string]Name of limit model",
        "counterName": "[string]Counter Name",
        "verifyType": "[string]Type of verification",
        "count": "[int]count value",
        "multiplyValueSpecifyingQuantity": "[bool]Whether to multiply the value used for verification when specifying the quantity",
        "timeOffsetToken": "[string]Time offset token"
    }
}
action: Gs2Limit:VerifyCounterByUserId
request:
  namespaceName: "[string]Namespace name"
  userId: "[string]User ID"
  limitName: "[string]Name of limit model"
  counterName: "[string]Counter Name"
  verifyType: "[string]Type of verification"
  count: "[int]count value"
  multiplyValueSpecifyingQuantity: "[bool]Whether to multiply the value used for verification when specifying the quantity"
  timeOffsetToken: "[string]Time offset token"
transaction.service("limit").verify.verify_counter_by_user_id({
    namespaceName="[string]Namespace name",
    userId="[string]User ID",
    limitName="[string]Name of limit model",
    counterName="[string]Counter Name",
    verifyType="[string]Type of verification",
    count="[int]count value",
    multiplyValueSpecifyingQuantity="[bool]Whether to multiply the value used for verification when specifying the quantity",
    timeOffsetToken="[string]Time offset token",
})

ConsumeAction

Gs2Limit:CountUpByUserId

count-up by the specify user ID

Whether the action allows quantity specification: YES

Whether the action is reversible: YES

TypeDescription
namespaceNamestringNamespace name
limitNamestringName of limit model
counterNamestringCounter Name
userIdstringSet #{userId} to replace the currently logged in user ID.
countUpValueintAmount to count up
maxValueintMaximum value allowed to count up
timeOffsetTokenstringTime offset token
{
    "action": "Gs2Limit:CountUpByUserId",
    "request": {
        "namespaceName": "[string]Namespace name",
        "limitName": "[string]Name of limit model",
        "counterName": "[string]Counter Name",
        "userId": "[string]User ID",
        "countUpValue": "[int]Amount to count up",
        "maxValue": "[int]Maximum value allowed to count up",
        "timeOffsetToken": "[string]Time offset token"
    }
}
action: Gs2Limit:CountUpByUserId
request:
  namespaceName: "[string]Namespace name"
  limitName: "[string]Name of limit model"
  counterName: "[string]Counter Name"
  userId: "[string]User ID"
  countUpValue: "[int]Amount to count up"
  maxValue: "[int]Maximum value allowed to count up"
  timeOffsetToken: "[string]Time offset token"
transaction.service("limit").consume.count_up_by_user_id({
    namespaceName="[string]Namespace name",
    limitName="[string]Name of limit model",
    counterName="[string]Counter Name",
    userId="[string]User ID",
    countUpValue="[int]Amount to count up",
    maxValue="[int]Maximum value allowed to count up",
    timeOffsetToken="[string]Time offset token",
})

AcquireAction

Gs2Limit:CountDownByUserId

count-down by the specify user ID

Whether the action allows quantity specification: YES

Whether the action is reversible: YES

TypeDescription
namespaceNamestringNamespace name
limitNamestringName of limit model
counterNamestringCounter Name
userIdstringSet #{userId} to replace the currently logged in user ID.
countDownValueintAmount to count down
timeOffsetTokenstringTime offset token
{
    "action": "Gs2Limit:CountDownByUserId",
    "request": {
        "namespaceName": "[string]Namespace name",
        "limitName": "[string]Name of limit model",
        "counterName": "[string]Counter Name",
        "userId": "[string]User ID",
        "countDownValue": "[int]Amount to count down",
        "timeOffsetToken": "[string]Time offset token"
    }
}
action: Gs2Limit:CountDownByUserId
request:
  namespaceName: "[string]Namespace name"
  limitName: "[string]Name of limit model"
  counterName: "[string]Counter Name"
  userId: "[string]User ID"
  countDownValue: "[int]Amount to count down"
  timeOffsetToken: "[string]Time offset token"
transaction.service("limit").acquire.count_down_by_user_id({
    namespaceName="[string]Namespace name",
    limitName="[string]Name of limit model",
    counterName="[string]Counter Name",
    userId="[string]User ID",
    countDownValue="[int]Amount to count down",
    timeOffsetToken="[string]Time offset token",
})

Gs2Limit:DeleteCounterByUserId

Delete counter by specifying user ID

Whether the action allows quantity specification: NO

Whether the action is reversible: NO

TypeDescription
namespaceNamestringNamespace name
limitNamestringName of limit model
userIdstringSet #{userId} to replace the currently logged in user ID.
counterNamestringCounter Name
timeOffsetTokenstringTime offset token
{
    "action": "Gs2Limit:DeleteCounterByUserId",
    "request": {
        "namespaceName": "[string]Namespace name",
        "limitName": "[string]Name of limit model",
        "userId": "[string]User ID",
        "counterName": "[string]Counter Name",
        "timeOffsetToken": "[string]Time offset token"
    }
}
action: Gs2Limit:DeleteCounterByUserId
request:
  namespaceName: "[string]Namespace name"
  limitName: "[string]Name of limit model"
  userId: "[string]User ID"
  counterName: "[string]Counter Name"
  timeOffsetToken: "[string]Time offset token"
transaction.service("limit").acquire.delete_counter_by_user_id({
    namespaceName="[string]Namespace name",
    limitName="[string]Name of limit model",
    userId="[string]User ID",
    counterName="[string]Counter Name",
    timeOffsetToken="[string]Time offset token",
})