实现管理员的用户增删改功能
This commit is contained in:
@@ -23,6 +23,13 @@ func (s *adminService) PageAdmins(req core.PageReq) (result []*m.Admin, count in
|
||||
FindByPage(req.GetOffset(), req.GetLimit())
|
||||
}
|
||||
|
||||
func (s *adminService) All() (result []*m.Admin, err error) {
|
||||
return q.Admin.
|
||||
Omit(q.Admin.Password).
|
||||
Order(q.Admin.CreatedAt.Desc()).
|
||||
Find()
|
||||
}
|
||||
|
||||
type CreateAdmin struct {
|
||||
Username string `json:"username" validate:"required,min=3,max=50"`
|
||||
Password string `json:"password" validate:"required,min=6,max=50"`
|
||||
|
||||
Reference in New Issue
Block a user