(c *gin.Context)
| 332 | } |
| 333 | |
| 334 | func GetChannel(c *gin.Context) { |
| 335 | id, err := strconv.Atoi(c.Param("id")) |
| 336 | if err != nil { |
| 337 | common.ApiError(c, err) |
| 338 | return |
| 339 | } |
| 340 | channel, err := model.GetChannelById(id, false) |
| 341 | if err != nil { |
| 342 | common.ApiError(c, err) |
| 343 | return |
| 344 | } |
| 345 | c.JSON(http.StatusOK, gin.H{ |
| 346 | "success": true, |
| 347 | "message": "", |
| 348 | "data": channel, |
| 349 | }) |
| 350 | return |
| 351 | } |
| 352 | |
| 353 | // validateChannel 通用的渠道校验函数 |
| 354 | func validateChannel(channel *model.Channel, isAdd bool) error { |
nothing calls this directly
no test coverage detected