mirror of
https://github.com/xinliangnote/go-gin-api.git
synced 2024-04-21 12:31:46 +00:00
- 新增数据表:cron_task; - 后台新增后台任务模块,支持(创建、编辑、启用/禁用、列表); - 调整项目初始化,使其支持安装后台任务模块; - 调整服务升级指引,1.2.6 -> 1.2.7;
36 lines
762 B
Go
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)
|
|
}
|
|
}
|