agentsclimarketplace

Allra api design

Skill ComeOnOliver/skillshub/skills/aiskillstore/marketplace/allra-fintech/allra-api-design

🧠 The right skill, one API call. AI agent skills registry with token-efficient skill resolution. 5,000+ skills from 500+ top repos.

Install
npx -y skills add ComeOnOliver/skillshub --skill allra-api-design

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its author says it does

Copied from the file, not written here

Allra λ°±μ—”λ“œ API 섀계 및 νŒ¨ν‚€μ§€ ꡬ쑰 κ·œμΉ™. Use when creating REST APIs, DTOs, or organizing backend code structure.

SKILL.md

6.6 KB, as published. Nobody here has run it

Allra Backend API 섀계 및 νŒ¨ν‚€μ§€ ꡬ쑰

Allra λ°±μ—”λ“œ νŒ€μ˜ API 섀계, DTO 넀이밍, νŒ¨ν‚€μ§€ ꡬ쑰 ν‘œμ€€μ„ μ •μ˜ν•©λ‹ˆλ‹€.

ν”„λ‘œμ νŠΈ κΈ°λ³Έ 정보

이 κ°€μ΄λ“œλŠ” λ‹€μŒ ν™˜κ²½μ„ κΈ°μ€€μœΌλ‘œ μž‘μ„±λ˜μ—ˆμŠ΅λ‹ˆλ‹€:

  • Java: 17 이상
  • Spring Boot: 3.2 이상
  • μ£Όμš” 기술: JPA/Hibernate, QueryDSL, JWT

μ°Έκ³ : ν”„λ‘œμ νŠΈλ³„λ‘œ μ‚¬μš©ν•˜λŠ” 기술 μŠ€νƒμ΄λ‚˜ 버전이 λ‹€λ₯Ό 수 μžˆμŠ΅λ‹ˆλ‹€. ν”„λ‘œμ νŠΈμ— 맞게 μ‘°μ •ν•˜μ—¬ μ‚¬μš©ν•˜μ„Έμš”.

νŒ¨ν‚€μ§€ ꡬ쑰 κ·œμΉ™

도메인별 νŒ¨ν‚€μ§€ ꡬ쑰λ₯Ό ꢌμž₯ν•©λ‹ˆλ‹€:

└── {domain}
    β”œβ”€β”€ api          // 컨트둀러 λ ˆμ΄μ–΄
    β”œβ”€β”€ dto          // 데이터 전솑 객체
    β”œβ”€β”€ entity       // JPA μ—”ν‹°ν‹°
    β”œβ”€β”€ enums        // Enum μ •μ˜ (선택)
    β”œβ”€β”€ repository   // 데이터 μ ‘κ·Ό 계측
    └── service      // λΉ„μ¦ˆλ‹ˆμŠ€ 둜직

μ°Έκ³ : ν”„λ‘œμ νŠΈμ— 따라 controller, model, dao λ“± λ‹€λ₯Έ 이름을 μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€. μ€‘μš”ν•œ 것은 λ ˆμ΄μ–΄λ³„ μ±…μž„μ„ λͺ…ν™•νžˆ λΆ„λ¦¬ν•˜λŠ” κ²ƒμž…λ‹ˆλ‹€.

μ˜ˆμ‹œ

└── user
    β”œβ”€β”€ api
    β”‚   └── UserController.java
    β”œβ”€β”€ dto
    β”‚   β”œβ”€β”€ UserSignUpEventDto.java  // λ‚΄λΆ€ μ‚¬μš©
    β”‚   β”œβ”€β”€ request
    β”‚   β”‚   └── SignUpRequest.java
    β”‚   └── response
    β”‚       └── SignUpResponse.java
    β”œβ”€β”€ entity
    β”‚   └── User.java
    β”œβ”€β”€ repository
    β”‚   β”œβ”€β”€ UserRepository.java
    β”‚   └── UserRepositorySupport.java
    └── service
        └── UserService.java

