class Img(db.Model): __tablename__ = 'img' __table_args__ = {"useexisting": True} id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(200)) url = db.Column(db.String(400), unique=True) type = db.Column(db.String(20)) def __init__(self, name, url, type): self.name = name self.url = url self.type = type
class BotParam(db.Model): __tablename__ = 'bot_param' __table_args__ = {"useexisting": True} id = db.Column(db.Integer, primary_key=True) Username = db.Column(db.String(200), unique=True) DeviceId = db.Column(db.String(200)) LongHost = db.Column(db.String(200)) ShortHost = db.Column(db.String(200)) def __init__(self, Username, DeviceId, LongHost, ShortHost): # 这些字段 是登陆成功后的返回 self.Username = Username self.DeviceId = DeviceId self.LongHost = LongHost self.ShortHost = ShortHost
class Qrcode(db.Model): __tablename__ = 'qrcode' __table_args__ = {"useexisting": True} id = db.Column(db.Integer, primary_key=True) CheckTime = db.Column(db.String(200)) ExpiredTime = db.Column(db.String(400)) HeadImgUrl = db.Column(db.String(200)) Nickname = db.Column(db.String(200)) NotifyKey = db.Column(db.String(200)) Password = db.Column(db.String(200)) RandomKey = db.Column(db.String(200)) Status = db.Column(db.String(200)) Username = db.Column(db.String(200)) Uuid = db.Column(db.String(200)) md_username = db.Column(db.String(200)) def __init__(self, CheckTime, ExpiredTime, HeadImgUrl, Nickname, NotifyKey, Password, RandomKey, Status, Username, Uuid, md_username): # 这些字段 是登陆成功后的返回 self.CheckTime = CheckTime self.ExpiredTime = ExpiredTime self.HeadImgUrl = HeadImgUrl self.Nickname = Nickname self.NotifyKey = NotifyKey self.Password = Password self.RandomKey = RandomKey self.Status = Status self.Username = Username self.Uuid = Uuid self.md_username = md_username
class Contact(db.Model): __tablename__ = 'contact' __table_args__ = {"useexisting": True} id = db.Column(db.Integer, primary_key=True) MsgType = db.Column(db.String(200)) UserName = db.Column(db.String(400), unique=True) NickName = db.Column(db.String(200)) Signature = db.Column(db.String(200)) SmallHeadImgUrl = db.Column(db.String(200)) BigHeadImgUrl = db.Column(db.String(200)) Province = db.Column(db.String(200)) City = db.Column(db.String(200)) Remark = db.Column(db.String(200)) Alias = db.Column(db.String(200)) Sex = db.Column(db.String(200)) ContactType = db.Column(db.String(200)) ChatRoomOwner = db.Column(db.String(200)) ExtInfo = db.Column(db.String(10000)) Ticket = db.Column(db.String(200)) ChatroomVersion = db.Column(db.String(200)) def __init__(self, MsgType, UserName, NickName, Signature, SmallHeadImgUrl, BigHeadImgUrl, Province, City, Remark, Alias, Sex, ContactType, ChatRoomOwner, ExtInfo, Ticket, ChatroomVersion): # 这些字段 是登陆成功后的返回 self.MsgType = MsgType self.UserName = UserName self.NickName = NickName self.Signature = Signature self.SmallHeadImgUrl = SmallHeadImgUrl self.BigHeadImgUrl = BigHeadImgUrl self.Province = Province self.City = City self.Remark = Remark self.Alias = Alias self.Sex = Sex self.ContactType = ContactType self.ChatRoomOwner = ChatRoomOwner self.ExtInfo = ExtInfo self.Ticket = Ticket self.ChatroomVersion = ChatroomVersion
class Message(db.Model): __tablename__ = 'message' __table_args__ = {"useexisting": True} id = db.Column(db.Integer, primary_key=True) Content = db.Column(db.String(2000)) CreateTime = db.Column(db.String(400)) FromUserName = db.Column(db.String(200)) ImgBuf = db.Column(db.String(200)) ImgStatus = db.Column(db.String(200)) MsgId = db.Column(db.String(200), unique=True) MsgSource = db.Column(db.String(200)) MsgType = db.Column(db.String(200)) NewMsgId = db.Column(db.String(200)) PushContent = db.Column(db.String(200)) Status = db.Column(db.String(200)) ToUserName = db.Column(db.String(200)) def __init__(self, Content, CreateTime, FromUserName, ImgBuf, ImgStatus, MsgId, MsgSource, MsgType, NewMsgId, PushContent, Status, ToUserName): self.Content = Content self.CreateTime = CreateTime self.FromUserName = FromUserName self.ImgBuf = ImgBuf self.ImgStatus = ImgStatus self.MsgId = MsgId self.MsgSource = MsgSource self.MsgType = MsgType self.NewMsgId = NewMsgId self.PushContent = PushContent self.Status = Status self.ToUserName = ToUserName
class User(db.Model): __tablename__ = 'user' __table_args__ = {"useexisting": True} id = db.Column(db.Integer, primary_key=True) autoAuthKey = db.Column(db.String(200)) cookies = db.Column(db.String(200)) currentsyncKey = db.Column(db.String(400)) deviceId = db.Column(db.String(200)) deviceName = db.Column(db.String(200)) deviceType = db.Column(db.String(200)) maxSyncKey = db.Column(db.String(200)) nickname = db.Column(db.String(200)) sessionKey = db.Column(db.String(200)) uin = db.Column(db.String(200), unique=True) userExt = db.Column(db.String(400)) userame = db.Column(db.String(400)) login = db.Column(db.Integer) def __init__(self, autoAuthKey, cookies, currentsyncKey, deviceId, deviceName, deviceType, maxSyncKey, nickname, sessionKey, uin, userExt, userame, login): # 这些字段 是登陆成功后的返回 self.autoAuthKey = str(autoAuthKey) self.cookies = str(cookies) self.currentsyncKey = str(currentsyncKey) self.deviceId = str(deviceId) self.deviceName = str(deviceName) self.deviceType = str(deviceType) self.maxSyncKey = str(maxSyncKey) self.nickname = str(nickname) self.sessionKey = str(sessionKey) self.uin = str(uin) self.userExt = str(userExt) self.userame = str(userame) self.login = login def __repr__(self): return '<user %r>' % self.username