feat:完善信息

This commit is contained in:
henry
2021-10-15 11:05:38 +08:00
parent 1fa9adbd25
commit 4fc13250f1
6 changed files with 288 additions and 14 deletions

View File

@ -22,13 +22,15 @@ type DemandHandle func(enterprise *service.SessionEnterprise, local string) *Dem
type (
// DemandInfo 需求信息
DemandInfo struct {
ID string `json:"id"`
Title string `json:"title"`
Name string `json:"name"`
Mobile string `json:"mobile"`
Kinds []string `json:"kinds"`
Deadline time.Time `json:"deadline"`
CreatedAt time.Time `json:"created_at"`
ID string `json:"id"`
Title string `json:"title"`
Name string `json:"name"`
Mobile string `json:"mobile"`
Kinds []string `json:"kinds"`
Budget float64 `json:"budget"`
BudgetMode model2.TechnologyDemandBudgetMode `json:"budget_mode"`
Deadline time.Time `json:"deadline"`
CreatedAt time.Time `json:"created_at"`
}
// DemandDetailInfo 需求详细信息
DemandDetailInfo struct {
@ -71,14 +73,14 @@ func (c *Demand) List(status, page, pageSize int) (*controller.ReturnPages, erro
out := make([]*model2.TechnologyDemand, 0)
if err := model2.PagesFields(mTechnologyDemand.TechnologyDemand, &out, []string{"id", "title", "kind", "name",
"mobile", "deadline", "created_at"}, page, pageSize, &count, where...); err != nil {
"mobile", "budget", "budget_mode", "deadline", "created_at"}, page, pageSize, &count, where...); err != nil {
return nil, err
}
list := make([]*DemandInfo, 0)
for _, v := range out {
list = append(list, &DemandInfo{
ID: v.GetEncodeID(), Title: v.Title, Name: v.Name, Mobile: v.Mobile,
ID: v.GetEncodeID(), Title: v.Title, Name: v.Name, Mobile: v.Mobile, Budget: v.Budget, BudgetMode: v.BudgetMode,
Kinds: v.GetKindAttribute(), Deadline: v.Deadline, CreatedAt: v.CreatedAt,
})
}