2025-06-30 16:44:06 +08:00

29 lines
845 B
Go

package system
import (
"context"
"time"
"management/internal/erpserver/model/system/request"
"gorm.io/datatypes"
)
type ConfigRepository interface {
Initialize(ctx context.Context) error
Create(ctx context.Context, obj *Config) error
Update(ctx context.Context, obj *Config) error
Get(ctx context.Context, id int32) (*Config, error)
GetByKey(ctx context.Context, key string) (*Config, error)
Count(ctx context.Context, filter request.ListConfig) (int64, error)
List(ctx context.Context, filter request.ListConfig) ([]*Config, error)
}
type Config struct {
ID int32 `db:"id" json:"id"`
Key string `db:"key" json:"key"`
Value datatypes.JSON `db:"value" json:"value"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}