package server import ( "admin/apps/game/model/dto" "admin/internal/context" ) func (ctl *controller) CommonList(ctx *context.WebContext, restfulResourceName string, params *dto.CommonListReq) { list, err := ctl.svc.CommonList(ctx, restfulResourceName, params) if err != nil { ctx.Fail(err) return } ctx.Ok(list) } func (ctl *controller) CommonPost(ctx *context.WebContext, restfulResourceName string, params *dto.CommonDtoValues) { newObj, err := ctl.svc.CommonPost(ctx, restfulResourceName, *params) if err != nil { ctx.Fail(err) return } ctx.Ok(newObj) } func (ctl *controller) CommonPut(ctx *context.WebContext, restfulResourceName string, params *dto.CommonDtoValues) { newObj, err := ctl.svc.CommonPut(ctx, restfulResourceName, *params) if err != nil { ctx.Fail(err) return } ctx.Ok(newObj) } func (ctl *controller) CommonDelete(ctx *context.WebContext, restfulResourceName string, id int) { err := ctl.svc.CommonDelete(ctx, restfulResourceName, id) if err != nil { ctx.Fail(err) return } ctx.Ok(nil) }