feat:完善项目信息
This commit is contained in:
@ -45,6 +45,7 @@ func (*Activity) Form(c *gin.Context) {
|
||||
api.TenantIDStringForm
|
||||
api.ImageForm
|
||||
Title string `json:"title" form:"title" binding:"required"`
|
||||
Description string `json:"description" form:"description" binding:"required"`
|
||||
Content string `json:"content" form:"content" binding:"required"`
|
||||
Contact string `json:"contact" form:"contact" binding:"required"`
|
||||
ContactMobile string `json:"contact_mobile" form:"contact_mobile"`
|
||||
@ -67,7 +68,7 @@ func (*Activity) Form(c *gin.Context) {
|
||||
err := activity.NewInstance()(api.GetSession()(c).(*session.Admin)).Form(&activity.InstanceParams{
|
||||
ID: form.IDStringForm.Convert(), ApplyID: (&api.IDStringForm{ID: form.ApplyID}).Convert(),
|
||||
TenantID: form.TenantIDStringForm.Convert(), Title: form.Title, Contact: form.Contact, ContactMobile: form.ContactMobile,
|
||||
Image: form.FilterImageURL(), Content: form.Content, BeginAt: form.BeginAt, FinishAt: form.FinishAt,
|
||||
Image: form.FilterImageURL(), Description: form.Description, Content: form.Content, BeginAt: form.BeginAt, FinishAt: form.FinishAt,
|
||||
JoinDeadline: form.JoinDeadline, Area: form.Area, Industrys: form.Industrys, Amount: form.Amount,
|
||||
MaxNumber: form.MaxNumber, NotifyCrowd: form.NotifyCrowd, IsHome: form.IsHome, Sort: form.Sort, Status: form.Status,
|
||||
})
|
||||
|
@ -25,7 +25,31 @@ func (a *manageExamineForm) handle(session *session.Admin, params map[string]int
|
||||
}
|
||||
|
||||
func (*Manage) Company(c *gin.Context) {
|
||||
form := &struct {
|
||||
api.TenantIDStringForm
|
||||
Name string `json:"name" form:"name"`
|
||||
ExamineStatus int `json:"examine_status" form:"examine_status"`
|
||||
api.PageForm
|
||||
}{}
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data, err := manage.NewInstance()(api.GetSession()(c).(*session.Admin), api.GetTenantID()(c).(uint64)).
|
||||
Company(form.Convert(), form.Name, form.ExamineStatus, form.Page, form.PageSize)
|
||||
api.APIResponse(err, data)(c)
|
||||
}
|
||||
|
||||
func (*Manage) CompanyDetail(c *gin.Context) {
|
||||
form := new(api.IDStringForm)
|
||||
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data, err := manage.NewInstance()(api.GetSession()(c).(*session.Admin), api.GetTenantID()(c).(uint64)).
|
||||
CompanyDetail(form.Convert())
|
||||
api.APIResponse(err, data)(c)
|
||||
}
|
||||
|
||||
func (*Manage) CompanyExamine(c *gin.Context) {
|
||||
@ -38,16 +62,15 @@ func (*Manage) CompanyExamine(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
form.Identity = config.TenantUserIdentityForCompany
|
||||
err := form.handle(api.GetSession()(c).(*session.Admin), map[string]interface{}{
|
||||
"kind": form.Kind,
|
||||
})
|
||||
api.APIResponse(err)
|
||||
err := form.handle(api.GetSession()(c).(*session.Admin), map[string]interface{}{"kind": form.Kind})
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
||||
func (*Manage) Expert(c *gin.Context) {
|
||||
form := &struct {
|
||||
Name string `json:"name" form:"name"`
|
||||
Status int `json:"status" form:"status"`
|
||||
api.TenantIDStringForm
|
||||
Name string `json:"name" form:"name"`
|
||||
ExamineStatus int `json:"examine_status" form:"examine_status"`
|
||||
api.PageForm
|
||||
}{}
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
@ -55,8 +78,20 @@ func (*Manage) Expert(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
data, err := manage.NewInstance()(api.GetSession()(c).(*session.Admin), api.GetTenantID()(c).(uint64)).
|
||||
Expert(form.Name, form.Status, form.Page, form.PageSize)
|
||||
api.APIResponse(err, data)
|
||||
Expert(form.Convert(), form.Name, form.ExamineStatus, form.Page, form.PageSize)
|
||||
api.APIResponse(err, data)(c)
|
||||
}
|
||||
|
||||
func (*Manage) ExpertDetail(c *gin.Context) {
|
||||
form := new(api.IDStringForm)
|
||||
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data, err := manage.NewInstance()(api.GetSession()(c).(*session.Admin), api.GetTenantID()(c).(uint64)).
|
||||
ExpertDetail(form.Convert())
|
||||
api.APIResponse(err, data)(c)
|
||||
}
|
||||
|
||||
func (*Manage) ExpertExamine(c *gin.Context) {
|
||||
@ -68,7 +103,7 @@ func (*Manage) ExpertExamine(c *gin.Context) {
|
||||
}
|
||||
form.Identity = config.TenantUserIdentityForExpert
|
||||
err := form.handle(api.GetSession()(c).(*session.Admin), nil)
|
||||
api.APIResponse(err)
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
||||
func (*Manage) Laboratory(c *gin.Context) {
|
||||
@ -84,7 +119,7 @@ func (*Manage) LaboratoryExamine(c *gin.Context) {
|
||||
}
|
||||
form.Identity = config.TenantUserIdentityForLaboratory
|
||||
err := form.handle(api.GetSession()(c).(*session.Admin), nil)
|
||||
api.APIResponse(err)
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
||||
func (*Manage) Research(c *gin.Context) {
|
||||
@ -100,7 +135,7 @@ func (*Manage) ResearchExamine(c *gin.Context) {
|
||||
}
|
||||
form.Identity = config.TenantUserIdentityForResearch
|
||||
err := form.handle(api.GetSession()(c).(*session.Admin), nil)
|
||||
api.APIResponse(err)
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
||||
func (*Manage) Agent(c *gin.Context) {
|
||||
@ -116,5 +151,5 @@ func (*Manage) AgentExamine(c *gin.Context) {
|
||||
}
|
||||
form.Identity = config.TenantUserIdentityForAgent
|
||||
err := form.handle(api.GetSession()(c).(*session.Admin), nil)
|
||||
api.APIResponse(err)
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
Reference in New Issue
Block a user