/**
 * <%= module_name %>
 * 用户版通用token test`test`7
 * URL： http://consumer.zaijiadd.com/<%= module_name %>.php?zjtoken=test`test`7
 * WiKi：<%= wiki_url %>
 */
var Base = require('../common/base'),
  HandlerBase = require('../common/handlerBase'),
  _ = require('underscore');

module.exports = Base.extend(function () {
}, {
  extend: HandlerBase,
  handlerName: '<%= module_name %>',
  doJob: function *() {
    var method = this.koa.req.method;
    return yield this['do' + method]();
  },
  doGET: function * () {
    return yield this.jade.getHTML(
      {
        dataString: JSON.stringify({})
      },
      '<%= module_name %>'
    );
  },
  cmdDispatch: function * () {
    var query = this.getQuery();
    var command = query.command;
    return yield this[command](query.data);
  },
  doPOST: function * () {
    return yield this.cmdDispatch();
  }
});
