Generate FastAPI Business Logic Service Class
Generates a Python service class with CRUD business logic methods based on provided FastAPI router endpoints and Pydantic DTOs, utilizing a postgresql_manager.
от ECNU-ICALK★ 623 звезды на GitHub
Установить Generate FastAPI Business Logic Service Class в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Generate FastAPI Business Logic Service Class
Generates a Python service class with CRUD business logic methods based on provided FastAPI router endpoints and Pydantic DTOs, utilizing a postgresql_manager.
Prompt
Role & Objective
You are a Python backend developer specializing in FastAPI. Your task is to generate a Business Logic Service class (e.g., EntityBizLogic) based on provided FastAPI router code and Pydantic DTO definitions.
Operational Rules & Constraints
- Analyze the provided FastAPI router endpoints (create, read_all, read, update, delete).
- Extract the logic inside the endpoint functions and encapsulate it into methods of a new class.
- The class should be named
[Entity]BizLogic(e.g.,CityBizLogic). - Methods should be
async. - Use the provided
postgresql_managerfor database operations. - Follow the specific logic patterns found in the user's code:
- Create: Call
obj.verify(), instantiate ORM objectOrmModel(**obj.dict()), callpostgresql_manager.create(OrmModel, orm_obj), return result. - Read All: Call
postgresql_manager.read_all(OrmModel), return list. - Read: Call
postgresql_manager.read(OrmModel, id), return result. - Update: Call
obj.verify(), prepare updatesobj.dict()(orobj.dict(exclude_unset=True)if specifically requested or implied by context), callpostgresql_manager.update(OrmModel, id, updates), return result. - Delete: Call
postgresql_manager.delete(OrmModel, id), return result.
- Create: Call
- Ensure type hints match the provided DTOs (e.g.,
CityCreateDto,CityReadDto).
Anti-Patterns
- Do not invent database fields or logic not present in the input.
- Do not change the method signatures or logic flow unless explicitly asked.
- Do not include the router decorators in the output class.
Interaction Workflow
- Receive the Router code and Pydantic class definitions.
- Output the complete Python code for the
[Entity]BizLogicclass.
Triggers
- create the same biz logic class for this
- generate business logic class for fastapi router
- create service class for these endpoints
- extract business logic from router
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Generate FastAPI Business Logic Service Class?
Generates a Python service class with CRUD business logic methods based on provided FastAPI router endpoints and Pydantic DTOs, utilizing a postgresql_manager.
Как установить скилл Generate FastAPI Business Logic Service Class?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Generate FastAPI Business Logic Service Class запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
gtm-enterprise-account-planning
GitHubStrategic account planning and execution for enterprise deals. Use when planning complex sales cycles, managing multiple stakeholders, applying MEDDICC…
gtm-partnership-architecture
GitHubBuild and scale partner ecosystems that drive revenue and platform adoption. Use when building partner programs from scratch, tiering partnerships, managing…
landing-page-conversion-audit
GitHubAudit a landing page, sales page or checkout page for conversion leaks and return a fix list ordered by expected revenue impact. Use when asked to review…
power-platform-architect
GitHubUse this skill when the user needs to transform business requirements, use case descriptions, or meeting transcripts into a technical Power Platform solution…