Skip to main content

Spring Boot CRUD 코드 생성기

Project description

Spring Boot CRUD 생성기

이 프로그램은 Spring Boot 프로젝트에서 엔티티 기반의 CRUD 기능을 자동으로 생성해주는 도구입니다. 3-레이어 아키텍처와 헥사고날 아키텍처를 모두 지원하며, 도메인 중심 설계를 따르는 모듈식 구조의 코드를 생성합니다.

기능

  • 도메인별 폴더 구조 자동 생성
  • 엔티티, DTO, 리포지토리, 서비스, 컨트롤러 자동 생성
  • Java 버전에 따른 코드 최적화 (Java 17+ 버전에서는 Record 클래스 사용)
  • 3-레이어 아키텍처 및 헥사고날 아키텍처 지원
  • RESTful API 엔드포인트 자동 구현
  • 복수형 변환 로직 내장 (Category → Categories, Box → Boxes 등)

설치 방법

방법 1: pip를 사용한 설치 (권장)

# 패키지 설치
pip install spring-boot-crud-generator

# 실행
spring-crud

방법 2: 직접 다운로드

별도의 설치 과정 없이 Python 3.6 이상만 설치되어 있으면 바로 사용할 수 있습니다.

요구사항

  • Python 3.6 이상

다운로드 및 실행

  1. 이 저장소에서 crud.py 파일을 다운로드합니다.
  2. 터미널/명령 프롬프트에서 다음 명령어를 실행합니다:
python crud.py crud

바로 실행하기 (Git Clone 없이)

  1. 다음 명령으로 단일 파일을 다운로드합니다:
# curl 사용
curl -o crud.py https://raw.githubusercontent.com/wonowonow/spring-boot-crud-generator/main/crud.py

# wget 사용
wget https://raw.githubusercontent.com/wonowonow/spring-boot-crud-generator/main/crud.py
  1. 다운로드한 파일을 실행합니다:
python crud.py crud

패키지 배포:

python setup.py sdist bdist_wheel
pip install twine
twine upload dist/*

사용 방법

  1. 프로그램을 실행하면 대화형 프롬프트가 나타납니다.
  2. 다음 정보를 입력해야 합니다:
    • 패키지 이름 (예: com.example)
    • 엔티티 이름 (예: Product)
    • Java 버전 (8 이상)
    • 아키텍처 (3-레이어 또는 헥사고날)
  3. 확인 후 코드가 자동으로 생성됩니다.

생성되는 파일 구조

src/main/java/com/example/domain/Product/
├── controller/
│   └── ProductController.java
├── domain/
│   └── Product.java
├── dto/
│   ├── ProductRequest.java
│   └── ProductResponse.java
├── repository/
│   └── ProductRepository.java
└── service/
    ├── ProductService.java
    └── ProductServiceImpl.java

URL 매핑

생성된 컨트롤러는 다음과 같은 REST API 엔드포인트를 제공합니다:

HTTP 메서드 엔드포인트 설명
POST /api/products 새 리소스 생성
GET /api/products 모든 리소스 조회
GET /api/products/{id} ID로 특정 리소스 조회
PUT /api/products/{id} ID로 특정 리소스 업데이트
DELETE /api/products/{id} ID로 특정 리소스 삭제

참고사항

  • 생성된 코드는 기본적인 CRUD 기능만 포함합니다. 필요에 따라 추가 기능을 구현해야 합니다.
  • Spring Boot 프로젝트에 다음 의존성이 필요합니다:
    • Spring Web
    • Spring Data JPA
    • Lombok
    • H2 Database (또는 선호하는 다른 데이터베이스)
  • Entity 클래스에는 기본적으로 id와 name 필드만 포함되어 있으므로 실제 요구사항에 맞게 수정해야 합니다.

작성자

작성자 정보를 여기에 추가하세요.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spring-boot-crud-generator-0.0.1.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spring_boot_crud_generator-0.0.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file spring-boot-crud-generator-0.0.1.tar.gz.

File metadata

File hashes

Hashes for spring-boot-crud-generator-0.0.1.tar.gz
Algorithm Hash digest
SHA256 215a9f46506e5bcb42aa960b454ec2087dd1879f1b4f4ba7580c7813da2920fd
MD5 9f86c765741a916cdcd1fadfe8265293
BLAKE2b-256 ebec04493b8a7bb27e5ca3b3e3a1b30d684087588adfd9b4ab3adb7b327229b4

See more details on using hashes here.

File details

Details for the file spring_boot_crud_generator-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for spring_boot_crud_generator-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 374d747f7da18cfccac5a7e34b3619acfd968c55bc7fcdf41d844241629d9e9b
MD5 030594433d12c0d39973c8ca2e267e85
BLAKE2b-256 65ecba194fb79adcf5511891cd956c0f33010d3bfc2e4dd18250d7c025f43840

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page