feat:完善信息
This commit is contained in:
@ -19,6 +19,10 @@ type Paper struct {
|
||||
type PaperHandle func(session *session.Enterprise, tenantID uint64) *Paper
|
||||
|
||||
type (
|
||||
PaperBasic struct {
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
}
|
||||
PaperInfo struct {
|
||||
ID string `json:"id"`
|
||||
*model2.TechnologyPaper
|
||||
@ -60,6 +64,27 @@ func (c *Paper) List(title string, page, pageSize int) (*controller.ReturnPages,
|
||||
return &controller.ReturnPages{Data: list, Count: count}, nil
|
||||
}
|
||||
|
||||
func (c *Paper) Select(title string) ([]*PaperBasic, error) {
|
||||
mTechnologyPaper := model.NewTechnologyPaper()
|
||||
|
||||
where := make([]*model2.ModelWhereOrder, 0)
|
||||
|
||||
if title != "" {
|
||||
where = append(where, &model2.ModelWhereOrder{Where: model2.NewWhereLike("title", title)})
|
||||
}
|
||||
out := make([]*model2.TechnologyPaper, 0)
|
||||
|
||||
if err := model2.ScanFields(mTechnologyPaper.TechnologyPaper, &out, []string{"id", "title"}, where...); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
list := make([]*PaperBasic, 0)
|
||||
|
||||
for _, v := range out {
|
||||
list = append(list, &PaperBasic{ID: v.GetEncodeID(), Title: v.Title})
|
||||
}
|
||||
return list, nil
|
||||
}
|
||||
|
||||
// Form 参数信息
|
||||
func (c *Paper) Form(params *PaperParams) error {
|
||||
mTechnologyPaper := model.NewTechnologyPaper()
|
||||
|
@ -22,6 +22,10 @@ type Patent struct {
|
||||
type PatentHandle func(session *session.Enterprise, tenantID uint64) *Patent
|
||||
|
||||
type (
|
||||
PatentBasic struct {
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
}
|
||||
// PatentInfo 专利信息
|
||||
PatentInfo struct {
|
||||
ID string `json:"id"`
|
||||
@ -247,6 +251,30 @@ func (c *Patent) List(kind int, title, applyCode, openCode, ipcCode string, page
|
||||
return &controller.ReturnPages{Data: list, Count: count}, nil
|
||||
}
|
||||
|
||||
// Select 列表信息
|
||||
func (c *Patent) Select(title string) ([]*PatentBasic, error) {
|
||||
where := make([]*model2.ModelWhereOrder, 0)
|
||||
|
||||
if title != "" {
|
||||
where = append(where, &model2.ModelWhereOrder{Where: model2.NewWhereLike("title", title)})
|
||||
}
|
||||
mTechnologyPatent := model.NewTechnologyPatent()
|
||||
|
||||
out := make([]*model2.TechnologyPatent, 0)
|
||||
|
||||
if err := model2.ScanFields(mTechnologyPatent.TechnologyPatent, &out, []string{"id", "title"}, where...); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
list := make([]*PatentBasic, 0)
|
||||
|
||||
for _, v := range out {
|
||||
list = append(list, &PatentBasic{
|
||||
ID: v.GetEncodeID(), Title: v.Title,
|
||||
})
|
||||
}
|
||||
return list, nil
|
||||
}
|
||||
|
||||
// Match 搜索信息
|
||||
func (c *Patent) Match(title string, industrys, keywords []string) (*controller.ReturnPages, error) {
|
||||
params := strings.Join([]string{
|
||||
|
Reference in New Issue
Block a user