MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / update_codex2api_service

Function update_codex2api_service

src/database/crud.py:857–871  ·  view source on GitHub ↗

更新 Codex2API 服务配置

(
    db: Session,
    service_id: int,
    **kwargs,
)

Source from the content-addressed store, hash-verified

855
856
857def update_codex2api_service(
858 db: Session,
859 service_id: int,
860 **kwargs,
861) -> Optional[Codex2ApiService]:
862 """更新 Codex2API 服务配置"""
863 svc = get_codex2api_service_by_id(db, service_id)
864 if not svc:
865 return None
866 for key, value in kwargs.items():
867 if hasattr(svc, key):
868 setattr(svc, key, value)
869 db.commit()
870 db.refresh(svc)
871 return svc
872
873
874def delete_codex2api_service(db: Session, service_id: int) -> bool:

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected