Files
wwjcloud-nest-v1/wwjcloud/src/common/sys/services/admin/ChannelService.ts

113 lines
2.3 KiB
TypeScript
Raw Normal View History

import { Injectable } from '@nestjs/common';
import { CoreChannelService } from '../core/CoreChannelService';
/**
* - Admin层
* 对应PHP: app\service\admin\sys\ChannelService
*/
@Injectable()
export class ChannelService {
constructor(
private readonly coreChannelService: CoreChannelService,
) {}
/**
*
* @param params
* @returns
*/
async getList(params: any) {
return await this.coreChannelService.getList(params);
}
/**
*
* @param id ID
* @returns
*/
async getInfo(id: number) {
return await this.coreChannelService.getInfo(id);
}
/**
*
* @param data
* @returns
*/
async add(data: any) {
return await this.coreChannelService.add(data);
}
/**
*
* @param id ID
* @param data
* @returns
*/
async edit(id: number, data: any) {
return await this.coreChannelService.edit(id, data);
}
/**
*
* @param id ID
* @returns
*/
async delete(id: number) {
return await this.coreChannelService.delete(id);
}
/**
*
* @returns
*/
async getChannelTypes() {
return await this.coreChannelService.getChannelTypes();
}
/**
*
* @returns
*/
async getChannelStatuses() {
return await this.coreChannelService.getChannelStatuses();
}
/**
*
* @param id ID
* @returns
*/
async enable(id: number) {
return await this.coreChannelService.updateStatus(id, 1);
}
/**
*
* @param id ID
* @returns
*/
async disable(id: number) {
return await this.coreChannelService.updateStatus(id, 0);
}
/**
*
* @param id ID
* @returns
*/
async getConfig(id: number) {
return await this.coreChannelService.getConfig(id);
}
/**
*
* @param id ID
* @param config
* @returns
*/
async setConfig(id: number, config: any) {
return await this.coreChannelService.setConfig(id, config);
}
}