切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
郑周
2 years ago
提交
897b9a1d5f68e795495b33f32c4069a8bd77eadd
1 个父辈
578fb5b5
1. 用户搜索 增加 状态过滤条件
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
6 行增加
和
1 行删除
pkg/application/user/user.go
pkg/domain/user.go
pkg/infrastructure/repository/pg_user_repository.go
pkg/application/user/user.go
查看文件 @
897b9a1
...
...
@@ -5,6 +5,7 @@ import (
"github.com/linmadan/egglib-go/utils/tool_funs"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/user/query"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
)
type
UserService
struct
{}
...
...
@@ -26,6 +27,7 @@ func (service *UserService) ListUsers(listUserQuery *query.ListUserQuery) (inter
count
,
list
,
err
:=
userRepo
.
Find
(
map
[
string
]
interface
{}{
"companyId"
:
listUserQuery
.
CompanyId
,
"name"
:
listUserQuery
.
Name
,
"status"
:
domain
.
UserStatusEnable
,
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
...
...
pkg/domain/user.go
查看文件 @
897b9a1
...
...
@@ -24,7 +24,7 @@ const (
UserTypeCommon
int
=
1
UserTypeManager
int
=
2
UserStatusEnable
int
=
1
UserStatusEnable
int
=
1
// 正常用户 2禁用用户
)
type
UserRepository
interface
{
...
...
pkg/infrastructure/repository/pg_user_repository.go
查看文件 @
897b9a1
...
...
@@ -119,6 +119,9 @@ 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
[
"status"
];
ok
{
query
.
Where
(
"status=?"
,
v
)
}
if
v
,
ok
:=
queryOptions
[
"name"
]
.
(
string
);
ok
&&
len
(
v
)
>
0
{
query
.
Where
(
"name like ?"
,
fmt
.
Sprintf
(
"%%%v%%"
,
v
))
}
...
...
请
注册
或
登录
后发表评论