diff --git a/backend/moment/moment-server/core/src/test/java/com/moment/core/controller/TripFileControllerTest.java b/backend/moment/moment-server/core/src/test/java/com/moment/core/controller/TripFileControllerTest.java index 31b2096220..7652b715d2 100644 --- a/backend/moment/moment-server/core/src/test/java/com/moment/core/controller/TripFileControllerTest.java +++ b/backend/moment/moment-server/core/src/test/java/com/moment/core/controller/TripFileControllerTest.java @@ -62,6 +62,7 @@ void getTripFiles() throws Exception { .email("test") .yearDate(LocalDate.now()) .analyzingCount(1) + .totalCount(1) .build(), TripFileResponseDTO.GetTripFile.builder() .id(2L) @@ -69,6 +70,7 @@ void getTripFiles() throws Exception { .email("test") .yearDate(LocalDate.now().plusDays(1)) .analyzingCount(2) + .totalCount(1) .build(), TripFileResponseDTO.GetTripFile.builder() .id(3L) @@ -76,6 +78,7 @@ void getTripFiles() throws Exception { .email("test") .yearDate(LocalDate.now().plusDays(2)) .analyzingCount(1) + .totalCount(1) .build() ); TripFileResponseDTO.GetAllTripFile allTripFile = TripFileResponseDTO.GetAllTripFile.builder() @@ -108,7 +111,8 @@ void getTripFiles() throws Exception { fieldWithPath("data.tripFiles[].tripId").type(JsonFieldType.NUMBER).description("여행 ID"), fieldWithPath("data.tripFiles[].email").type(JsonFieldType.STRING).description("유저 email"), fieldWithPath("data.tripFiles[].yearDate").type(JsonFieldType.STRING).attributes(getDateFormat()).description("연월일"), - fieldWithPath("data.tripFiles[].analyzingCount").type(JsonFieldType.NUMBER).description("분석 중 파일 개수") + fieldWithPath("data.tripFiles[].analyzingCount").type(JsonFieldType.NUMBER).description("분석 중 파일 개수"), + fieldWithPath("data.tripFiles[].totalCount").type(JsonFieldType.NUMBER).description("전체 파일 개수") ) ) ) @@ -124,6 +128,7 @@ void getUntitledTripFiles() throws Exception { .email("test") .yearDate(LocalDate.now()) .analyzingCount(1) + .totalCount(1) .build(), TripFileResponseDTO.GetTripFile.builder() .id(2L) @@ -131,6 +136,7 @@ void getUntitledTripFiles() throws Exception { .email("test") .yearDate(LocalDate.now().plusDays(1)) .analyzingCount(2) + .totalCount(1) .build(), TripFileResponseDTO.GetTripFile.builder() .id(3L) @@ -138,6 +144,7 @@ void getUntitledTripFiles() throws Exception { .email("test") .yearDate(LocalDate.now().plusDays(2)) .analyzingCount(1) + .totalCount(1) .build() ); TripFileResponseDTO.GetAllTripFile allTripFile = TripFileResponseDTO.GetAllTripFile.builder() @@ -166,7 +173,8 @@ void getUntitledTripFiles() throws Exception { fieldWithPath("data.tripFiles[].tripId").type(JsonFieldType.NUMBER).description("여행 ID"), fieldWithPath("data.tripFiles[].email").type(JsonFieldType.STRING).description("유저 email"), fieldWithPath("data.tripFiles[].yearDate").type(JsonFieldType.STRING).attributes(getDateFormat()).description("연월일"), - fieldWithPath("data.tripFiles[].analyzingCount").type(JsonFieldType.NUMBER).description("분석 중 파일 개수") + fieldWithPath("data.tripFiles[].analyzingCount").type(JsonFieldType.NUMBER).description("분석 중 파일 개수"), + fieldWithPath("data.tripFiles[].totalCount").type(JsonFieldType.NUMBER).description("전체 파일 개수") ) ) ) diff --git a/backend/moment/moment-server/gateway/src/main/resources/static/docs/index.html b/backend/moment/moment-server/gateway/src/main/resources/static/docs/index.html index 3b76eb9fd4..dba8a84fb1 100644 --- a/backend/moment/moment-server/gateway/src/main/resources/static/docs/index.html +++ b/backend/moment/moment-server/gateway/src/main/resources/static/docs/index.html @@ -577,41 +577,68 @@

