feat:优化信息

This commit is contained in:
henry
2021-12-23 10:33:31 +08:00
parent f4c02860b4
commit 741138b3ea
5 changed files with 92 additions and 45 deletions

View File

@ -10,9 +10,10 @@ type ES struct{}
func (*ES) Create(c *gin.Context) {
form := &struct {
ID uint64 `json:"id" form:"id"`
Title string `json:"title" form:"title"`
Keyword string `json:"keyword" form:"keyword"`
ID uint64 `json:"id" form:"id"`
Title string `json:"title" form:"title"`
Keyword string `json:"keyword" form:"keyword"`
Research string `json:"research" form:"research"`
}{}
if err := api.Bind(form)(c); err != nil {
api.APIFailure(err.(error))(c)
@ -22,6 +23,7 @@ func (*ES) Create(c *gin.Context) {
service.WithManageID(form.ID),
service.WithManageTitle(form.Title),
service.WithManageKeyword(form.Keyword),
service.WithManageResearch(form.Research),
)
api.APIResponse(manage.Create())(c)
}
@ -35,6 +37,6 @@ func (*ES) Search(c *gin.Context) {
return
}
manage := service.NewManage()
data, err := manage.Search(form.Params)
data, err := manage.Search(1, 10, form.Params)
api.APIResponse(err, data)(c)
}

View File

@ -93,7 +93,7 @@ func (c *Search) Launch(identity int, params string) (interface{}, error) {
_params := map[string]interface{}{
"title": params, "keyword": params, "research": params,
}
data, err := manage.Search(_params)
data, err := manage.Search(1, 1, _params)
if err != nil {
return nil, err