import { Context } from 'koa' import { App } from '../../types' import { TWSCore } from '../../service/tws-core' /** * @author jiangwei * @desc 第三方请求客户端基类,只包含 SOA 服务接口,其他服务接口应继承基类拓展 * @export * @class Base */ export default class Base { protected app: App protected ctx: Context protected clientSOACore: TWSCore constructor (app: App, ctx: Context) { this.ctx = ctx this.app = app this.clientSOACore = new TWSCore(this.app.token, this.ctx.header['cookie']) } getScenariofieldconfigById(_id: string) { return this.clientSOACore.getScenariofieldConfigById(_id) } getCustomfieldById(_customfieldId: string) { return this.clientSOACore.getCustomfieldById(_customfieldId) } }