diff --git a/infra/db/converter.go b/infra/db/converter.go index 99a2c5b..3e23bae 100644 --- a/infra/db/converter.go +++ b/infra/db/converter.go @@ -22,11 +22,6 @@ func ConvCreateRoomParamsToRoom(src CreateRoomParams) (dst Room) { return } -// func ConvEventAdminToRoomAdmin(src EventAdmin) (dst RoomAdmin) { -// dst.UserID = src.UserID -// return -// } - func ConvEventAdminTodomainUser(src EventAdmin) (dst domain.User) { dst.ID = src.UserID return @@ -101,10 +96,6 @@ func ConvGroupTodomainGroup(src Group) (dst domain.Group) { (*dst.Model.DeletedAt) = convgormDeletedAtTotimeTime(src.Model.DeletedAt) return } -// func ConvRoomAdminTodomainUser(src RoomAdmin) (dst domain.User) { -// dst.ID = src.UserID -// return -// } func ConvRoomTodomainRoom(src Room) (dst domain.Room) { dst.ID = src.ID @@ -128,14 +119,6 @@ func ConvRoomTodomainRoom(src Room) (dst domain.Room) { return } -// func ConvSEventAdminToSRoomAdmin(src []EventAdmin) (dst []RoomAdmin) { -// dst = make([]RoomAdmin, len(src)) -// for i := range src { -// dst[i] = convEventAdminToRoomAdmin(src[i]) -// } -// return -// } - func ConvSEventAdminToSUser(src []EventAdmin) (dst []User) { dst = make([]User, len(src)) for i := range src { @@ -297,20 +280,12 @@ func ConvuuidUUIDToGroupMember(src uuid.UUID) (dst GroupMember) { dst.UserID = src return } -// func ConvuuidUUIDToRoomAdmin(src uuid.UUID) (dst RoomAdmin) { -// dst.UserID = src -// return -// } + func ConvuuidUUIDToUserMeta(src uuid.UUID) (dst User) { dst.ID = src return } -// func convEventAdminToRoomAdmin(src EventAdmin) (dst RoomAdmin) { -// dst.UserID = src.UserID -// return -// } - func convEventAdminTodomainUser(src EventAdmin) (dst domain.User) { dst.ID = src.UserID return @@ -389,10 +364,7 @@ func convGroupTodomainGroup(src Group) (dst domain.Group) { (*dst.Model.DeletedAt) = convgormDeletedAtTotimeTime(src.Model.DeletedAt) return } -// func convRoomAdminTodomainUser(src RoomAdmin) (dst domain.User) { -// dst.ID = src.UserID -// return -// } + func convRoomTodomainRoom(src Room) (dst domain.Room) { dst.ID = src.ID dst.Place = src.Place @@ -452,8 +424,3 @@ func convuuidUUIDToGroupMember(src uuid.UUID) (dst GroupMember) { dst.UserID = src return } - -// func convuuidUUIDToRoomAdmin(src uuid.UUID) (dst RoomAdmin) { -// dst.UserID = src -// return -// } diff --git a/infra/db/model.go b/infra/db/model.go index 5bd8e01..e5dfd31 100644 --- a/infra/db/model.go +++ b/infra/db/model.go @@ -15,7 +15,6 @@ var tables = []interface{}{ GroupAdmin{}, Tag{}, Room{}, - // RoomAdmin{}, Event{}, EventTag{}, // Eventより下にないと、overrideされる EventAdmin{}, @@ -79,13 +78,6 @@ type UserBody struct { User User `gorm:"->; foreignKey:ID; constraint:OnDelete:CASCADE;" cvt:"->"` } -// type RoomAdmin struct { -// UserID uuid.UUID `gorm:"type:char(36); primaryKey"` -// RoomID uuid.UUID `gorm:"type:char(36); primaryKey"` -// User User `gorm:"->; foreignKey:UserID; constraint:OnDelete:CASCADE;" cvt:"->"` -// Model `cvt:"-"` -// } - //go:generate go run github.com/fuji8/gotypeconverter/cmd/gotypeconverter@latest -s Room -d domain.Room -o converter.go . //go:generate go run github.com/fuji8/gotypeconverter/cmd/gotypeconverter@latest -s []*Room -d []*domain.Room -o converter.go . type Room struct {