5 分钟发布一次
This commit is contained in:
@@ -4,12 +4,14 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
ErrDependencyUnavailable = errors.New("dependency unavailable")
|
||||
ErrInvalidInput = errors.New("invalid listing input")
|
||||
ErrListingLocked = errors.New("listing locked")
|
||||
ErrPublishCooldown = errors.New("listing publish cooldown")
|
||||
ErrMissingTitle = errors.New("missing listing title")
|
||||
ErrMissingServerRegion = errors.New("missing server region")
|
||||
ErrInvalidPrice = errors.New("invalid listing price")
|
||||
@@ -38,13 +40,28 @@ type ConfigReader interface {
|
||||
}
|
||||
|
||||
const (
|
||||
reviewRequiredConfigKey = "listing.review_required"
|
||||
publishOptionsConfigKey = "listing.publish_options"
|
||||
defaultFireLevelMin = 38
|
||||
maxExternalUploadItems = 10
|
||||
defaultUploadScreenshot = "/api/listings/default-upload-screenshot"
|
||||
reviewRequiredConfigKey = "listing.review_required"
|
||||
publishOptionsConfigKey = "listing.publish_options"
|
||||
publishCooldownMinutesKey = "listing.publish_cooldown_minutes"
|
||||
defaultFireLevelMin = 38
|
||||
defaultPublishCooldownMinutes = 5
|
||||
maxExternalUploadItems = 10
|
||||
defaultUploadScreenshot = "/api/listings/default-upload-screenshot"
|
||||
)
|
||||
|
||||
type PublishCooldownError struct {
|
||||
Cooldown time.Duration
|
||||
Remaining time.Duration
|
||||
}
|
||||
|
||||
func (e PublishCooldownError) Error() string {
|
||||
return ErrPublishCooldown.Error()
|
||||
}
|
||||
|
||||
func (e PublishCooldownError) Is(target error) bool {
|
||||
return target == ErrPublishCooldown
|
||||
}
|
||||
|
||||
type FireLevelTooLowError struct {
|
||||
Min int
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user