   add: (Model, cols, hook = "#{Model.name}s", attachs = null) ->
     [
       rest.validate(Model, cols, hook)
-      rest.save(hook)
+      rest.save(hook, Model)
       rest.detail(hook, attachs, 201)
     ]
 

async   = require 'async'
utils   = require '../../lib/utils'
errors  = require '../../lib/errors'

PARALLELLIMIt = (require('os')).cpus().length or 8

save = (model, callback) ->
  model.save().done((error, mod) ->
    return callback(error) if error
    mod.reload().done((error) ->
      return callback(error) if error
      callback(null, mod)
    )
  )

rest =


      )

  # 报错
  save: (hook, Model) ->
    (req, res, next) ->
      Model.bulkCreate(req.hooks[hook]).done((error, results) ->
        err = errors.sequelizeIfError error
        return next(err) if err
        req.hooks[hook] = results
