update
This commit is contained in:
@ -21,7 +21,6 @@ type DraftCard struct {
|
||||
Cover string `json:"cover"`
|
||||
ImageCount uint16 `json:"image_count"`
|
||||
Status string `json:"status"`
|
||||
SourceURL string `json:"source_url"`
|
||||
CreatedAt uint32 `json:"created_at"`
|
||||
UpdatedAt uint32 `json:"updated_at"`
|
||||
}
|
||||
@ -59,7 +58,6 @@ type DraftDetailView struct {
|
||||
SeasonCode string `json:"season_code"`
|
||||
City string `json:"city"`
|
||||
Cover string `json:"cover"`
|
||||
SourceURL string `json:"source_url"`
|
||||
ImageCount uint16 `json:"image_count"`
|
||||
Status string `json:"status"`
|
||||
Images []DraftImageRef `json:"images"`
|
||||
@ -102,7 +100,6 @@ type ReviewService interface {
|
||||
UpdateDraft(ctx context.Context, kind string, id uint32, fields map[string]any) error
|
||||
Approve(ctx context.Context, kind string, id uint32, reviewer string) (uint32, error)
|
||||
Reject(ctx context.Context, kind string, id uint32, reviewer, reason string) error
|
||||
CountPending(ctx context.Context) (int64, error)
|
||||
// DeleteDraftImage 软删审核草稿里的单张图片(审核阶段剔除坏图,不删七牛文件)。
|
||||
DeleteDraftImage(ctx context.Context, kind string, draftID, imgID uint32) error
|
||||
// KindTabs 返回类型标签(含「全部」与每个模块的待审数),驱动大审核列表概览。
|
||||
@ -219,18 +216,6 @@ func (s *reviewService) Reject(ctx context.Context, kind string, id uint32, revi
|
||||
return m.Reject(ctx, id, reviewer, reason)
|
||||
}
|
||||
|
||||
func (s *reviewService) CountPending(ctx context.Context) (int64, error) {
|
||||
var total int64
|
||||
for _, k := range s.order {
|
||||
n, err := s.modules[k].CountPending(ctx)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
total += n
|
||||
}
|
||||
return total, nil
|
||||
}
|
||||
|
||||
func (s *reviewService) KindTabs(ctx context.Context) []KindTab {
|
||||
tabs := []KindTab{{Kind: "", Label: "全部"}}
|
||||
var all int64
|
||||
@ -315,8 +300,7 @@ func (m *runwayModule) DraftDetail(ctx context.Context, id uint32) (*DraftDetail
|
||||
Season: d.Season,
|
||||
CollectionType: d.CollectionType,
|
||||
SeasonCode: d.SeasonCode,
|
||||
Cover: m.img.Compose(d.Cover, true), // 后台预览看高清
|
||||
SourceURL: d.SourceURL,
|
||||
Cover: m.img.Compose(d.Cover), // 后台预览看展示图
|
||||
ImageCount: d.ImageCount,
|
||||
Status: d.Status,
|
||||
Fields: []EditField{
|
||||
@ -331,7 +315,7 @@ func (m *runwayModule) DraftDetail(ctx context.Context, id uint32) (*DraftDetail
|
||||
},
|
||||
}
|
||||
for _, im := range imgs {
|
||||
v.Images = append(v.Images, DraftImageRef{ID: im.ID, Image: m.img.Compose(im.Image, true), Name: im.Name, SortOrder: im.SortOrder})
|
||||
v.Images = append(v.Images, DraftImageRef{ID: im.ID, Image: m.img.Compose(im.Image), Name: im.Name, SortOrder: im.SortOrder})
|
||||
}
|
||||
return v, nil
|
||||
}
|
||||
@ -392,8 +376,7 @@ func (m *streetModule) DraftDetail(ctx context.Context, id uint32) (*DraftDetail
|
||||
Title: d.Title,
|
||||
Year: d.Year,
|
||||
City: d.City,
|
||||
Cover: m.img.Compose(d.Cover, true), // 后台预览看高清
|
||||
SourceURL: d.SourceURL,
|
||||
Cover: m.img.Compose(d.Cover), // 后台预览看展示图
|
||||
ImageCount: d.ImageCount,
|
||||
Status: d.Status,
|
||||
Fields: []EditField{
|
||||
@ -403,7 +386,7 @@ func (m *streetModule) DraftDetail(ctx context.Context, id uint32) (*DraftDetail
|
||||
},
|
||||
}
|
||||
for _, im := range imgs {
|
||||
v.Images = append(v.Images, DraftImageRef{ID: im.ID, Image: m.img.Compose(im.Image, true), Name: im.Name, SortOrder: im.SortOrder})
|
||||
v.Images = append(v.Images, DraftImageRef{ID: im.ID, Image: m.img.Compose(im.Image), Name: im.Name, SortOrder: im.SortOrder})
|
||||
}
|
||||
return v, nil
|
||||
}
|
||||
@ -448,10 +431,9 @@ func (m *runwayModule) toRunwayCards(rows []model.BrandRunwayDraft) []DraftCard
|
||||
ID: d.ID,
|
||||
Title: d.TitleEn,
|
||||
Subtitle: sub,
|
||||
Cover: m.img.Compose(d.Cover, true), // 后台列表封面看高清
|
||||
Cover: m.img.Compose(d.Cover), // 后台列表封面看展示图
|
||||
ImageCount: d.ImageCount,
|
||||
Status: d.Status,
|
||||
SourceURL: d.SourceURL,
|
||||
CreatedAt: d.CreatedAt,
|
||||
UpdatedAt: d.UpdatedAt,
|
||||
})
|
||||
@ -471,10 +453,9 @@ func (m *streetModule) toStreetCards(rows []model.StreetSnapDraft) []DraftCard {
|
||||
ID: d.ID,
|
||||
Title: d.Title,
|
||||
Subtitle: sub,
|
||||
Cover: m.img.Compose(d.Cover, true), // 后台列表封面看高清
|
||||
Cover: m.img.Compose(d.Cover), // 后台列表封面看展示图
|
||||
ImageCount: d.ImageCount,
|
||||
Status: d.Status,
|
||||
SourceURL: d.SourceURL,
|
||||
CreatedAt: d.CreatedAt,
|
||||
UpdatedAt: d.UpdatedAt,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user