29 lines
824 B
Go
29 lines
824 B
Go
package system
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"management/internal/erpserver/model/dto"
|
|
|
|
"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 dto.SearchDto) (int64, error)
|
|
List(ctx context.Context, filter dto.SearchDto) ([]*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"`
|
|
}
|