feat:完善信息
This commit is contained in:
@ -23,37 +23,37 @@ type (
|
|||||||
}
|
}
|
||||||
// patentForm 专利参数
|
// patentForm 专利参数
|
||||||
patentForm struct {
|
patentForm struct {
|
||||||
Title string `json:"title" form:"title"`
|
Title string `json:"title" form:"title" binding:"required"`
|
||||||
IPCCode string `json:"ipc_code" form:"ipc_code"`
|
IPCCode string `json:"ipc_code" form:"ipc_code" binding:"required"`
|
||||||
CPCCode string `json:"cpc_code" form:"cpc_code"`
|
CPCCode string `json:"cpc_code" form:"cpc_code" binding:"required"`
|
||||||
ApplyCode string `json:"apply_code" form:"apply_code"`
|
ApplyCode string `json:"apply_code" form:"apply_code" binding:"required"`
|
||||||
ApplyName string `json:"apply_name" form:"apply_name"`
|
ApplyName string `json:"apply_name" form:"apply_name" binding:"required"`
|
||||||
ApplyAddress string `json:"apply_address" form:"apply_address"`
|
ApplyAddress string `json:"apply_address" form:"apply_address" binding:"required"`
|
||||||
ApplyZipCode string `json:"apply_zip_code" form:"apply_zip_code"`
|
ApplyZipCode string `json:"apply_zip_code" form:"apply_zip_code" binding:"required"`
|
||||||
Inventor string `json:"inventor" form:"inventor"`
|
Inventor string `json:"inventor" form:"inventor" binding:"required"`
|
||||||
PriorityCode string `json:"priority_code" form:"priority_code"`
|
PriorityCode string `json:"priority_code" form:"priority_code" binding:"required"`
|
||||||
OpenCode string `json:"open_code" form:"open_code"`
|
OpenCode string `json:"open_code" form:"open_code" binding:"required"`
|
||||||
ApplyAt string `json:"apply_at" form:"apply_at"`
|
ApplyAt string `json:"apply_at" form:"apply_at" binding:"required"`
|
||||||
PriorityAt string `json:"priority_at" form:"priority_at"`
|
PriorityAt string `json:"priority_at" form:"priority_at" binding:"required"`
|
||||||
OpenAt string `json:"open_at" form:"open_at"`
|
OpenAt string `json:"open_at" form:"open_at" binding:"required"`
|
||||||
}
|
}
|
||||||
// demandForm 需求参数
|
// demandForm 需求参数
|
||||||
demandForm struct {
|
demandForm struct {
|
||||||
Title string `json:"title"`
|
Title string `json:"title" form:"title" binding:"required"`
|
||||||
Introduce string `json:"introduce"`
|
Introduce string `json:"introduce" form:"introduce" binding:"required"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name" form:"name" binding:"required"`
|
||||||
Mobile string `json:"mobile"`
|
Mobile string `json:"mobile" form:"mobile" binding:"required"`
|
||||||
Deadline string `json:"deadline"`
|
Deadline string `json:"deadline" form:"deadline" binding:"required"`
|
||||||
Industry []string `json:"industry"`
|
Industry []string `json:"industry" form:"industry" binding:"required"`
|
||||||
Kinds []string `json:"kinds"`
|
Kinds []string `json:"kinds" form:"kinds" binding:"required"`
|
||||||
config.Area
|
config.Area
|
||||||
Budget float64 `json:"budget"`
|
Budget float64 `json:"budget" form:"budget"`
|
||||||
BudgetMode int `json:"budget_mode"`
|
BudgetMode int `json:"budget_mode" form:"budget_mode"`
|
||||||
Expect []string `json:"expect"` // 期望合作的企业及模式
|
Expect []string `json:"expect" form:"expect"` // 期望合作的企业及模式
|
||||||
DemandBasic string `json:"demand_basic"` // 基础
|
DemandBasic string `json:"demand_basic" form:"demand_basic"` // 基础
|
||||||
DemandExpect string `json:"demand_expect"` // 预期
|
DemandExpect string `json:"demand_expect" form:"demand_expect"` // 预期
|
||||||
DemandBenefit string `json:"demand_benefit"` // 效益
|
DemandBenefit string `json:"demand_benefit" form:"demand_benefit"` // 效益
|
||||||
Status int `json:"status"`
|
Status int `json:"status" form:"status"`
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,8 @@ import (
|
|||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
func registerAPi(app *gin.Engine) {
|
// registerAPI 注册API
|
||||||
|
func registerAPI(app *gin.Engine) {
|
||||||
apiPrefix := "/api"
|
apiPrefix := "/api"
|
||||||
g := app.Group(apiPrefix)
|
g := app.Group(apiPrefix)
|
||||||
// 登录验证
|
// 登录验证
|
||||||
@ -114,7 +115,8 @@ func registerAPi(app *gin.Engine) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func registerEnterprise(app *gin.Engine) {
|
// registerEnterpriseAPI 注册企业/管家后台API
|
||||||
|
func registerEnterpriseAPI(app *gin.Engine) {
|
||||||
apiPrefix := "/enterprise"
|
apiPrefix := "/enterprise"
|
||||||
g := app.Group(apiPrefix)
|
g := app.Group(apiPrefix)
|
||||||
// Config 配置管理
|
// Config 配置管理
|
||||||
@ -123,4 +125,23 @@ func registerEnterprise(app *gin.Engine) {
|
|||||||
_api := new(api3.Config)
|
_api := new(api3.Config)
|
||||||
config.GET("/area", _api.Area)
|
config.GET("/area", _api.Area)
|
||||||
}
|
}
|
||||||
|
// Technology 技术管理
|
||||||
|
technology := g.Group("/technology")
|
||||||
|
{
|
||||||
|
_api := new(api3.Technology)
|
||||||
|
technology.POST("/paper", _api.Paper)
|
||||||
|
technology.POST("/paper/add", _api.PaperAdd)
|
||||||
|
technology.POST("/paper/edit", _api.PaperEdit)
|
||||||
|
technology.POST("/paper/delete", _api.PaperDelete)
|
||||||
|
technology.POST("/patent", _api.Patent)
|
||||||
|
technology.POST("/patent/detail", _api.PatentDetail)
|
||||||
|
technology.POST("/patent/add", _api.PatentAdd)
|
||||||
|
technology.POST("/patent/edit", _api.PatentEdit)
|
||||||
|
technology.POST("/patent/delete", _api.PatentDelete)
|
||||||
|
technology.POST("/demand", _api.Demand)
|
||||||
|
technology.POST("/demand/detail", _api.DemandDetail)
|
||||||
|
technology.POST("/demand/add", _api.DemandAdd)
|
||||||
|
technology.POST("/demand/edit", _api.DemandEdit)
|
||||||
|
technology.POST("/demand/delete", _api.DemandDelete)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -56,8 +56,8 @@ func (this *Router) Init() *gin.Engine {
|
|||||||
}
|
}
|
||||||
app.StaticFS("/upload", http.Dir("./upload"))
|
app.StaticFS("/upload", http.Dir("./upload"))
|
||||||
// 注册路由
|
// 注册路由
|
||||||
registerAPi(app)
|
registerAPI(app)
|
||||||
registerEnterprise(app)
|
registerEnterpriseAPI(app)
|
||||||
|
|
||||||
app.MaxMultipartMemory = 4 << 20
|
app.MaxMultipartMemory = 4 << 20
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user