       throw new Error('upload fail') unless result.result is 'success'
       @validateAttach(result.id).then (nResult) -> _.extend(nResult, boundle: result.id)
     .then (result) =>
+      console.log "fetchWidgetId"
+      @fetchWidgetIdByIdentifier(module.package.identifier).then (nResult) ->
+        _.extend(result, widget_id: nResult.id)
+    .then (result) =>
       console.log "new module"
       throw new Error('validate fail') unless result.result is 'success'
-      @newModule _.extend result, {widget_id: '548698920cf2da4e8927bab5'}
+      @newModule _.extend result, {widget_id: result.widget_id}
     .then (result) ->
       cell.changeState 'normal' if result.result is 'success'
     .catch (err) ->

fs = require 'fs'
request = require 'request'
Q = require 'q'

readdir = Q.denodeify fs.readdir
stat = Q.denodeify fs.stat

      throw new Error('login fail') unless result.result is 'true'
      console.log "upload"
      zip = new AdmZip()
      # zip.addLocalFolder path.join(atom.project.path, 'encrypt', module.package.identifier)
      zip.addLocalFolder module.path
      @uploadAttach zip.toBuffer()
    .then (result) =>
