36 lines
783 B
Go
36 lines
783 B
Go
package admin
|
|
|
|
import (
|
|
"context"
|
|
"github.com/zeromicro/go-zero/core/logx"
|
|
"github.com/zeromicro/go-zero/core/threading"
|
|
"nova_task/internal/logic/nft"
|
|
"nova_task/internal/pkg/errs"
|
|
"nova_task/internal/svc"
|
|
"nova_task/internal/types"
|
|
)
|
|
|
|
type StakeSettleLogic struct {
|
|
logx.Logger
|
|
ctx context.Context
|
|
svcCtx *svc.ServiceContext
|
|
}
|
|
|
|
// 软质压手动结算
|
|
func NewStakeSettleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *StakeSettleLogic {
|
|
return &StakeSettleLogic{
|
|
Logger: logx.WithContext(ctx),
|
|
ctx: ctx,
|
|
svcCtx: svcCtx,
|
|
}
|
|
}
|
|
|
|
func (l *StakeSettleLogic) StakeSettle(req *types.StakeSettleReq) error {
|
|
threading.GoSafe(func() {
|
|
lg := nft.NewStakeSettleLogic(context.Background(), l.svcCtx)
|
|
lg.StakeSettle(req.Date)
|
|
})
|
|
|
|
return errs.Success()
|
|
}
|