Moment Application API Document

  • Receipt @@ -757,7 +784,7 @@

    Trip

    여행 등록

    +

    Curl request

    +
    +
    +
    $ curl 'http://localhost:8080/core/trip/register' -i -X POST \
    +    -H 'Content-Type: application/json;charset=UTF-8' \
    +    -H 'userId: 1' \
    +    -H 'Accept: application/json' \
    +    -d '{
    +  "startDate" : "2024-05-07",
    +  "endDate" : "2024-05-08",
    +  "tripName" : "test"
    +}'
    +
    +
    +
    +

    HTTP request

    @@ -2814,41 +2857,53 @@

    -

    Request headers

    - ---- - - - - - - - - - - - - -
    NameDescription

    userId

    Bearer Token

    +

    HTTP response

    +
    +
    +
    HTTP/1.1 200 OK
    +Content-Type: application/json
    +Content-Length: 102
    +
    +{
    +  "status" : 201,
    +  "code" : "201",
    +  "msg" : "INSERT SUCCESS",
    +  "detailMsg" : "",
    +  "data" : { }
    +}
    +
    +
    +
    +
    +

    HTTPie request

    +
    +
    +
    $ echo '{
    +  "startDate" : "2024-05-07",
    +  "endDate" : "2024-05-08",
    +  "tripName" : "test"
    +}' | http POST 'http://localhost:8080/core/trip/register' \
    +    'Content-Type:application/json;charset=UTF-8' \
    +    'userId:1' \
    +    'Accept:application/json'
    +
    +

    Request body

    {
    -  "startDate" : "2024-05-02",
    -  "endDate" : "2024-05-03",
    +  "startDate" : "2024-05-07",
    +  "endDate" : "2024-05-08",
       "tripName" : "test"
     }
    @@ -2899,14 +2954,31 @@

    -

    HTTP response

    +

    Request headers

    + ++++ + + + + + + + + + + + + +
    NameDescription

    userId

    Bearer Token

    +
    +
    +

    Response body

    -
    HTTP/1.1 200 OK
    -Content-Type: application/json
    -Content-Length: 102
    -
    -{
    +
    {
       "status" : 201,
       "code" : "201",
       "msg" : "INSERT SUCCESS",
    @@ -2964,6 +3036,17 @@ 

    여행 목록 조회

    +

    Curl request

    +
    +
    +
    $ curl 'http://localhost:8080/core/trip/all' -i -X GET \
    +    -H 'Content-Type: application/json;charset=UTF-8' \
    +    -H 'userId: 1' \
    +    -H 'Accept: application/json'
    +
    +
    +
    +

    HTTP request

    @@ -2976,6 +3059,66 @@

    +

    HTTP response

    +
    +
    +
    HTTP/1.1 200 OK
    +Content-Type: application/json
    +Content-Length: 628
    +
    +{
    +  "status" : 200,
    +  "code" : "200",
    +  "msg" : "SELECT SUCCESS",
    +  "detailMsg" : "",
    +  "data" : {
    +    "trips" : [ {
    +      "id" : 1,
    +      "email" : "test",
    +      "startDate" : "2024-05-07",
    +      "endDate" : "2024-05-08",
    +      "analyzingCount" : 0,
    +      "tripName" : "test"
    +    }, {
    +      "id" : 2,
    +      "email" : "test",
    +      "startDate" : "2024-05-07",
    +      "endDate" : "2024-05-08",
    +      "analyzingCount" : 1,
    +      "tripName" : "test"
    +    }, {
    +      "id" : 3,
    +      "email" : "test",
    +      "startDate" : "2024-05-07",
    +      "endDate" : "2024-05-08",
    +      "analyzingCount" : 2,
    +      "tripName" : "test"
    +    } ]
    +  }
    +}
    +
    +
    +

    +
    +

    HTTPie request

    +
    +
    +
    $ http GET 'http://localhost:8080/core/trip/all' \
    +    'Content-Type:application/json;charset=UTF-8' \
    +    'userId:1' \
    +    'Accept:application/json'
    +
    +
    +
    +
    +

    Request body

    +
    +
    +
    +
    +
    +
    +

    Request headers

    @@ -2997,14 +3140,10 @@

    -

    HTTP response

    +

    Response body

    -
    HTTP/1.1 200 OK
    -Content-Type: application/json
    -Content-Length: 628
    -
    -{
    +
    {
       "status" : 200,
       "code" : "200",
       "msg" : "SELECT SUCCESS",
    @@ -3013,22 +3152,22 @@ 

    여행 수정

    +

    Curl request

    +
    +
    +
    $ curl 'http://localhost:8080/core/trip' -i -X PUT \
    +    -H 'Content-Type: application/json;charset=UTF-8' \
    +    -H 'userId: 1' \
    +    -H 'Accept: application/json' \
    +    -d '{
    +  "tripId" : 1,
    +  "startDate" : "2024-05-07",
    +  "endDate" : "2024-05-08",
    +  "tripName" : "test"
    +}'
    +
    +
    +
    +

    HTTP request

    @@ -3122,33 +3278,46 @@

    ---- - - - - - - - - - - - - -
    NameDescription

    userId

    Bearer Token

    +

    HTTP response

    +
    +
    +
    HTTP/1.1 200 OK
    +Content-Type: application/json
    +Content-Length: 102
    +
    +{
    +  "status" : 200,
    +  "code" : "200",
    +  "msg" : "UPDATE SUCCESS",
    +  "detailMsg" : "",
    +  "data" : { }
    +}
    +
    +
    +
    +
    +

    HTTPie request

    +
    +
    +
    $ echo '{
    +  "tripId" : 1,
    +  "startDate" : "2024-05-07",
    +  "endDate" : "2024-05-08",
    +  "tripName" : "test"
    +}' | http PUT 'http://localhost:8080/core/trip' \
    +    'Content-Type:application/json;charset=UTF-8' \
    +    'userId:1' \
    +    'Accept:application/json'
    +
    +
    @@ -3215,14 +3384,31 @@

    -

    HTTP response

    +

    Request headers

    + ++++ + + + + + + + + + + + + +
    NameDescription

    userId

    Bearer Token

    +
    +
    +

    Response body

    -
    HTTP/1.1 200 OK
    -Content-Type: application/json
    -Content-Length: 102
    -
    -{
    +
    {
       "status" : 200,
       "code" : "200",
       "msg" : "UPDATE SUCCESS",
    @@ -3280,15 +3466,85 @@ 

    여행 삭제

    -

    HTTP request

    +

    Curl request

    -
    DELETE /core/trip/1 HTTP/1.1
    -Content-Type: application/json;charset=UTF-8
    -userId: 1
    -Accept: application/json
    -Host: localhost:8080
    -
    +
    $ curl 'http://localhost:8080/core/trip/1' -i -X DELETE \
    +    -H 'Content-Type: application/json;charset=UTF-8' \
    +    -H 'userId: 1' \
    +    -H 'Accept: application/json'
    +
    +
    +

    +
    +

    HTTP request

    +
    +
    +
    DELETE /core/trip/1 HTTP/1.1
    +Content-Type: application/json;charset=UTF-8
    +userId: 1
    +Accept: application/json
    +Host: localhost:8080
    +
    +
    +
    +
    +

    HTTP response

    +
    +
    +
    HTTP/1.1 200 OK
    +Content-Type: application/json
    +Content-Length: 102
    +
    +{
    +  "status" : 200,
    +  "code" : "200",
    +  "msg" : "DELETE SUCCESS",
    +  "detailMsg" : "",
    +  "data" : { }
    +}
    +
    +
    +
    +
    +

    HTTPie request

    +
    +
    +
    $ http DELETE 'http://localhost:8080/core/trip/1' \
    +    'Content-Type:application/json;charset=UTF-8' \
    +    'userId:1' \
    +    'Accept:application/json'
    +
    +
    +
    +
    +

    Path parameters

    + + ++++ + + + + + + + + + + + + +
    Table 1. /core/trip/{tripId}
    ParameterDescription

    tripId

    삭제할 여행 ID

    +
    +
    +

    Request body

    +
    +
    +
    +
    @@ -3313,7 +3569,133 @@

    -

    Path parameters

    +

    Response body

    +
    +
    +
    {
    +  "status" : 200,
    +  "code" : "200",
    +  "msg" : "DELETE SUCCESS",
    +  "detailMsg" : "",
    +  "data" : { }
    +}
    +
    +
    +
    +
    +

    Response fields

    + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    PathTypeDescription

    status

    Number

    응답 상태 코드

    code

    String

    응답 코드

    msg

    String

    응답 메시지

    detailMsg

    String

    상세 메시지

    data

    Object

    데이터 없음

    +
    +
    +
    +

    여행 상세 조회

    +
    +

    Curl request

    +
    +
    +
    $ curl 'http://localhost:8080/core/trip/1' -i -X GET \
    +    -H 'Content-Type: application/json;charset=UTF-8' \
    +    -H 'userId: 1' \
    +    -H 'Accept: application/json'
    +
    +
    +
    +
    +

    HTTP request

    +
    +
    +
    GET /core/trip/1 HTTP/1.1
    +Content-Type: application/json;charset=UTF-8
    +userId: 1
    +Accept: application/json
    +Host: localhost:8080
    +
    +
    +
    +
    +

    HTTP response

    +
    +
    +
    HTTP/1.1 200 OK
    +Content-Type: application/json
    +Content-Length: 370
    +
    +{
    +  "status" : 200,
    +  "code" : "200",
    +  "msg" : "SELECT SUCCESS",
    +  "detailMsg" : "",
    +  "data" : {
    +    "id" : 1,
    +    "email" : "test",
    +    "startDate" : "2024-05-07",
    +    "endDate" : "2024-05-08",
    +    "analyzingCount" : 0,
    +    "tripName" : "test",
    +    "numOfCard" : 0,
    +    "happy" : 0.0,
    +    "sad" : 0.0,
    +    "angry" : 0.0,
    +    "neutral" : 0.0,
    +    "disgust" : 0.0
    +  }
    +}
    +
    +
    +
    +
    +

    HTTPie request

    +
    +
    +
    $ http GET 'http://localhost:8080/core/trip/1' \
    +    'Content-Type:application/json;charset=UTF-8' \
    +    'userId:1' \
    +    'Accept:application/json'
    +
    +
    +
    +
    +

    Path parameters

    @@ -3329,31 +3711,69 @@

    tripId

    -

    +
    Table 1. /core/trip/{tripId}

    삭제할 여행 ID

    조회할 여행 ID

    -

    HTTP response

    +

    Request body

    -
    HTTP/1.1 200 OK
    -Content-Type: application/json
    -Content-Length: 102
    -
    -{
    +
    +
    +
    +
    +
    +

    Request headers

    + ++++ + + + + + + + + + + + + +
    NameDescription

    userId

    Bearer Token

    +
    +
    +

    Response body

    +
    +
    +
    {
       "status" : 200,
       "code" : "200",
    -  "msg" : "DELETE SUCCESS",
    +  "msg" : "SELECT SUCCESS",
       "detailMsg" : "",
    -  "data" : { }
    +  "data" : {
    +    "id" : 1,
    +    "email" : "test",
    +    "startDate" : "2024-05-07",
    +    "endDate" : "2024-05-08",
    +    "analyzingCount" : 0,
    +    "tripName" : "test",
    +    "numOfCard" : 0,
    +    "happy" : 0.0,
    +    "sad" : 0.0,
    +    "angry" : 0.0,
    +    "neutral" : 0.0,
    +    "disgust" : 0.0
    +  }
     }
    -

    Response fields

    +

    Response fields

    @@ -3389,9 +3809,64 @@

    상세 메시지

    - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    data

    Object

    데이터 없음

    data.id

    Number

    여행 ID

    data.email

    String

    유저 email

    data.startDate

    String

    출발일

    data.endDate

    String

    도착일

    data.analyzingCount

    Number

    분석 중 파일 개수

    data.tripName

    String

    여행 이름

    data.numOfCard

    Number

    카드뷰 개수

    data.happy

    Number

    행복한 감정 비율

    data.sad

    Number

    슬픈 감정 비율

    data.angry

    Number

    화난 감정 비율

    data.neutral

    Number

    중립적인 감정 비율

    data.disgust

    Number

    역겨운 감정 비율

    @@ -4185,7 +4660,7 @@

    HTTP/1.1 200 OK
     Content-Type: application/json
    -Content-Length: 512
    +Content-Length: 584
     
     {
       "status" : 200,
    @@ -4197,20 +4672,23 @@ 

    @@ -4292,20 +4770,23 @@

    @@ -4373,6 +4854,11 @@

    Number

    분석 중 파일 개수

    + +

    data.tripFiles[].totalCount

    +

    Number

    +

    전체 파일 개수

    +

    @@ -4406,7 +4892,7 @@

    HTTP/1.1 200 OK
     Content-Type: application/json
    -Content-Length: 512
    +Content-Length: 584
     
     {
       "status" : 200,
    @@ -4418,20 +4904,23 @@ 

    @@ -4491,20 +4980,23 @@

    @@ -4572,6 +5064,11 @@

    Number

    분석 중 파일 개수

    + +

    data.tripFiles[].totalCount

    +

    Number

    +

    전체 파일 개수

    +