Skip to content

Commit

Permalink
feat: add validation for CreatePostRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
Ji-soo708 committed Dec 14, 2023
1 parent 1983909 commit ee9db01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.oing.dto.request;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;

/**
* no5ing-server
Expand All @@ -10,6 +11,7 @@
*/
@Schema(description = "피드 게시물 생성 요청")
public record CreatePostRequest(
@NotNull
@Schema(description = "피드 게시물 사진 주소", example = "https://asset.no5ing.kr/post/01HGW2N7EHJVJ4CJ999RRS2E97")
String imageUrl,

Expand Down
2 changes: 1 addition & 1 deletion post/src/main/java/com/oing/restapi/PostApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.oing.dto.response.PreSignedUrlResponse;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import jakarta.validation.constraints.Min;
Expand Down Expand Up @@ -63,6 +62,7 @@ PaginationResponse<PostResponse> fetchDailyFeeds(
@Operation(summary = "게시물 생성", description = "게시물을 생성합니다.")
@PostMapping
PostResponse createPost(
@Valid
@RequestBody
CreatePostRequest request
);
Expand Down

0 comments on commit ee9db01

Please sign in to comment.