feat:完善入驻信息管理

This commit is contained in:
henry
2021-12-02 15:23:48 +08:00
parent 30173f8dd2
commit 5c4d883c97
12 changed files with 418 additions and 203 deletions

View File

@ -0,0 +1,23 @@
package api
import (
"SciencesServer/app/api/enterprise/controller/settled"
"SciencesServer/app/basic/api"
"SciencesServer/app/session"
"github.com/gin-gonic/gin"
)
type Settled struct{}
func (*Settled) Index(c *gin.Context) {
settled.NewInstance()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).Index()
}
func (*Settled) Company(c *gin.Context) {
settled.NewCompany()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Launch(nil, 0, nil)
}
func (*Settled) Expert(c *gin.Context) {
}

View File

@ -49,85 +49,85 @@ func (*User) BindMobile(c *gin.Context) {
api.APIResponse(err)(c)
}
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 {
api.APIFailure(err.(error))(c)
return
}
err := user.NewSettled()(api.GetSession()(c).(*session.Enterprise)).Company(&user.SettledParams{
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)
}
func (*User) SettledExpert(c *gin.Context) {
form := &struct {
userSettledForm
config.IdentityForExpert
}{}
if err := api.Bind(form)(c); err != nil {
api.APIFailure(err.(error))(c)
return
}
err := user.NewSettled()(api.GetSession()(c).(*session.Enterprise)).Expert(&user.SettledParams{
Area: form.Area, Introduce: form.Introduce, Industrys: form.Industrys,
Keywords: form.Keywords,
}, &form.IdentityForExpert)
api.APIResponse(err)(c)
}
func (*User) SettledResearch(c *gin.Context) {
form := &struct {
userSettledForm
config.IdentityForResearch
}{}
if err := api.Bind(form)(c); err != nil {
api.APIFailure(err.(error))(c)
return
}
err := user.NewSettled()(api.GetSession()(c).(*session.Enterprise)).Research(&user.SettledParams{
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)
}
func (*User) SettledLaboratory(c *gin.Context) {
form := &struct {
userSettledForm
config.IdentityForLaboratory
}{}
if err := api.Bind(form)(c); err != nil {
api.APIFailure(err.(error))(c)
return
}
err := user.NewSettled()(api.GetSession()(c).(*session.Enterprise)).Laboratory(&user.SettledParams{
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 {
api.APIFailure(err.(error))(c)
return
}
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, Industrys: form.Industrys, Keywords: form.Keywords,
})
api.APIResponse(err)(c)
}
//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 {
// api.APIFailure(err.(error))(c)
// return
// }
// err := user.NewSettled()(api.GetSession()(c).(*session.Enterprise)).Company(&user.SettledParams{
// 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)
//}
//
//func (*User) SettledExpert(c *gin.Context) {
// form := &struct {
// userSettledForm
// config.IdentityForExpert
// }{}
// if err := api.Bind(form)(c); err != nil {
// api.APIFailure(err.(error))(c)
// return
// }
// err := user.NewSettled()(api.GetSession()(c).(*session.Enterprise)).Expert(&user.SettledParams{
// Area: form.Area, Introduce: form.Introduce, Industrys: form.Industrys,
// Keywords: form.Keywords,
// }, &form.IdentityForExpert)
// api.APIResponse(err)(c)
//}
//
//func (*User) SettledResearch(c *gin.Context) {
// form := &struct {
// userSettledForm
// config.IdentityForResearch
// }{}
// if err := api.Bind(form)(c); err != nil {
// api.APIFailure(err.(error))(c)
// return
// }
// err := user.NewSettled()(api.GetSession()(c).(*session.Enterprise)).Research(&user.SettledParams{
// 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)
//}
//
//func (*User) SettledLaboratory(c *gin.Context) {
// form := &struct {
// userSettledForm
// config.IdentityForLaboratory
// }{}
// if err := api.Bind(form)(c); err != nil {
// api.APIFailure(err.(error))(c)
// return
// }
// err := user.NewSettled()(api.GetSession()(c).(*session.Enterprise)).Laboratory(&user.SettledParams{
// 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 {
// api.APIFailure(err.(error))(c)
// return
// }
// 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, Industrys: form.Industrys, Keywords: form.Keywords,
// })
// api.APIResponse(err)(c)
//}
func (*User) IdentityBasic(c *gin.Context) {
data, err := user.NewIdentity()(api.GetSession()(c).(*session.Enterprise)).Basic()