feat:完善入驻信息管理
This commit is contained in:
23
app/api/enterprise/api/settled.go
Normal file
23
app/api/enterprise/api/settled.go
Normal 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) {
|
||||
|
||||
}
|
@ -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()
|
||||
|
Reference in New Issue
Block a user