GS2-Dictionary 스크립트 트리거 레퍼런스

확장 스크립트를 호출하는 이벤트 트리거의 레퍼런스

트리거

entry

엔트리 등록

동기 실행 스크립트

엔트리 등록 처리 전에, 스크립트가 동기 실행됩니다.

Request
타입 설명
namespace Namespace 네임스페이스
entryModels EntryModel[] 엔트리 모델 목록
userId string 사용자ID
Result
타입 필수 기본값 값 제한 설명
permit bool
✓
엔트리 등록을 허용할지 여부
구현 예제
-- Request
local namespace = args.namespace
local entryModels = args.entryModels
local userId = args.userId

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}

비동기 실행 스크립트

엔트리 등록 처리 후에, 스크립트가 비동기 실행됩니다.

Request
타입 설명
namespace Namespace 네임스페이스
entryModels EntryModel[] 엔트리 모델 목록
userId string 사용자ID
구현 예제
-- Request
local namespace = args.namespace
local entryModels = args.entryModels
local userId = args.userId

-- 비동기 스크립트는 일반적으로 API 응답에 영향을 주지 않습니다.
-- 로그 출력이나 분석, 외부 알림 등에 사용됩니다.

result = {
}

duplicateEntry

이미 등록된 엔트리에 대한 재등록

동기 실행 스크립트

이미 등록된 엔트리에 대한 재등록 처리 전에, 스크립트가 동기 실행됩니다.

Request
타입 설명
namespace Namespace 네임스페이스
entryModel EntryModel 엔트리 모델
userId string 사용자ID
구현 예제
-- Request
local namespace = args.namespace
local entryModel = args.entryModel
local userId = args.userId

-- Business logic:

-- Result
result = {
}