func (d *ServiceAPI) Put(c web.C, w http.ResponseWriter, r *http.Request) { identifier, _ := url.QueryUnescape(c.URLParams["id"]) serviceModel, err := extractServiceModel(r) if err != nil { responseError(w, err.Error()) return } _, err1 := service.Put(d.Zookeeper, d.Config.Bamboo.Zookeeper, identifier, serviceModel.Acl) if err1 != nil { responseError(w, err1.Error()) return } responseJSON(w, serviceModel) }
func (d *ServiceAPI) Put(params martini.Params, w http.ResponseWriter, r *http.Request) { identity := params["_1"] println(identity) serviceModel, err := extractServiceModel(r) if err != nil { responseError(w, err.Error()) return } _, err1 := service.Put(d.Zookeeper, d.Config.Bamboo.Zookeeper, identity, serviceModel.Acl) if err1 != nil { responseError(w, err1.Error()) return } responseJSON(w, serviceModel) }