Skip to content

Commit

Permalink
Merge pull request #164 from JokerTrickster/improvement/163/recommend…
Browse files Browse the repository at this point in the history
…_api

{improvement} - 요청 프로퍼티 수정 \n #163
  • Loading branch information
JokerTrickster authored Oct 2, 2024
2 parents be920b6 + 4e9b4f8 commit 4fa1ba4
Show file tree
Hide file tree
Showing 11 changed files with 150 additions and 108 deletions.
20 changes: 10 additions & 10 deletions src/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -962,27 +962,27 @@ const docTemplate = `{
"request.ReqRecommendFood": {
"type": "object",
"properties": {
"flavor": {
"flavors": {
"type": "string",
"example": "매운맛"
},
"previousAnswer": {
"type": "string",
"example": "김치찌개 떡볶이 치킨"
},
"scenario": {
"scenarios": {
"type": "string",
"example": "혼밥"
},
"theme": {
"themes": {
"type": "string",
"example": "스트레스 해소"
},
"time": {
"times": {
"type": "string",
"example": "점심"
},
"type": {
"types": {
"type": "string",
"example": "한식"
}
Expand Down Expand Up @@ -1021,28 +1021,28 @@ const docTemplate = `{
"request.ReqSelectFood": {
"type": "object",
"properties": {
"flavor": {
"flavors": {
"type": "string",
"example": "매운맛"
},
"name": {
"type": "string",
"example": "된장찌개"
},
"scenario": {
"scenarios": {
"description": "전체 , 혼밥, 가족, 친구들",
"type": "string",
"example": "혼밥"
},
"theme": {
"themes": {
"type": "string",
"example": "스트레스 해소"
},
"time": {
"times": {
"type": "string",
"example": "점심"
},
"type": {
"types": {
"description": "전체, 양식, 한식, 중식 등",
"type": "string",
"example": "한식"
Expand Down
20 changes: 10 additions & 10 deletions src/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -951,27 +951,27 @@
"request.ReqRecommendFood": {
"type": "object",
"properties": {
"flavor": {
"flavors": {
"type": "string",
"example": "매운맛"
},
"previousAnswer": {
"type": "string",
"example": "김치찌개 떡볶이 치킨"
},
"scenario": {
"scenarios": {
"type": "string",
"example": "혼밥"
},
"theme": {
"themes": {
"type": "string",
"example": "스트레스 해소"
},
"time": {
"times": {
"type": "string",
"example": "점심"
},
"type": {
"types": {
"type": "string",
"example": "한식"
}
Expand Down Expand Up @@ -1010,28 +1010,28 @@
"request.ReqSelectFood": {
"type": "object",
"properties": {
"flavor": {
"flavors": {
"type": "string",
"example": "매운맛"
},
"name": {
"type": "string",
"example": "된장찌개"
},
"scenario": {
"scenarios": {
"description": "전체 , 혼밥, 가족, 친구들",
"type": "string",
"example": "혼밥"
},
"theme": {
"themes": {
"type": "string",
"example": "스트레스 해소"
},
"time": {
"times": {
"type": "string",
"example": "점심"
},
"type": {
"types": {
"description": "전체, 양식, 한식, 중식 등",
"type": "string",
"example": "한식"
Expand Down
20 changes: 10 additions & 10 deletions src/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ definitions:
type: object
request.ReqRecommendFood:
properties:
flavor:
flavors:
example: 매운맛
type: string
previousAnswer:
example: 김치찌개 떡볶이 치킨
type: string
scenario:
scenarios:
example: 혼밥
type: string
theme:
themes:
example: 스트레스 해소
type: string
time:
times:
example: 점심
type: string
type:
types:
example: 한식
type: string
type: object
Expand All @@ -51,23 +51,23 @@ definitions:
type: object
request.ReqSelectFood:
properties:
flavor:
flavors:
example: 매운맛
type: string
name:
example: 된장찌개
type: string
scenario:
scenarios:
description: 전체 , 혼밥, 가족, 친구들
example: 혼밥
type: string
theme:
themes:
example: 스트레스 해소
type: string
time:
times:
example: 점심
type: string
type:
types:
description: 전체, 양식, 한식, 중식 등
example: 한식
type: string
Expand Down
12 changes: 6 additions & 6 deletions src/features/food/handler/recommendFoodHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ func (d *RecommendFoodHandler) Recommend(c echo.Context) error {

//business logic
entity := entity.RecommendFoodEntity{
Type: req.Type,
Scenario: req.Scenario,
Time: req.Time,
Theme: req.Theme,
Flavor: req.Flavor,
UserID: uID,
Types: req.Types,
Scenarios: req.Scenarios,
Times: req.Times,
Themes: req.Themes,
Flavors: req.Flavors,
UserID: uID,
}
if req.PreviousAnswer != "" {
entity.PreviousAnswer = req.PreviousAnswer
Expand Down
10 changes: 5 additions & 5 deletions src/features/food/handler/selectFoodHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ func (d *SelectFoodHandler) Select(c echo.Context) error {

//business logic
e := entity.SelectFoodEntity{
Type: req.Type,
Time: req.Time,
Types: req.Types,
Times: req.Times,
Name: req.Name,
Theme: req.Theme,
Flavor: req.Flavor,
Scenario: req.Scenario,
Themes: req.Themes,
Flavors: req.Flavors,
Scenarios: req.Scenarios,
UserID: uID,
}

Expand Down
10 changes: 5 additions & 5 deletions src/features/food/model/entity/recommendFoodEntity.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package entity

type RecommendFoodEntity struct {
Type string `json:"type"`
Scenario string `json:"scenario"`
Time string `json:"time"`
Theme string `json:"theme"`
Flavor string `json:"flavor"`
Types string `json:"types"`
Scenarios string `json:"scenarios"`
Times string `json:"times"`
Themes string `json:"themes"`
Flavors string `json:"flavors"`
UserID uint `json:"userID"`
PreviousAnswer string `json:"previousAnswer"`
}
Expand Down
14 changes: 7 additions & 7 deletions src/features/food/model/entity/selectFoodEntity.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package entity

type SelectFoodEntity struct {
Type string `json:"type"`
Scenario string `json:"scenario"`
Time string `json:"time"`
Theme string `json:"theme"`
Flavor string `json:"flavor"`
Name string `json:"name"`
UserID uint `json:"userID"`
Types string `json:"types"`
Scenarios string `json:"scenarios"`
Times string `json:"times"`
Themes string `json:"themes"`
Flavors string `json:"flavors"`
Name string `json:"name"`
UserID uint `json:"userID"`
}
10 changes: 5 additions & 5 deletions src/features/food/model/request/recommendFood.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package request

type ReqRecommendFood struct {
Type string `json:"type" example:"한식"`
Scenario string `json:"scenario" example:"혼밥"`
Time string `json:"time" example:"점심"`
Theme string `json:"theme" example:"스트레스 해소"`
Flavor string `json:"flavor" example:"매운맛"`
Types string `json:"types" example:"한식"`
Scenarios string `json:"scenarios" example:"혼밥"`
Times string `json:"times" example:"점심"`
Themes string `json:"themes" example:"스트레스 해소"`
Flavors string `json:"flavors" example:"매운맛"`
PreviousAnswer string `json:"previousAnswer" example:"김치찌개 떡볶이 치킨"`
}
12 changes: 6 additions & 6 deletions src/features/food/model/request/selectFood.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package request

type ReqSelectFood struct {
Type string `json:"type" example:"한식"` // 전체, 양식, 한식, 중식 등
Scenario string `json:"scenario" example:"혼밥"` // 전체 , 혼밥, 가족, 친구들
Time string `json:"time" example:"점심"`
Theme string `json:"theme" example:"스트레스 해소"`
Flavor string `json:"flavor" example:"매운맛"`
Name string `json:"name" example:"된장찌개"`
Types string `json:"types" example:"한식"` // 전체, 양식, 한식, 중식 등
Scenarios string `json:"scenarios" example:"혼밥"` // 전체 , 혼밥, 가족, 친구들
Times string `json:"times" example:"점심"`
Themes string `json:"themes" example:"스트레스 해소"`
Flavors string `json:"flavors" example:"매운맛"`
Name string `json:"name" example:"된장찌개"`
}
Loading

0 comments on commit 4fa1ba4

Please sign in to comment.