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

Function GetChannel

controller/channel.go:334–351  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

332}
333
334func 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 通用的渠道校验函数
354func validateChannel(channel *model.Channel, isAdd bool) error {

Callers

nothing calls this directly

Calls 2

ApiErrorFunction · 0.92
GetChannelByIdFunction · 0.92

Tested by

no test coverage detected