chore: gofmt for golangci-lint

This commit is contained in:
ducky
2026-01-30 17:28:53 +08:00
parent b7f69844e1
commit 9bee0a2071
8 changed files with 5 additions and 13 deletions

View File

@@ -88,4 +88,3 @@ func (Announcement) Indexes() []ent.Index {
index.Fields("ends_at"),
}
}

View File

@@ -63,4 +63,3 @@ func (AnnouncementRead) Indexes() []ent.Index {
index.Fields("announcement_id", "user_id").Unique(),
}
}

View File

@@ -27,12 +27,12 @@ func NewAnnouncementHandler(announcementService *service.AnnouncementService) *A
}
type CreateAnnouncementRequest struct {
Title string `json:"title" binding:"required"`
Content string `json:"content" binding:"required"`
Status string `json:"status" binding:"omitempty,oneof=draft active archived"`
Title string `json:"title" binding:"required"`
Content string `json:"content" binding:"required"`
Status string `json:"status" binding:"omitempty,oneof=draft active archived"`
Targeting service.AnnouncementTargeting `json:"targeting"`
StartsAt *int64 `json:"starts_at"` // Unix seconds, 0/empty = immediate
EndsAt *int64 `json:"ends_at"` // Unix seconds, 0/empty = never
StartsAt *int64 `json:"starts_at"` // Unix seconds, 0/empty = immediate
EndsAt *int64 `json:"ends_at"` // Unix seconds, 0/empty = never
}
type UpdateAnnouncementRequest struct {
@@ -244,4 +244,3 @@ func (h *AnnouncementHandler) ListReadStatus(c *gin.Context) {
response.Paginated(c, items, paginationResult.Total, page, pageSize)
}

View File

@@ -79,4 +79,3 @@ func parseBoolQuery(v string) bool {
return false
}
}

View File

@@ -72,4 +72,3 @@ func UserAnnouncementFromService(a *service.UserAnnouncement) *UserAnnouncement
UpdatedAt: a.Announcement.UpdatedAt,
}
}

View File

@@ -81,4 +81,3 @@ func (r *announcementReadRepository) CountByAnnouncementID(ctx context.Context,
}
return int64(count), nil
}

View File

@@ -192,4 +192,3 @@ func announcementEntitiesToService(models []*dbent.Announcement) []service.Annou
}
return out
}

View File

@@ -64,4 +64,3 @@ func TestAnnouncementTargeting_Matches_AndOrSemantics(t *testing.T) {
require.False(t, targeting.Matches(99.9, map[int64]struct{}{10: {}}))
require.True(t, targeting.Matches(100, map[int64]struct{}{10: {}}))
}