recordInfoService.js
1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const recordInfo =require( '../model/RecordInfoModel')
const tencentRecordInfoModel =require( '../model/tencentRecordInfoModel')
function recordInfoService(){
}
recordInfoService.prototype.updaterecordInfo = async(channel)=>{
try {
let channelupdate = await recordInfo.update(
{status:0},
{where:
{channel:channel}})
return channelupdate;
} catch (error) {
throw error;
}
}
recordInfoService.prototype.addRecordInfo = async(body) =>{
try {
let addrecord = await recordInfo.create(body);
return addrecord;
} catch (error) {
throw error;
}
}
recordInfoService.prototype.getRecordInfo = async(channel) =>{
try {
let addrecord = await recordInfo.findAll({where:{channel:channel}});
return addrecord;
} catch (error) {
throw error;
}
}
recordInfoService.prototype.tencentRecordInfo = async(channelId)=>{
try {
let tencentRecordInfo = await tencentRecordInfoModel.findAll({where:{channelId:channelId}})
return tencentRecordInfo
} catch (error) {
throw error;
}
}
module.exports = new recordInfoService();