创建 Codex2API 服务配置
(
db: Session,
name: str,
api_url: str,
admin_key: str,
enabled: bool = True,
priority: int = 0,
)
| 817 | # ============================================================================ |
| 818 | |
| 819 | def create_codex2api_service( |
| 820 | db: Session, |
| 821 | name: str, |
| 822 | api_url: str, |
| 823 | admin_key: str, |
| 824 | enabled: bool = True, |
| 825 | priority: int = 0, |
| 826 | ) -> Codex2ApiService: |
| 827 | """创建 Codex2API 服务配置""" |
| 828 | svc = Codex2ApiService( |
| 829 | name=name, |
| 830 | api_url=api_url, |
| 831 | admin_key=admin_key, |
| 832 | enabled=enabled, |
| 833 | priority=priority, |
| 834 | ) |
| 835 | db.add(svc) |
| 836 | db.commit() |
| 837 | db.refresh(svc) |
| 838 | return svc |
| 839 | |
| 840 | |
| 841 | def get_codex2api_service_by_id(db: Session, service_id: int) -> Optional[Codex2ApiService]: |
nothing calls this directly
no test coverage detected