增加发布协议确认配置

This commit is contained in:
yml2213
2026-06-07 21:14:49 +08:00
parent 954c3d6be3
commit eebd2d3b04
19 changed files with 760 additions and 13 deletions
@@ -22,6 +22,7 @@ var (
ErrDepositTooLow = errors.New("listing deposit too low")
ErrInvalidHafCoin = errors.New("invalid haf coin amount")
ErrMissingScreenshot = errors.New("missing screenshot")
ErrAgreementRequired = errors.New("listing publish agreement required")
ErrMissingUploaderName = errors.New("missing uploader name")
ErrMissingUploadData = errors.New("missing upload data")
ErrUploaderNotFound = errors.New("uploader not found")
@@ -80,6 +81,9 @@ func (s *Service) Create(ownerID uint64, req CreateRequest) (*ListingDTO, error)
if s.repo == nil {
return nil, ErrDependencyUnavailable
}
if !req.AgreedVirtualAssetSale || !req.AgreedSellerAgreement {
return nil, ErrAgreementRequired
}
rules, err := s.publishRules()
if err != nil {
return nil, err