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 createOrUpdate (pobj, qobj, req) {
    try {
      console.log(pobj)
      let result = await this.service.createOrUpdate(pobj)
      return system.getResultSuccess(result)
    } 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 findAndCountAll (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)
    }
  }

  async pushQfTest(pobj, qobj, req) {
    return await this.service.pushQf(pobj.id)
  }
}
module.exports = TrademarkcaseCtl;
