kra-oa/internal/modules/system/biz/parameter.go

34 lines
895 B
Go

package biz
import (
"context"
"time"
)
type SystemParameter struct {
ID uint
CreatedAt time.Time
UpdatedAt time.Time
Name string
Key string
Value string
Desc string
StartCreatedAt *time.Time
EndCreatedAt *time.Time
}
type ParameterRepo interface {
CreateParameter(context.Context, *SystemParameter) error
UpdateParameter(context.Context, *SystemParameter) error
DeleteParameters(context.Context, []string) error
FindParameterByID(context.Context, string) (*SystemParameter, error)
FindParameterByKey(context.Context, string) (*SystemParameter, error)
ListParameters(context.Context, int, int, *SystemParameter) ([]*SystemParameter, int64, error)
}
type ParameterUsecase struct{ ParameterRepo }
func NewParameterUsecase(repo ParameterRepo) *ParameterUsecase {
return &ParameterUsecase{ParameterRepo: repo}
}