feat:完善项目

This commit is contained in:
henry
2021-11-09 14:08:02 +08:00
parent 08083d26d3
commit d544b7f80c
14 changed files with 338 additions and 61 deletions

View File

@ -94,10 +94,35 @@ func (*Work) Instance(c *gin.Context) {
APIResponse(err, data)(c)
}
func (*Work) Person(c *gin.Context) {
form := &struct {
MaterialID uint64 `json:"material_id" form:"material_id"`
Kind int `json:"kind" form:"kind"`
PageForm
}{}
if err := bind(form)(c); err != nil {
APIFailure(err.(error))(c)
return
}
data, err := work.NewInstance()(getSession()(c).(*service.Session)).Person(form.MaterialID, form.Kind, form.Page, form.PageSize)
APIResponse(err, data)(c)
}
func (*Work) ToDo(c *gin.Context) {
}
func (*Work) Detail(c *gin.Context) {
form := new(IDStringForm)
if err := bind(form)(c); err != nil {
APIFailure(err.(error))(c)
return
}
data, err := work.NewInstance()(getSession()(c).(*service.Session)).Detail(form.Convert())
APIResponse(err, data)(c)
}
func (*Work) Launch(c *gin.Context) {
form := &struct {
workLaunchForm
@ -129,3 +154,19 @@ func (*Work) Examine(c *gin.Context) {
err := work.NewInstance()(getSession()(c).(*service.Session)).Examine(form.Convert(), form.Status, form.Remark, form.IsAssist)
APIResponse(err)
}
func (*Work) Delete(c *gin.Context) {
form := new(IDStringForm)
if err := bind(form)(c); err != nil {
APIFailure(err.(error))(c)
return
}
err := work.NewInstance()(getSession()(c).(*service.Session)).Delete(form.Convert())
APIResponse(err)(c)
}
func (*Work) Schedule(c *gin.Context) {
data, err := work.NewSchedule()(getSession()(c).(*service.Session)).List()
APIResponse(err, data)(c)
}