Showing
3 changed files
with
39 additions
and
2 deletions
| @@ -114,7 +114,7 @@ export { ShareInfo } from './src/main/ets/bean/morningevening/ShareInfo'; | @@ -114,7 +114,7 @@ export { ShareInfo } from './src/main/ets/bean/morningevening/ShareInfo'; | ||
| 114 | 114 | ||
| 115 | export { slideShows } from './src/main/ets/bean/morningevening/slideShows'; | 115 | export { slideShows } from './src/main/ets/bean/morningevening/slideShows'; |
| 116 | 116 | ||
| 117 | -export { LiveDetailsBean } from './src/main/ets/bean/live/LiveDetailsBean'; | 117 | +export { LiveDetailsBean, joinPeopleNum } from './src/main/ets/bean/live/LiveDetailsBean'; |
| 118 | 118 | ||
| 119 | export { ArticleListDTO } from './src/main/ets/bean/component/ArticleListDTO'; | 119 | export { ArticleListDTO } from './src/main/ets/bean/component/ArticleListDTO'; |
| 120 | 120 |
| @@ -208,3 +208,11 @@ export interface Vlive { | @@ -208,3 +208,11 @@ export interface Vlive { | ||
| 208 | export interface ReLInfo { | 208 | export interface ReLInfo { |
| 209 | relId: string | 209 | relId: string |
| 210 | } | 210 | } |
| 211 | + | ||
| 212 | +export interface joinPeopleNum { | ||
| 213 | + barrageNum: number, | ||
| 214 | + likeNum: number, | ||
| 215 | + liveId: number, | ||
| 216 | + pv: number, | ||
| 217 | + subscribeNum: number | ||
| 218 | +} |
| 1 | import { HttpUrlUtils, ResponseDTO } from 'wdNetwork'; | 1 | import { HttpUrlUtils, ResponseDTO } from 'wdNetwork'; |
| 2 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; | 2 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; |
| 3 | import { Logger, ToastUtils, EmitterEventId, EmitterUtils } from 'wdKit'; | 3 | import { Logger, ToastUtils, EmitterEventId, EmitterUtils } from 'wdKit'; |
| 4 | -import { LiveDetailsBean, ReserveBean, ReserveItemBean } from 'wdBean/Index'; | 4 | +import { LiveDetailsBean, ReserveBean, ReserveItemBean, joinPeopleNum } from 'wdBean/Index'; |
| 5 | 5 | ||
| 6 | const TAG = 'LiveModel' | 6 | const TAG = 'LiveModel' |
| 7 | 7 | ||
| @@ -105,5 +105,34 @@ export class LiveModel { | @@ -105,5 +105,34 @@ export class LiveModel { | ||
| 105 | }) | 105 | }) |
| 106 | }) | 106 | }) |
| 107 | } | 107 | } |
| 108 | + | ||
| 109 | + /** | ||
| 110 | + * 查询直播参与人数 | ||
| 111 | + */ | ||
| 112 | + static getJoinPeopleNum(liveIdList: string) { | ||
| 113 | + return new Promise<Array<joinPeopleNum>>((success, fail) => { | ||
| 114 | + HttpRequest.get<ResponseDTO<Array<joinPeopleNum>>>( | ||
| 115 | + HttpUrlUtils.getJoinPeopleNum() + `?liveIdList=${liveIdList}`, | ||
| 116 | + ).then((data: ResponseDTO<Array<joinPeopleNum>>) => { | ||
| 117 | + Logger.debug(TAG, 'getJoinPeopleNum:' + `${JSON.stringify(data)}`) | ||
| 118 | + Logger.debug(TAG, 'liveIdList:' + liveIdList) | ||
| 119 | + if (!data || !data.data) { | ||
| 120 | + fail("数据为空") | ||
| 121 | + return | ||
| 122 | + } | ||
| 123 | + if (data.code != 0) { | ||
| 124 | + fail(data.message) | ||
| 125 | + ToastUtils.shortToast(data.message) | ||
| 126 | + return | ||
| 127 | + } | ||
| 128 | + success(data.data) | ||
| 129 | + Logger.info('getJoinPeopleNum', JSON.stringify(data.data)) | ||
| 130 | + }, (error: Error) => { | ||
| 131 | + fail(error.message) | ||
| 132 | + Logger.debug(TAG + ":error ", JSON.stringify(error)) | ||
| 133 | + }) | ||
| 134 | + }) | ||
| 135 | + } | ||
| 136 | + | ||
| 108 | } | 137 | } |
| 109 | 138 |
-
Please register or login to post a comment