feat(distribution): 支持分销上传来源追踪、主站审核展示与收售结算模式自动判定

This commit is contained in:
yml2213
2026-09-08 15:00:35 +08:00
parent a61828c6ca
commit 0fcb6a513f
14 changed files with 301 additions and 69 deletions
+40 -34
View File
@@ -18,8 +18,10 @@ type listingRow struct {
Title string
OwnerPhone string
OwnerNickname string
SourceChannel string `gorm:"column:source_channel"`
IsExternalUpload bool `gorm:"column:is_external_upload"`
SourceChannel string `gorm:"column:source_channel"`
IsExternalUpload bool `gorm:"column:is_external_upload"`
DistributionSiteCode string `gorm:"column:distribution_site_code"`
DistributionSiteName string `gorm:"column:distribution_site_name"`
Description string
GameName string
ServerRegion string
@@ -189,11 +191,14 @@ func (row listingRow) toDTO() ListingDTO {
ReviewStatus: reviewStatus,
HandoffMode: row.HandoffMode,
SettlementMode: row.SettlementMode,
ManagedAdminID: row.ManagedAdminID,
ReviewReason: reviewReason,
PublishedAt: row.PublishedAt,
CreatedAt: row.CreatedAt,
UpdatedAt: row.UpdatedAt,
ManagedAdminID: row.ManagedAdminID,
DistributionSiteID: row.DistributionSiteID,
DistributionSiteCode: row.DistributionSiteCode,
DistributionSiteName: row.DistributionSiteName,
ReviewReason: reviewReason,
PublishedAt: row.PublishedAt,
CreatedAt: row.CreatedAt,
UpdatedAt: row.UpdatedAt,
}
}
@@ -202,33 +207,34 @@ func toDTO(account model.GameAccount, listing model.RentalListing) *ListingDTO {
screenshotURLS := cleanScreenshotURLs(decodeScreenshots(account.ScreenshotURLS))
reviewStatus, reviewReason := normalizedReviewState(listing.Status, listing.ReviewStatus, listing.ReviewReason)
return &ListingDTO{
ID: listing.ID,
ListingNo: listing.ListingNo,
AccountID: account.ID,
OwnerID: listing.OwnerID,
Title: account.Title,
Description: account.Description,
GameName: account.GameName,
ServerRegion: account.ServerRegion,
LoginPlatform: account.LoginPlatform,
RankLevel: account.RankLevel,
HafCoinAmount: account.HafCoinAmount,
AssetSummary: assetSummary,
ScreenshotURLS: screenshotURLS,
CoverURL: publicCoverURL(listing.ID, screenshotURLS, listing.Status, listing.ReviewStatus),
PriceCent: listing.PriceCent,
DepositAmountCent: listing.DepositAmountCent,
IsAccelerated: isAcceleratedSale(assetSummary),
InTransaction: listing.InTransaction,
Status: listing.Status,
ReviewStatus: reviewStatus,
HandoffMode: listing.HandoffMode,
SettlementMode: listing.SettlementMode,
ManagedAdminID: listing.ManagedAdminID,
ReviewReason: reviewReason,
PublishedAt: listing.PublishedAt,
CreatedAt: listing.CreatedAt,
UpdatedAt: listing.UpdatedAt,
ID: listing.ID,
ListingNo: listing.ListingNo,
AccountID: account.ID,
OwnerID: listing.OwnerID,
Title: account.Title,
Description: account.Description,
GameName: account.GameName,
ServerRegion: account.ServerRegion,
LoginPlatform: account.LoginPlatform,
RankLevel: account.RankLevel,
HafCoinAmount: account.HafCoinAmount,
AssetSummary: assetSummary,
ScreenshotURLS: screenshotURLS,
CoverURL: publicCoverURL(listing.ID, screenshotURLS, listing.Status, listing.ReviewStatus),
PriceCent: listing.PriceCent,
DepositAmountCent: listing.DepositAmountCent,
IsAccelerated: isAcceleratedSale(assetSummary),
InTransaction: listing.InTransaction,
Status: listing.Status,
ReviewStatus: reviewStatus,
HandoffMode: listing.HandoffMode,
SettlementMode: listing.SettlementMode,
ManagedAdminID: listing.ManagedAdminID,
DistributionSiteID: listing.DistributionSiteID,
ReviewReason: reviewReason,
PublishedAt: listing.PublishedAt,
CreatedAt: listing.CreatedAt,
UpdatedAt: listing.UpdatedAt,
}
}