作者 郑周

调试 项目接口

... ... @@ -418,5 +418,5 @@ func (rs *EvaluationProjectService) CheckRecipients(in *command.CheckRecipientCo
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return repeatNum, nil
return map[string]interface{}{"repeatNum": repeatNum}, nil
}
... ...
... ... @@ -119,7 +119,7 @@ func (repo *EvaluationCycleRepository) Find(queryOptions map[string]interface{})
query := tx.Model(&m).Where("deleted_at isnull")
if v, ok := queryOptions["name"]; ok && len(v.(string)) > 0 {
if v, ok := queryOptions["name"].(string); ok && len(v) > 0 {
query.Where("name LIKE ?", v)
}
... ... @@ -170,7 +170,7 @@ func (repo *EvaluationCycleRepository) Count(queryOptions map[string]interface{}
query.Where("id != ?", notId)
}
if v, ok := queryOptions["name"]; ok {
if v, ok := queryOptions["name"].(string); ok && len(v) > 0 {
query.Where("name = ?", v)
}
... ...
... ... @@ -186,7 +186,7 @@ func (repo *EvaluationCycleTemplateRepository) Count(queryOptions map[string]int
query.Where("id != ?", v)
}
if v, ok := queryOptions["name"]; ok {
if v, ok := queryOptions["name"].(string); ok && len(v) > 0 {
query.Where("name = ?", v)
}
... ...
... ... @@ -131,7 +131,7 @@ func (repo *EvaluationProjectRepository) Find(queryOptions map[string]interface{
query.ExcludeColumn(excludeColumns...)
}
if v, ok := queryOptions["name"]; ok {
if v, ok := queryOptions["name"].(string); ok && len(v) > 0 {
query.Where("name = ?", v)
}
... ... @@ -192,7 +192,7 @@ func (repo *EvaluationProjectRepository) Count(queryOptions map[string]interface
query.Where("id != ?", v)
}
if v, ok := queryOptions["name"]; ok {
if v, ok := queryOptions["name"].(string); ok && len(v) > 0 {
query.Where("name = ?", v)
}
... ...
... ... @@ -127,7 +127,7 @@ func (repo *EvaluationRuleRepository) Find(queryOptions map[string]interface{})
query.Where("id in(?)", pg.In(v))
}
if v, ok := queryOptions["name"]; ok {
if v, ok := queryOptions["name"].(string); ok && len(v) > 0 {
query.Where("name = ?", v)
}
... ... @@ -176,7 +176,7 @@ func (repo *EvaluationRuleRepository) Count(queryOptions map[string]interface{})
query.Where("id != ?", v)
}
if v, ok := queryOptions["name"]; ok {
if v, ok := queryOptions["name"].(string); ok && len(v) > 0 {
query.Where("name = ?", v)
}
... ...
... ... @@ -129,7 +129,7 @@ func (repo *EvaluationTemplateRepository) Find(queryOptions map[string]interface
query.Where("id != ?", v)
}
if v, ok := queryOptions["name"]; ok && len(v.(string)) > 0 {
if v, ok := queryOptions["name"].(string); ok && len(v) > 0 {
query.Where("name LIKE ?", v)
}
... ... @@ -186,7 +186,7 @@ func (repo *EvaluationTemplateRepository) Count(queryOptions map[string]interfac
query.Where("id != ?", v)
}
if v, ok := queryOptions["name"]; ok {
if v, ok := queryOptions["name"].(string); ok && len(v) > 0 {
query.Where("name = ?", v)
}
... ...
... ... @@ -113,8 +113,8 @@ func (repo *RoleRepository) Find(queryOptions map[string]interface{}) (int64, []
var m []*models.Role
query := tx.Model(&m).Where("deleted_at isnull")
if name, ok := queryOptions["name"]; ok {
query.Where("name = ?", name)
if v, ok := queryOptions["name"].(string); ok && len(v) > 0 {
query.Where("name = ?", v)
}
if companyId, ok := queryOptions["companyId"]; ok {
... ... @@ -154,8 +154,8 @@ func (repo *RoleRepository) Count(queryOptions map[string]interface{}) (int64, e
query.Where("id != ?", notId)
}
if name, ok := queryOptions["name"]; ok {
query.Where("name = ?", name)
if v, ok := queryOptions["name"].(string); ok && len(v) > 0 {
query.Where("name = ?", v)
}
if companyId, ok := queryOptions["companyId"]; ok {
... ...
... ... @@ -161,8 +161,8 @@ func (repo *RoleUserRepository) Count(queryOptions map[string]interface{}) (int6
query.Where("id != ?", notId)
}
if name, ok := queryOptions["name"]; ok {
query.Where("name = ?", name)
if v, ok := queryOptions["name"].(string); ok && len(v) > 0 {
query.Where("name = ?", v)
}
if companyId, ok := queryOptions["companyId"]; ok {
... ...
... ... @@ -116,7 +116,7 @@ func (repo *UserRepository) Find(queryOptions map[string]interface{}) (int, []*d
if v, ok := queryOptions["account"]; ok {
query.Where("account like ?", v)
}
if v, ok := queryOptions["name"]; ok {
if v, ok := queryOptions["name"].(string); ok && len(v) > 0 {
query.Where("name like ?", fmt.Sprintf("%%%v%%", v))
}
if v, ok := queryOptions["offset"]; ok {
... ...