Bladeren bron

feat:xiugai

wangchuanjin 5 maanden geleden
bovenliggende
commit
0e45aa8dee

+ 5 - 0
api/buyer/buyer.go

@@ -6,6 +6,7 @@ package buyer
 
 import (
 	"context"
+	v2 "debrisProduct/api/buyer/v2"
 
 	"debrisProduct/api/buyer/v1"
 )
@@ -15,3 +16,7 @@ type IBuyerV1 interface {
 	BuyerList(ctx context.Context, req *v1.BuyerListReq) (res *v1.BuyerListRes, err error)
 	BuyerSearch(ctx context.Context, req *v1.BuyerSearchReq) (res *v1.BuyerSearchRes, err error)
 }
+
+type IBuyerV2 interface {
+	BuyerList(ctx context.Context, req *v2.BuyerListV2Req) (res *v1.BuyerListRes, err error)
+}

+ 11 - 0
api/buyer/v2/buyer.go

@@ -0,0 +1,11 @@
+package v2
+
+import (
+	v1 "debrisProduct/api/buyer/v1"
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+type BuyerListV2Req struct {
+	g.Meta `path:"/buyer/getList/v2" tags:"业主单位" method:"post" summary:"业主单位列表"`
+	*v1.BuyerListReq
+}

+ 6 - 0
api/info/info.go

@@ -8,6 +8,7 @@ import (
 	"context"
 
 	"debrisProduct/api/info/v1"
+	"debrisProduct/api/info/v2"
 )
 
 type IInfoV1 interface {
@@ -16,3 +17,8 @@ type IInfoV1 interface {
 	InfoListSubscribe(ctx context.Context, req *v1.InfoListSubscribeReq) (res *v1.InfoListSubscribeRes, err error)
 	InfoDetail(ctx context.Context, req *v1.InfoDetailReq) (res *v1.InfoDetailRes, err error)
 }
+
+type IInfoV2 interface {
+	InfoList(ctx context.Context, req *v2.InfoListReq) (res *v1.InfoListRes, err error)
+	InfoListSubscribe(ctx context.Context, req *v2.InfoListSubscribeReq) (res *v1.InfoListSubscribeRes, err error)
+}

+ 7 - 7
api/info/v1/info.go

@@ -42,15 +42,15 @@ type InfoListSubscribeReq struct {
 	Hsl          []string               `json:"hsl" dc:"换手率"`
 }
 type InfoListRes struct {
-	Total    int     `dc:"总数" json:"total"`
-	Count    int64   `dc:"实际返回数量" json:"count"`
-	List     []Infos `dc:"返回数据" json:"list"`
-	KeyWords string  `json:"keyWords"`
+	Total    int                      `dc:"总数" json:"total"`
+	Count    int64                    `dc:"实际返回数量" json:"count"`
+	List     []map[string]interface{} `dc:"返回数据" json:"list"`
+	KeyWords string                   `json:"keyWords"`
 }
 type InfoListSubscribeRes struct {
-	Total int64   `dc:"总数" json:"total"`
-	Count int64   `dc:"实际返回数量" json:"count"`
-	List  []Infos `dc:"返回数据" json:"list"`
+	Total int64                    `dc:"总数" json:"total"`
+	Count int64                    `dc:"实际返回数量" json:"count"`
+	List  []map[string]interface{} `dc:"返回数据" json:"list"`
 }
 type InfoDetailReq struct {
 	g.Meta `path:"/info/getInfoDetail" tags:"情报" method:"post" summary:"情报详情"`

+ 15 - 0
api/info/v2/info.go

@@ -0,0 +1,15 @@
+package v2
+
+import (
+	v1 "debrisProduct/api/info/v1"
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+type InfoListReq struct {
+	g.Meta `path:"/info/getInfoList/v2" tags:"情报" method:"post" summary:"情报列表/搜索"`
+	*v1.InfoListReq
+}
+type InfoListSubscribeReq struct {
+	g.Meta `path:"/info/subscribeList/v2" tags:"情报" method:"post" summary:"情报列表/搜索"`
+	*v1.InfoListSubscribeReq
+}

+ 8 - 0
api/search/search.go

@@ -8,6 +8,7 @@ import (
 	"context"
 
 	"debrisProduct/api/search/v1"
+	"debrisProduct/api/search/v2"
 )
 
 type ISearchV1 interface {
@@ -16,3 +17,10 @@ type ISearchV1 interface {
 	BidList(ctx context.Context, req *v1.BidListReq) (res *v1.BidListRes, err error)
 	BuyPurposeList(ctx context.Context, req *v1.BuyPurposeListReq) (res *v1.BuyPurposeListRes, err error)
 }
+
+type ISearchV2 interface {
+	BidSubscribeList(ctx context.Context, req *v2.BidSubscribeListReq) (res *v1.BidSubscribeListRes, err error)
+	BuyPurposeSubscribeList(ctx context.Context, req *v2.BuyPurposeSubscribeListReq) (res *v1.BuyPurposeSubscribeListRes, err error)
+	BidList(ctx context.Context, req *v2.BidListReq) (res *v1.BidListRes, err error)
+	BuyPurposeList(ctx context.Context, req *v2.BuyPurposeListReq) (res *v1.BuyPurposeListRes, err error)
+}

+ 7 - 7
api/search/v1/BidSubscribeList.go

@@ -21,11 +21,11 @@ type BidSubscribeListReq struct {
 }
 
 type BidSubscribeListRes struct {
-	Total               int64                     `json:"total" dc:"总量"`
-	List                []*map[string]interface{} `json:"list" dc:"列表数据"`
-	TotalPage           int64                     `json:"count" dc:"总页数"`
-	KeyWords            string                    `json:"keyWords"`
-	InterceptOtherWords string                    `json:"interceptOtherWords"` //关键词截取剩余关键词
-	InterceptKeyWords   string                    `json:"interceptKeyWords"`   //关键词截取后的关键词
-	InterceptLimit      int64                     `json:"interceptLimit"`
+	Total               int64                    `json:"total" dc:"总量"`
+	List                []map[string]interface{} `json:"list" dc:"列表数据"`
+	TotalPage           int64                    `json:"count" dc:"总页数"`
+	KeyWords            string                   `json:"keyWords"`
+	InterceptOtherWords string                   `json:"interceptOtherWords"` //关键词截取剩余关键词
+	InterceptKeyWords   string                   `json:"interceptKeyWords"`   //关键词截取后的关键词
+	InterceptLimit      int64                    `json:"interceptLimit"`
 }

+ 7 - 7
api/search/v1/BuyPurposeSubscribeList.go

@@ -16,11 +16,11 @@ type BuyPurposeSubscribeListReq struct {
 }
 
 type BuyPurposeSubscribeListRes struct {
-	Total               int64                     `json:"total" dc:"总量"`
-	List                []*map[string]interface{} `json:"list" dc:"列表数据"`
-	TotalPage           int64                     `json:"count" dc:"总页数"`
-	KeyWords            string                    `json:"keyWords"`
-	InterceptOtherWords string                    `json:"interceptOtherWords"` //关键词截取剩余关键词
-	InterceptKeyWords   string                    `json:"interceptKeyWords"`   //关键词截取后的关键词
-	InterceptLimit      int64                     `json:"interceptLimit"`
+	Total               int64                    `json:"total" dc:"总量"`
+	List                []map[string]interface{} `json:"list" dc:"列表数据"`
+	TotalPage           int64                    `json:"count" dc:"总页数"`
+	KeyWords            string                   `json:"keyWords"`
+	InterceptOtherWords string                   `json:"interceptOtherWords"` //关键词截取剩余关键词
+	InterceptKeyWords   string                   `json:"interceptKeyWords"`   //关键词截取后的关键词
+	InterceptLimit      int64                    `json:"interceptLimit"`
 }

+ 7 - 7
api/search/v1/bidSearchList.go

@@ -27,13 +27,13 @@ type BidListReq struct {
 }
 
 type BidListRes struct {
-	Total               int64                     `json:"total" dc:"总量"`
-	List                []*map[string]interface{} `json:"list" dc:"列表数据"`
-	Count               int64                     `json:"count" dc:"总页数"`
-	KeyWords            string                    `json:"keyWords"`
-	InterceptOtherWords string                    `json:"interceptOtherWords"` //关键词截取剩余关键词
-	InterceptKeyWords   string                    `json:"interceptKeyWords"`   //关键词截取后的关键词
-	InterceptLimit      int64                     `json:"interceptLimit"`      //关键词截取后的关键词
+	Total               int64                    `json:"total" dc:"总量"`
+	List                []map[string]interface{} `json:"list" dc:"列表数据"`
+	Count               int64                    `json:"count" dc:"总页数"`
+	KeyWords            string                   `json:"keyWords"`
+	InterceptOtherWords string                   `json:"interceptOtherWords"` //关键词截取剩余关键词
+	InterceptKeyWords   string                   `json:"interceptKeyWords"`   //关键词截取后的关键词
+	InterceptLimit      int64                    `json:"interceptLimit"`      //关键词截取后的关键词
 }
 
 type SearchOptimize struct {

+ 7 - 7
api/search/v1/buyPurposeSearch.go

@@ -23,13 +23,13 @@ type BuyPurposeListReq struct {
 }
 
 type BuyPurposeListRes struct {
-	Total               int64                     `json:"total" dc:"总量"`
-	List                []*map[string]interface{} `json:"list" dc:"列表数据"`
-	Count               int64                     `json:"count" dc:"页面展示数量"`
-	KeyWords            string                    `json:"keyWords"`
-	InterceptOtherWords string                    `json:"interceptOtherWords"` //关键词截取剩余关键词
-	InterceptKeyWords   string                    `json:"interceptKeyWords"`   //关键词截取后的关键词
-	InterceptLimit      int64                     `json:"interceptLimit"`
+	Total               int64                    `json:"total" dc:"总量"`
+	List                []map[string]interface{} `json:"list" dc:"列表数据"`
+	Count               int64                    `json:"count" dc:"页面展示数量"`
+	KeyWords            string                   `json:"keyWords"`
+	InterceptOtherWords string                   `json:"interceptOtherWords"` //关键词截取剩余关键词
+	InterceptKeyWords   string                   `json:"interceptKeyWords"`   //关键词截取后的关键词
+	InterceptLimit      int64                    `json:"interceptLimit"`
 }
 
 /*type SearchOptimize struct {

+ 11 - 0
api/search/v2/BidSubscribeList.go

@@ -0,0 +1,11 @@
+package v2
+
+import (
+	v1 "debrisProduct/api/search/v1"
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+type BidSubscribeListReq struct {
+	g.Meta `path:"/search/bidSubscribeList/v2" tags:"搜索" method:"post" summary:"招标项目搜索"`
+	*v1.BidSubscribeListReq
+}

+ 11 - 0
api/search/v2/BuyPurposeSubscribeList.go

@@ -0,0 +1,11 @@
+package v2
+
+import (
+	v1 "debrisProduct/api/search/v1"
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+type BuyPurposeSubscribeListReq struct {
+	g.Meta `path:"/search/buyPurposeSubscribeList/v2" tags:"搜索" method:"post" summary:"采购意向搜索"`
+	*v1.BuyPurposeSubscribeListReq
+}

+ 11 - 0
api/search/v2/bidSearchList.go

@@ -0,0 +1,11 @@
+package v2
+
+import (
+	v1 "debrisProduct/api/search/v1"
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+type BidListReq struct {
+	g.Meta `path:"/search/bidList/v2" tags:"搜索" method:"post" summary:"招标项目搜索"`
+	*v1.BidListReq
+}

+ 11 - 0
api/search/v2/buyPurposeSearch.go

@@ -0,0 +1,11 @@
+package v2
+
+import (
+	v1 "debrisProduct/api/search/v1"
+	"github.com/gogf/gf/v2/frame/g"
+)
+
+type BuyPurposeListReq struct {
+	g.Meta `path:"/search/buyPurposeList/v2" tags:"搜索" method:"post" summary:"采购意向搜索"`
+	*v1.BuyPurposeListReq
+}

+ 1 - 3
go.mod

@@ -1,8 +1,6 @@
 module debrisProduct
 
-go 1.21
-
-toolchain go1.23.4
+go 1.20
 
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20240617105649-cedad42b8b1f

+ 0 - 12
go.sum

@@ -850,12 +850,10 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5
 github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE=
 github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc=
 github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302 h1:uvdUDbHQHO85qeSydJtItA4T55Pw6BtAejd0APRJOCE=
-github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc=
 github.com/alicebob/miniredis/v2 v2.17.0/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I=
 github.com/alicebob/miniredis/v2 v2.22.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv52acZ6kqeS0t88=
 github.com/alicebob/miniredis/v2 v2.30.5/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg=
 github.com/alicebob/miniredis/v2 v2.32.1 h1:Bz7CciDnYSaa0mX5xODh6GUITRSx+cVhjNoOR4JssBo=
-github.com/alicebob/miniredis/v2 v2.32.1/go.mod h1:AqkLNAfUm0K07J28hnAyyQKf/x0YkCY/g5DCtuL01Mw=
 github.com/aliyun/aliyun-oss-go-sdk v2.1.6+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
 github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
 github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
@@ -885,9 +883,7 @@ github.com/bos-hieu/mongostore v0.0.2/go.mod h1:8AbbVmDEb0yqJsBrWxZIAZOxIfv/tsP8
 github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA=
 github.com/bradleypeabody/gorilla-sessions-memcache v0.0.0-20181103040241-659414f458e1/go.mod h1:dkChI7Tbtx7H1Tj7TqGSZMOeGpMP5gLHtjroHd4agiI=
 github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
-github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c=
 github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
-github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0=
 github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8=
 github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE=
 github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
@@ -1086,7 +1082,6 @@ github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqw
 github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
 github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
 github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
-github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
 github.com/go-test/deep v1.0.7/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8=
 github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:56xuuqnHyryaerycW3BfssRdxQstACi0Epw/yC5E2xM=
 github.com/go-xorm/xorm v0.7.9/go.mod h1:XiVxrMMIhFkwSkh96BW7PACl7UhLtx2iJIHMdmjh5sQ=
@@ -1138,7 +1133,6 @@ github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0L
 github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ=
 github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ=
 github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68=
-github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w=
 github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
@@ -1232,7 +1226,6 @@ github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLe
 github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
 github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
 github.com/google/pprof v0.0.0-20211214055906-6f57359322fd h1:1FjCyPC+syAzJ5/2S8fqdZK1R22vvA0J7JZKcuOIQ7Y=
-github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg=
 github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
 github.com/google/s2a-go v0.1.0/go.mod h1:OJpEgntRZo8ugHpF9hkoLJbS5dSI20XZeXJ9JVywLlM=
 github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A=
@@ -1536,7 +1529,6 @@ github.com/onsi/ginkgo/v2 v2.4.0/go.mod h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkA
 github.com/onsi/ginkgo/v2 v2.5.0/go.mod h1:Luc4sArBICYCS8THh8v3i3i5CuSZO+RaQRaJoeNwomw=
 github.com/onsi/ginkgo/v2 v2.7.0/go.mod h1:yjiuMwPokqY1XauOgju45q3sJt6VzQ/Fict1LFVcsAo=
 github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4=
-github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
 github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
 github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
 github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
@@ -1554,7 +1546,6 @@ github.com/onsi/gomega v1.24.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2
 github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmvt1jM=
 github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM=
 github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg=
-github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
 github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
 github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
 github.com/openzipkin/zipkin-go v0.3.0/go.mod h1:4c3sLeE8xjNqehmF5RpAFLPLJxXscc0R4l6Zg0P1tTQ=
@@ -1651,7 +1642,6 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
 github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
 github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
 github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
-github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
 github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
 github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
 github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
@@ -1753,7 +1743,6 @@ github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da/go.mod h1:E1AXubJB
 github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA=
 github.com/yuin/gopher-lua v1.1.0/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw=
 github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M=
-github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw=
 github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
 github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
 github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
@@ -2384,7 +2373,6 @@ golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4=
 golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
 golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM=
 golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA=
-golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0=
 golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

+ 6 - 0
internal/cmd/cmd.go

@@ -13,6 +13,7 @@ import (
 	"debrisProduct/internal/controller/search"
 	"debrisProduct/internal/logic/middleware"
 	"debrisProduct/internal/service"
+	"debrisProduct/internal/timetask"
 
 	"github.com/gogf/gf/v2/frame/g"
 	"github.com/gogf/gf/v2/net/ghttp"
@@ -36,6 +37,8 @@ var (
 			c.Status()
 			service.MiniProgram().LoadMiniProgram(ctx)
 			//
+			timetask.Run(ctx)
+			//
 			s := g.Server()
 			s.SetSessionStorage(gsession.NewStorageRedis(g.Redis("session")))
 			s.Group("/debrisproduct", func(group *ghttp.RouterGroup) {
@@ -58,6 +61,9 @@ var (
 				)
 				group.Bind(
 					order.NewV2(),
+					buyer.NewV2(),
+					info.NewV2(),
+					search.NewV2(),
 				)
 			})
 			s.Run()

+ 6 - 0
internal/controller/buyer/buyer_new.go

@@ -13,3 +13,9 @@ type ControllerV1 struct{}
 func NewV1() buyer.IBuyerV1 {
 	return &ControllerV1{}
 }
+
+type ControllerV2 struct{}
+
+func NewV2() buyer.IBuyerV2 {
+	return &ControllerV2{}
+}

+ 6 - 0
internal/controller/info/info_new.go

@@ -13,3 +13,9 @@ type ControllerV1 struct{}
 func NewV1() info.IInfoV1 {
 	return &ControllerV1{}
 }
+
+type ControllerV2 struct{}
+
+func NewV2() info.IInfoV2 {
+	return &ControllerV2{}
+}

+ 1 - 1
internal/controller/info/info_v1_info_list.go

@@ -221,7 +221,7 @@ func (c *ControllerV1) InfoList(ctx context.Context, req *v1.InfoListReq) (res *
 	}
 	res.Total = int(total)
 	res.Count = common.If(total <= count, total, count).(int64)
-	res.List = results
+	res.List = gconv.Maps(results)
 	if req.KeyWords != "" {
 		res.KeyWords = strings.Join(GetSearchKeyWordsQueryStr(req.KeyWords), " ")
 	}

+ 1 - 1
internal/controller/info/info_v1_info_list_subscribe.go

@@ -211,6 +211,6 @@ func (c *ControllerV1) InfoListSubscribe(ctx context.Context, req *v1.InfoListSu
 	}
 	res.Total = total
 	res.Count = common.If(total <= count, total, count).(int64)
-	res.List = results
+	res.List = gconv.Maps(results)
 	return res, nil
 }

+ 6 - 0
internal/controller/search/search_new.go

@@ -13,3 +13,9 @@ type ControllerV1 struct{}
 func NewV1() search.ISearchV1 {
 	return &ControllerV1{}
 }
+
+type ControllerV2 struct{}
+
+func NewV2() search.ISearchV2 {
+	return &ControllerV2{}
+}

+ 4 - 4
internal/controller/search/search_v1_bid_list.go

@@ -25,7 +25,7 @@ func (c *ControllerV1) BidList(ctx context.Context, req *v1.BidListReq) (res *v1
 	res = &v1.BidListRes{}
 	var (
 		count, total int64
-		list         []*map[string]interface{}
+		list         []map[string]interface{}
 	)
 	if len(req.Subtype) == 0 {
 		req.Subtype = utility.SubTypeInit(ctx) //初始花全部
@@ -64,7 +64,7 @@ var (
 	MatchSpace = regexp.MustCompile("\\s+")
 )
 
-func (so *SearchOptimize) IsNullQuery(ctx context.Context, redisKey string, countLimit int64) ([]*map[string]interface{}, int64, int64, bool) {
+func (so *SearchOptimize) IsNullQuery(ctx context.Context, redisKey string, countLimit int64) ([]map[string]interface{}, int64, int64, bool) {
 	if so.KeyWords == "" && so.Price == "" && (len(so.Province) == 1 || len(so.Province) == 0) && len(so.City) == 0 && so.Subtype == "" &&
 		so.PublishTime == "" && so.District == "" && len(so.PropertyForm) == 0 && so.Scale == "" &&
 		so.ExpurasingTime == "" && so.Isfile == 0 && len(so.OwnerType) == 0 && len(so.Subinformation) == 0 {
@@ -74,11 +74,11 @@ func (so *SearchOptimize) IsNullQuery(ctx context.Context, redisKey string, coun
 			lists := gconv.Maps(dataMap["list"])
 			count := gconv.Int64(dataMap["count"])
 			total := gconv.Int64(dataMap["total"])
-			var list []*map[string]interface{}
+			var list []map[string]interface{}
 			log.Println(len(lists), so.PageNum, so.PageSize)
 			for _, m := range lists[(so.PageNum-1)*so.PageSize : so.PageNum*so.PageSize] {
 				ms := m
-				list = append(list, &ms)
+				list = append(list, ms)
 			}
 			return list, count, total, true
 		} else {

+ 1 - 1
internal/controller/search/search_v1_bid_subscribe_list.go

@@ -23,7 +23,7 @@ func (c *ControllerV1) BidSubscribeList(ctx context.Context, req *v1.BidSubscrib
 	res = &v1.BidSubscribeListRes{}
 	var (
 		count, total int64
-		list         []*map[string]interface{}
+		list         []map[string]interface{}
 	)
 	if len(req.Subtype) == 0 {
 		req.Subtype = utility.SubTypeInit(ctx) //初始花全部

+ 4 - 4
internal/controller/search/search_v1_buy_purpose_list.go

@@ -41,7 +41,7 @@ func (c *ControllerV1) BuyPurposeList(ctx context.Context, req *v1.BuyPurposeLis
 	res = &v1.BuyPurposeListRes{}
 	var (
 		count, total int64
-		list         []*map[string]interface{}
+		list         []map[string]interface{}
 		//heightKeys   string //需要高亮的关键词
 	)
 	so := NewSearchOptimize(areaArr, cityArr, propertyForm, req.OwnerType, nil, strings.Join(districtArr, ","), subType, publishtime, expurasingTime, topInformation, keyWords,
@@ -117,7 +117,7 @@ type SearchByES struct {
 }
 
 // GetBidSearchList 搜索 查询
-func (so *SearchOptimize) GetBidSearchList(isCache bool, countLimit int64) (count, total int64, list []*map[string]interface{}) {
+func (so *SearchOptimize) GetBidSearchList(isCache bool, countLimit int64) (count, total int64, list []map[string]interface{}) {
 	var start = (so.PageNum - 1) * so.PageSize
 	if start >= 0 {
 		t := time.Now()
@@ -181,7 +181,7 @@ func (e *SearchByES) GetAllByNgramWithCount() (int64, *[]map[string]interface{})
 }
 
 // SearchListFormat  格式化数据
-func SearchListFormat(industry string, propertyForm, subinformation []string, repl []map[string]interface{}, b bool) (list []*map[string]interface{}) {
+func SearchListFormat(industry string, propertyForm, subinformation []string, repl []map[string]interface{}, b bool) (list []map[string]interface{}) {
 	for _, v := range repl {
 		v["agencyPerson"] = gconv.String(v["agencyperson"])
 		v["agencyTel"] = gconv.String(v["agencytel"])
@@ -320,7 +320,7 @@ func SearchListFormat(industry string, propertyForm, subinformation []string, re
 		delete(v, "tag_set")
 		//}
 		tmp := v
-		list = append(list, &tmp)
+		list = append(list, tmp)
 	}
 	return
 }

+ 1 - 1
internal/controller/search/search_v1_buy_purpose_subscribe_list.go

@@ -32,7 +32,7 @@ func (c *ControllerV1) BuyPurposeSubscribeList(ctx context.Context, req *v1.BuyP
 	res = &v1.BuyPurposeSubscribeListRes{}
 	var (
 		count, total int64
-		list         []*map[string]interface{}
+		list         []map[string]interface{}
 		//heightKeys   string //需要高亮的关键词
 	)
 	so := NewSearchOptimize(areaArr, cityArr, propertyForm, req.OwnerType, nil, strings.Join(districtArr, ","), subType, publishtime, expurasingTime, topInformation, keyWords,

+ 62 - 0
internal/drainage/drainage.go

@@ -0,0 +1,62 @@
+package drainage
+
+import (
+	"context"
+	"debrisProduct/internal/service"
+	"fmt"
+	"github.com/gogf/gf/v2/container/gmap"
+	"github.com/gogf/gf/v2/frame/g"
+	"sync"
+)
+
+var Lock = &sync.RWMutex{}
+var DrainageDatas = map[string]map[string][]map[string]interface{}{}
+
+func AppendDrainage(ctx context.Context, list []map[string]interface{}, pageNum, pageSize int) []map[string]interface{} {
+	if list == nil || len(list) <= 0 {
+		return list
+	}
+	industryCode, industryItem := service.BizCtx().Get(ctx).MiniProgram.IndustryCode, service.BizCtx().Get(ctx).MiniProgram.IndustryItemCode
+	itemMap := map[string]bool{}
+	for _, v := range g.Config(fmt.Sprintf("setting-%s.yaml", industryCode)).MustGet(ctx, "allBusiness.child").Maps() {
+		code := gmap.NewStrAnyMapFrom(v).GetVar("code").String()
+		if code == industryItem {
+			continue
+		}
+		itemMap[code] = true
+	}
+	items := []string{}
+	for _, v := range g.Config().MustGet(ctx, "drainage.order").Strings() {
+		if itemMap[v] {
+			items = append(items, v)
+		}
+	}
+	newList := make([]map[string]interface{}, 0)
+	Lock.RLock()
+	defer Lock.RUnlock()
+	for k, v := range list {
+		drainagePosition := g.Config().MustGet(ctx, "drainage.position").Int()
+		if ((pageNum-1)*pageSize+k+1)%drainagePosition == 0 {
+			// 插入当前对象
+			objIndex := ((pageNum-1)*pageSize + k) / (len(items) * drainagePosition)
+			item := items[k/drainagePosition%len(items)]
+			if len(DrainageDatas[industryCode][item]) == 0 {
+				continue
+			}
+			objIndex = objIndex % len(DrainageDatas[industryCode][item])
+			DrainageDatas[industryCode][item][objIndex]["miniprogramIndustryItem"] = item
+			mp := service.MiniProgram().GetMiniProgramByIndustryItem(industryCode, item)
+			miniprogramAppid := mp.Appid
+			if mp.PointVersion == 0 {
+				if cp := service.MiniProgram().GetMiniProgramByCode(fmt.Sprintf("common_%s", industryItem)); cp != nil {
+					miniprogramAppid = cp.Appid
+				}
+			}
+			DrainageDatas[industryCode][item][objIndex]["miniprogramCode"] = mp.Code
+			DrainageDatas[industryCode][item][objIndex]["miniprogramAppid"] = miniprogramAppid
+			newList = append(newList, DrainageDatas[industryCode][item][objIndex])
+		}
+		newList = append(newList, v)
+	}
+	return newList
+}

+ 20 - 8
internal/logic/miniProgram/miniprogram.go

@@ -15,9 +15,10 @@ import (
 
 type (
 	sMiniProgram struct {
-		cacheMap map[string]*model.MiniProgram
-		lock     sync.RWMutex
-		md5      string
+		cacheMap                map[string]*model.MiniProgram
+		industryItemMiniProgram map[string]map[string]*model.MiniProgram
+		lock                    sync.RWMutex
+		md5                     string
 	}
 )
 
@@ -28,7 +29,6 @@ func init() {
 	service.RegisterMiniProgram(sMp)
 }
 
-//
 func (s *sMiniProgram) GetMiniProgramByCode(miniCode string) *model.MiniProgram {
 	s.lock.RLock()
 	defer s.lock.RUnlock()
@@ -38,7 +38,6 @@ func (s *sMiniProgram) GetMiniProgramByCode(miniCode string) *model.MiniProgram
 	return &model.MiniProgram{}
 }
 
-//
 func (s *sMiniProgram) GetMiniProgramByCtx(ctx context.Context, miniCode string) *model.MiniProgram {
 	s.lock.RLock()
 	defer s.lock.RUnlock()
@@ -53,7 +52,6 @@ func (s *sMiniProgram) GetMiniProgramByCtx(ctx context.Context, miniCode string)
 	return &model.MiniProgram{}
 }
 
-//
 func (s *sMiniProgram) GetMiniProgramByReferer(ctx context.Context) *model.MiniProgram {
 	s.lock.RLock()
 	defer s.lock.RUnlock()
@@ -67,7 +65,8 @@ func (s *sMiniProgram) LoadMiniProgram(ctx context.Context) {
 	res, _ := g.DB().GetAll(ctx, "SELECT a.name,a.code,a.industry_code,a.industry_item_code,a.appid,a.appsecret,a.point_version,b.value AS industryValue,b.name AS industryName FROM miniprogram a LEFT JOIN industry b ON a.industry_code = b.`code` order by a.id asc")
 	if thisMd5, _ := gmd5.Encrypt(res.Json()); res.Len() > 0 && s.md5 != thisMd5 {
 		var (
-			cache = map[string]*model.MiniProgram{}
+			cache                   = map[string]*model.MiniProgram{}
+			industryItemMiniProgram = map[string]map[string]*model.MiniProgram{}
 		)
 		for _, m := range res.List() {
 			appid := gconv.String(m["appid"])
@@ -89,16 +88,20 @@ func (s *sMiniProgram) LoadMiniProgram(ctx context.Context) {
 			if appid != "" {
 				cache[appid] = mp
 			}
+			if industryItemMiniProgram[mp.IndustryCode] == nil {
+				industryItemMiniProgram[mp.IndustryCode] = map[string]*model.MiniProgram{}
+			}
+			industryItemMiniProgram[mp.IndustryCode][mp.IndustryItemCode] = mp
 		}
 		s.lock.Lock()
 		defer s.lock.Unlock()
 		s.cacheMap = cache
 		s.md5 = thisMd5
+		s.industryItemMiniProgram = industryItemMiniProgram
 		g.Log().Infof(ctx, "加载更新miniProgram配置")
 	}
 }
 
-//
 func (s *sMiniProgram) IsInExamine(ctx context.Context) bool {
 	biz := service.BizCtx().Get(ctx)
 	if biz == nil {
@@ -120,3 +123,12 @@ func (s *sMiniProgram) IsInExamine(ctx context.Context) bool {
 	}
 	return false
 }
+
+func (s *sMiniProgram) GetMiniProgramByIndustryItem(code, item string) *model.MiniProgram {
+	s.lock.RLock()
+	defer s.lock.RUnlock()
+	if s.industryItemMiniProgram[code] != nil && s.industryItemMiniProgram[code][item] != nil {
+		return s.industryItemMiniProgram[code][item]
+	}
+	return &model.MiniProgram{}
+}

+ 1 - 0
internal/service/mini_program.go

@@ -17,6 +17,7 @@ type (
 		GetMiniProgramByReferer(ctx context.Context) *model.MiniProgram
 		LoadMiniProgram(ctx context.Context)
 		IsInExamine(ctx context.Context) bool
+		GetMiniProgramByIndustryItem(code, item string) *model.MiniProgram
 	}
 )
 

+ 65 - 0
internal/timetask/drainage.go

@@ -0,0 +1,65 @@
+package timetask
+
+import (
+	"context"
+	buyerV1 "debrisProduct/api/buyer/v1"
+	infoV1 "debrisProduct/api/info/v1"
+	searchV1 "debrisProduct/api/search/v1"
+	"debrisProduct/internal/consts"
+	"debrisProduct/internal/controller/buyer"
+	"debrisProduct/internal/controller/info"
+	"debrisProduct/internal/controller/search"
+	. "debrisProduct/internal/drainage"
+	"debrisProduct/internal/model"
+	"fmt"
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/os/gctx"
+	"time"
+)
+
+var Drainage = &drainage{}
+
+type drainage struct {
+}
+
+func (d *drainage) Run() {
+	d.do()
+	time.AfterFunc(time.Duration(g.Config().MustGet(gctx.New(), "drainage.interval").Int64())*time.Second, d.Run)
+}
+
+func (d *drainage) do() {
+	pool := make(chan bool, 3)
+	list, _ := g.DB().GetAll(gctx.New(), `select name,code,value from debris_product.industry`)
+	pageSize := g.Config().MustGet(gctx.New(), "drainage.pageSize").Int()
+	for _, v := range list {
+		pool <- true
+		go func(name, code, value string) {
+			defer func() {
+				<-pool
+			}()
+			ctx := context.Background()
+			if !g.Config(fmt.Sprintf("setting-%s.yaml", code)).Available(ctx) {
+				g.Log().Info(ctx, code, "配置文件不存在,不加载该行业的引导数据")
+				return
+			}
+			g.Log().Info(ctx, "开始加载", name, "行业的引导数据。。。")
+			ctx = context.WithValue(ctx, consts.ContextKey, &model.Context{
+				MiniProgram: &model.MiniProgram{
+					IndustryCode:  code,
+					IndustryValue: value,
+				},
+			})
+			qzcgf, _ := buyer.NewV1().BuyerList(ctx, &buyerV1.BuyerListReq{PageNum: 1, PageSize: pageSize})
+			hydqxm, _ := info.NewV1().InfoList(ctx, &infoV1.InfoListReq{PageNum: 1, PageSize: pageSize})
+			zbxm, _ := search.NewV1().BidList(ctx, &searchV1.BidListReq{Page: 1, PageSize: pageSize, Publish_time: "threeyear"})
+			cgyx, _ := search.NewV1().BuyPurposeList(ctx, &searchV1.BuyPurposeListReq{Page: 1, PageSize: pageSize, Publish_time: "threeyear"})
+			DrainageDatas[code] = map[string][]map[string]interface{}{
+				"qzcgf":  qzcgf.List,
+				"hydqxm": hydqxm.List,
+				"zbxm":   zbxm.List,
+				"cgyx":   cgyx.List,
+			}
+			g.Log().Info(ctx, "加载", name, "行业的引导数据结束。。。", "hydqxm", len(hydqxm.List), "cgyx", len(cgyx.List), "zbxm", len(zbxm.List), "qzcgf", len(qzcgf.List))
+		}(v.GMap().GetVar("name").String(), v.GMap().GetVar("code").String(), v.GMap().GetVar("value").String())
+	}
+}

+ 7 - 0
internal/timetask/timetask.go

@@ -0,0 +1,7 @@
+package timetask
+
+import "context"
+
+func Run(ctx context.Context) {
+	go Drainage.Run()
+}

+ 17 - 8
manifest/config/config.yaml

@@ -16,29 +16,29 @@ logger:
 
 database:
   default:
-    link: "mysql:root:=PDT49#80Z!RVv52_z@tcp(192.168.3.14:4000)/debris_product"
+    link: "mysql:root:=PDT49#80Z!RVv52_z@tcp(172.20.45.129:4000)/debris_product"
     debug: true
   jianyu:
-    link: "mysql:root:=PDT49#80Z!RVv52_z@tcp(192.168.3.14:4000)/jianyu"
+    link: "mysql:root:=PDT49#80Z!RVv52_z@tcp(172.20.45.129:4000)/jianyu"
     debug: true
 
 mongodb:
   default:
-    address: "192.168.3.149:27180"
+    address: "172.20.45.129:27002"
     size: 5
     dbName: qfw
     replSet: ""
     userName: ""
     password: ""
   bidding:
-    address: "192.168.3.149:27102"
+    address: "172.20.45.129:27002"
     size: 5
     dbName: "qfw_data"
     replSet: ""
     userName: "jyDevGroup"
     password: "jy@DevGroup"
   log:
-    address: "192.168.3.149:27190"
+    address: "172.20.45.129:27002"
     size: 5
     dbName: "qfw"
     replSet: ""
@@ -47,7 +47,7 @@ mongodb:
 
 elasticsearch:
   default:
-    address: "http://192.168.3.149:9200"
+    address: "http://172.20.45.129:9206"
     size: 3
     version: "v7"
     userName: ""
@@ -55,11 +55,20 @@ elasticsearch:
 
 redis:
   default: # 配置newother
-    address: 192.168.3.149:1713
+    address: 172.20.45.129:1713
   session: # session
-    address: 192.168.3.149:1713
+    address: 172.20.45.129:1713
 
 wxTokenRpc: "192.168.3.206:6666"
 jyPayWebRpc: "192.168.3.206:84"
 examineVersion:
   - 1220
+drainage:
+  interval: 3600
+  position: 6
+  pageSize: 6
+  order:
+    - hydqxm
+    - cgyx
+    - zbxm
+    - qzcgf