feat:增加专利模型数据

This commit is contained in:
henry
2021-11-26 17:26:01 +08:00
parent 3908a05bfa
commit dabb567d41
17 changed files with 512 additions and 7 deletions

View File

@ -0,0 +1,27 @@
package api
import (
"SciencesServer/app/api/enterprise/controller/sys"
"SciencesServer/app/basic/api"
"github.com/gin-gonic/gin"
)
type Sys struct{}
func (*Sys) Patent(c *gin.Context) {
form := &struct {
Kind int `json:"kind" form:"kind"`
Title string `json:"title" form:"title"`
ApplyCode string `json:"apply_code" form:"apply_code"`
OpenCode string `json:"open_code" form:"open_code"`
IPCCode string `json:"ipc_code" form:"ipc_code"`
api.PageForm
}{}
if err := api.Bind(form)(c); err != nil {
api.APIFailure(err.(error))(c)
return
}
data, err := sys.NewPatent()(nil).
List(form.Kind, form.Title, form.ApplyCode, form.OpenCode, form.IPCCode, form.Page, form.PageSize)
api.APIResponse(err, data)(c)
}

View File

@ -158,3 +158,14 @@ func (*User) BackUnbind(c *gin.Context) {
err := user.NewBank()(api.GetSession()(c).(*session.Enterprise)).Unbind(form.Convert())
api.APIResponse(err)
}
func (*User) Patent(c *gin.Context) {
form := &struct {
Title string `json:"title" form:"title"`
api.PageForm
}{}
if err := api.Bind(form)(c); err != nil {
api.APIFailure(err.(error))(c)
return
}
}