feat:增加科技产品数据模型管理
This commit is contained in:
@ -3,18 +3,41 @@ package api
|
||||
import (
|
||||
"SciencesServer/app/api/manage/controller/manage"
|
||||
"SciencesServer/app/basic/api"
|
||||
"SciencesServer/app/basic/config"
|
||||
"SciencesServer/app/service"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type Manage struct{}
|
||||
|
||||
type (
|
||||
// manageExamineForm 审核处理
|
||||
manageExamineForm struct {
|
||||
api.IDStringForm
|
||||
Identity int
|
||||
Status int `json:"status" form:"status" binding:"required"`
|
||||
}
|
||||
)
|
||||
|
||||
// handle 审核处理
|
||||
func (a *manageExamineForm) handle(session *service.Session, local string) error {
|
||||
return manage.NewExamine()(session, local).Launch(a.Convert(), a.Identity, a.Status)
|
||||
}
|
||||
|
||||
func (*Manage) Company(c *gin.Context) {
|
||||
|
||||
}
|
||||
|
||||
func (*Manage) CompanyExamine(c *gin.Context) {
|
||||
form := new(manageExamineForm)
|
||||
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
form.Identity = config.TenantUserIdentityForCompany
|
||||
err := form.handle(api.GetSession()(c).(*service.Session), api.GetLocal()(c).(string))
|
||||
api.APIResponse(err)
|
||||
}
|
||||
|
||||
func (*Manage) Expert(c *gin.Context) {
|
||||
@ -33,28 +56,61 @@ func (*Manage) Expert(c *gin.Context) {
|
||||
}
|
||||
|
||||
func (*Manage) ExpertExamine(c *gin.Context) {
|
||||
form := new(manageExamineForm)
|
||||
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
form.Identity = config.TenantUserIdentityForExpert
|
||||
err := form.handle(api.GetSession()(c).(*service.Session), api.GetLocal()(c).(string))
|
||||
api.APIResponse(err)
|
||||
}
|
||||
|
||||
func (*Manage) Laboratory(c *gin.Context) {
|
||||
|
||||
}
|
||||
|
||||
func (*Menu) Research(c *gin.Context) {
|
||||
func (*Manage) LaboratoryExamine(c *gin.Context) {
|
||||
form := new(manageExamineForm)
|
||||
|
||||
}
|
||||
|
||||
func (*Menu) Examine(c *gin.Context) {
|
||||
form := &struct {
|
||||
api.IDStringForm
|
||||
Identity int `json:"identity" form:"identity" binding:"required"`
|
||||
Status int `json:"status" form:"status" binding:"required"`
|
||||
}{}
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
err := manage.NewExamine()(api.GetSession()(c).(*service.Session), api.GetLocal()(c).(string)).
|
||||
Launch(form.Convert(), form.Identity, form.Status)
|
||||
form.Identity = config.TenantUserIdentityForLaboratory
|
||||
err := form.handle(api.GetSession()(c).(*service.Session), api.GetLocal()(c).(string))
|
||||
api.APIResponse(err)
|
||||
}
|
||||
|
||||
func (*Manage) Research(c *gin.Context) {
|
||||
|
||||
}
|
||||
|
||||
func (*Manage) ResearchExamine(c *gin.Context) {
|
||||
form := new(manageExamineForm)
|
||||
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
form.Identity = config.TenantUserIdentityForResearch
|
||||
err := form.handle(api.GetSession()(c).(*service.Session), api.GetLocal()(c).(string))
|
||||
api.APIResponse(err)
|
||||
}
|
||||
|
||||
func (*Manage) Agent(c *gin.Context) {
|
||||
|
||||
}
|
||||
|
||||
func (*Manage) AgentExamine(c *gin.Context) {
|
||||
form := new(manageExamineForm)
|
||||
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
form.Identity = config.TenantUserIdentityForAgent
|
||||
err := form.handle(api.GetSession()(c).(*service.Session), api.GetLocal()(c).(string))
|
||||
api.APIResponse(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user