TransactionRead
public BackendReturnObject TransactionRead(TransactionParam tParam);
파라미터
Value | Type | Description |
---|---|---|
tParam | TransactionParam | Read 작업을 저장한 트랜잭션 파라미터 |
설명
TransactionParam에 존재하는 AddGet 트랜잭션 명령들을 서버에 요청합니다.
- 최대 10개의 작업을 1개로 묶을 수 있습니다.
Example
동기
// InDate(row) should be ALL DIFFERENT.
TransactionParam tParam = new TransactionParam ();
// When you want to ask for gameinfo of the other one, you should add indate of the gamer as well.
tParam.AddRead(tableName.mine.ToString(), "2019-07-25T07:15:00.668Z", "2018-11-29T01:54:40.799Z");
// Read a row in table
tParam.AddRead(tableName.mine.ToString(), mInDate_mine);
// Read a row in table
tParam.AddRead(tableName.dream.ToString(), mInDate_dream);
Backend.GameInfo.TransactionRead ( tParam );
비동기
// InDate(row) should be ALL DIFFERENT.
TransactionParam tParam = new TransactionParam ();
// When you want to ask for gameinfo of the other one, you should add indate of the gamer as well.
tParam.AddRead(tableName.mine.ToString(), "2019-07-25T07:15:00.668Z", "2018-11-29T01:54:40.799Z");
// Read a row in table
tParam.AddRead(tableName.mine.ToString(), mInDate_mine);
// Read a row in table
tParam.AddRead(tableName.dream.ToString(), mInDate_dream);
Backend.GameInfo.TransactionRead( tParam, ( callback ) =>
{
// 이후 처리
});
SendQueue
// InDate(row) should be ALL DIFFERENT.
TransactionParam tParam = new TransactionParam ();
// When you want to ask for gameinfo of the other one, you should add indate of the gamer as well.
tParam.AddRead(tableName.mine.ToString(), "2019-07-25T07:15:00.668Z", "2018-11-29T01:54:40.799Z");
// Read a row in table
tParam.AddRead(tableName.mine.ToString(), mInDate_mine);
// Read a row in table
tParam.AddRead(tableName.dream.ToString(), mInDate_dream);
SendQueue.Enqueue(Backend.GameInfo.TransactionRead, tParam, ( callback ) =>
{
// 이후 처리
});
ReturnCase
Success cases
조회에 성공한 경우
statusCode : 200
message : Success
returnValue : GetReturnValueToJson 참조
Error cases
트랜잭션 작업 내에 타인의 private 테이블 정보의 조회가 포함된 경우
statusCode : 400
errorCode : BadParameterException
message : bad table, 잘못된 table 입니다
같은 row에 대하여 두번 read하는 경우
statusCode : 400
errorCode : ValidationException
message : Transaction request cannot include multiple operations on one item
비활성화된 테이블에 접근한 경우
statusCode : 412
errorCode : PreconditionFailed
message : inactiveTable 사전 조건을 만족하지 않습니다.
GetReturnValueToJSON
```js
{
Responses:
[
// AddRead의 첫번째 내용
{
column1: { S: "ddv" },
client_date: { S: "2019-07-29T07:37:15.000Z" },
nickname: { "S":"id3" },
inDate: { S: "2019-07-29T07:37:15.339Z" },
updatedAt: { S: "2019-07-29T07:37:15.339Z" },
column2: { S: "nn" }
},
// AddRead의 두번째 내용
// 잘못된 데이터정보를 입력하여 데이터에 접근할 수 없는 경우
{
},
// AddRead의 세번째 내용
{
client_date:{ S: "2019-07-23T07:21:36.000Z" },
nickname: { S: "id3" },
inDate: { S: "2019-07-23T07:21:36.758Z" },
updatedAt: { S: "2019-07-29T07:33:06.721Z" },
column1: { S: "hello there"},
column2: { S: "vv" },
column3: {
M:
{
mapData:
{
M:{
map1:
{
L:
[
{
M:{
a:{ S: "b" }
}
},
{
M:{
c:{ S: "d" }
}
}
]
},
map2: { N: "22" },
map3: { S: "2019-07-29T07:33:06.721Z" }
}
}
}
}
}
]
}