feat:完善信息

This commit is contained in:
henry
2022-01-23 22:59:11 +08:00
parent 5e328ab2da
commit 79c5cbfe74
9 changed files with 340 additions and 7 deletions

View File

@ -439,6 +439,44 @@ func (a *Technology) DemandDelete(c *gin.Context) {
api.APIResponse(err)(c)
}
func (*Technology) DemandService(c *gin.Context) {
form := &struct {
Title string `json:"title" form:"status"`
api.PageForm
}{}
if err := api.Bind(form)(c); err != nil {
api.APIFailure(err.(error))(c)
return
}
data, err := technology2.NewDemandService()(api.GetSession()(c).(*session.Enterprise)).Instance(form.Title, form.Page, form.PageSize)
api.APIResponse(err, data)(c)
}
func (*Technology) DemandServiceDetail(c *gin.Context) {
form := new(api.IDStringForm)
if err := api.Bind(form)(c); err != nil {
api.APIFailure(err.(error))(c)
return
}
data, err := technology2.NewDemandService()(api.GetSession()(c).(*session.Enterprise)).Detail(form.Convert())
api.APIResponse(err, data)(c)
}
func (*Technology) DemandServiceHandle(c *gin.Context) {
form := &struct {
api.IDStringForm
Status int `json:"status" form:"status" binding:"required"`
Config string `json:"config" form:"config"`
}{}
if err := api.Bind(form)(c); err != nil {
api.APIFailure(err.(error))(c)
return
}
err := technology2.NewDemandService()(api.GetSession()(c).(*session.Enterprise)).Handle(form.Convert(), form.Status, form.Config)
api.APIResponse(err)(c)
}
func (a *Technology) Topic(c *gin.Context) {
form := &struct {
Status int `json:"status" form:"status"`