(c *gin.Context)
| 643 | } |
| 644 | |
| 645 | func DeleteChannelBatch(c *gin.Context) { |
| 646 | channelBatch := ChannelBatch{} |
| 647 | err := c.ShouldBindJSON(&channelBatch) |
| 648 | if err != nil || len(channelBatch.Ids) == 0 { |
| 649 | c.JSON(http.StatusOK, gin.H{ |
| 650 | "success": false, |
| 651 | "message": "参数错误", |
| 652 | }) |
| 653 | return |
| 654 | } |
| 655 | err = model.BatchDeleteChannels(channelBatch.Ids) |
| 656 | if err != nil { |
| 657 | common.ApiError(c, err) |
| 658 | return |
| 659 | } |
| 660 | model.InitChannelCache() |
| 661 | c.JSON(http.StatusOK, gin.H{ |
| 662 | "success": true, |
| 663 | "message": "", |
| 664 | "data": len(channelBatch.Ids), |
| 665 | }) |
| 666 | return |
| 667 | } |
| 668 | |
| 669 | type PatchChannel struct { |
| 670 | model.Channel |
nothing calls this directly
no test coverage detected