feat:完善项目
This commit is contained in:
@ -126,11 +126,30 @@ func (*Config) Breakdown(c *gin.Context) {
|
||||
}
|
||||
|
||||
func (*Config) BreakdownAdd(c *gin.Context) {
|
||||
|
||||
form := &struct {
|
||||
Title string `json:"title" form:"title" binding:"required"`
|
||||
Remark string `json:"remark" form:"remark"`
|
||||
}{}
|
||||
if err := bind(form)(c); err != nil {
|
||||
APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
err := config.NewBreakdown()(getSession()(c).(*service.Session)).Form(0, form.Title, form.Remark)
|
||||
APIResponse(err)(c)
|
||||
}
|
||||
|
||||
func (*Config) BreakdownEdit(c *gin.Context) {
|
||||
|
||||
form := &struct {
|
||||
IDStringForm
|
||||
Title string `json:"title" form:"title" binding:"required"`
|
||||
Remark string `json:"remark" form:"remark"`
|
||||
}{}
|
||||
if err := bind(form)(c); err != nil {
|
||||
APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
err := config.NewBreakdown()(getSession()(c).(*service.Session)).Form(form.Convert(), form.Title, form.Remark)
|
||||
APIResponse(err)(c)
|
||||
}
|
||||
|
||||
func (*Config) BreakdownDelete(c *gin.Context) {
|
||||
|
Reference in New Issue
Block a user