feat: live module and jenkins pipeline to harbor deploy

This commit is contained in:
Yvan
2026-09-21 16:45:44 +08:00
parent 451c8e2abc
commit 829d75c657
145 changed files with 8984 additions and 269 deletions
+5
View File
@@ -0,0 +1,5 @@
package platformsetting
import "github.com/google/wire"
var ProviderSet = wire.NewSet(NewUsecase)
+24
View File
@@ -0,0 +1,24 @@
package platformsetting
import (
"context"
kratoserrors "github.com/go-kratos/kratos/v3/errors"
)
var ErrInvalid = kratoserrors.BadRequest("PLATFORM_SETTING_INVALID", "diamond rate must be between 0.01 and 1.00")
type Setting struct{ DiamondRateCents int64 }
type Repo interface {
Get(context.Context) (*Setting, error)
Save(context.Context, *Setting) error
}
type Usecase struct{ repo Repo }
func NewUsecase(repo Repo) *Usecase { return &Usecase{repo: repo} }
func (uc *Usecase) Get(ctx context.Context) (*Setting, error) { return uc.repo.Get(ctx) }
func (uc *Usecase) Save(ctx context.Context, v *Setting) error {
if v == nil || v.DiamondRateCents < 1 || v.DiamondRateCents > 100 {
return ErrInvalid
}
return uc.repo.Save(ctx, v)
}