|
|
|
@@ -275,6 +275,17 @@ func GetAllChannels(startIdx int, num int, selectAll bool, idSort bool) ([]*Chan |
|
|
|
return channels, err |
|
|
|
} |
|
|
|
|
|
|
|
// GetAllChannelsForBinding 获取所有启用的渠道(用于用户绑定渠道) |
|
|
|
// 只返回 id, name, type, remark,不包含敏感信息 |
|
|
|
func GetAllChannelsForBinding() ([]*Channel, error) { |
|
|
|
var channels []*Channel |
|
|
|
err := DB.Select("id, name, type, remark"). |
|
|
|
Where("status = ?", common.ChannelStatusEnabled). |
|
|
|
Order("priority desc"). |
|
|
|
Find(&channels).Error |
|
|
|
return channels, err |
|
|
|
} |
|
|
|
|
|
|
|
func GetChannelsByTag(tag string, idSort bool, selectAll bool) ([]*Channel, error) { |
|
|
|
var channels []*Channel |
|
|
|
order := "priority desc" |
|
|
|
|