diff --git a/rpc/core/internal/logic/oauth_provider/get_oauth_provider_list_logic.go b/rpc/core/internal/logic/oauth_provider/get_oauth_provider_list_logic.go index 7da7443..655bf8f 100644 --- a/rpc/core/internal/logic/oauth_provider/get_oauth_provider_list_logic.go +++ b/rpc/core/internal/logic/oauth_provider/get_oauth_provider_list_logic.go @@ -38,10 +38,6 @@ func (l *GetOauthProviderListLogic) GetOauthProviderList(in *core.OauthProviderR if in.Init != nil { predicates = append(predicates, oauthprovider.InitEQ(in.GetInit())) } - if len(predicates) == 0 { - return &core.OauthProviderListResp{}, nil - } - query := l.svcCtx.DB.OauthProvider.Query().Where(predicates...) var ( pagination *core.Pagination diff --git a/rpc/core/internal/logic/oauth_provider/get_oauth_provider_logic.go b/rpc/core/internal/logic/oauth_provider/get_oauth_provider_logic.go index e38e0f5..0379230 100644 --- a/rpc/core/internal/logic/oauth_provider/get_oauth_provider_logic.go +++ b/rpc/core/internal/logic/oauth_provider/get_oauth_provider_logic.go @@ -41,9 +41,6 @@ func (l *GetOauthProviderLogic) GetOauthProvider(in *core.OauthProviderReq) (*co if in.Init != nil { predicates = append(predicates, oauthprovider.InitEQ(in.GetInit())) } - if len(predicates) == 0 { - return l.svcCtx.Convert.ConvertOAuthProviderRpc(l.ctx, nil), nil - } Query: dbData, err := l.svcCtx.DB.OauthProvider.Query(). Where(predicates...). diff --git a/rpc/core/internal/logic/role/get_role_list_logic.go b/rpc/core/internal/logic/role/get_role_list_logic.go index 4fb258e..54d66f4 100644 --- a/rpc/core/internal/logic/role/get_role_list_logic.go +++ b/rpc/core/internal/logic/role/get_role_list_logic.go @@ -26,17 +26,12 @@ func NewGetRoleListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetRo func (l *GetRoleListLogic) GetRoleList(in *core.RoleReq) (*core.RoleListResp, error) { var predicates []predicate.Role - if in.ID != 0 { - predicates = append(predicates, role.IDEQ(in.ID)) - goto Query - } if in.Name != "" { predicates = append(predicates, role.NameContains(in.Name)) } if in.Code != "" { - predicates = append(predicates, role.CodeEQ(in.Code)) + predicates = append(predicates, role.CodeContains(in.Code)) } -Query: query := l.svcCtx.DB.Role.Query(). Where(predicates...) if in.WithUser { diff --git a/rpc/core/internal/logic/user/get_user_list_logic.go b/rpc/core/internal/logic/user/get_user_list_logic.go index 93f4b03..210d0a4 100644 --- a/rpc/core/internal/logic/user/get_user_list_logic.go +++ b/rpc/core/internal/logic/user/get_user_list_logic.go @@ -26,9 +26,6 @@ func NewGetUserListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUs func (l *GetUserListLogic) GetUserList(in *core.UserReq) (*core.UserListResp, error) { var predicates []predicate.User - if in.ID != 0 { - predicates = append(predicates, user.IDEQ(in.ID)) - } if in.Username != "" { predicates = append(predicates, user.UsernameContains(in.Username)) }