feat:完善项目信息
This commit is contained in:
@ -12,13 +12,13 @@ type Manage struct{}
|
||||
type (
|
||||
// enterpriseForm 设备信息
|
||||
enterpriseForm struct {
|
||||
Mode int `json:"mode" form:"mode" binding:"required"`
|
||||
Title string `json:"title" form:"title" binding:"required"`
|
||||
Name string `json:"name" form:"name"`
|
||||
Mobile string `json:"mobile" form:"mobile"`
|
||||
Content string `json:"content" form:"content"`
|
||||
Papers []string `json:"papers" form:"papers"`
|
||||
Patents []string `json:"patents" form:"patents"`
|
||||
Mode int `json:"mode" form:"mode" binding:"required"`
|
||||
Name string `json:"name" form:"name" binding:"required"`
|
||||
Contact string `json:"contact" form:"contact"`
|
||||
ContactMobile string `json:"contact_mobile" form:"contact_mobile"`
|
||||
Content string `json:"content" form:"content"`
|
||||
Papers []string `json:"papers" form:"papers"`
|
||||
Patents []string `json:"patents" form:"patents"`
|
||||
}
|
||||
// equipmentForm 设备信息
|
||||
equipmentForm struct {
|
||||
@ -54,8 +54,8 @@ func (a *enterpriseForm) PatentInfo() []uint64 {
|
||||
|
||||
func (*Manage) Enterprise(c *gin.Context) {
|
||||
form := &struct {
|
||||
Mode int `json:"mode" form:"mode" binding:"required"`
|
||||
Title string `json:"title" form:"title"`
|
||||
Name string `json:"name" form:"name"`
|
||||
Mode int `json:"mode" form:"mode" binding:"required"`
|
||||
api.PageForm
|
||||
}{}
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
@ -63,7 +63,7 @@ func (*Manage) Enterprise(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
data, err := manage.NewEnterprise()(api.GetSession()(c).(*session.Enterprise), api.GetTenantID()(c).(uint64)).
|
||||
List(form.Mode, form.Title, form.Page, form.PageSize)
|
||||
List(form.Name, form.Mode, form.Page, form.PageSize)
|
||||
api.APIResponse(err, data)(c)
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ func (*Manage) EnterpriseAdd(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
err := manage.NewEnterprise()(api.GetSession()(c).(*session.Enterprise), api.GetTenantID()(c).(uint64)).
|
||||
Form(&manage.EnterpriseParams{Mode: form.Mode, Title: form.Title, Name: form.Name, Mobile: form.Mobile,
|
||||
Form(&manage.EnterpriseParams{Mode: form.Mode, Name: form.Name, Contact: form.Contact, ContactMobile: form.ContactMobile,
|
||||
Papers: form.paperInfo(), Patents: form.PatentInfo(), Content: form.Content,
|
||||
})
|
||||
api.APIResponse(err)(c)
|
||||
@ -91,8 +91,8 @@ func (*Manage) EnterpriseEdit(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
err := manage.NewEnterprise()(api.GetSession()(c).(*session.Enterprise), api.GetTenantID()(c).(uint64)).
|
||||
Form(&manage.EnterpriseParams{ID: form.Convert(), Mode: form.Mode, Title: form.Title, Name: form.Name,
|
||||
Mobile: form.Mobile, Papers: form.paperInfo(), Patents: form.PatentInfo(), Content: form.Content,
|
||||
Form(&manage.EnterpriseParams{ID: form.Convert(), Mode: form.Mode, Name: form.Name, Contact: form.Contact,
|
||||
ContactMobile: form.ContactMobile, Papers: form.paperInfo(), Patents: form.PatentInfo(), Content: form.Content,
|
||||
})
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
Reference in New Issue
Block a user