正在显示
1 个修改的文件
包含
0 行增加
和
8 行删除
@@ -58,20 +58,12 @@ func (repository *RoleRepository) Remove(Role *domain.Role) (*domain.Role, error | @@ -58,20 +58,12 @@ func (repository *RoleRepository) Remove(Role *domain.Role) (*domain.Role, error | ||
58 | if _, err := repository.Query(queryFunc, cacheRoleIdKey(Role.Id)); err != nil { | 58 | if _, err := repository.Query(queryFunc, cacheRoleIdKey(Role.Id)); err != nil { |
59 | return Role, err | 59 | return Role, err |
60 | } | 60 | } |
61 | - //if _, err := tx.Model(RoleModel).Where("id = ?", Role.Id).Delete(); err != nil { | ||
62 | - // return Role, err | ||
63 | - //} | ||
64 | return Role, nil | 61 | return Role, nil |
65 | } | 62 | } |
66 | 63 | ||
67 | func (repository *RoleRepository) FindOne(queryOptions map[string]interface{}) (*domain.Role, error) { | 64 | func (repository *RoleRepository) FindOne(queryOptions map[string]interface{}) (*domain.Role, error) { |
68 | tx := repository.transactionContext.PgDd | 65 | tx := repository.transactionContext.PgDd |
69 | RoleModel := new(models.Role) | 66 | RoleModel := new(models.Role) |
70 | - //query := NewQuery(tx.Model(RoleModel), queryOptions) | ||
71 | - //query.SetWhere("id = ?", "id") | ||
72 | - //if err := query.First(); err != nil { | ||
73 | - // return nil, fmt.Errorf("query row not found") | ||
74 | - //} | ||
75 | queryFunc := func() (interface{}, error) { | 67 | queryFunc := func() (interface{}, error) { |
76 | query := NewQuery(tx.Model(RoleModel), queryOptions) | 68 | query := NewQuery(tx.Model(RoleModel), queryOptions) |
77 | query.SetWhere("id = ?", "id") | 69 | query.SetWhere("id = ?", "id") |
-
请 注册 或 登录 后发表评论