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

Method Delete

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

Source from the content-addressed store, hash-verified

114}
115
116func (this *ImageCacheController) Delete(writer http.ResponseWriter, request *http.Request) *result.WebResult {
117
118 uuid := request.FormValue("uuid")
119 if uuid == "" {
120 panic(result.BadRequest("uuid cannot be null"))
121 }
122
123 imageCache := this.imageCacheDao.FindByUuid(uuid)
124
125 user := this.checkUser(request)
126 if imageCache.UserUuid != user.Uuid {
127 panic(result.UNAUTHORIZED)
128 }
129
130 this.imageCacheDao.Delete(imageCache)
131
132 return this.Success("OK")
133}
134
135func (this *ImageCacheController) DeleteBatch(writer http.ResponseWriter, request *http.Request) *result.WebResult {
136

Callers 1

DeleteBatchMethod · 0.45

Calls 4

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

Tested by

no test coverage detected