mirror of
https://github.com/stardrophere/InsightRadar.git
synced 2026-06-05 23:32:49 +08:00
应用层限制同步
This commit is contained in:
@@ -24,6 +24,10 @@ def get_multi(db: Session, skip: int = 0, limit: int = 100) -> List[InfoSource]:
|
||||
def create(db: Session, obj_in: InfoSourceCreate) -> InfoSource:
|
||||
"""创建新的信息源"""
|
||||
db_obj = InfoSource(**obj_in.model_dump())
|
||||
exits =db.query(InfoSource).filter(InfoSource.source_name == db_obj.source_name).first()
|
||||
if exits:
|
||||
db.close()
|
||||
return db_obj
|
||||
try:
|
||||
db.add(db_obj)
|
||||
db.commit()
|
||||
|
||||
Reference in New Issue
Block a user