feat:完善入驻信息管理
This commit is contained in:
@ -13,13 +13,12 @@ type User struct{}
|
||||
type (
|
||||
// userSettledForm 入驻平台参数
|
||||
userSettledForm struct {
|
||||
api.IDStringForm
|
||||
api.ImageForm
|
||||
Name string `json:"name" form:"name"`
|
||||
Code string `json:"code" form:"code"`
|
||||
config.Area
|
||||
Introduce string `json:"introduce" form:"introduce"`
|
||||
Industry string `json:"industry" form:"industry"` // 行业领域
|
||||
Industrys []string `json:"industrys" form:"industrys"` // 行业领域
|
||||
Keywords []string `json:"keywords" form:"keywords"`
|
||||
}
|
||||
// userBankForm 银行平台信息参数
|
||||
@ -52,6 +51,7 @@ func (*User) BindMobile(c *gin.Context) {
|
||||
|
||||
func (*User) SettledCompany(c *gin.Context) {
|
||||
form := &struct {
|
||||
InviteCode string `json:"invite_code" form:"invite_code"`
|
||||
userSettledForm
|
||||
}{}
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
@ -59,9 +59,9 @@ func (*User) SettledCompany(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
err := user.NewSettled()(api.GetSession()(c).(*session.Enterprise)).Company(&user.SettledParams{
|
||||
ID: form.Convert(), Image: form.FilterImageURL(), Name: form.Name, Code: form.Code,
|
||||
Area: form.Area, Introduce: form.Introduce, Industry: form.Industry, Keywords: form.Keywords,
|
||||
}, nil)
|
||||
Image: form.FilterImageURL(), Name: form.Name, Code: form.Code,
|
||||
Area: form.Area, Introduce: form.Introduce, Industrys: form.Industrys, Keywords: form.Keywords,
|
||||
}, (&api.IDStringForm{ID: form.InviteCode}).Convert(), nil)
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ func (*User) SettledExpert(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
err := user.NewSettled()(api.GetSession()(c).(*session.Enterprise)).Expert(&user.SettledParams{
|
||||
ID: form.Convert(), Area: form.Area, Introduce: form.Introduce, Industry: form.Industry,
|
||||
Area: form.Area, Introduce: form.Introduce, Industrys: form.Industrys,
|
||||
Keywords: form.Keywords,
|
||||
}, &form.IdentityForExpert)
|
||||
api.APIResponse(err)(c)
|
||||
@ -91,8 +91,8 @@ func (*User) SettledResearch(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
err := user.NewSettled()(api.GetSession()(c).(*session.Enterprise)).Research(&user.SettledParams{
|
||||
ID: form.Convert(), Image: form.FilterImageURL(), Name: form.Name, Code: form.Code,
|
||||
Area: form.Area, Introduce: form.Introduce, Industry: form.Industry, Keywords: form.Keywords,
|
||||
Image: form.FilterImageURL(), Name: form.Name, Code: form.Code,
|
||||
Area: form.Area, Introduce: form.Introduce, Industrys: form.Industrys, Keywords: form.Keywords,
|
||||
}, &form.IdentityForResearch)
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
@ -107,14 +107,15 @@ func (*User) SettledLaboratory(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
err := user.NewSettled()(api.GetSession()(c).(*session.Enterprise)).Laboratory(&user.SettledParams{
|
||||
ID: form.Convert(), Image: form.FilterImageURL(), Name: form.Name, Code: form.Code,
|
||||
Area: form.Area, Introduce: form.Introduce, Industry: form.Industry, Keywords: form.Keywords,
|
||||
Image: form.FilterImageURL(), Name: form.Name, Code: form.Code,
|
||||
Area: form.Area, Introduce: form.Introduce, Industrys: form.Industrys, Keywords: form.Keywords,
|
||||
}, &form.IdentityForLaboratory)
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
||||
func (*User) SettledAgent(c *gin.Context) {
|
||||
form := &struct {
|
||||
api.IDStringForm
|
||||
userSettledForm
|
||||
}{}
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
@ -123,7 +124,7 @@ func (*User) SettledAgent(c *gin.Context) {
|
||||
}
|
||||
err := user.NewSettled()(api.GetSession()(c).(*session.Enterprise)).Agent(&user.SettledParams{
|
||||
ID: form.Convert(), Image: form.FilterImageURL(), Name: form.Name, Code: form.Code,
|
||||
Area: form.Area, Introduce: form.Introduce, Industry: form.Industry, Keywords: form.Keywords,
|
||||
Area: form.Area, Introduce: form.Introduce, Industrys: form.Industrys, Keywords: form.Keywords,
|
||||
})
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
Reference in New Issue
Block a user