MCPcopy
hub / github.com/eyebluecn/tank / DeleteBatch

Method DeleteBatch

code/rest/image_cache_controller.go:135–158  ·  view source on GitHub ↗
(writer http.ResponseWriter, request *http.Request)

Source from the content-addressed store, hash-verified

133}
134
135func (this *ImageCacheController) DeleteBatch(writer http.ResponseWriter, request *http.Request) *result.WebResult {
136
137 uuids := request.FormValue("uuids")
138 if uuids == "" {
139 panic(result.BadRequest("uuids cannot be null"))
140 }
141
142 uuidArray := strings.Split(uuids, ",")
143
144 for _, uuid := range uuidArray {
145
146 imageCache := this.imageCacheDao.FindByUuid(uuid)
147
148 user := this.checkUser(request)
149 if imageCache.UserUuid != user.Uuid {
150 panic(result.UNAUTHORIZED)
151 }
152
153 this.imageCacheDao.Delete(imageCache)
154
155 }
156
157 return this.Success("OK")
158}

Callers

nothing calls this directly

Calls 5

BadRequestFunction · 0.92
checkUserMethod · 0.80
SuccessMethod · 0.80
FindByUuidMethod · 0.45
DeleteMethod · 0.45

Tested by

no test coverage detected