Documentation ¶
Index ¶
- func NewAlarmRepository(db *gorm.DB) repository.AlarmRepository
- func NewMemberDeviceRepository(db *gorm.DB) repository.MemberDeviceRepository
- func NewMemberRepository(db *gorm.DB) repository.MemberRepository
- func NewRoomMemberRepository(db *gorm.DB) repository.RoomMemberRepository
- func NewRoomRepository(db *gorm.DB) repository.RoomRepository
- func ToEntity(dto *RoomGorm) *entity.Room
- func ToMemberEntity(memberDto *MemberGorm) *entity.Member
- type AlarmGorm
- type AlarmRepository
- type AlarmsGorm
- type BaseGormModel
- type MemberDeviceGorm
- type MemberDeviceGorms
- type MemberDeviceRepository
- func (mdr *MemberDeviceRepository) CreateIfNotExist(memberID uint, token string) (memberDevice *entity.MemberDevice, err error)
- func (mdr *MemberDeviceRepository) Delete(memberDevice *entity.MemberDevice) error
- func (mdr *MemberDeviceRepository) DeleteBatch(tokens []string) error
- func (mdr *MemberDeviceRepository) Get(token string) (memberDevice *entity.MemberDevice, err error)
- func (mdr *MemberDeviceRepository) GetAllMemberTokens(memberIDs []uint) (tokens []string, err error)
- func (mdr *MemberDeviceRepository) GetAllTokens(memberID uint) (tokens []string, err error)
- type MemberGorm
- type MemberRepository
- func (r *MemberRepository) Create(member *entity.Member) (*entity.Member, error)
- func (r MemberRepository) Delete(member *entity.Member) error
- func (r *MemberRepository) Get(id uint) (*entity.Member, error)
- func (r *MemberRepository) GetAllByIDs(ids []uint) (*entity.Members, error)
- func (r *MemberRepository) GetByEmail(email string) (*entity.Member, error)
- func (r *MemberRepository) GetByNickName(name string) (*entity.Member, error)
- func (r *MemberRepository) Update(member *entity.Member) (*entity.Member, error)
- type MembersGorm
- type RoomGorm
- type RoomGorms
- type RoomMemberGorm
- type RoomMemberGorms
- type RoomMemberRepository
- func (rmr *RoomMemberRepository) Create(roomMember *entity.RoomMember) (*entity.RoomMember, error)
- func (rmr *RoomMemberRepository) Delete(roomMember *entity.RoomMember) error
- func (rmr *RoomMemberRepository) GetAllRoomIDs(memberID uint) (roomIDs []uint, err error)
- func (rmr *RoomMemberRepository) GetByUnq(roomID, accountID uint) (*entity.RoomMember, error)
- func (rmr *RoomMemberRepository) SortedMemberIDs(memberIDs []uint) (sortedMemberIDs []uint, err error)
- type RoomRepository
- func (rr *RoomRepository) Create(room *entity.Room) (*entity.Room, error)
- func (rr *RoomRepository) Delete(room *entity.Room) error
- func (rr *RoomRepository) GetAll(accountID uint, roomIDs []uint) (*entity.Rooms, error)
- func (rr *RoomRepository) GetByID(id uint) (*entity.Room, error)
- func (rr *RoomRepository) Update(room *entity.Room) (*entity.Room, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAlarmRepository ¶
func NewAlarmRepository(db *gorm.DB) repository.AlarmRepository
NewAlarmRepository ...
func NewMemberDeviceRepository ¶
func NewMemberDeviceRepository(db *gorm.DB) repository.MemberDeviceRepository
NewMemberDeviceRepository ...
func NewMemberRepository ¶
func NewMemberRepository(db *gorm.DB) repository.MemberRepository
NewMemberRepository ...
func NewRoomMemberRepository ¶
func NewRoomMemberRepository(db *gorm.DB) repository.RoomMemberRepository
NewRoomMemberRepository ...
func NewRoomRepository ¶
func NewRoomRepository(db *gorm.DB) repository.RoomRepository
NewRoomRepository ... Domain layer의 RoomRepository interface를 만족시키는 repository impl. gorm connection을 들고 가지고 있다.
Types ¶
type AlarmGorm ¶
type AlarmGorm struct { ID uint `gorm:"primaryKey"` MemberID uint `gorm:"column:member_id"` Member MemberGorm `gorm:"uniqueIndex:unq_room_member_code;column:member_id;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"` Code string `gorm:"uniqueIndex:unq_room_member_code;column:code;type:varchar(512)"` Title string `gorm:"column:title"` RoomID uint `gorm:"column:room_id"` Room RoomGorm `gorm:"uniqueIndex:unq_room_member_code;column:room_id;constraint:OnDelete:CASCADE;"` RoomName string `gorm:"column:room_name"` Author string `gorm:"column:author"` AlarmAt time.Time `gorm:"column:alarm_at"` }
AlarmGorm is a db representation of entity.Member
type AlarmRepository ¶
type AlarmRepository struct {
// contains filtered or unexported fields
}
AlarmRepository ...
type AlarmsGorm ¶
type AlarmsGorm []AlarmGorm
AlarmsGorm is a type that represents list of AlarmGorm
type BaseGormModel ¶
BaseGormModel contains common gorm model fields
func (*BaseGormModel) BeforeCreate ¶
func (base *BaseGormModel) BeforeCreate(tx *gorm.DB) error
BeforeCreate do field initialization before insert a row.
type MemberDeviceGorm ¶
type MemberDeviceGorm struct { ID uint `gorm:"primaryKey"` MemberID uint `gorm:"column:member_id"` Member MemberGorm `gorm:"index;column:member_id;constraint:OnDelete:CASCADE;"` // varchar(512)사용 이유: https://stackoverflow.com/questions/11668761/gcm-max-length-for-registration-id DeviceToken string `gorm:"column:device_token;type:varchar(512);uniqueIndex:idx_device_token;not null"` BaseGormModel }
MemberDeviceGorm ...
func (MemberDeviceGorm) TableName ¶
func (MemberDeviceGorm) TableName() string
TableName define gorm table name
func (*MemberDeviceGorm) ToEntity ¶
func (dto *MemberDeviceGorm) ToEntity() *entity.MemberDevice
ToEntity ...
type MemberDeviceGorms ¶
type MemberDeviceGorms []MemberDeviceGorm
MemberDeviceGorms define list of MemberDeviceGorm
type MemberDeviceRepository ¶
type MemberDeviceRepository struct {
// contains filtered or unexported fields
}
MemberDeviceRepository ...
func (*MemberDeviceRepository) CreateIfNotExist ¶
func (mdr *MemberDeviceRepository) CreateIfNotExist(memberID uint, token string) (memberDevice *entity.MemberDevice, err error)
CreateIfNotExist ...
func (*MemberDeviceRepository) Delete ¶
func (mdr *MemberDeviceRepository) Delete(memberDevice *entity.MemberDevice) error
Delete ...
func (*MemberDeviceRepository) DeleteBatch ¶
func (mdr *MemberDeviceRepository) DeleteBatch(tokens []string) error
DeleteBatch ...
func (*MemberDeviceRepository) Get ¶
func (mdr *MemberDeviceRepository) Get(token string) (memberDevice *entity.MemberDevice, err error)
Get ...
func (*MemberDeviceRepository) GetAllMemberTokens ¶
func (mdr *MemberDeviceRepository) GetAllMemberTokens(memberIDs []uint) (tokens []string, err error)
GetAllMemberTokens ...
func (*MemberDeviceRepository) GetAllTokens ¶
func (mdr *MemberDeviceRepository) GetAllTokens(memberID uint) (tokens []string, err error)
GetAllTokens ...
type MemberGorm ¶
type MemberGorm struct { ID uint `gorm:"primaryKey"` Email string `gorm:"column:email;not null"` Name string `gorm:"column:name;not null;type:varchar(256);uniqueIndex"` ProfileURL string `gorm:"column:profile_url"` AuthType string `gorm:"column:auth_type"` AlarmFlag bool `gorm:"column:alarm_flag"` BaseGormModel }
MemberGorm is a db representation of entity.Member
type MemberRepository ¶
type MemberRepository struct {
// contains filtered or unexported fields
}
MemberRepository ...
func (MemberRepository) Delete ¶
func (r MemberRepository) Delete(member *entity.Member) error
Delete ...
func (*MemberRepository) Get ¶
func (r *MemberRepository) Get(id uint) (*entity.Member, error)
Get ...
func (*MemberRepository) GetAllByIDs ¶
func (r *MemberRepository) GetAllByIDs(ids []uint) (*entity.Members, error)
GetAllByIDs ...
func (*MemberRepository) GetByEmail ¶
func (r *MemberRepository) GetByEmail(email string) (*entity.Member, error)
GetByEmail ...
func (*MemberRepository) GetByNickName ¶
func (r *MemberRepository) GetByNickName(name string) (*entity.Member, error)
GetByNickName ...
type MembersGorm ¶
type MembersGorm []MemberGorm
MembersGorm is a type that represents list of MemberGorm
type RoomGorm ¶
type RoomGorm struct { ID uint `gorm:"primaryKey"` Name string `gorm:"column:name;not null"` Code string `gorm:"column:code;not null"` Hint string `gorm:"column:hint;not null"` Theme string `gorm:"column:theme;not null"` Period uint8 `gorm:"column:period;not null"` MasterID uint `gorm:"column:master_id"` Master MemberGorm `gorm:"column:master_id;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"` TurnAccountID uint `gorm:"column:turn_account_id"` DueAt time.Time `gorm:"column:due_at"` TurnAccount MemberGorm `gorm:"column:turn_account_id;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"` Orders datatypes.JSON `gorm:"column:orders"` BaseGormModel }
RoomGorm is a db representation of entity.Room
type RoomMemberGorm ¶
type RoomMemberGorm struct { ID uint `gorm:"primaryKey"` RoomID uint `gorm:"column:room_id"` Room RoomGorm `gorm:"uniqueIndex:idx_room_account;column:room_id;constraint:OnDelete:CASCADE;"` AccountID uint `gorm:"column:account_id"` Account MemberGorm `gorm:"uniqueIndex:idx_room_account;column:account_id;constraint:OnDelete:CASCADE;"` BaseGormModel }
RoomMemberGorm is a db representation of entity.RoomMember "idx_room_account" is a unique key combined with (RoomID, AccountID)
func (RoomMemberGorm) TableName ¶
func (RoomMemberGorm) TableName() string
TableName define gorm table name
type RoomMemberGorms ¶
type RoomMemberGorms []RoomMemberGorm
RoomMemberGorms define list of RoomMemberGorm
type RoomMemberRepository ¶
type RoomMemberRepository struct {
// contains filtered or unexported fields
}
RoomMemberRepository is a impl of domain/repository/roomMemberRepository.go RoomMemberRepository interface
func (*RoomMemberRepository) Create ¶
func (rmr *RoomMemberRepository) Create(roomMember *entity.RoomMember) (*entity.RoomMember, error)
Create ...
func (*RoomMemberRepository) Delete ¶
func (rmr *RoomMemberRepository) Delete(roomMember *entity.RoomMember) error
Delete ...
func (*RoomMemberRepository) GetAllRoomIDs ¶
func (rmr *RoomMemberRepository) GetAllRoomIDs(memberID uint) (roomIDs []uint, err error)
GetAllRoomIDs ...
func (*RoomMemberRepository) GetByUnq ¶
func (rmr *RoomMemberRepository) GetByUnq(roomID, accountID uint) (*entity.RoomMember, error)
GetByUnq func gets RoomMember row by unique_key(RoomID, AccountID)
func (*RoomMemberRepository) SortedMemberIDs ¶
func (rmr *RoomMemberRepository) SortedMemberIDs(memberIDs []uint) (sortedMemberIDs []uint, err error)
SortedMemberIDs ...
type RoomRepository ¶
type RoomRepository struct {
// contains filtered or unexported fields
}
RoomRepository is a impl of domain/repository/roomRepository.go RoomRepository interface
func (*RoomRepository) Delete ¶
func (rr *RoomRepository) Delete(room *entity.Room) error
Delete func delete a room