Explorar el Código

fix:收藏列表

xmy hace 3 años
padre
commit
94015b3dc7

+ 1 - 1
README.md

@@ -11,5 +11,5 @@ https://yapi.jydev.jianyu360.com/project/63/interface/api
 #jyBXCore 标讯核心模块(搜索、详情、项目关注等)
 ```
 ```
-#jyBXAdditional 标讯附加模块(标讯收藏、标讯搜索筛选等)
+#jyBXBase 标讯基础模块(标讯收藏、标讯搜索筛选等)
 ```

+ 11 - 11
jyBXBase/api/bxcore.api

@@ -17,10 +17,10 @@ type (
 	//标签新增或删除
 	LabelAction {
 		UserId  string   `header:"userId"`
-		Lids    string   `json:"lids"`    //标签ids
-		Lname   string   `json:"lname"`   //标签名称
-		Binfo   []string `json:"binfo"`   //收藏的招标信息
-		Laction string   `json:"laction"` //用户行为:S添加或绑定标签;D删除标签
+		Lids    string   `json:"lids"`           //标签ids
+		Lname   string   `json:"lname"`          //标签名称
+		Binfo   []string `json:"binfo,optional"` //收藏的招标信息
+		Laction string   `json:"laction"`        //用户行为:S添加或绑定标签;D删除标签
 	}
 	//获取标签
 	GetLabelAction {
@@ -29,13 +29,13 @@ type (
 	//获取收藏列表
 	List {
 		UserId      string `header:"userId"`
-		Pagenum     int64  `json:"pagenum"`     //页数
-		Label       string `json:"label"`       //标签 用,分隔开
-		SelectTime  string `json:"selectTime"`  //收藏时间
-		Buyerclass  string `json:"buyerclass"`  //采购单位 用,分隔开
-		BuyerPhone  int64  `json:"buyerPhone"`  //是否需要采购单位联系方式 1:需要 -1:不需要 0:未选中
-		WinnerPhone int64  `json:"winnerPhone"` //是否需要中标单位联系方式 1:需要 -1:不需要 0:未选中
-		Pagesize    int64  `json:"pagesize"`    //每页展示数量
+		Pagenum     int64  `json:"pagenum"`              //页数
+		Label       string `json:"label"`                //标签 用,分隔开
+		SelectTime  string `json:"selectTime,optional"`  //收藏时间
+		Buyerclass  string `json:"buyerclass,optional"`  //采购单位 用,分隔开
+		BuyerPhone  int64  `json:"buyerPhone,optional"`  //是否需要采购单位联系方式 1:需要 -1:不需要 0:未选中
+		WinnerPhone int64  `json:"winnerPhone,optional"` //是否需要中标单位联系方式 1:需要 -1:不需要 0:未选中
+		Pagesize    int64  `json:"pagesize"`             //每页展示数量
 	}
 	//新增标签
 	AddLabel {

+ 11 - 11
jyBXBase/api/internal/types/types.go

@@ -9,10 +9,10 @@ type BCAction struct {
 
 type LabelAction struct {
 	UserId  string   `header:"userId"`
-	Lids    string   `json:"lids"`    //标签ids
-	Lname   string   `json:"lname"`   //标签名称
-	Binfo   []string `json:"binfo"`   //收藏的招标信息
-	Laction string   `json:"laction"` //用户行为:S添加或绑定标签;D删除标签
+	Lids    string   `json:"lids"`           //标签ids
+	Lname   string   `json:"lname"`          //标签名称
+	Binfo   []string `json:"binfo,optional"` //收藏的招标信息
+	Laction string   `json:"laction"`        //用户行为:S添加或绑定标签;D删除标签
 }
 
 type GetLabelAction struct {
@@ -21,13 +21,13 @@ type GetLabelAction struct {
 
 type List struct {
 	UserId      string `header:"userId"`
-	Pagenum     int64  `json:"pagenum"`     //页数
-	Label       string `json:"label"`       //标签 用,分隔开
-	SelectTime  string `json:"selectTime"`  //收藏时间
-	Buyerclass  string `json:"buyerclass"`  //采购单位 用,分隔开
-	BuyerPhone  int64  `json:"buyerPhone"`  //是否需要采购单位联系方式 1:需要 -1:不需要 0:未选中
-	WinnerPhone int64  `json:"winnerPhone"` //是否需要中标单位联系方式 1:需要 -1:不需要 0:未选中
-	Pagesize    int64  `json:"pagesize"`    //每页展示数量
+	Pagenum     int64  `json:"pagenum"`              //页数
+	Label       string `json:"label"`                //标签 用,分隔开
+	SelectTime  string `json:"selectTime,optional"`  //收藏时间
+	Buyerclass  string `json:"buyerclass,optional"`  //采购单位 用,分隔开
+	BuyerPhone  int64  `json:"buyerPhone,optional"`  //是否需要采购单位联系方式 1:需要 -1:不需要 0:未选中
+	WinnerPhone int64  `json:"winnerPhone,optional"` //是否需要中标单位联系方式 1:需要 -1:不需要 0:未选中
+	Pagesize    int64  `json:"pagesize"`             //每页展示数量
 }
 
 type AddLabel struct {

+ 7 - 7
jyBXBase/rpc/bxcollection/etc/bxcollection.yaml

@@ -7,36 +7,36 @@ Etcd:
 Webrpcport: 8012
 MysqlMain:
   dbName: jianyu
-  address: 127.0.0.1:3366
+  address: 192.168.3.11:3366
   userName: root
   passWord: Topnet123
   maxOpenConns: 5
   maxIdleConns: 5
 Redis:
-  Host: 127.0.0.1
-  addr: 127.0.0.1:1712
+  Host: 192.168.3.206
+  addr: 192.168.3.206:1712
   modules: other
 Es:
-  addr: http://127.0.0.1:9800
+  addr: http://192.168.3.206:9800
   size: 5
 MangoDb:
   dbName: qfw
   size: 5
-  address: 127.0.0.1:27080
+  address: 192.168.3.206:27080
   replSet: ""
   userName: ""
   password: ""
 MangoEnt:
   dbName: mixdata
   size: 5
-  address: 127.0.0.1:27001
+  address: 192.168.3.206:27001
   replSet: ""
   userName: jyDevGroup
   password: DevGroup
 MangoBid:
   dbName: qfw_data
   size: 5
-  address: 127.0.0.1:27001
+  address: 192.168.3.206:27001
   replSet: ""
   userName: jyDevGroup
   password: DevGroup

+ 1 - 6
jyBXBase/rpc/bxcollection/internal/logic/labelactionlogic.go

@@ -34,16 +34,11 @@ func NewLabelActionLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Label
 
 // 标签新增或删除
 func (l *LabelActionLogic) LabelAction(in *bxcol.LabelActionReq) (*bxcol.LabelActionRes, error) {
-	var resp bxcol.LabelActionRes
+	//var resp bxcol.LabelActionRes
 	var (
 		//insertCollKey  = []string{"userid", "bid", "buyerclass", "buyerinfo", "winnerinfo", "createdate"}
 		insertCollKey2 = []string{"userid", "bid", "labelid", "buyerclass", "buyerinfo", "winnerinfo", "createdate"}
 	)
-	if len(in.Binfo) == 0 && in.Lids == "" && in.Lname == "" {
-		resp.ErrCode = -1
-		resp.ErrMsg = "参数错误"
-		return &resp, nil
-	}
 
 	ibool, ok, msg := true, true, ""
 	redisArr := []string{}

+ 20 - 6
jyBXBase/rpc/bxcollection/internal/logic/listlogic.go

@@ -1,6 +1,7 @@
 package logic
 
 import (
+	"app.yhyue.com/moapp/jybase/common"
 	"context"
 	"jyBXBase/rpc/bxcollection/bxcol"
 	"jyBXBase/rpc/bxcollection/internal/svc"
@@ -29,11 +30,6 @@ func NewListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListLogic {
 func (l *ListLogic) List(in *bxcol.ListReq) (*bxcol.ListRes, error) {
 	var ldata bxcol.ColList
 	pagesize_max := 50
-	rdata := map[string]interface{}{
-		"count":        0,
-		"haveNextPage": false,
-		"res":          []map[string]interface{}{},
-	}
 	isPay, _ := util.Power(in.UserId)
 	if !isPay {
 		pagesize_max = 100
@@ -64,7 +60,25 @@ func (l *ListLogic) List(in *bxcol.ListReq) (*bxcol.ListRes, error) {
 	ldata.Count = int64(count)
 	ldata.HaveNextPage = haveNextPage
 	ldata.Pagesize = int64(pagesize_max)
-	rdata["res"] = util.GetInfoById(model.Mgo_Bidding, "collection", "bidding_back", result)
+	var res []*bxcol.ColData
+	mres := util.GetInfoById(model.Mgo_Bidding, "collection", "bidding_back", result)
+	for _, v := range mres {
+		var r bxcol.ColData
+		r.Id = v.Id
+		r.Title = v.Title
+		r.Buyerclass = v.Buyerclass
+		r.Buyer = v.Buyer
+		r.Type = v.Type
+		r.Budget = common.InterfaceToStr(v.Budget)
+		r.Area = v.Area
+		r.Bidamount = common.InterfaceToStr(v.Bidamount)
+		r.Bidopentime = v.Bidopentime
+		r.Publishtime = v.Publishtime
+		r.SSubscopeclass = v.S_subscopeclass
+		r.SWinner = v.S_winner
+		res = append(res, &r)
+	}
+	ldata.Res = res
 
 	return &bxcol.ListRes{
 		Ldata: &ldata,