Files
go-gin-api/internal/web/controller/cron_handler/func_editview.go
T
新亮 b382919cb5 feature(1.2.7): 新增 WEB 模块 - 后台任务
- 新增数据表:cron_task;
- 后台新增后台任务模块,支持(创建、编辑、启用/禁用、列表);
- 调整项目初始化,使其支持安装后台任务模块;
- 调整服务升级指引,1.2.6 -> 1.2.7;
2021-08-21 21:04:42 +08:00

36 lines
762 B
Go

package cron_handler
import (
"net/http"
"github.com/xinliangnote/go-gin-api/internal/pkg/code"
"github.com/xinliangnote/go-gin-api/internal/pkg/core"
"github.com/xinliangnote/go-gin-api/pkg/errno"
)
type editViewRequest struct {
Id string `uri:"id"` // 主键ID
}
type editViewResponse struct {
HashID string `json:"hash_id"` // hashID
}
func (h *handler) EditView() core.HandlerFunc {
return func(ctx core.Context) {
req := new(editViewRequest)
if err := ctx.ShouldBindURI(req); err != nil {
ctx.AbortWithError(errno.NewError(
http.StatusBadRequest,
code.ParamBindError,
code.Text(code.ParamBindError)).WithErr(err),
)
return
}
obj := new(editViewResponse)
obj.HashID = req.Id
ctx.HTML("cron_task_edit", obj)
}
}