30 lines
626 B
Go
30 lines
626 B
Go
package controller
|
|
|
|
import (
|
|
"net/http"
|
|
"yintai-api/app/api/request"
|
|
"yintai-api/app/api/service"
|
|
err2 "yintai-api/app/common/err"
|
|
"yintai-api/app/common/response"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type Job struct{}
|
|
|
|
func (r *Job) List(ctx *gin.Context) {
|
|
var req request.JobList2
|
|
if err := ctx.Bind(&req); err != nil {
|
|
err2.ParamErr(err)
|
|
}
|
|
res, count := new(service.Job).List(req)
|
|
ctx.JSON(http.StatusOK, response.NewListRsp(count, res))
|
|
}
|
|
|
|
func (r *Job) Get(ctx *gin.Context) {
|
|
var req request.JobDelete
|
|
req.ID = ctx.Param("id")
|
|
res := new(service.Job).Get(req)
|
|
ctx.JSON(http.StatusOK, response.NewRsp(res))
|
|
}
|