Skip to content

Commit

Permalink
id type change
Browse files Browse the repository at this point in the history
  • Loading branch information
Danushka96 committed Dec 1, 2024
1 parent ca8e743 commit f33be4a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ type User struct {
Name string `bson:"name"`
}

func (u User) GetID() interface{} { return u.ID }
func (u User) GetID() string { return u.ID }
func (u User) SetID(id interface{}) { u.ID = id.(string) }
func (u *User) GetCollectionName() string { return "users" }

Expand Down
2 changes: 1 addition & 1 deletion example/internal/model/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type Post struct {
UpdatedAt time.Time `bson:"updated_at" json:"updatedAt"`
}

func (p Post) GetID() interface{} {
func (p Post) GetID() string {
return p.ID
}

Expand Down
2 changes: 1 addition & 1 deletion mongo_document.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ginboot

type Document interface {
GetID() interface{}
GetID() string
GetCollectionName() string
}

0 comments on commit f33be4a

Please sign in to comment.