Add creator and modifier fields

This commit is contained in:
cuigh
2021-12-16 16:11:16 +08:00
parent bd7b8364d9
commit c3115b952c
48 changed files with 668 additions and 544 deletions

View File

@@ -36,21 +36,15 @@ func NewChart(b biz.ChartBiz) *ChartHandler {
}
func chartSearch(b biz.ChartBiz) web.HandlerFunc {
type Args struct {
Name string `json:"name" bind:"name"`
Dashboard string `json:"dashboard" bind:"dashboard"`
PageIndex int `json:"pageIndex" bind:"pageIndex"`
PageSize int `json:"pageSize" bind:"pageSize"`
}
return func(ctx web.Context) (err error) {
var (
args = &Args{}
args = &model.ChartSearchArgs{}
charts []*biz.Chart
total int
)
if err = ctx.Bind(args); err == nil {
charts, total, err = b.Search(args.Name, args.Dashboard, args.PageIndex, args.PageSize)
charts, total, err = b.Search(args)
}
if err != nil {

View File

@@ -25,7 +25,7 @@ func NewEvent(b biz.EventBiz) *EventHandler {
func eventSearch(b biz.EventBiz) web.HandlerFunc {
return func(ctx web.Context) (err error) {
var (
args = &model.EventListArgs{}
args = &model.EventSearchArgs{}
events []*biz.Event
total int
)

View File

@@ -147,7 +147,7 @@ func userSetStatus(b biz.UserBiz) web.HandlerFunc {
args := &Args{}
err := ctx.Bind(args)
if err == nil {
err = b.SetStatus(args.ID, args.Status)
err = b.SetStatus(args.ID, args.Status, ctx.User())
}
return ajax(ctx, err)
}
@@ -163,7 +163,7 @@ func userModifyPassword(b biz.UserBiz) web.HandlerFunc {
args := &Args{}
err := ctx.Bind(args)
if err == nil {
err = b.ModifyPassword(ctx.User().ID(), args.OldPassword, args.NewPassword)
err = b.ModifyPassword(args.OldPassword, args.NewPassword, ctx.User())
}
return ajax(ctx, err)
}
@@ -174,8 +174,7 @@ func userModifyProfile(b biz.UserBiz) web.HandlerFunc {
u := &biz.User{}
err := ctx.Bind(u, true)
if err == nil {
u.ID = ctx.User().ID()
err = b.ModifyProfile(u)
err = b.ModifyProfile(u, ctx.User())
}
return ajax(ctx, err)
}