DTO 넀이밍 κ·œμΉ™

1. ν΄λΌμ΄μ–ΈνŠΈ 톡신 DTO

  • Request: {Operation}Request
    • 예: SignUpRequest, UpdateUserRequest
  • Response: {Operation}Response
    • 예: SignUpResponse, UserDetailResponse

2. λ‚΄λΆ€ μ‚¬μš© DTO

λ‚΄λΆ€μ—μ„œλ§Œ μ‚¬μš©ν•˜λŠ” DTOλŠ” Dto 접미사 μΆ”κ°€:

  • Repository Layer QueryDSL Fetch DTO
  • Internal Layer Transfer DTO
  • 예: UserSignUpEventDto, UserSummaryDto

3. Record μ‚¬μš©

DTO 같은 λ‹¨μˆœ ν΄λž˜μŠ€λ“€μ€ κ°€λŠ₯ν•˜λ©΄ λŒ€λΆ€λΆ„ record둜 생성

// Request/Response
public record SignUpRequest(
    String email,
    String password,
    String name
) {}

public record SignUpResponse(
    Long userId,
    String email
) {}

// λ‚΄λΆ€ μ‚¬μš© DTO
public record UserSignUpEventDto(
    Long userId,
    String email,
    LocalDateTime signUpAt
) {}

API 컨트둀러 섀계 κ°€μ΄λ“œ

1. REST API λͺ…λͺ… κ·œμΉ™

@RestController
@RequestMapping("/api/v1/users")
public class UserController {

    // GET /api/v1/users - λͺ©λ‘ 쑰회
    @GetMapping
    public List<UserResponse> getUsers() { }

    // GET /api/v1/users/{id} - 단건 쑰회
    @GetMapping("/{id}")
    public UserDetailResponse getUser(@PathVariable Long id) { }

    // POST /api/v1/users - 생성
    @PostMapping
    public SignUpResponse createUser(@RequestBody @Valid SignUpRequest request) { }

    // PUT /api/v1/users/{id} - 전체 μˆ˜μ •
    @PutMapping("/{id}")
    public UserResponse updateUser(
        @PathVariable Long id,
        @RequestBody @Valid UpdateUserRequest request
    ) { }

    // PATCH /api/v1/users/{id} - λΆ€λΆ„ μˆ˜μ •
    @PatchMapping("/{id}")
    public UserResponse patchUser(
        @PathVariable Long id,
        @RequestBody @Valid PatchUserRequest request
    ) { }

    // DELETE /api/v1/users/{id} - μ‚­μ œ
    @DeleteMapping("/{id}")
    public void deleteUser(@PathVariable Long id) { }
}

μ°Έκ³ : API 버저닝(/api/v1/...)은 ν”„λ‘œμ νŠΈ 정책에 따라 μ„ νƒμ μœΌλ‘œ μ μš©ν•©λ‹ˆλ‹€.

2. Request Validation

λͺ¨λ“  Request DTOλŠ” Bean Validation μ‚¬μš©:

public record SignUpRequest(
    @NotBlank(message = "이메일은 ν•„μˆ˜μž…λ‹ˆλ‹€")
    @Email(message = "μ˜¬λ°”λ₯Έ 이메일 ν˜•μ‹μ΄ μ•„λ‹™λ‹ˆλ‹€")
    String email,

    @NotBlank(message = "λΉ„λ°€λ²ˆν˜ΈλŠ” ν•„μˆ˜μž…λ‹ˆλ‹€")
    @Size(min = 8, message = "λΉ„λ°€λ²ˆν˜ΈλŠ” μ΅œμ†Œ 8자 이상이어야 ν•©λ‹ˆλ‹€")
    String password,

    @NotBlank(message = "이름은 ν•„μˆ˜μž…λ‹ˆλ‹€")
    String name
) {}

3. 응닡 ν˜•μ‹

Allra ν‘œμ€€ ν˜•μ‹ (μ˜ˆμ‹œ):

