feat(distribution): 分站品牌装修可配置首页入口并上传图片
分站可单独配置回收、合作反馈和客服二维码,未配置时继承主站;Logo、图标和轮播支持直接上传。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -855,26 +855,28 @@ func (r *Repository) UpdateRuleStatus(ctx context.Context, adminID, id uint64, s
|
||||
|
||||
func siteDTO(row model.DistributionSite) SiteDTO {
|
||||
return SiteDTO{
|
||||
ID: row.ID,
|
||||
SiteCode: row.SiteCode,
|
||||
SiteName: row.SiteName,
|
||||
Domain: row.Domain,
|
||||
Status: row.Status,
|
||||
DisplayAccountEnabled: row.DisplayAccountEnabled,
|
||||
DefaultSupportGroupID: row.DefaultSupportGroupID,
|
||||
ListingQrcodeURL: row.ListingQrcodeURL,
|
||||
ReceiveRatioDelta: row.ReceiveRatioDelta,
|
||||
ReceiveCostDelta: row.ReceiveCostDelta,
|
||||
TaxEnabled: row.TaxEnabled,
|
||||
TaxRateBPS: row.TaxRateBPS,
|
||||
SettlementHoldDays: row.SettlementHoldDays,
|
||||
LogoURL: row.LogoURL,
|
||||
FaviconURL: row.FaviconURL,
|
||||
BannersJSON: row.BannersJSON,
|
||||
AnnouncementsJSON: row.AnnouncementsJSON,
|
||||
FooterInfoJSON: row.FooterInfoJSON,
|
||||
CreatedAt: row.CreatedAt,
|
||||
UpdatedAt: row.UpdatedAt,
|
||||
ID: row.ID,
|
||||
SiteCode: row.SiteCode,
|
||||
SiteName: row.SiteName,
|
||||
Domain: row.Domain,
|
||||
Status: row.Status,
|
||||
DisplayAccountEnabled: row.DisplayAccountEnabled,
|
||||
DefaultSupportGroupID: row.DefaultSupportGroupID,
|
||||
ListingQrcodeURL: row.ListingQrcodeURL,
|
||||
ReceiveRatioDelta: row.ReceiveRatioDelta,
|
||||
ReceiveCostDelta: row.ReceiveCostDelta,
|
||||
TaxEnabled: row.TaxEnabled,
|
||||
TaxRateBPS: row.TaxRateBPS,
|
||||
SettlementHoldDays: row.SettlementHoldDays,
|
||||
LogoURL: row.LogoURL,
|
||||
FaviconURL: row.FaviconURL,
|
||||
BannersJSON: row.BannersJSON,
|
||||
AnnouncementsJSON: row.AnnouncementsJSON,
|
||||
FooterInfoJSON: row.FooterInfoJSON,
|
||||
AWRecycleJSON: row.AWRecycleJSON,
|
||||
CooperationFeedbackJSON: row.CooperationFeedbackJSON,
|
||||
CreatedAt: row.CreatedAt,
|
||||
UpdatedAt: row.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2700,6 +2702,18 @@ func (r *Repository) UpdateSiteBranding(ctx context.Context, adminID, siteID uin
|
||||
site.FooterInfoJSON = strings.TrimSpace(*req.FooterInfoJSON)
|
||||
updates["footer_info_json"] = site.FooterInfoJSON
|
||||
}
|
||||
if req.AWRecycleJSON != nil {
|
||||
site.AWRecycleJSON = strings.TrimSpace(*req.AWRecycleJSON)
|
||||
updates["aw_recycle_json"] = site.AWRecycleJSON
|
||||
}
|
||||
if req.CooperationFeedbackJSON != nil {
|
||||
site.CooperationFeedbackJSON = strings.TrimSpace(*req.CooperationFeedbackJSON)
|
||||
updates["cooperation_feedback_json"] = site.CooperationFeedbackJSON
|
||||
}
|
||||
if req.ListingQrcodeURL != nil {
|
||||
site.ListingQrcodeURL = strings.TrimSpace(*req.ListingQrcodeURL)
|
||||
updates["listing_qrcode_url"] = site.ListingQrcodeURL
|
||||
}
|
||||
if len(updates) > 0 {
|
||||
if err := r.db.WithContext(ctx).Model(&site).Updates(updates).Error; err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user