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.
 

26 lines
847 B

from entity.ChannelEntity import Channel
from common.Utils import getSession
class ChannelService:
# 新增一个channel
def insertOneByValues(channelId, channelTitle, channelLanguage, region):
session = getSession()
channel = Channel(channelId=channelId, channelTitle=channelTitle,
channelLanguage=channelLanguage, region=region)
session.add(channel)
session.commit()
session.close()
def queryOneById(id):
session = getSession()
channel = session.query(Channel).filter(Channel.id == id).first()
session.close()
return channel
def queryOneByChannelId(channelId):
session = getSession()
channel = session.query(Channel).filter(Channel.channelId == channelId).first()
session.close()
return channel