성곡 응닡:

{
  "data": { ... },
  "message": "μš”μ²­μ΄ μ„±κ³΅μ μœΌλ‘œ μ²˜λ¦¬λ˜μ—ˆμŠ΅λ‹ˆλ‹€"
}

μ—λŸ¬ 응닡:

{
  "error": {
    "code": "USER_NOT_FOUND",
    "message": "μ‚¬μš©μžλ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€",
    "details": []
  }
}

μ°Έκ³ : 응닡 ν˜•μ‹μ€ ν”„λ‘œμ νŠΈλ³„λ‘œ λ‹€λ₯Ό 수 μžˆμŠ΅λ‹ˆλ‹€. 일관성 μžˆλŠ” ν˜•μ‹μ„ μœ μ§€ν•˜λŠ” 것이 μ€‘μš”ν•©λ‹ˆλ‹€.

When to Use This Skill

이 skill은 λ‹€μŒ μƒν™©μ—μ„œ μžλ™μœΌλ‘œ μ μš©λ©λ‹ˆλ‹€:

  • μƒˆλ‘œμš΄ API μ—”λ“œν¬μΈνŠΈ 생성
  • DTO 클래슀 μž‘μ„±
  • 컨트둀러 κ΅¬ν˜„
  • 도메인 νŒ¨ν‚€μ§€ ꡬ쑰 섀계
  • Request/Response 객체 넀이밍

Examples

예제 1: μƒˆλ‘œμš΄ 도메인 API 생성

// 1. νŒ¨ν‚€μ§€ ꡬ쑰 생성
kr.co.allra.product/
β”œβ”€β”€ api/ProductController.java
β”œβ”€β”€ dto/
β”‚   β”œβ”€β”€ request/CreateProductRequest.java
β”‚   └── response/ProductResponse.java
β”œβ”€β”€ entity/Product.java
β”œβ”€β”€ repository/ProductRepository.java
└── service/ProductService.java

// 2. Request DTO
public record CreateProductRequest(
    @NotBlank String name,
    @NotNull BigDecimal price
) {}

// 3. Response DTO
public record ProductResponse(
    Long id,
    String name,
    BigDecimal price,
    LocalDateTime createdAt
) {}

// 4. Controller
@RestController
@RequestMapping("/api/v1/products")
public class ProductController {

    @PostMapping
    public ProductResponse createProduct(
        @RequestBody @Valid CreateProductRequest request
    ) {
        return productService.createProduct(request);
    }
}

예제 2: λ‚΄λΆ€ DTO 생성

// QueryDSL κ²°κ³Όλ₯Ό μœ„ν•œ λ‚΄λΆ€ DTO
public record ProductSummaryDto(
    Long id,
    String name,
    Long orderCount
) {
    @QueryProjection
    public ProductSummaryDto {}
}

// 이벀트 μ „λ‹¬μš© λ‚΄λΆ€ DTO
public record ProductCreatedEventDto(
    Long productId,
    String productName,
    LocalDateTime createdAt
) {}

Checklist

μƒˆλ‘œμš΄ APIλ₯Ό λ§Œλ“€ λ•Œ 확인사항:

  • 도메인별 νŒ¨ν‚€μ§€ ꡬ쑰λ₯Ό λ”°λ₯΄λŠ”κ°€?
  • Request/Response DTO 넀이밍이 κ·œμΉ™μ„ λ”°λ₯΄λŠ”κ°€?
  • DTOκ°€ record둜 μž‘μ„±λ˜μ—ˆλŠ”κ°€?
  • Request DTO에 Validation이 μ μš©λ˜μ—ˆλŠ”κ°€?
  • REST API λͺ…λͺ… κ·œμΉ™μ„ λ”°λ₯΄λŠ”κ°€?
  • λ‚΄λΆ€ μ‚¬μš© DTO에 Dto 접미사가 μžˆλŠ”κ°€?

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.