Selaa lähdekoodia

feat:时间格式

wangshan 2 vuotta sitten
vanhempi
commit
8a7bcedaf4
3 muutettua tiedostoa jossa 47 lisäystä ja 47 poistoa
  1. 4 4
      jyBXCore/rpc/bxcore.proto
  2. 16 16
      jyBXCore/rpc/type/bxcore/bxcore.pb.go
  3. 27 27
      jyBXCore/rpc/util/search.go

+ 4 - 4
jyBXCore/rpc/bxcore.proto

@@ -63,7 +63,7 @@ message  SearchList {
   string detail = 6;//正文搜索内容
   string industry = 7;//行业标签
   string industryUrl = 8;//行业标签地址
-  string  publishTime = 9;//发布时间
+  int64  publishTime = 9;//发布时间
   bool   fileExists = 10;//是否有附件
   string subtype = 11;//信息类型
   string subtypeUrl = 12;//信息类型标签地址
@@ -80,9 +80,9 @@ message  SearchList {
   string agencyPerson = 23;//代理机构联系人
   string agencyTel = 24;//代理机构联系电话
   repeated WinnerInfo winnerInfo = 25;//中标企业信息
-  string bidOpenTime = 26;//开标时间
-  string signEndTime = 27;//报名截止时间
-  string bidEndTime = 28;//投标截止时间
+  int64 bidOpenTime = 26;//开标时间
+  int64 signEndTime = 27;//报名截止时间
+  int64 bidEndTime = 28;//投标截止时间
   string site = 29;//网站名称
   string spiderCode = 30;//网站代码
   PInfo  projectInfo = 31;//拟建项目信息

+ 16 - 16
jyBXCore/rpc/type/bxcore/bxcore.pb.go

@@ -494,7 +494,7 @@ type SearchList struct {
 	Detail       string        `protobuf:"bytes,6,opt,name=detail,proto3" json:"detail,omitempty"`              //正文搜索内容
 	Industry     string        `protobuf:"bytes,7,opt,name=industry,proto3" json:"industry,omitempty"`          //行业标签
 	IndustryUrl  string        `protobuf:"bytes,8,opt,name=industryUrl,proto3" json:"industryUrl,omitempty"`    //行业标签地址
-	PublishTime  string        `protobuf:"bytes,9,opt,name=publishTime,proto3" json:"publishTime,omitempty"`    //发布时间
+	PublishTime  int64         `protobuf:"varint,9,opt,name=publishTime,proto3" json:"publishTime,omitempty"`   //发布时间
 	FileExists   bool          `protobuf:"varint,10,opt,name=fileExists,proto3" json:"fileExists,omitempty"`    //是否有附件
 	Subtype      string        `protobuf:"bytes,11,opt,name=subtype,proto3" json:"subtype,omitempty"`           //信息类型
 	SubtypeUrl   string        `protobuf:"bytes,12,opt,name=subtypeUrl,proto3" json:"subtypeUrl,omitempty"`     //信息类型标签地址
@@ -511,9 +511,9 @@ type SearchList struct {
 	AgencyPerson string        `protobuf:"bytes,23,opt,name=agencyPerson,proto3" json:"agencyPerson,omitempty"` //代理机构联系人
 	AgencyTel    string        `protobuf:"bytes,24,opt,name=agencyTel,proto3" json:"agencyTel,omitempty"`       //代理机构联系电话
 	WinnerInfo   []*WinnerInfo `protobuf:"bytes,25,rep,name=winnerInfo,proto3" json:"winnerInfo,omitempty"`     //中标企业信息
-	BidOpenTime  string        `protobuf:"bytes,26,opt,name=bidOpenTime,proto3" json:"bidOpenTime,omitempty"`   //开标时间
-	SignEndTime  string        `protobuf:"bytes,27,opt,name=signEndTime,proto3" json:"signEndTime,omitempty"`   //报名截止时间
-	BidEndTime   string        `protobuf:"bytes,28,opt,name=bidEndTime,proto3" json:"bidEndTime,omitempty"`     //投标截止时间
+	BidOpenTime  int64         `protobuf:"varint,26,opt,name=bidOpenTime,proto3" json:"bidOpenTime,omitempty"`  //开标时间
+	SignEndTime  int64         `protobuf:"varint,27,opt,name=signEndTime,proto3" json:"signEndTime,omitempty"`  //报名截止时间
+	BidEndTime   int64         `protobuf:"varint,28,opt,name=bidEndTime,proto3" json:"bidEndTime,omitempty"`    //投标截止时间
 	Site         string        `protobuf:"bytes,29,opt,name=site,proto3" json:"site,omitempty"`                 //网站名称
 	SpiderCode   string        `protobuf:"bytes,30,opt,name=spiderCode,proto3" json:"spiderCode,omitempty"`     //网站代码
 	ProjectInfo  *PInfo        `protobuf:"bytes,31,opt,name=projectInfo,proto3" json:"projectInfo,omitempty"`   //拟建项目信息
@@ -607,11 +607,11 @@ func (x *SearchList) GetIndustryUrl() string {
 	return ""
 }
 
-func (x *SearchList) GetPublishTime() string {
+func (x *SearchList) GetPublishTime() int64 {
 	if x != nil {
 		return x.PublishTime
 	}
-	return ""
+	return 0
 }
 
 func (x *SearchList) GetFileExists() bool {
@@ -726,25 +726,25 @@ func (x *SearchList) GetWinnerInfo() []*WinnerInfo {
 	return nil
 }
 
-func (x *SearchList) GetBidOpenTime() string {
+func (x *SearchList) GetBidOpenTime() int64 {
 	if x != nil {
 		return x.BidOpenTime
 	}
-	return ""
+	return 0
 }
 
-func (x *SearchList) GetSignEndTime() string {
+func (x *SearchList) GetSignEndTime() int64 {
 	if x != nil {
 		return x.SignEndTime
 	}
-	return ""
+	return 0
 }
 
-func (x *SearchList) GetBidEndTime() string {
+func (x *SearchList) GetBidEndTime() int64 {
 	if x != nil {
 		return x.BidEndTime
 	}
-	return ""
+	return 0
 }
 
 func (x *SearchList) GetSite() string {
@@ -1199,7 +1199,7 @@ var file_bxcore_proto_rawDesc = []byte{
 	0x64, 0x75, 0x73, 0x74, 0x72, 0x79, 0x55, 0x72, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52,
 	0x0b, 0x69, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x79, 0x55, 0x72, 0x6c, 0x12, 0x20, 0x0a, 0x0b,
 	0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e,
+	0x03, 0x52, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e,
 	0x0a, 0x0a, 0x66, 0x69, 0x6c, 0x65, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x0a, 0x20, 0x01,
 	0x28, 0x08, 0x52, 0x0a, 0x66, 0x69, 0x6c, 0x65, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x18,
 	0x0a, 0x07, 0x73, 0x75, 0x62, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52,
@@ -1232,11 +1232,11 @@ var file_bxcore_proto_rawDesc = []byte{
 	0x78, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x57, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f,
 	0x52, 0x0a, 0x77, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, 0x0b,
 	0x62, 0x69, 0x64, 0x4f, 0x70, 0x65, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x1a, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x0b, 0x62, 0x69, 0x64, 0x4f, 0x70, 0x65, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x20,
+	0x03, 0x52, 0x0b, 0x62, 0x69, 0x64, 0x4f, 0x70, 0x65, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x20,
 	0x0a, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x1b, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65,
+	0x01, 0x28, 0x03, 0x52, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65,
 	0x12, 0x1e, 0x0a, 0x0a, 0x62, 0x69, 0x64, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x1c,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x69, 0x64, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x62, 0x69, 0x64, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65,
 	0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x74, 0x65, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
 	0x73, 0x69, 0x74, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x70, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f,
 	0x64, 0x65, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x70, 0x69, 0x64, 0x65, 0x72,

+ 27 - 27
jyBXCore/rpc/util/search.go

@@ -244,38 +244,38 @@ func SearchListFormat(industry string, repl *[]map[string]interface{}, b bool) (
 			}
 			searchList.Detail = detail
 		}
-		searchList.Id = ME.EncodeArticleId2ByCheck(MC.ObjToString(v["_id"]))                                        //ME.EncodeArticleId2ByCheck(MC.ObjToString(v["_id"]))                                         //加密信息id
-		searchList.Area = MC.ObjToString(v["area"])                                                                 //地区
-		searchList.AreaUrl = IC.LabelMap[searchList.Area].Url                                                       //地区分类链接
-		searchList.BuyerClass = MC.ObjToString(v["buyerclass"])                                                     //采购单位类型
-		searchList.City = MC.ObjToString(v["city"])                                                                 //城市
-		searchList.Industry = IndustryFormat(industry, strings.Trim(MC.ObjToString(v["s_subscopeclass"]), ","))     //行业
-		searchList.IndustryUrl = IC.LabelMap[searchList.Industry].Url                                               //行业分类地址
-		searchList.PublishTime = MC.If(v["publishtime"] != nil, MC.LongToDate(v["publishtime"], true), "").(string) //发布时间
-		searchList.FileExists, _ = v["isValidFile"].(bool)                                                          //是否有附件
-		searchList.Subtype = MC.ObjToString(v["subtype"])                                                           //信息类型
-		searchList.SubtypeUrl = IC.LabelMap[searchList.Subtype].Url                                                 //信息类型分类链接
-		searchList.Title = MC.ObjToString(v["title"])                                                               //标题
-		searchList.ProjectName = MC.ObjToString(v["projectname"])                                                   //项目名称
-		searchList.ProjectCode = MC.ObjToString(v["projectcode"])                                                   //项目代码
-		if budget, ok := v["budget"].(float64); ok && budget > 0 {                                                  //预算
+		searchList.Id = ME.EncodeArticleId2ByCheck(MC.ObjToString(v["_id"]))                                    //ME.EncodeArticleId2ByCheck(MC.ObjToString(v["_id"]))                                         //加密信息id
+		searchList.Area = MC.ObjToString(v["area"])                                                             //地区
+		searchList.AreaUrl = IC.LabelMap[searchList.Area].Url                                                   //地区分类链接
+		searchList.BuyerClass = MC.ObjToString(v["buyerclass"])                                                 //采购单位类型
+		searchList.City = MC.ObjToString(v["city"])                                                             //城市
+		searchList.Industry = IndustryFormat(industry, strings.Trim(MC.ObjToString(v["s_subscopeclass"]), ",")) //行业
+		searchList.IndustryUrl = IC.LabelMap[searchList.Industry].Url                                           //行业分类地址
+		searchList.PublishTime = MC.Int64All(v["publishtime"])                                                  //发布时间
+		searchList.FileExists, _ = v["isValidFile"].(bool)                                                      //是否有附件
+		searchList.Subtype = MC.ObjToString(v["subtype"])                                                       //信息类型
+		searchList.SubtypeUrl = IC.LabelMap[searchList.Subtype].Url                                             //信息类型分类链接
+		searchList.Title = MC.ObjToString(v["title"])                                                           //标题
+		searchList.ProjectName = MC.ObjToString(v["projectname"])                                               //项目名称
+		searchList.ProjectCode = MC.ObjToString(v["projectcode"])                                               //项目代码
+		if budget, ok := v["budget"].(float64); ok && budget > 0 {                                              //预算
 			searchList.Budget = int64(budget)
 		}
 		if bidAmount, ok := v["bidamount"].(float64); ok && bidAmount > 0 { //中标金额
 			searchList.BidAmount = int64(bidAmount)
 		}
-		searchList.Buyer = MC.ObjToString(v["buyer"])                                                               //采购单位
-		searchList.BuyerTel = MC.ObjToString(v["buyertel"])                                                         //采购单位联系方式
-		searchList.BuyerPerson = MC.ObjToString(v["buyerperson"])                                                   //采购单位联系人
-		searchList.Agency = MC.ObjToString(v["agency"])                                                             //代理机构
-		searchList.AgencyTel = MC.ObjToString(v["agencytel"])                                                       //代理机构联系电话
-		searchList.AgencyPerson = MC.ObjToString(v["agencyperson"])                                                 //代理机构联系人
-		searchList.BidOpenTime = MC.If(v["bidopentime"] != nil, MC.LongToDate(v["bidopentime"], true), "").(string) //开标时间
-		searchList.BidEndTime = MC.If(v["bidendtime"] != nil, MC.LongToDate(v["bidendtime"], true), "").(string)    //发布时间
-		searchList.SignEndTime = MC.If(v["signendtime"] != nil, MC.LongToDate(v["signendtime"], true), "").(string) //投标截止日期
-		searchList.Site = MC.ObjToString(v["site"])                                                                 //网站来源名称
-		searchList.SpiderCode = MC.ObjToString(v["spidercode"])                                                     //网站来源代码
-		winnerList := MC.ObjToString(v["s_winner"])                                                                 //中标企业名称集合
+		searchList.Buyer = MC.ObjToString(v["buyer"])               //采购单位
+		searchList.BuyerTel = MC.ObjToString(v["buyertel"])         //采购单位联系方式
+		searchList.BuyerPerson = MC.ObjToString(v["buyerperson"])   //采购单位联系人
+		searchList.Agency = MC.ObjToString(v["agency"])             //代理机构
+		searchList.AgencyTel = MC.ObjToString(v["agencytel"])       //代理机构联系电话
+		searchList.AgencyPerson = MC.ObjToString(v["agencyperson"]) //代理机构联系人
+		searchList.BidOpenTime = MC.Int64All(v["bidopentime"])      //开标时间
+		searchList.BidEndTime = MC.Int64All(v["bidendtime"])        //发布时间
+		searchList.SignEndTime = MC.Int64All(v["signendtime"])      //投标截止日期
+		searchList.Site = MC.ObjToString(v["site"])                 //网站来源名称
+		searchList.SpiderCode = MC.ObjToString(v["spidercode"])     //网站来源代码
+		winnerList := MC.ObjToString(v["s_winner"])                 //中标企业名称集合
 		if winnerList != "" && len(strings.Split(winnerList, ",")) > 0 {
 			for wk, wv := range strings.Split(winnerList, ",") {
 				var (