优化
This commit is contained in:
@@ -23,10 +23,10 @@ type AnnouncementFilter struct {
|
||||
|
||||
type AnnouncementRepo interface {
|
||||
Create(context.Context, *Announcement) error
|
||||
Delete(context.Context, uint) error
|
||||
DeleteByIDs(context.Context, []uint) error
|
||||
Delete(context.Context, string) error
|
||||
DeleteByIDs(context.Context, []string) error
|
||||
Update(context.Context, *Announcement) error
|
||||
Find(context.Context, uint) (*Announcement, error)
|
||||
Find(context.Context, string) (*Announcement, error)
|
||||
List(context.Context, AnnouncementFilter) ([]*Announcement, int64, error)
|
||||
UserOptions(context.Context) ([]UserOption, error)
|
||||
}
|
||||
@@ -50,15 +50,15 @@ func (uc *AnnouncementUsecase) Update(ctx context.Context, item *Announcement) e
|
||||
return uc.repo.Update(ctx, item)
|
||||
}
|
||||
|
||||
func (uc *AnnouncementUsecase) Delete(ctx context.Context, id uint) error {
|
||||
func (uc *AnnouncementUsecase) Delete(ctx context.Context, id string) error {
|
||||
return uc.repo.Delete(ctx, id)
|
||||
}
|
||||
|
||||
func (uc *AnnouncementUsecase) DeleteByIDs(ctx context.Context, ids []uint) error {
|
||||
func (uc *AnnouncementUsecase) DeleteByIDs(ctx context.Context, ids []string) error {
|
||||
return uc.repo.DeleteByIDs(ctx, ids)
|
||||
}
|
||||
|
||||
func (uc *AnnouncementUsecase) Find(ctx context.Context, id uint) (*Announcement, error) {
|
||||
func (uc *AnnouncementUsecase) Find(ctx context.Context, id string) (*Announcement, error) {
|
||||
return uc.repo.Find(ctx, id)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user