feat:完善入驻信息管理
This commit is contained in:
@ -3,6 +3,7 @@ package api
|
||||
import (
|
||||
"SciencesServer/app/api/enterprise/controller/config"
|
||||
"SciencesServer/app/basic/api"
|
||||
"SciencesServer/utils"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@ -19,7 +20,15 @@ func (a *Config) Transaction(c *gin.Context) {
|
||||
}
|
||||
|
||||
func (a *Config) Industry(c *gin.Context) {
|
||||
|
||||
form := &struct {
|
||||
ParentID string `json:"parent_id" form:"parent_id"`
|
||||
}{}
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data := config.NewConfig().Industry(utils.StringToUnit64(form.ParentID))
|
||||
api.APISuccess(data)(c)
|
||||
}
|
||||
|
||||
func (a *Config) Research(c *gin.Context) {
|
||||
@ -28,12 +37,12 @@ func (a *Config) Research(c *gin.Context) {
|
||||
|
||||
func (a *Config) Area(c *gin.Context) {
|
||||
form := &struct {
|
||||
Key string `json:"key" form:"key"`
|
||||
Code string `json:"code" form:"code"`
|
||||
}{}
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data := config.NewConfig().Area(form.Key)
|
||||
data := config.NewConfig().Area(form.Code)
|
||||
api.APIResponse(nil, data)(c)
|
||||
}
|
||||
|
@ -47,11 +47,26 @@ func (*Settled) Company(c *gin.Context) {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
form.License = (&api.ImageForm{Image: form.License}).FilterImageURL()
|
||||
|
||||
err := settled.NewCompany()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
|
||||
Launch(form.settledForm.bind(), (&api.IDStringForm{ID: form.InviterCode}).Convert(), &form.IdentityForCompany)
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
||||
// CompanyGet 公司入驻信息
|
||||
func (*Settled) CompanyGet(c *gin.Context) {
|
||||
form := &struct {
|
||||
Code string `json:"code" form:"code" binding:"required"`
|
||||
}{}
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data, err := settled.NewCompany()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).Get(form.Code)
|
||||
api.APIResponse(err, data)(c)
|
||||
}
|
||||
|
||||
// Expert 专家入驻信息
|
||||
func (*Settled) Expert(c *gin.Context) {
|
||||
form := &struct {
|
||||
|
Reference in New Issue
Block a user