feat:完善项目信息
This commit is contained in:
@ -80,7 +80,7 @@ func (c *Achievement) Instance(status, page, pageSize int) (*controller.ReturnPa
|
||||
}
|
||||
|
||||
// Match 匹配信息
|
||||
func (c *Achievement) Match(title string, industrys, keywords []string) ([]*AchievementMatchInfo, error) {
|
||||
func (c *Achievement) Match(title string, industrys, keywords []string) (*controller.ReturnPages, error) {
|
||||
params := strings.Join([]string{
|
||||
title, strings.Join(industrys, ","), strings.Join(keywords, ","),
|
||||
}, ",")
|
||||
@ -89,7 +89,7 @@ func (c *Achievement) Match(title string, industrys, keywords []string) ([]*Achi
|
||||
service.WithAchievementIndustry(params),
|
||||
service.WithAchievementKeyword(params),
|
||||
)
|
||||
out, err := achievement.Search(0, 0)
|
||||
out, count, err := achievement.Search(0, 0)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -123,7 +123,7 @@ func (c *Achievement) Match(title string, industrys, keywords []string) ([]*Achi
|
||||
Customers: mTechnologyAchievement.GetCustomerAttribute(),
|
||||
})
|
||||
}
|
||||
return list, nil
|
||||
return &controller.ReturnPages{Data: list, Count: count}, nil
|
||||
}
|
||||
|
||||
// Detail 详情信息
|
||||
|
@ -193,7 +193,7 @@ func (c *Patent) List(kind int, title, applyCode, openCode, ipcCode string, page
|
||||
}
|
||||
|
||||
// Match 搜索信息
|
||||
func (c *Patent) Match(title string, industrys, keywords []string) ([]*PatentMatchInfo, error) {
|
||||
func (c *Patent) Match(title string, industrys, keywords []string) (*controller.ReturnPages, error) {
|
||||
params := strings.Join([]string{
|
||||
title, strings.Join(industrys, ","), strings.Join(keywords, ","),
|
||||
}, ",")
|
||||
@ -201,7 +201,7 @@ func (c *Patent) Match(title string, industrys, keywords []string) ([]*PatentMat
|
||||
service.WithPatentTitle(params),
|
||||
service.WithPatentIndustry(params),
|
||||
)
|
||||
out, err := patent.Search(0, 0)
|
||||
out, count, err := patent.Search(0, 0)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -229,7 +229,7 @@ func (c *Patent) Match(title string, industrys, keywords []string) ([]*PatentMat
|
||||
ID: v.GetEncodeID(), Title: v.Title, Description: v.Description, ApplyAt: v.ApplyAt,
|
||||
})
|
||||
}
|
||||
return list, nil
|
||||
return &controller.ReturnPages{Data: list, Count: count}, nil
|
||||
}
|
||||
|
||||
// Detail 详细信息
|
||||
|
@ -50,33 +50,33 @@ type (
|
||||
}
|
||||
)
|
||||
|
||||
var matchHandle = map[int]func(title string, industrys, keywords []string) (interface{}, error){
|
||||
var matchHandle = map[int]func(title string, industrys, keywords []string) (*controller.ReturnPages, error){
|
||||
1: matchAchievement, 2: matchPatent, 3: matchExpect, 4: matchLaboratory, 5: matchCompany,
|
||||
}
|
||||
|
||||
// matchAchievement 成果匹配
|
||||
func matchAchievement(title string, industrys, keywords []string) (interface{}, error) {
|
||||
func matchAchievement(title string, industrys, keywords []string) (*controller.ReturnPages, error) {
|
||||
return (&Achievement{}).Match(title, industrys, keywords)
|
||||
}
|
||||
|
||||
// matchPatent 专利匹配
|
||||
func matchPatent(title string, industrys, keywords []string) (interface{}, error) {
|
||||
func matchPatent(title string, industrys, keywords []string) (*controller.ReturnPages, error) {
|
||||
return (&Patent{}).Match(title, industrys, keywords)
|
||||
}
|
||||
|
||||
// matchExpect 专家匹配
|
||||
func matchExpect(title string, industrys, keywords []string) (interface{}, error) {
|
||||
func matchExpect(title string, industrys, keywords []string) (*controller.ReturnPages, error) {
|
||||
return (&manage.Expert{}).Match(title, industrys, keywords)
|
||||
|
||||
}
|
||||
|
||||
// matchLaboratory 实验室匹配
|
||||
func matchLaboratory(title string, industrys, keywords []string) (interface{}, error) {
|
||||
func matchLaboratory(title string, industrys, keywords []string) (*controller.ReturnPages, error) {
|
||||
return (&manage.Laboratory{}).Match(title, industrys, keywords)
|
||||
}
|
||||
|
||||
// matchCompany 公司匹配
|
||||
func matchCompany(title string, industrys, keywords []string) (interface{}, error) {
|
||||
func matchCompany(title string, industrys, keywords []string) (*controller.ReturnPages, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user