新增首页 AW炫彩回收入口,支持后台配置展示图
首页第三入口点击查看回收说明图;配置项 mobile.aw_recycle 可配标题/图片;aw-recycle 走公开文件链路,首页鉴权预览兼容旧私有地址。
This commit is contained in:
@@ -28,6 +28,10 @@ func (s *Service) HomeConfig(ctx context.Context) (*HomeConfigDTO, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
awRecycle, err := s.awRecycle(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
publishOptions, err := s.publishOptions(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -36,6 +40,7 @@ func (s *Service) HomeConfig(ctx context.Context) (*HomeConfigDTO, error) {
|
||||
Announcements: announcements,
|
||||
Banners: banners,
|
||||
PublishOptions: publishOptions,
|
||||
AWRecycle: awRecycle,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -62,3 +67,15 @@ func (s *Service) homeBanners(ctx context.Context) ([]HomeBannerItem, error) {
|
||||
}
|
||||
return normalizeHomeBanners(items), nil
|
||||
}
|
||||
|
||||
func (s *Service) awRecycle(ctx context.Context) (AWRecycleConfig, error) {
|
||||
value, err := s.repo.FindValue(ctx, awRecycleConfigKey)
|
||||
if err != nil {
|
||||
return defaultAWRecycle(), err
|
||||
}
|
||||
item := defaultAWRecycle()
|
||||
if err := json.Unmarshal([]byte(value), &item); err != nil {
|
||||
item = defaultAWRecycle()
|
||||
}
|
||||
return normalizeAWRecycle(item), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user