feat:完善项目信息
This commit is contained in:
@ -11,6 +11,19 @@ import (
|
||||
type Manage struct{}
|
||||
|
||||
type (
|
||||
// manageForm 参数信息
|
||||
manageForm struct {
|
||||
api.IDStringForm
|
||||
api.TenantIDStringForm
|
||||
api.ImageForm
|
||||
Name string `json:"name" form:"name" binding:"required"`
|
||||
Code string `json:"code" form:"code" binding:"required"`
|
||||
Mobile string `json:"mobile" form:"mobile" binding:"required"`
|
||||
config.Area
|
||||
Industrys []string `json:"industrys" form:"industrys"`
|
||||
Keywords []string `json:"keywords" form:"keywords"`
|
||||
Introduce string `json:"introduce" form:"introduce"`
|
||||
}
|
||||
// manageExamineForm 审核处理
|
||||
manageExamineForm struct {
|
||||
api.IDStringForm
|
||||
@ -19,6 +32,13 @@ type (
|
||||
}
|
||||
)
|
||||
|
||||
func (c *manageForm) bind() *manage.BasicParams {
|
||||
return &manage.BasicParams{ID: c.IDStringForm.Convert(), TenantID: c.TenantIDStringForm.Convert(),
|
||||
Name: c.Name, Image: c.FilterImageURL(), Code: c.Code, Mobile: c.Mobile,
|
||||
Introduce: c.Introduce, Area: c.Area, Industrys: c.Industrys, Keywords: c.Keywords,
|
||||
}
|
||||
}
|
||||
|
||||
// handle 审核处理
|
||||
func (a *manageExamineForm) handle(session *session.Admin, params map[string]interface{}) error {
|
||||
return manage.NewExamine()(session).Launch(a.Convert(), a.Identity, a.Status, params)
|
||||
@ -35,8 +55,8 @@ func (*Manage) Company(c *gin.Context) {
|
||||
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)
|
||||
data, err := manage.NewCompany()(api.GetSession()(c).(*session.Admin)).Instance(form.Convert(), form.Name,
|
||||
form.ExamineStatus, form.Page, form.PageSize)
|
||||
api.APIResponse(err, data)(c)
|
||||
}
|
||||
|
||||
@ -47,8 +67,7 @@ func (*Manage) CompanyDetail(c *gin.Context) {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data, err := manage.NewInstance()(api.GetSession()(c).(*session.Admin), api.GetTenantID()(c).(uint64)).
|
||||
CompanyDetail(form.Convert())
|
||||
data, err := manage.NewCompany()(api.GetSession()(c).(*session.Admin)).Detail(form.Convert())
|
||||
api.APIResponse(err, data)(c)
|
||||
}
|
||||
|
||||
@ -77,8 +96,7 @@ func (*Manage) Expert(c *gin.Context) {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data, err := manage.NewInstance()(api.GetSession()(c).(*session.Admin), api.GetTenantID()(c).(uint64)).
|
||||
Expert(form.Convert(), form.Name, form.ExamineStatus, form.Page, form.PageSize)
|
||||
data, err := manage.NewExpert()(api.GetSession()(c).(*session.Admin)).Instance(form.Convert(), form.Name, form.ExamineStatus, form.Page, form.PageSize)
|
||||
api.APIResponse(err, data)(c)
|
||||
}
|
||||
|
||||
@ -89,11 +107,23 @@ func (*Manage) ExpertDetail(c *gin.Context) {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data, err := manage.NewInstance()(api.GetSession()(c).(*session.Admin), api.GetTenantID()(c).(uint64)).
|
||||
ExpertDetail(form.Convert())
|
||||
data, err := manage.NewExpert()(api.GetSession()(c).(*session.Admin)).Detail(form.Convert())
|
||||
api.APIResponse(err, data)(c)
|
||||
}
|
||||
|
||||
func (*Manage) ExpertForm(c *gin.Context) {
|
||||
form := &struct {
|
||||
manageForm
|
||||
config.IdentityForExpert
|
||||
}{}
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
err := manage.NewExpert()(api.GetSession()(c).(*session.Admin)).Form(form.bind(), &form.IdentityForExpert)
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
||||
func (*Manage) ExpertExamine(c *gin.Context) {
|
||||
form := new(manageExamineForm)
|
||||
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"SciencesServer/app/api/admin/controller/user"
|
||||
"SciencesServer/app/basic/api"
|
||||
"SciencesServer/app/session"
|
||||
"fmt"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
@ -39,6 +40,8 @@ func (this *userForm) RoleInfo() []uint64 {
|
||||
}
|
||||
|
||||
func (*User) Info(c *gin.Context) {
|
||||
fmt.Println(4564645646)
|
||||
|
||||
data, err := user.NewInstance()(api.GetSession()(c).(*session.Admin)).Info()
|
||||
api.APIResponse(err, data)(c)
|
||||
}
|
||||
|
Reference in New Issue
Block a user