diff options
Diffstat (limited to 'server/models/request/request-video-qadu-interface.ts')
-rw-r--r-- | server/models/request/request-video-qadu-interface.ts | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/server/models/request/request-video-qadu-interface.ts b/server/models/request/request-video-qadu-interface.ts index 805771cda..9a172a4d4 100644 --- a/server/models/request/request-video-qadu-interface.ts +++ b/server/models/request/request-video-qadu-interface.ts | |||
@@ -1,5 +1,7 @@ | |||
1 | import * as Sequelize from 'sequelize' | 1 | import * as Sequelize from 'sequelize' |
2 | import * as Promise from 'bluebird' | ||
2 | 3 | ||
4 | import { AbstractRequestClass, AbstractRequestToPodClass } from './abstract-request-interface' | ||
3 | import { VideoInstance } from '../video' | 5 | import { VideoInstance } from '../video' |
4 | import { PodInstance } from '../pod' | 6 | import { PodInstance } from '../pod' |
5 | 7 | ||
@@ -14,20 +16,16 @@ export type RequestsVideoQaduGrouped = { | |||
14 | } | 16 | } |
15 | 17 | ||
16 | export namespace RequestVideoQaduMethods { | 18 | export namespace RequestVideoQaduMethods { |
17 | export type CountTotalRequestsCallback = (err: Error, total: number) => void | 19 | export type CountTotalRequests = () => Promise<number> |
18 | export type CountTotalRequests = (callback: CountTotalRequestsCallback) => void | ||
19 | 20 | ||
20 | export type ListWithLimitAndRandomCallback = (err: Error, requestsGrouped?: RequestsVideoQaduGrouped) => void | 21 | export type ListWithLimitAndRandom = (limitPods: number, limitRequestsPerPod: number) => Promise<RequestsVideoQaduGrouped> |
21 | export type ListWithLimitAndRandom = (limitPods: number, limitRequestsPerPod: number, callback: ListWithLimitAndRandomCallback) => void | ||
22 | 22 | ||
23 | export type RemoveByRequestIdsAndPodCallback = () => void | 23 | export type RemoveByRequestIdsAndPod = (ids: number[], podId: number) => Promise<number> |
24 | export type RemoveByRequestIdsAndPod = (ids: number[], podId: number, callback: RemoveByRequestIdsAndPodCallback) => void | ||
25 | 24 | ||
26 | export type RemoveAllCallback = () => void | 25 | export type RemoveAll = () => Promise<void> |
27 | export type RemoveAll = (callback: RemoveAllCallback) => void | ||
28 | } | 26 | } |
29 | 27 | ||
30 | export interface RequestVideoQaduClass { | 28 | export interface RequestVideoQaduClass extends AbstractRequestClass<RequestsVideoQaduGrouped>, AbstractRequestToPodClass { |
31 | countTotalRequests: RequestVideoQaduMethods.CountTotalRequests | 29 | countTotalRequests: RequestVideoQaduMethods.CountTotalRequests |
32 | listWithLimitAndRandom: RequestVideoQaduMethods.ListWithLimitAndRandom | 30 | listWithLimitAndRandom: RequestVideoQaduMethods.ListWithLimitAndRandom |
33 | removeByRequestIdsAndPod: RequestVideoQaduMethods.RemoveByRequestIdsAndPod | 31 | removeByRequestIdsAndPod: RequestVideoQaduMethods.RemoveByRequestIdsAndPod |
@@ -38,11 +36,13 @@ export interface RequestVideoQaduAttributes { | |||
38 | type: RequestVideoQaduType | 36 | type: RequestVideoQaduType |
39 | } | 37 | } |
40 | 38 | ||
41 | export interface RequestVideoQaduInstance extends RequestVideoQaduClass, RequestVideoQaduAttributes, Sequelize.Instance<RequestVideoQaduAttributes> { | 39 | export interface RequestVideoQaduInstance |
40 | extends RequestVideoQaduClass, RequestVideoQaduAttributes, Sequelize.Instance<RequestVideoQaduAttributes> { | ||
42 | id: number | 41 | id: number |
43 | 42 | ||
44 | Pod: PodInstance | 43 | Pod: PodInstance |
45 | Video: VideoInstance | 44 | Video: VideoInstance |
46 | } | 45 | } |
47 | 46 | ||
48 | export interface RequestVideoQaduModel extends RequestVideoQaduClass, Sequelize.Model<RequestVideoQaduInstance, RequestVideoQaduAttributes> {} | 47 | export interface RequestVideoQaduModel |
48 | extends RequestVideoQaduClass, Sequelize.Model<RequestVideoQaduInstance, RequestVideoQaduAttributes> {} | ||