70 lines
2.3 KiB
Go
70 lines
2.3 KiB
Go
package dto
|
|
|
|
type JobConfig struct {
|
|
Auth ServiceConfig `json:"auth,omitempty"`
|
|
Service ServiceConfig `json:"service,omitempty"`
|
|
Persistencia Persistencia `json:"persistencia,omitempty"`
|
|
}
|
|
|
|
type ServiceConfig struct {
|
|
GQL bool `json:"gql,omitempty"`
|
|
Method string `json:"method"`
|
|
Path string `json:"path"`
|
|
Headers map[string]string `json:"headers"`
|
|
Rest *RestOptions `json:"rest,omitempty"`
|
|
GraphQL *GraphQLOptions `json:"graphql,omitempty"`
|
|
}
|
|
|
|
type RestOptions struct {
|
|
Body any `json:"body"`
|
|
Query map[string]string `json:"query"`
|
|
Pagination *RestPagination `json:"pagination,omitempty"`
|
|
}
|
|
|
|
type RestPagination struct {
|
|
Enabled bool `json:"enabled"`
|
|
Skip int `json:"skip"`
|
|
Top int `json:"top"`
|
|
}
|
|
|
|
type GraphQLOptions struct {
|
|
Query string `json:"query"`
|
|
RootField string `json:"root_field"`
|
|
RowField string `json:"row_field"`
|
|
Variables map[string]interface{} `json:"variables"`
|
|
Pagination *GraphQLPagination `json:"pagination"`
|
|
}
|
|
|
|
type GraphQLPagination struct {
|
|
Enabled bool `json:"enabled"`
|
|
CursorField string `json:"cursorField"`
|
|
HasNextField string `json:"hasNextField"`
|
|
LimitField string `json:"limitField"`
|
|
CursorParam string `json:"cursorParam"`
|
|
}
|
|
|
|
type Persistencia struct {
|
|
Table string `json:"table"`
|
|
BatchSize int `json:"batch_size"`
|
|
CampoSync string `json:"campo_sync"`
|
|
PrimaryKey string `json:"primary_key"`
|
|
Fields map[string]string `json:"fields"`
|
|
StaticFields map[string]interface{} `json:"static_fields"`
|
|
UpdateBy map[string]string `json:"update_by"`
|
|
Eliminacion struct {
|
|
Field string `json:"field"`
|
|
Enabled bool `json:"enabled"`
|
|
} `json:"soft_delete"`
|
|
StringifyFields []string `json:"stringify_fields"`
|
|
|
|
// 👇 NUEVO: clave compuesta precomputada
|
|
PrimaryKeyName string `json:"primary_key_name"` // p.ej. "pk_redis"
|
|
PrimaryKeyConcat []string `json:"primary_key_concat"` // p.ej. ["@company_db","card_code"]
|
|
PrimaryKeySeparator string `json:"primary_key_separator"` // p.ej. ":"
|
|
}
|
|
|
|
type Eliminacion struct {
|
|
Field string `json:"field"`
|
|
Enabled bool `json:"enabled"`
|
|
}
|