...
|
...
|
@@ -162,23 +162,6 @@ func (rs *EvaluationRuleService) Remove(in *command.DeleteRuleCommand) (interfac |
|
|
return rule, nil
|
|
|
}
|
|
|
|
|
|
//func (rs *EvaluationRuleService) List(in *command.QueryRuleCommand) (interface{}, error) {
|
|
|
// transactionContext, err := factory.StartTransaction()
|
|
|
// if err != nil {
|
|
|
// return nil, err
|
|
|
// }
|
|
|
// defer func() {
|
|
|
// transactionContext.RollbackTransaction()
|
|
|
// }()
|
|
|
// ruleRepository := factory.CreateEvaluationRuleRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
//
|
|
|
// total, rules, err := ruleRepository.Find(tool_funs.SimpleStructToMap(in))
|
|
|
// if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
// }
|
|
|
// return tool_funs.SimpleWrapGridMap(total, rules), nil
|
|
|
//}
|
|
|
|
|
|
func (rs *EvaluationRuleService) ListRelCreator(in *command.QueryRuleCommand) (interface{}, error) {
|
|
|
transactionContext, err := factory.ValidateStartTransaction(in)
|
|
|
if err != nil {
|
...
|
...
|
@@ -220,6 +203,8 @@ func (rs *EvaluationRuleService) ListRelCreator(in *command.QueryRuleCommand) (i |
|
|
ra := &adapter.RuleAdapter{}
|
|
|
ra.EvaluationRule = rule
|
|
|
ras = append(ras, ra)
|
|
|
|
|
|
total += 1
|
|
|
}
|
|
|
|
|
|
_, users, _ := userRepository.Find(map[string]interface{}{"ids": creatorIds, "limit": len(creatorIds)})
|
...
|
...
|
@@ -234,6 +219,11 @@ func (rs *EvaluationRuleService) ListRelCreator(in *command.QueryRuleCommand) (i |
|
|
ras[i].CreatorName = v
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
return tool_funs.SimpleWrapGridMap(total, ras), nil
|
|
|
}
|
|
|
|
...
|
...
|
@@ -271,5 +261,9 @@ func (rs *EvaluationRuleService) ListCreator(in *command.QueryCreatorCommand) (i |
|
|
}
|
|
|
cas = append(cas, ca)
|
|
|
}
|
|
|
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
return map[string]interface{}{"list": cas}, nil
|
|
|
} |
...
|
...
|
|