MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / DeleteTokenBatch

Function DeleteTokenBatch

controller/token.go:248–268  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

246}
247
248func DeleteTokenBatch(c *gin.Context) {
249 tokenBatch := TokenBatch{}
250 if err := c.ShouldBindJSON(&tokenBatch); err != nil || len(tokenBatch.Ids) == 0 {
251 c.JSON(http.StatusOK, gin.H{
252 "success": false,
253 "message": "参数错误",
254 })
255 return
256 }
257 userId := c.GetInt("id")
258 count, err := model.BatchDeleteTokens(tokenBatch.Ids, userId)
259 if err != nil {
260 common.ApiError(c, err)
261 return
262 }
263 c.JSON(http.StatusOK, gin.H{
264 "success": true,
265 "message": "",
266 "data": count,
267 })
268}

Callers

nothing calls this directly

Calls 2

BatchDeleteTokensFunction · 0.92
ApiErrorFunction · 0.92

Tested by

no test coverage detected