upload
This commit is contained in:
@@ -39,14 +39,7 @@ func (a *app) list(w http.ResponseWriter, r *http.Request) {
|
||||
a.render.JSONErr(w, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
data := render.ResponseList{
|
||||
Code: 0,
|
||||
Message: "ok",
|
||||
Count: count,
|
||||
Data: res,
|
||||
}
|
||||
a.render.JSON(w, data)
|
||||
a.render.JSON(w, render.NewResponseList(count, res))
|
||||
default:
|
||||
http.Error(w, "Method Not Allowed", http.StatusMethodNotAllowed)
|
||||
}
|
||||
|
||||
@@ -44,14 +44,7 @@ func (a *app) list(w http.ResponseWriter, r *http.Request) {
|
||||
a.render.JSONErr(w, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
data := render.ResponseList{
|
||||
Code: 0,
|
||||
Message: "ok",
|
||||
Count: count,
|
||||
Data: res,
|
||||
}
|
||||
a.render.JSON(w, data)
|
||||
a.render.JSON(w, render.NewResponseList(count, res))
|
||||
default:
|
||||
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
|
||||
}
|
||||
|
||||
@@ -44,14 +44,7 @@ func (a *app) list(w http.ResponseWriter, r *http.Request) {
|
||||
a.render.JSONErr(w, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
data := render.ResponseList{
|
||||
Code: 0,
|
||||
Message: "ok",
|
||||
Count: count,
|
||||
Data: res,
|
||||
}
|
||||
a.render.JSON(w, data)
|
||||
a.render.JSON(w, render.NewResponseList(count, res))
|
||||
default:
|
||||
http.Error(w, "Method Not Allowed", http.StatusMethodNotAllowed)
|
||||
}
|
||||
|
||||
@@ -38,14 +38,7 @@ func (a *app) list(w http.ResponseWriter, r *http.Request) {
|
||||
a.render.JSONErr(w, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
data := render.ResponseList{
|
||||
Code: 0,
|
||||
Message: "ok",
|
||||
Count: count,
|
||||
Data: res,
|
||||
}
|
||||
a.render.JSON(w, data)
|
||||
a.render.JSON(w, render.NewResponseList(count, res))
|
||||
default:
|
||||
http.Error(w, "Method Not Allowed", http.StatusMethodNotAllowed)
|
||||
}
|
||||
|
||||
@@ -54,14 +54,7 @@ func (a *app) list(w http.ResponseWriter, r *http.Request) {
|
||||
a.render.JSONErr(w, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
data := render.ResponseList{
|
||||
Code: 0,
|
||||
Message: "ok",
|
||||
Count: 0,
|
||||
Data: res,
|
||||
}
|
||||
a.render.JSON(w, data)
|
||||
a.render.JSON(w, render.NewResponseList(0, res))
|
||||
default:
|
||||
a.render.JSONErr(w, "method not allowed")
|
||||
}
|
||||
|
||||
@@ -48,14 +48,7 @@ func (a *app) list(w http.ResponseWriter, r *http.Request) {
|
||||
a.render.JSONErr(w, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
data := render.ResponseList{
|
||||
Code: 0,
|
||||
Message: "ok",
|
||||
Count: count,
|
||||
Data: res,
|
||||
}
|
||||
a.render.JSON(w, data)
|
||||
a.render.JSON(w, render.NewResponseList(count, res))
|
||||
default:
|
||||
http.Error(w, "Method Not Allowed", http.StatusMethodNotAllowed)
|
||||
}
|
||||
|
||||
@@ -56,8 +56,8 @@ func (a *app) edit(w http.ResponseWriter, r *http.Request) {
|
||||
vm := &systemmodel.User{}
|
||||
if id > 0 {
|
||||
if u, err := a.userService.Get(ctx, id); err == nil {
|
||||
vm.HashedPassword = []byte("********")
|
||||
vm = u
|
||||
vm.HashedPassword = []byte("********")
|
||||
}
|
||||
}
|
||||
a.render.Render(ctx, w, user.Edit(ctx, vm))
|
||||
@@ -122,14 +122,7 @@ func (a *app) list(w http.ResponseWriter, r *http.Request) {
|
||||
a.render.JSONErr(w, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
data := render.ResponseList{
|
||||
Code: 0,
|
||||
Message: "ok",
|
||||
Count: count,
|
||||
Data: res,
|
||||
}
|
||||
a.render.JSON(w, data)
|
||||
a.render.JSON(w, render.NewResponseList(count, res))
|
||||
default:
|
||||
http.Error(w, "Method Not Allowed", http.StatusMethodNotAllowed)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user