-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. config enf file 통일 2. model선언(jsonb_build_object배열 받기위해서 category, hashtag의 scan/value implements)
- Loading branch information
1 parent
d92a0c9
commit 725be5f
Showing
26 changed files
with
183 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
Oops, something went wrong.