(c *gin.Context)
| 246 | } |
| 247 | |
| 248 | func 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 | } |
nothing calls this directly
no test coverage detected