You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
505 B
22 lines
505 B
5 months ago
|
package service
|
||
|
|
||
|
import (
|
||
|
"errors"
|
||
|
"main_program/common"
|
||
|
"main_program/entity"
|
||
|
)
|
||
|
|
||
|
type channelService struct{}
|
||
|
|
||
|
var ChannelService channelService
|
||
|
|
||
|
func (c *channelService) QueryOneByChannelId(channelId string) (channel entity.Channel, err error) {
|
||
|
var channelEntity entity.Channel
|
||
|
result := common.MysqlDB.Where(&entity.Channel{ChannelId: channelId}).First(&channelEntity)
|
||
|
if result.Error != nil {
|
||
|
return channelEntity, errors.New("query channel error")
|
||
|
} else {
|
||
|
return channelEntity, nil
|
||
|
}
|
||
|
}
|