增加上传接口
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
package listing
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"encoding/json"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
type ListingDTO struct {
|
||||
ID uint64 `json:"id"`
|
||||
@@ -116,3 +120,78 @@ type AuditMeta struct {
|
||||
IP string
|
||||
UserAgent string
|
||||
}
|
||||
|
||||
type ExternalUploadRequest struct {
|
||||
UploadTime int64 `json:"uploadTime"`
|
||||
UploaderName string `json:"uploaderName"`
|
||||
Uploaderame string `json:"uploaderame"`
|
||||
Data json.RawMessage `json:"data"`
|
||||
}
|
||||
|
||||
func (r ExternalUploadRequest) normalizedUploaderName() string {
|
||||
if name := strings.TrimSpace(r.UploaderName); name != "" {
|
||||
return name
|
||||
}
|
||||
return strings.TrimSpace(r.Uploaderame)
|
||||
}
|
||||
|
||||
type ExternalAccountData struct {
|
||||
LoginMethod string `json:"loginMethod"`
|
||||
Rank string `json:"rank"`
|
||||
Level int `json:"level"`
|
||||
SafeSlots int `json:"safeSlots"`
|
||||
SecretKD float64 `json:"secretKD"`
|
||||
DailyLossM float64 `json:"dailyLossM"`
|
||||
Deposit float64 `json:"deposit"`
|
||||
BanRecord string `json:"banRecord"`
|
||||
CommonRegion string `json:"commonRegion"`
|
||||
ContactPhone string `json:"contactPhone"`
|
||||
OwnerOnlineTime string `json:"ownerOnlineTime"`
|
||||
Currency ExternalUploadCurrency `json:"currency"`
|
||||
DailyConsumption ExternalDailyConsumption `json:"dailyConsumption"`
|
||||
Inventory ExternalUploadInventory `json:"inventory"`
|
||||
}
|
||||
|
||||
type ExternalUploadCurrency struct {
|
||||
HafuCoin float64 `json:"hafuCoin"`
|
||||
RecycleRatio float64 `json:"recycleRatio"`
|
||||
RecycleRent float64 `json:"recycleRent"`
|
||||
}
|
||||
|
||||
type ExternalDailyConsumption struct {
|
||||
Stamina int `json:"stamina"`
|
||||
Weight int `json:"weight"`
|
||||
}
|
||||
|
||||
type ExternalUploadInventory struct {
|
||||
AWMBullets int `json:"awmBullets"`
|
||||
Level6Helmets int `json:"level6Helmets"`
|
||||
Level6Armor int `json:"level6Armor"`
|
||||
Skins []string `json:"skins"`
|
||||
}
|
||||
|
||||
type ExternalUploadMeta struct {
|
||||
IP string
|
||||
UserAgent string
|
||||
RawPayload []byte
|
||||
}
|
||||
|
||||
type ExternalUploadResult struct {
|
||||
Index int `json:"index"`
|
||||
ListingID uint64 `json:"listing_id,omitempty"`
|
||||
AccountID uint64 `json:"account_id,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
ReviewStatus string `json:"review_status,omitempty"`
|
||||
Error string `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
type ExternalUploadResponse struct {
|
||||
ListingID uint64 `json:"listing_id,omitempty"`
|
||||
AccountID uint64 `json:"account_id,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
ReviewStatus string `json:"review_status,omitempty"`
|
||||
Total int `json:"total"`
|
||||
Success int `json:"success"`
|
||||
Failed int `json:"failed"`
|
||||
Items []ExternalUploadResult `json:"items,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user