diff --git a/api/_build/api-server.yaml b/api/_build/api-server.yaml index 2cfa9e8..7da3a01 100644 --- a/api/_build/api-server.yaml +++ b/api/_build/api-server.yaml @@ -952,17 +952,17 @@ components: x-oapi-codegen-extra-tags: db: updated_at hashtags: - x-go-type: pq.StringArray - x-go-type-import: - path: github.com/lib/pq + type: array + x-oapi-codegen-extra-tags: + db: hashtags items: $ref: '#/components/schemas/HashtagGet' categories: - x-go-type: pq.StringArray - x-go-type-import: - path: github.com/lib/pq + type: array + x-oapi-codegen-extra-tags: + db: categories items: - $ref: '#/components/schemas/HashtagGet' + $ref: '#/components/schemas/CategoryGet' user: $ref: '#/components/schemas/HomeSimpleUser' HomeSimpleUser: diff --git a/api/api-server/schemas/home/get.yaml b/api/api-server/schemas/home/get.yaml index c2f3525..4451364 100644 --- a/api/api-server/schemas/home/get.yaml +++ b/api/api-server/schemas/home/get.yaml @@ -32,17 +32,17 @@ properties: x-oapi-codegen-extra-tags: db: "updated_at" hashtags: - x-go-type: pq.StringArray - x-go-type-import: - path: "github.com/lib/pq" + type: array + x-oapi-codegen-extra-tags: + db: "hashtags" items: $ref: '../hashtags/get.yaml' categories: - x-go-type: pq.StringArray - x-go-type-import: - path: "github.com/lib/pq" + type: array + x-oapi-codegen-extra-tags: + db: "categories" items: - $ref: '../hashtags/get.yaml' + $ref: '../categories/get.yaml' user: $ref: './user.yaml' diff --git a/cmd/api-server/api-server b/cmd/api-server/api-server index 2829cd1..4cce9b6 100755 Binary files a/cmd/api-server/api-server and b/cmd/api-server/api-server differ diff --git a/cmd/api-server/internal/repository/MentorProfileRepository.go b/cmd/api-server/internal/repository/MentorProfileRepository.go index 8d4f7ff..a3335f1 100644 --- a/cmd/api-server/internal/repository/MentorProfileRepository.go +++ b/cmd/api-server/internal/repository/MentorProfileRepository.go @@ -5,19 +5,19 @@ import ( query "golang-with-k8s/cmd/api-server/internal/repository/internal" "golang-with-k8s/generated/api_server" "golang-with-k8s/pkg/database" + "golang-with-k8s/pkg/models" ) -func SearchMentor(searchString *api_server.SearchStringPath, params *api_server.GetSearchMentorSearchStringParams) (*[]api_server.HomeGet, error) { - - result := []api_server.HomeGet{} +func MentorProfileSearch(searchString *api_server.SearchStringPath, params *api_server.GetSearchMentorSearchStringParams) (*[]models.HomeGet, error) { + result := []models.HomeGet{} db := database.SqlX sql := query.GetSearchMentorWhereQuery(searchString, params) sql += query.GetSearchMentorGroupbyQuery() + fmt.Println(sql) err := db.Select(&result, sql, false, "%"+string(*searchString)+"%", params.Take, params.Take*params.Page) if err != nil { - fmt.Println(err) return nil, err } return &result, nil diff --git a/cmd/api-server/internal/repository/UserRepository.go b/cmd/api-server/internal/repository/UserRepository.go index e8fb255..c63b3d7 100644 --- a/cmd/api-server/internal/repository/UserRepository.go +++ b/cmd/api-server/internal/repository/UserRepository.go @@ -11,9 +11,9 @@ import ( "github.com/lib/pq" ) -func GetUsers(params *api_server.GetUsersParams) (*[]models.User, error) { +func GetUsers(params *api_server.GetUsersParams) (*[]models.UserGet, error) { - users := []models.User{} + users := []models.UserGet{} sql := query.GetUsers @@ -27,8 +27,8 @@ func GetUsers(params *api_server.GetUsersParams) (*[]models.User, error) { return &users, err } -func GetUserById(id *api_server.IdPath) (*api_server.UserGet, error) { - var user api_server.UserGet +func GetUserById(id *api_server.IdPath) (*models.UserGet, error) { + var user models.UserGet sql := query.GetUserById @@ -41,10 +41,10 @@ func GetUserById(id *api_server.IdPath) (*api_server.UserGet, error) { return &user, err } -func GetUsersIdReservations(id *api_server.IdPath, params *api_server.GetUsersIdReservationsParams) (*api_server.UserReservationPagination, error) { +func GetUsersIdReservations(id *api_server.IdPath, params *api_server.GetUsersIdReservationsParams) (*models.UserReservationPagination, error) { - result := api_server.UserReservationPagination{} - reservations := []api_server.ReservationGet{} + result := models.UserReservationPagination{} + reservations := []models.ReservationGet{} var page *api_server.Page db := database.SqlX @@ -71,8 +71,8 @@ func GetUsersIdReservations(id *api_server.IdPath, params *api_server.GetUsersId return &result, nil } -func PatchUser(id *api_server.IdPath, body *api_server.PatchUsersIdJSONRequestBody) (*api_server.UserGet, error) { - var user api_server.UserGet +func PatchUser(id *api_server.IdPath, body *api_server.PatchUsersIdJSONRequestBody) (*models.UserGet, error) { + var user models.UserGet sql := query.PatchUser diff --git a/cmd/api-server/internal/repository/internal/mentorProfileQuery.go b/cmd/api-server/internal/repository/internal/mentorProfileQuery.go index 54cb69e..1484814 100644 --- a/cmd/api-server/internal/repository/internal/mentorProfileQuery.go +++ b/cmd/api-server/internal/repository/internal/mentorProfileQuery.go @@ -14,8 +14,8 @@ const ( m.created_at as created_at, m.updated_at as updated_at, m.ishide as is_hide, - array_agg(DISTINCT c.name) FILTER (WHERE c.name IS NOT NULL) as "categories", - array_agg(DISTINCT h.tag_name) FILTER (WHERE h.tag_name IS NOT NULL) as "hashtags", + json_agg(DISTINCT jsonb_build_object('id', c.id, 'name', c.name)) FILTER (WHERE c.name IS NOT NULL) as "categories", + json_agg(DISTINCT jsonb_build_object('id', h.id, 'name', h.tag_name)) FILTER (WHERE h.tag_name IS NOT NULL) as "hashtags", u.id as "user.id", u.nickname as "user.nickname", u.profile_image as "user.profile_image" diff --git a/cmd/api-server/internal/repository/internal/userQuery.go b/cmd/api-server/internal/repository/internal/userQuery.go index 1398d4a..33c0e51 100644 --- a/cmd/api-server/internal/repository/internal/userQuery.go +++ b/cmd/api-server/internal/repository/internal/userQuery.go @@ -19,8 +19,8 @@ const ( mp.mentoring_count as "mentorprofile.mentoring_count", mp.isHide as "mentorprofile.isHide", mp.shortDescription as "mentorprofile.shortDescription", - array_agg(DISTINCT c.name) FILTER (WHERE c.name IS NOT NULL) as "mentorprofile.categories", - array_agg(DISTINCT h.tag_name) FILTER (WHERE h.tag_name IS NOT NULL) as "mentorprofile.hashtags" + json_agg(DISTINCT jsonb_build_object('id', c.id, 'name', c.name)) FILTER (WHERE c.name IS NOT NULL) as "mentorprofile.categories", + json_agg(DISTINCT jsonb_build_object('id', h.id, 'name', h.tag_name)) FILTER (WHERE h.tag_name IS NOT NULL) as "mentorprofile.hashtags", FROM users u right join mentor_profiles mp on mp.user_id = u.id left join _profiles_categories pc on pc.B = mp.id @@ -46,8 +46,8 @@ const ( mp.mentoring_count as "mentorprofile.mentoring_count", mp.isHide as "mentorprofile.isHide", mp.shortDescription as "mentorprofile.shortDescription", - array_agg(DISTINCT c.name) FILTER (WHERE c.name IS NOT NULL) as "mentorprofile.categories", - array_agg(DISTINCT h.tag_name) FILTER (WHERE h.tag_name IS NOT NULL) as "mentorprofile.hashtags" + json_agg(DISTINCT jsonb_build_object('id', c.id, 'name', c.name)) FILTER (WHERE c.name IS NOT NULL) as "mentorprofile.categories", + json_agg(DISTINCT jsonb_build_object('id', h.id, 'name', h.tag_name)) FILTER (WHERE h.tag_name IS NOT NULL) as "mentorprofile.hashtags", FROM users u right join mentor_profiles mp on mp.user_id = u.id left join _profiles_categories pc on pc.B = mp.id @@ -86,7 +86,7 @@ const ( cr.requested_user_id as "cancelreason.requested_user_id", c.id as "category.id", c.name as "category.name", - array_agg(DISTINCT h.tag_name) FILTER (WHERE h.tag_name IS NOT NULL) as "hashtags" + json_agg(DISTINCT jsonb_build_object('id', h.id, 'name', h.tag_name)) FILTER (WHERE h.tag_name IS NOT NULL) as "hashtags", from reservations r right join mentor_profiles mp on mp.user_id = r.mentor_id left join _profiles_categories pc on pc.B = mp.id diff --git a/cmd/api-server/internal/service/SearchService.go b/cmd/api-server/internal/service/SearchService.go index 4ae592b..91199e9 100644 --- a/cmd/api-server/internal/service/SearchService.go +++ b/cmd/api-server/internal/service/SearchService.go @@ -3,8 +3,9 @@ package service import ( "golang-with-k8s/cmd/api-server/internal/repository" "golang-with-k8s/generated/api_server" + "golang-with-k8s/pkg/models" ) -func MentorSearchString(searchString *api_server.SearchStringPath, params *api_server.GetSearchMentorSearchStringParams) (*[]api_server.HomeGet, error) { - return repository.SearchMentor(searchString, params) +func MentorSearchString(searchString *api_server.SearchStringPath, params *api_server.GetSearchMentorSearchStringParams) (*[]models.HomeGet, error) { + return repository.MentorProfileSearch(searchString, params) } diff --git a/cmd/api-server/internal/service/UserService.go b/cmd/api-server/internal/service/UserService.go index 21ebab9..3ea6ed2 100644 --- a/cmd/api-server/internal/service/UserService.go +++ b/cmd/api-server/internal/service/UserService.go @@ -6,18 +6,18 @@ import ( "golang-with-k8s/pkg/models" ) -func GetUsersService(param *api_server.GetUsersParams) (*[]models.User, error) { +func GetUsersService(param *api_server.GetUsersParams) (*[]models.UserGet, error) { return repository.GetUsers(param) } -func GetUserByIdService(id *api_server.IdPath) (*api_server.UserGet, error) { +func GetUserByIdService(id *api_server.IdPath) (*models.UserGet, error) { return repository.GetUserById(id) } -func GetUsersIdReservationService(id *api_server.IdPath, params *api_server.GetUsersIdReservationsParams) (*api_server.UserReservationPagination, error) { +func GetUsersIdReservationService(id *api_server.IdPath, params *api_server.GetUsersIdReservationsParams) (*models.UserReservationPagination, error) { return repository.GetUsersIdReservations(id, params) } -func PatchUserService(id *api_server.IdPath, body *api_server.PatchUsersIdJSONRequestBody) (*api_server.UserGet, error) { +func PatchUserService(id *api_server.IdPath, body *api_server.PatchUsersIdJSONRequestBody) (*models.UserGet, error) { return repository.PatchUser(id, body) } diff --git a/deployments/api-server.yaml b/deployments/api-server.yaml new file mode 100644 index 0000000..e69de29 diff --git a/generated/api_server/server.gen.go b/generated/api_server/server.gen.go index 54988d5..c7654d4 100644 --- a/generated/api_server/server.gen.go +++ b/generated/api_server/server.gen.go @@ -131,10 +131,10 @@ type HashtagUpdateBody struct { // HomeGet defines model for HomeGet. type HomeGet struct { - Categories *pq.StringArray `json:"categories,omitempty"` + Categories *[]CategoryGet `db:"categories" json:"categories,omitempty"` CreatedAt *time.Time `db:"created_at" json:"createdAt,omitempty"` Description *string `db:"description" json:"description,omitempty"` - Hashtags *pq.StringArray `json:"hashtags,omitempty"` + Hashtags *[]HashtagGet `db:"hashtags" json:"hashtags,omitempty"` Id *int32 `db:"id" json:"id,omitempty"` IsHide *bool `db:"is_hide" json:"isHide,omitempty"` MentoringCount *int `db:"mentoring_count" json:"mentoringCount,omitempty"` diff --git a/pkg/config/config.go b/pkg/config/config.go index 49777f2..90bd629 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -39,14 +39,17 @@ func (c *config) initConfig() { func init() { ConfigInstance = new(config) ConfigInstance.initConfig() + var envFilePath string + + deploy_mode := os.Getenv("ENVIROMENT") + if deploy_mode == "production" { + envFilePath = ".env.prod" + } else { + envFilePath = ".env.dev" + } - envFilePath := ".env.auth" ConfigInstance.loadEnvfile(&envFilePath, []string{"GOOGLE_CLIENT_ID", "GOOGLE_CLIENT_SECRET", "GOOGLE_LOGIN_CALLBACK"}) ConfigInstance.loadEnvfile(&envFilePath, []string{"FT_CLIENT_ID", "FT_CLIENT_SECRET", "FT_LOGIN_CALLBACK"}) - - envFilePath = ".env.db" ConfigInstance.loadEnvfile(&envFilePath, []string{"URL"}) - - envFilePath = ".env.secrets" ConfigInstance.loadEnvfile(&envFilePath, []string{"SESSION_SECRET"}) } diff --git a/pkg/models/cancel_reason.go b/pkg/models/cancel_reason.go index 0f1ac23..71cd99c 100644 --- a/pkg/models/cancel_reason.go +++ b/pkg/models/cancel_reason.go @@ -2,12 +2,9 @@ package models import "time" -type CancelReason struct { - ID int - Content string - CreatedAt time.Time - RequestUser User - RequestedUserId int - Reservation Reservation - ReservationId int +type ReservationCancelReason struct { + Content *string `db:"content" json:"content,omitempty"` + CreatedAt *time.Time `db:"created_at" json:"createdAt,omitempty"` + RequestedUserId *int32 `db:"requested_user_id" json:"requestedUserId,omitempty"` + ReservationId *int32 `db:"reservation_id" json:"reservationId,omitempty"` } diff --git a/pkg/models/category.go b/pkg/models/category.go index 6c98d47..7069763 100644 --- a/pkg/models/category.go +++ b/pkg/models/category.go @@ -1,8 +1,26 @@ package models -type Category struct { - ID int `db:"id"` - Name string `db:"name"` - MentorProfiles []MentorProfile - Reservations []Reservation +import ( + "database/sql/driver" + "encoding/json" + "golang-with-k8s/generated/api_server" +) + +type CategorySlices []*api_server.CategoryGet + +func (s CategorySlices) Value() (driver.Value, error) { + return json.Marshal(s) +} + +func (s *CategorySlices) Scan(src interface{}) error { + var data []byte + switch v := src.(type) { + case string: + data = []byte(v) + case []byte: + data = v + default: + return nil + } + return json.Unmarshal(data, s) } diff --git a/pkg/models/consts.go b/pkg/models/consts.go deleted file mode 100644 index 1ff349d..0000000 --- a/pkg/models/consts.go +++ /dev/null @@ -1,15 +0,0 @@ -package models - -const ( - ADMIN UserRole = "admin" - USER UserRole = "user" -) - -const ( - REQUEST ReservationStatus = "REQUEST" - ACCEPT ReservationStatus = "ACCEPT" - CANCEL ReservationStatus = "CANCEL" - MENTEE_CHECKED ReservationStatus = "MENTEE_CHECKED" - MENTEE_FEEDBACK ReservationStatus = "MENTEE_FEEDBACK" - DONE ReservationStatus = "DONE" -) diff --git a/pkg/models/hashtag.go b/pkg/models/hashtag.go index 478aea0..f779bb7 100644 --- a/pkg/models/hashtag.go +++ b/pkg/models/hashtag.go @@ -1,8 +1,27 @@ package models -type Hashtag struct { - ID int `db:"id"` - Name string `db:"tag_name"` - MentorProfile []MentorProfile - Reservations []Reservation +import ( + "database/sql/driver" + "encoding/json" + "golang-with-k8s/generated/api_server" +) + +type HashtagSlices []*api_server.HashtagGet + +func (s HashtagSlices) Value() (driver.Value, error) { + return json.Marshal(s) + +} + +func (s *HashtagSlices) Scan(src interface{}) error { + var data []byte + switch v := src.(type) { + case string: + data = []byte(v) + case []byte: + data = v + default: + return nil + } + return json.Unmarshal(data, s) } diff --git a/pkg/models/home.go b/pkg/models/home.go new file mode 100644 index 0000000..7ae7750 --- /dev/null +++ b/pkg/models/home.go @@ -0,0 +1,20 @@ +package models + +import ( + "golang-with-k8s/generated/api_server" + "time" +) + +// HomeGet defines model for HomeGet. +type HomeGet struct { + Categories CategorySlices `db:"categories" json:"categories,omitempty"` + CreatedAt *time.Time `db:"created_at" json:"createdAt,omitempty"` + Description *string `db:"description" json:"description,omitempty"` + Hashtags HashtagSlices `db:"hashtags" json:"hashtags,omitempty"` + Id *int32 `db:"id" json:"id,omitempty"` + IsHide *bool `db:"is_hide" json:"isHide,omitempty"` + MentoringCount *int `db:"mentoring_count" json:"mentoringCount,omitempty"` + ShortDescription *string `db:"short_description" json:"shortDescription,omitempty"` + UpdatedAt *time.Time `db:"updated_at" json:"updatedAt,omitempty"` + User *api_server.HomeSimpleUser `json:"user,omitempty"` +} diff --git a/pkg/models/mentee_feedback.go b/pkg/models/mentee_feedback.go index f2b3e32..2640e7f 100644 --- a/pkg/models/mentee_feedback.go +++ b/pkg/models/mentee_feedback.go @@ -1,17 +1 @@ package models - -import "time" - -type MenteeFeedback struct { - ID int - Mentee User - MenteeId int - Mentor User - MentorId int - Reservation Reservation - ReservationId int - Rating float64 - Content *string - CreatedAt time.Time - UpdatedAt *time.Time -} diff --git a/pkg/models/mentor_feedback.go b/pkg/models/mentor_feedback.go index 3133ad7..2640e7f 100644 --- a/pkg/models/mentor_feedback.go +++ b/pkg/models/mentor_feedback.go @@ -1,16 +1 @@ package models - -import "time" - -type MentorFeedback struct { - ID int - Mentee User - MenteeId int - Mentor User - MentorId int - Reservation Reservation - ReservationId int - Rating float64 - CreatedAt time.Time - UpdatedAt *time.Time -} diff --git a/pkg/models/mentor_profile.go b/pkg/models/mentor_profile.go index 2627d83..f9dfdc9 100644 --- a/pkg/models/mentor_profile.go +++ b/pkg/models/mentor_profile.go @@ -2,8 +2,6 @@ package models import ( "time" - - "github.com/lib/pq" ) type MentorProfile struct { @@ -15,6 +13,20 @@ type MentorProfile struct { CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at"` UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at"` SocialLink *string `json:"socialLink,omitempty" db:"socialLink"` - Hashtags pq.StringArray `json:"hashtags,omitempty" db:"hashtags"` - Categories pq.StringArray `json:"categories,omitempty" db:"categories"` + Categories CategorySlices `db:"categories" json:"categories,omitempty"` + Hashtags HashtagSlices `db:"hashtags" json:"hashtags,omitempty"` +} + +// MentorProfileSimpleGet defines model for MentorProfileSimpleGet. +type MentorProfileSimpleGet struct { + Categories CategorySlices `db:"categories" json:"categories,omitempty"` + CreatedAt *time.Time `db:"created_at" json:"createdAt,omitempty"` + Description *string `db:"description" json:"description,omitempty"` + Hashtags HashtagSlices `db:"hashtags" json:"hashtags,omitempty"` + Id *int32 `db:"id" json:"id,omitempty"` + IsHide *bool `db:"isHide" json:"isHide,omitempty"` + MentoringCount *int `db:"mentoring_count" json:"mentoringCount,omitempty"` + ShortDescription *string `db:"shortDescription" json:"shortDescription,omitempty"` + SocialLink *string `db:"socialLink" json:"socialLink,omitempty"` + UpdatedAt *time.Time `db:"updated_at" json:"updatedAt,omitempty"` } diff --git a/pkg/models/profiles_categories.go b/pkg/models/profiles_categories.go deleted file mode 100644 index ac3e81d..0000000 --- a/pkg/models/profiles_categories.go +++ /dev/null @@ -1,6 +0,0 @@ -package models - -type ProfilesCategories struct { - ProfileId int `db:"A"` - CategoryId int `db:"B"` -} diff --git a/pkg/models/profiles_hashtags.go b/pkg/models/profiles_hashtags.go deleted file mode 100644 index 1e078f3..0000000 --- a/pkg/models/profiles_hashtags.go +++ /dev/null @@ -1,6 +0,0 @@ -package models - -type ProfilesHashtags struct { - ProfileId int `db:A` - HashtagId int `db:B` -} diff --git a/pkg/models/reservation.go b/pkg/models/reservation.go index 1a1c570..d931ee9 100644 --- a/pkg/models/reservation.go +++ b/pkg/models/reservation.go @@ -1,21 +1,32 @@ package models -import "time" +import ( + "golang-with-k8s/generated/api_server" + "time" -type Reservation struct { - ID int - Mentor User - MentorId int - Mentee User - MenteeId int - Category Category - CategoryId int - RequestMessage *string - Status ReservationStatus - CreatedAt time.Time - UpdatedAt *time.Time - Hashtags []Hashtag - MentorFeedback *MentorFeedback - MenteeFeedback *MenteeFeedback - CancelReason *CancelReason + "github.com/lib/pq" +) + +// UserReservationPagination defines model for UserReservationPagination. +type UserReservationPagination struct { + Content *[]ReservationGet `json:"content,omitempty"` + Page *api_server.Page `json:"page,omitempty"` +} + +// ReservationGet defines model for ReservationGet. +type ReservationGet struct { + CancelReason *ReservationCancelReason `json:"cancelReason,omitempty"` + Category CategorySlices `json:"category,omitempty"` + CreatedAt *time.Time `db:"created_at" json:"createdAt,omitempty"` + Hashtags *pq.StringArray `json:"hashtags,omitempty"` + + // Id reservation id + Id *int32 `db:"id" json:"id,omitempty"` + MenteeFeedback *api_server.MenteeFeedbackGet `json:"menteeFeedback,omitempty"` + MenteeId *int32 `db:"mentee_id" json:"menteeId,omitempty"` + MentorFeedback *api_server.MentorFeedbackGet `json:"mentorFeedback,omitempty"` + MentorId *int32 `db:"mentor_id" json:"mentorId,omitempty"` + RequestMessage *string `db:"request_message" json:"requestMessage,omitempty"` + Status *api_server.ReservationGetStatus `db:"status" json:"status,omitempty"` + UpdatedAt *time.Time `db:"updated_at" json:"updatedAt,omitempty"` } diff --git a/pkg/models/reservations_hashtags.go b/pkg/models/reservations_hashtags.go deleted file mode 100644 index ea9c9c0..0000000 --- a/pkg/models/reservations_hashtags.go +++ /dev/null @@ -1,6 +0,0 @@ -package models - -type ReservationsHashtags struct { - ReservationId int `db:"A"` - HashtagId int `db:"B"` -} diff --git a/pkg/models/types.go b/pkg/models/types.go deleted file mode 100644 index d302f58..0000000 --- a/pkg/models/types.go +++ /dev/null @@ -1,5 +0,0 @@ -package models - -type UserRole string - -type ReservationStatus string diff --git a/pkg/models/user.go b/pkg/models/user.go index fa499e9..d263f44 100644 --- a/pkg/models/user.go +++ b/pkg/models/user.go @@ -1,16 +1,23 @@ package models import ( + "golang-with-k8s/generated/api_server" "time" + + openapi_types "github.com/oapi-codegen/runtime/types" ) -type User struct { - ID int `json:"id,omitempty" db:"id"` - Email *string `json:"email,omitempty" db:"email"` - Nickname *string `json:"nickname,omitempty" db:"nickname"` - ProfileImage *string `json:"profileImage,omitempty" db:"profile_image"` - Role *UserRole `json:"role,omitempty" db:"role"` - CreatedAt *time.Time `json:"createdAt,omitempty" db:"created_at"` - UpdatedAt *time.Time `json:"updatedAt,omitempty" db:"updated_at"` - MentorProfile *MentorProfile `json:"mentorProfile,omitempty"` +//Implement user_get. + +type UserGet struct { + CreatedAt *time.Time `db:"created_at" json:"createdAt,omitempty"` + Email *openapi_types.Email `db:"email" json:"email,omitempty"` + Id *int32 `db:"id" json:"id,omitempty"` + MentorProfile *MentorProfileSimpleGet `json:"mentorProfile,omitempty"` + Nickname *string `db:"nickname" json:"nickname,omitempty"` + ProfileImage *string `db:"profile_image" json:"profileImage,omitempty"` + + // Role required + Role *api_server.UserGetRole `db:"role" json:"role,omitempty"` + UpdatedAt *time.Time `db:"updated_at" json:"updatedAt,omitempty"` }