feat:完善项目
This commit is contained in:
@ -12,3 +12,51 @@ func (*User) Info(c *gin.Context) {
|
||||
data := user.NewInstance()(getSession()(c).(*service.Session)).Info()
|
||||
APIResponse(nil, data)
|
||||
}
|
||||
|
||||
func (*User) List(c *gin.Context) {
|
||||
form := &struct {
|
||||
Name string `json:"name" form:"name"`
|
||||
Mobile string `json:"mobile" form:"mobile"`
|
||||
TenantID uint64 `json:"tenant_id" form:"tenant_id"`
|
||||
PageForm
|
||||
}{}
|
||||
if err := bind(form)(c); err != nil {
|
||||
APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data, err := user.NewInstance()(getSession()(c).(*service.Session)).List(form.Name, form.Mobile, form.TenantID,
|
||||
form.Page, form.PageSize)
|
||||
APIResponse(err, data)
|
||||
}
|
||||
|
||||
func (*User) Add(c *gin.Context) {
|
||||
form := &struct {
|
||||
Name string `json:"name" form:"name"`
|
||||
Mobile string `json:"mobile" form:"mobile"`
|
||||
TenantID uint64 `json:"tenant_id" form:"tenant_id"`
|
||||
PageForm
|
||||
}{}
|
||||
if err := bind(form)(c); err != nil {
|
||||
APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data, err := user.NewInstance()(getSession()(c).(*service.Session)).List(form.Name, form.Mobile, form.TenantID,
|
||||
form.Page, form.PageSize)
|
||||
APIResponse(err, data)
|
||||
}
|
||||
|
||||
func (*User) Edit(c *gin.Context) {
|
||||
form := &struct {
|
||||
Name string `json:"name" form:"name"`
|
||||
Mobile string `json:"mobile" form:"mobile"`
|
||||
TenantID uint64 `json:"tenant_id" form:"tenant_id"`
|
||||
PageForm
|
||||
}{}
|
||||
if err := bind(form)(c); err != nil {
|
||||
APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data, err := user.NewInstance()(getSession()(c).(*service.Session)).List(form.Name, form.Mobile, form.TenantID,
|
||||
form.Page, form.PageSize)
|
||||
APIResponse(err, data)
|
||||
}
|
||||
|
Reference in New Issue
Block a user