package handler

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"youngee_b_api/model/http_model"
	"youngee_b_api/service"
)

func WrapdeleteJobHandler(ctx *gin.Context) {
	handler := newdeleteJobHandler(ctx)
	baseRun(handler)
}

func newdeleteJobHandler(ctx *gin.Context) *DeleteJobHandler {
	return &DeleteJobHandler{
		req:  http_model.NewDeleteJobRequest(),
		resp: http_model.NewDeleteJobResponse(),
		ctx:  ctx,
	}
}

type DeleteJobHandler struct {
	req  *http_model.DeleteJobRequest
	resp *http_model.CommonResponse
	ctx  *gin.Context
}

func (h *DeleteJobHandler) getRequest() interface{} {
	return h.req
}
func (h *DeleteJobHandler) getContext() *gin.Context {
	return h.ctx
}
func (h *DeleteJobHandler) getResponse() interface{} {
	return h.resp
}
func (h *DeleteJobHandler) run() {
	jobData := http_model.DeleteJobRequest{}
	jobData = *h.req
	err := service.Job.DeleteJob(h.ctx, jobData)
	if err != nil {
		fmt.Println(err)
	}
	return
}

func (h *DeleteJobHandler) checkParam() error {
	return nil
}
