[Snow Team] backend-fixer: auto-commit work

This commit is contained in:
yml
2026-06-09 17:04:40 +08:00
parent f5b38ff772
commit 62b898d7cc
11 changed files with 291 additions and 214 deletions
+29 -23
View File
@@ -82,14 +82,16 @@ func (r *Repository) Create(ownerID uint64, req CreateRequest, reviewRequired bo
price := normalizedListingPrice(req)
depositAmount := roundMoney(req.DepositAmount)
listing := model.RentalListing{
ListingNo: listingNo,
AccountID: account.ID,
OwnerID: ownerID,
Price: price,
DepositAmount: depositAmount,
Status: listingStatus,
ReviewStatus: reviewStatus,
PublishedAt: publishedAt,
ListingNo: listingNo,
AccountID: account.ID,
OwnerID: ownerID,
Price: price,
PriceCent: int64(math.Round(price * 100)),
DepositAmount: depositAmount,
DepositAmountCent: int64(math.Round(depositAmount * 100)),
Status: listingStatus,
ReviewStatus: reviewStatus,
PublishedAt: publishedAt,
}
if err := tx.Create(&listing).Error; err != nil {
return err
@@ -147,14 +149,18 @@ func (r *Repository) CreateFromExternalUpload(upload externalUploadCreate, req C
if err := tx.Create(&account).Error; err != nil {
return err
}
price := normalizedListingPrice(req)
depositAmount := roundMoney(req.DepositAmount)
listing := model.RentalListing{
ListingNo: listingNo,
AccountID: account.ID,
OwnerID: owner.ID,
Price: normalizedListingPrice(req),
DepositAmount: roundMoney(req.DepositAmount),
Status: "draft",
ReviewStatus: "pending",
ListingNo: listingNo,
AccountID: account.ID,
OwnerID: owner.ID,
Price: price,
PriceCent: int64(math.Round(price * 100)),
DepositAmount: depositAmount,
DepositAmountCent: int64(math.Round(depositAmount * 100)),
Status: "draft",
ReviewStatus: "pending",
}
if err := tx.Create(&listing).Error; err != nil {
return err
@@ -1439,14 +1445,14 @@ func (row listingRow) toDTO() ListingDTO {
screenshotURLS := cleanScreenshotURLs(decodeScreenshots(row.ScreenshotURLS))
reviewStatus, reviewReason := normalizedReviewState(row.Status, row.ReviewStatus, row.ReviewReason)
return ListingDTO{
ID: row.ID,
ListingNo: row.ListingNo,
AccountID: row.AccountID,
OwnerID: row.OwnerID,
OwnerPhone: row.OwnerPhone,
OwnerNickname: row.OwnerNickname,
Title: row.Title,
Description: row.Description,
ID: row.ID,
ListingNo: row.ListingNo,
AccountID: row.AccountID,
OwnerID: row.OwnerID,
OwnerPhone: row.OwnerPhone,
OwnerNickname: row.OwnerNickname,
Title: row.Title,
Description: row.Description,
GameName: row.GameName,
ServerRegion: row.ServerRegion,
LoginPlatform: row.LoginPlatform,