(c *gin.Context)
| 608 | } |
| 609 | |
| 610 | func EditTagChannels(c *gin.Context) { |
| 611 | channelTag := ChannelTag{} |
| 612 | err := c.ShouldBindJSON(&channelTag) |
| 613 | if err != nil { |
| 614 | c.JSON(http.StatusOK, gin.H{ |
| 615 | "success": false, |
| 616 | "message": "参数错误", |
| 617 | }) |
| 618 | return |
| 619 | } |
| 620 | if channelTag.Tag == "" { |
| 621 | c.JSON(http.StatusOK, gin.H{ |
| 622 | "success": false, |
| 623 | "message": "tag不能为空", |
| 624 | }) |
| 625 | return |
| 626 | } |
| 627 | err = model.EditChannelByTag(channelTag.Tag, channelTag.NewTag, channelTag.ModelMapping, channelTag.Models, channelTag.Groups, channelTag.Priority, channelTag.Weight) |
| 628 | if err != nil { |
| 629 | common.ApiError(c, err) |
| 630 | return |
| 631 | } |
| 632 | model.InitChannelCache() |
| 633 | c.JSON(http.StatusOK, gin.H{ |
| 634 | "success": true, |
| 635 | "message": "", |
| 636 | }) |
| 637 | return |
| 638 | } |
| 639 | |
| 640 | type ChannelBatch struct { |
| 641 | Ids []int `json:"ids"` |
nothing calls this directly
no test coverage detected