增加示例
Build and Push to Harbor / build-deploy (push) Failing after 3m8s
Details
Build and Push to Harbor / build-deploy (push) Failing after 3m8s
Details
This commit is contained in:
parent
410bd2515c
commit
799eb2ad11
|
|
@ -60,11 +60,14 @@ func UserCreate(obj *model.User) (*model.User, error) {
|
|||
return obj, nil
|
||||
}
|
||||
|
||||
func UserList(page, pageSize int) ([]model.User, int64, error) {
|
||||
func UserList(page, pageSize int, username *string) ([]model.User, int64, error) {
|
||||
db, err := newDB()
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
if username != nil && *username != "" {
|
||||
db = db.Where("user_name LIKE ?", "%"+*username+"%")
|
||||
}
|
||||
|
||||
var users []model.User
|
||||
var total int64
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ func UserGet(userID string) (*model.User, error) {
|
|||
// UserList 获取用户列表
|
||||
func UserList(page, pageSize int) ([]model.User, int64, error) {
|
||||
// 获取所有用户
|
||||
users, total, err := mysql.UserList(page, pageSize)
|
||||
users, total, err := mysql.UserList(page, pageSize, nil)
|
||||
if err != nil {
|
||||
logrus.WithFields(logrus.Fields{
|
||||
"func": "UserList",
|
||||
|
|
|
|||
Loading…
Reference in New Issue