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

Function GetChannelById

model/channel.go:313–328  ·  view source on GitHub ↗
(id int, selectAll bool)

Source from the content-addressed store, hash-verified

311}
312
313func GetChannelById(id int, selectAll bool) (*Channel, error) {
314 channel := &Channel{Id: id}
315 var err error = nil
316 if selectAll {
317 err = DB.First(channel, "id = ?", id).Error
318 } else {
319 err = DB.Omit("key").First(channel, "id = ?", id).Error
320 }
321 if err != nil {
322 return nil, err
323 }
324 if channel == nil {
325 return nil, errors.New("channel not found")
326 }
327 return channel, nil
328}
329
330func BatchInsertChannels(channels []Channel) error {
331 var err error

Callers 12

DistributeFunction · 0.92
FetchUpstreamModelsFunction · 0.92
GetChannelFunction · 0.92
UpdateChannelFunction · 0.92
CopyChannelFunction · 0.92
RelayMidjourneySubmitFunction · 0.92
RelayTaskSubmitFunction · 0.92
CacheGetChannelFunction · 0.85
CacheGetChannelInfoFunction · 0.85
UpdateMethod · 0.85
UpdateChannelStatusFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected