def delete(self): self.status = self.DELETE_STATUS try: db.session.commit() except Exception as e: log.exception(e) handelAbort(f"err:{str(e)}")
def Delete(self): try: db.session.delete(self) db.session.commit() except Exception as e: log.exception(e) db.session.rollback() handelAbort(f"err:{str(e)}")
def assertDo(self, do: str): if do not in DO: handelAbort(f"Parameter:{do} not support") return do
def assertName(cls, name): res = cls.query.filter_by(name=name).first() if res: handelAbort(f"已存在 {name}!")
def assertName(cls, name): res = cls.query.filter_by(name=name).first() if res: handelAbort("caseNamec存在")
def assertIdExisted(cls, id): p = cls.query.get_or_NoFound(id) if not p or p.status == 0: handelAbort("envId 不存在或删除") return p
def assertIdExisted(cls, id): p = cls.query.get(id) if not p or p.status == 0: handelAbort("interface 不存在或删除")
def assertName(cle, name): res = cle.query.filter_by(interface_name=name).first() if res: handelAbort("interface_name 重复!")
def assertName(cle, name): res = cle.query.filter_by(project_name=name, status=1).first() if res: handelAbort("projectName 重复!")
def assertIdExisted(cls, id): p = cls.query.get(id) if not p: handelAbort(f"projectId {id} 不存在或删除") return p