feat:完善项目
This commit is contained in:
@ -269,3 +269,31 @@ func (*Service) MessageDelete(c *gin.Context) {
|
||||
err := service.NewMessage()(api.GetSession()(c).(*session.Admin)).Delete(form.Convert())
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
||||
func (*Service) Demand(c *gin.Context) {
|
||||
form := &struct {
|
||||
api.TenantIDStringForm
|
||||
Title string `json:"title" form:"title"`
|
||||
Kind int `json:"kind" form:"kind"`
|
||||
api.PageForm
|
||||
}{}
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data, err := service.NewDemand()(api.GetSession()(c).(*session.Admin)).Instance(form.TenantIDStringForm.Convert(),
|
||||
form.Title, form.Kind, form.Page, form.PageSize)
|
||||
api.APIResponse(err, data)(c)
|
||||
}
|
||||
|
||||
func (*Service) DemandDelete(c *gin.Context) {
|
||||
form := &struct {
|
||||
api.IDStringForm
|
||||
}{}
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
err := service.NewDemand()(api.GetSession()(c).(*session.Admin)).Delete(form.Convert())
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
Reference in New Issue
Block a user