feat:完善项目
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user