...
|
...
|
@@ -92,28 +92,28 @@ func (ptr *QuerySetService) Create(ctx *domain.Context, qs *domain.QuerySet) (*d |
|
|
return newQuerySet, nil
|
|
|
}
|
|
|
|
|
|
func (ptr *QuerySetService) Update(ctx *domain.Context, querySetId int, queryComponents []*domain.QueryComponent) error {
|
|
|
func (ptr *QuerySetService) Update(ctx *domain.Context, querySetId int, queryComponents []*domain.QueryComponent) (*domain.QuerySet, error) {
|
|
|
querySetRepository, _ := repository.NewQuerySetRepository(ptr.transactionContext)
|
|
|
qs, err := querySetRepository.FindOne(map[string]interface{}{"querySetId": querySetId})
|
|
|
if err != nil {
|
|
|
return err
|
|
|
return qs, err
|
|
|
}
|
|
|
defer func() {
|
|
|
AsyncEvent(domain.NewEventTable(ctx, domain.QuerySetUpdateEvent).WithQuerySet(qs))
|
|
|
}()
|
|
|
if qs.Type == domain.SchemaTable.ToString() || qs.Type == domain.SubProcessTable.ToString() {
|
|
|
return ptr.UpdateDefault(ctx, qs, queryComponents)
|
|
|
return qs, ptr.UpdateDefault(ctx, qs, queryComponents)
|
|
|
}
|
|
|
if qs.Type == domain.CalculateItem.ToString() {
|
|
|
return ptr.UpdateCalculateItem(ctx, qs, queryComponents)
|
|
|
return qs, ptr.UpdateCalculateItem(ctx, qs, queryComponents)
|
|
|
}
|
|
|
if qs.Type == domain.CalculateTable.ToString() {
|
|
|
return ptr.UpdateCalculateTable(ctx, qs, queryComponents)
|
|
|
return qs, ptr.UpdateCalculateTable(ctx, qs, queryComponents)
|
|
|
}
|
|
|
if qs.Type == domain.CalculateSet.ToString() {
|
|
|
return ptr.UpdateCalculateSet(ctx, qs, queryComponents)
|
|
|
return qs, ptr.UpdateCalculateSet(ctx, qs, queryComponents)
|
|
|
}
|
|
|
return nil
|
|
|
return qs, nil
|
|
|
}
|
|
|
|
|
|
func (ptr *QuerySetService) UpdateDefault(ctx *domain.Context, qs *domain.QuerySet, queryComponents []*domain.QueryComponent) error {
|
...
|
...
|
|