MCPcopy Create free account
hub / github.com/tbphp/gpt-load / DeleteMultipleKeysAsync

Method DeleteMultipleKeysAsync

internal/handler/key_handler.go:272–295  ·  view source on GitHub ↗

DeleteMultipleKeysAsync handles deleting keys from a text block within a specific group using async task.

(c *gin.Context)

Source from the content-addressed store, hash-verified

270
271// DeleteMultipleKeysAsync handles deleting keys from a text block within a specific group using async task.
272func (s *Server) DeleteMultipleKeysAsync(c *gin.Context) {
273 var req KeyTextRequest
274 if err := c.ShouldBindJSON(&req); err != nil {
275 response.Error(c, app_errors.NewAPIError(app_errors.ErrInvalidJSON, err.Error()))
276 return
277 }
278
279 group, ok := s.findGroupByID(c, req.GroupID)
280 if !ok {
281 return
282 }
283
284 if !validateKeysText(c, req.KeysText) {
285 return
286 }
287
288 taskStatus, err := s.KeyDeleteService.StartDeleteTask(group, req.KeysText)
289 if err != nil {
290 response.Error(c, app_errors.NewAPIError(app_errors.ErrTaskInProgress, err.Error()))
291 return
292 }
293
294 response.Success(c, taskStatus)
295}
296
297// RestoreMultipleKeys handles restoring keys from a text block within a specific group.
298func (s *Server) RestoreMultipleKeys(c *gin.Context) {

Callers

nothing calls this directly

Calls 6

findGroupByIDMethod · 0.95
ErrorFunction · 0.92
SuccessFunction · 0.92
validateKeysTextFunction · 0.85
StartDeleteTaskMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected