Usage
1. Start Lucky Draw Activity
API Method: startLuckyLottery(activityId: number): Promise<CommonResult<string, Object>>
Parameter Description:
- activityId: Activity ID,
numbertype, required
Return Value Description: Promise<CommonResult<string, Object>> type
Example:
const result = await luckyLotteryTarget.startLuckyLottery(123);
if (result.success) {
console.log('抽奖成功', result.data);
} else {
console.error('抽奖失败', result.failReason);
}
2. Get Lucky Draw Activity List
API Method: getLuckyLotteryActivityList(options?: PageOptions): Promise<PageContent<LuckyLotteryActivityItem>>
Parameter Description:
- options: Pagination parameters,
PageOptionstype, optional, default{}, detailed type description as follows
| Parameter Name | Description | Type | Required | Default Value |
|---|---|---|---|---|
pageNumber |
Page number | number |
No | - |
pageSize |
Page size | number |
No | - |
Return Value Description: Paginated data, Promise<PageContent<LuckyLotteryActivityItem>> type, detailed type description as follows
| Property Name | Description | Type |
|---|---|---|
pageNumber |
Current page number | number |
pageSize |
Items per page | number |
totalItems |
Total records | number |
totalPages |
Total pages | number |
contents |
Content list | I[] |
Example:
const data = await luckyLotteryTarget.getLuckyLotteryActivityList({ pageNumber: 1, pageSize: 10 });
console.log('幸运抽奖活动列表', data.contents);
3. Get Lucky Draw Activity Details
API Method: getLuckyLotteryActivityById(activityId: number): Promise<LuckyLotteryActivityDetailData>
Parameter Description:
- activityId: Activity ID,
numbertype, required
Return Value Description: Promise<LuckyLotteryActivityDetailData> type, detailed type description as follows
| Property Name | Description | Type |
|---|---|---|
taskId |
Activity ID | number |
lotteryStyle |
Activity template | string |
activityName |
Activity name | string |
startTime |
Activity start time, unit: milliseconds | number |
endTime |
Activity end time, unit: milliseconds | number |
drawFrequency |
Draw frequency | string |
drawTimes |
Number of draws | number |
winLimit |
Winning limit | string |
maxWins |
Maximum number of winners | number |
showWinners |
Whether to display winner list | boolean |
rules |
Activity rules | string |
noWinSetting |
Non-winning settings | LuckyLotteryMissSetting |
channelIds |
Channel ID list | Channel[] |
prizes |
Prize list | LuckyLotteryPrize[] |
status |
Activity status | string |
reachMaxDrawTimes |
Whether maximum draws reached | boolean |
reachMaxWinTimes |
Whether maximum wins reached | boolean |
Example:
const data = await luckyLotteryTarget.getLuckyLotteryActivityById(123);
console.log('幸运抽奖活动详情', data);
4. Get Winner List
API Method: getLuckyLotteryWinnersList(options: PageOptions & Object): Promise<PageContent<LuckyLotteryWinnersItem>>
Parameter Description:
- options: Pagination parameters, including pagination info and activity ID,
PageOptions & Objecttype, required
Return Value Description: Paginated data, Promise<PageContent<LuckyLotteryWinnersItem>> type, detailed type description as follows
| Property Name | Description | Type |
|---|---|---|
pageNumber |
Current page number | number |
pageSize |
Items per page | number |
totalItems |
Total records | number |
totalPages |
Total pages | number |
contents |
Content list | I[] |
Example:
const data = await luckyLotteryTarget.getLuckyLotteryWinnersList({
pageNumber: 1,
pageSize: 10,
taskId: 123
});
console.log('中奖者列表', data.contents);
5. Get Lucky Draw Prize Records
API Method: getLuckyLotteryPrizeList(options?: PageOptions): Promise<PageContent<LuckyLotteryPrizeItem>>
Parameter Description:
- options: Retrieval parameters, including pagination info,
PageOptionstype, optional, default{}, detailed type description as follows
| Parameter Name | Description | Type | Required | Default Value |
|---|---|---|---|---|
pageNumber |
Page number | number |
No | - |
pageSize |
Page size | number |
No | - |
Return Value Description: Paginated data, Promise<PageContent<LuckyLotteryPrizeItem>> type, detailed type description as follows
| Property Name | Description | Type |
|---|---|---|
pageNumber |
Current page number | number |
pageSize |
Items per page | number |
totalItems |
Total records | number |
totalPages |
Total pages | number |
contents |
Content list | I[] |
Example:
const data = await luckyLotteryTarget.getLuckyLotteryPrizeList({
pageNumber: 1,
pageSize: 10
});
console.log('奖品列表', data.contents);
6. Get Prize Claim Information
API Method: getLuckyLotteryReceive(recordId: number): Promise<LuckyLotteryReceiveData>
Parameter Description:
- recordId: Winning record row ID,
numbertype, required
Return Value Description: Promise<LuckyLotteryReceiveData> type, detailed type description as follows
| Property Name | Description | Type |
|---|---|---|
receiveType |
Claim method | PrizeAcceptType |
isReceived |
Whether claimed | boolean |
formList |
Form list | LuckyLotteryReceiveFormItem[] |
recordId |
Prize item ID | number |
taskId |
Activity ID | number |
Example:
const data = await luckyLotteryTarget.getLuckyLotteryReceive(123);
console.log('中奖领取信息', data);
7. Submit Prize Claim Information
API Method: submitLuckyLotteryReceive(options: LuckyLotterySubmitReceiveOptions): Promise<unknown>
Parameter Description:
- options: Submission parameters,
LuckyLotterySubmitReceiveOptionstype, required, detailed type description as follows
| Parameter Name | Description | Type | Required | Default Value |
|---|---|---|---|---|
taskId |
Activity ID | number |
Yes | - |
recordId |
Prize item ID | number |
Yes | - |
collectItems |
Claim information | LuckyLotterySubmitReceiveItem[] |
Yes | - |
Return Value Description: Promise<unknown> type
Example:
await luckyLotteryTarget.submitLuckyLotteryReceive({
taskId: 123,
recordId: 123,
collectItems: [{ field: '姓名', type: 'text', tips: '请输入姓名', required: true, value: '张三' }],
});
toast('提交成功');
