Skip to content

Commit

Permalink
Revert "fix error"
Browse files Browse the repository at this point in the history
This reverts commit 6407e0e.
  • Loading branch information
azbcww committed Nov 27, 2023
1 parent fd669b5 commit d65701a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 635 deletions.
18 changes: 9 additions & 9 deletions repository/gorm/stamp.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ func (r *stampRepository) GetStampStats(stampID uuid.UUID) (*repository.StampSta

func (r *stampRepository) StampThumbnailExists(stamps []*model.Stamp) (stampsWithThumb []repository.StampWithThumbnail, err error) {
IDs := make([]uuid.UUID, len(stamps))
stampsWithThumb = make([]repository.StampWithThumbnail, 0)

for i, s := range stamps {
IDs[i] = s.FileID
}
Expand All @@ -364,16 +364,16 @@ func (r *stampRepository) StampThumbnailExists(stamps []*model.Stamp) (stampsWit
tm[v] = struct{}{}
}

for _, s := range stamps {
for _, s := range(stamps) {
_, ok := tm[s.FileID]
stampsWithThumb = append(stampsWithThumb, repository.StampWithThumbnail{
ID: s.ID,
Name: s.Name,
CreatorID: s.CreatorID,
FileID: s.FileID,
IsUnicode: s.IsUnicode,
CreatedAt: s.CreatedAt,
UpdatedAt: s.UpdatedAt,
ID: s.ID,
Name: s.Name,
CreatorID: s.CreatorID,
FileID: s.FileID,
IsUnicode: s.IsUnicode,
CreatedAt: s.CreatedAt,
UpdatedAt: s.UpdatedAt,
HasThumbnail: ok,
})
}
Expand Down
16 changes: 8 additions & 8 deletions repository/stamp.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ type StampStats struct {
}

type StampWithThumbnail struct {
ID uuid.UUID `json:"id"`
Name string `json:"name"`
CreatorID uuid.UUID `json:"creatorId"`
FileID uuid.UUID `json:"fileId"`
IsUnicode bool `json:"isUnicode"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
HasThumbnail bool `json:"hasThumbnail"`
ID uuid.UUID `json:"id"`
Name string `json:"name"`
CreatorID uuid.UUID `json:"creatorId"`
FileID uuid.UUID `json:"fileId"`
IsUnicode bool `json:"isUnicode"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
HasThumbnail bool `json:"hasThumbnail"`
}

// StampType スタンプの種類
Expand Down

0 comments on commit d65701a

Please sign in to comment.