gosf-atk
Version:
shared atk api.
23 lines (22 loc) • 789 B
JavaScript
;
const HttpRequestModule = require('../module/HttpRequestModule') ;
module.exports = class RoundService extends HttpRequestModule {
constructor( performId = '' ){
super() ;
this.performId = performId ;
this.memcachedKey = `ROUND[${this.performId}]`;
}
async doGetRoundList() {
let resp = {} ;
try{
resp = await this.getDataMemcached( this.memcachedKey ) ;
if( resp == null ){
resp = await this.prepareHttp( process.env.API_GET_ROUND , {performId: this.performId }).post() ;
return resp.data.code == 100 ? resp.data.data : null ;
}
return JSON.parse( resp ) ;
}catch(e){
throw e ;
}
}
}