var system = require("../../../system")
const CtlBase = require("../../ctl.base");
class TrademarkcaseCtl extends CtlBase {
  constructor() {
    super("rejreex", CtlBase.getServiceName(TrademarkcaseCtl));
  }

  async test () {
    console.log('test------')
    return system.getResult('test')
  }

  async createRejReex (pobj, qobj, req) {
    try {
      pobj.agents.caseId = pobj.applicant.caseId = pobj.case.caseId
      await this.service.createCase(pobj)
      return system.getResultSuccess('success')
    } catch (error) {
      console.log('err: ', error)
      return system.getResultFail(error.message)
    }
  }

  async getCase (pobj, qobj, req) {
    try {
      let caseId = pobj.caseId
      let result = await this.service.getCase(caseId)
      return system.getResultSuccess(result)
    } catch (error) {
      console.log('err: ', error)
      return system.getResultFail(error.message)
    }
  }

  async getCaseList (pobj, qobj, req) {
    try {
      let result = await this.service.getCaseList(pobj)
      return system.getResultSuccess(result)
    } catch (error) {
      console.log('err: ', error)
      return system.getResultFail(error.message)
    }
  }
}
module.exports = TrademarkcaseCtl;
