class Website(db.Model): __tablename__ = 'website' id = db.Column(db.Integer, primary_key=True, autoincrement=True) name = db.Column(db.String(50)) description = db.Column(db.String(1000)) is_hot = db.Column(db.Integer) category_id = db.Column(db.Integer, db.ForeignKey('category.id'))
class Node(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) ip_addr = db.Column(db.String(50)) host_name = db.Column(db.String(50)) node_type = db.Column(db.String(50)) max_ps = db.Column(db.Integer) cur_ps = db.Column(db.Integer) status = db.Column(db.Integer) ps_id = db.Column(db.Integer)
class SpiderTemplate(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) name = db.Column(db.String(50)) website_id = db.Column(db.Integer, db.ForeignKey('website.id')) category_id = db.Column(db.Integer, db.ForeignKey('category.id')) para_file = db.Column(db.String(50)) node_type = db.Column(db.String(50)) task_type = db.Column(db.String(50)) sctript_name = db.Column(db.String(100))
class TemplateFileds(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) template_id = db.Column(db.Integer, db.ForeignKey('spider_template.id')) inner_id = db.Column(db.Integer) filed_name = db.Column(db.String(50)) filed_cn_name = db.Column(db.String(50)) filed_preview_type = db.Column(db.String(50)) filed_string = db.Column(db.String(1000)) filed_image = db.Column(db.String(100)) filed_table = db.Column(db.String(100))
class SpiderTask(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) name = db.Column(db.String(50)) template_id = db.Column(db.Integer, db.ForeignKey('spider_template.id')) node_type = db.Column(db.Integer) task_type = db.Column(db.Integer) script_name = db.Column(db.String(200)) is_timing = db.Column(db.Integer) publish_time = db.Column(db.DateTime) user = db.Column(db.String(50)) execute_cycle = db.Column(db.Integer) start_time = db.Column(db.DateTime) end_time = db.Column(db.DateTime) status = db.Column(db.Integer) node_id = db.Column(db.Integer, db.ForeignKey('node.id')) paras_table = db.Column(db.String(100)) res_table = db.Column(db.String(100)) res_file = db.Column(db.String(100))
class TemplateDescription(db.Model): template_id = db.Column(db.Integer, db.ForeignKey('spider_template.id'), primary_key=True) description = db.Column(db.String(1000))
class Category(db.Model): __tablename__ = 'category' id = db.Column(db.Integer, primary_key=True, autoincrement=True) name = db.Column(db.String(50))
class ParaFiles(db.Model): id = db.Column(db.String(200), primary_key=True) file_name = db.Column(db.String(200)) create_time = db.Column(db.DateTime)
class TemplateDataExample(db.Model): template_id = db.Column(db.Integer, db.ForeignKey('spider_template.id'), primary_key=True) example_table = db.Column(db.String(50))