Browse Source

物料保存

renjiaojiao 3 weeks ago
parent
commit
1c96928649

+ 9 - 9
api/internal/svc/servicecontext.go

@@ -24,23 +24,23 @@ func NewServiceContext(c config.Config) *ServiceContext {
 		BiServiceRpc: biservice.NewBiService(zrpc.MustNewClient(c.BiServiceRpc)),
 		ResourceCenterRpc: resource.NewResource(zrpc.MustNewClient(zrpc.RpcClientConf{
 			Etcd: discov.EtcdConf{
-				Hosts: c.BiServiceRpc.Etcd.Hosts,
-				//Hosts: []string{"172.31.31.205:2379"},
-				Key: c.ResourceCenterKey,
+				//Hosts: c.BiServiceRpc.Etcd.Hosts,
+				Hosts: []string{"172.31.31.205:2379"},
+				Key:   c.ResourceCenterKey,
 			},
 		})),
 		UserCenterRpc: usercenter.NewUserCenter(zrpc.MustNewClient(zrpc.RpcClientConf{
 			Etcd: discov.EtcdConf{
-				Hosts: c.BiServiceRpc.Etcd.Hosts,
-				//Hosts: []string{"172.31.31.205:2379"},
-				Key: c.UserCenterKey,
+				//Hosts: c.BiServiceRpc.Etcd.Hosts,
+				Hosts: []string{"172.31.31.205:2379"},
+				Key:   c.UserCenterKey,
 			},
 		})),
 		MessageCenterRpc: messageclient.NewMessage(zrpc.MustNewClient(zrpc.RpcClientConf{
 			Etcd: discov.EtcdConf{
-				Hosts: c.BiServiceRpc.Etcd.Hosts,
-				//Hosts: []string{"172.31.31.205:2379"},
-				Key: c.MessageCenterKey,
+				//Hosts: c.BiServiceRpc.Etcd.Hosts,
+				Hosts: []string{"172.31.31.205:2379"},
+				Key:   c.MessageCenterKey,
 			},
 		})),
 	}

+ 0 - 1
rpc/etc/biservice.yaml

@@ -190,4 +190,3 @@ productArr:
 materialMsg:
   title: "您有1个宣传物料需要发布!"
   content: "%s给你分享了运营宣传物料,请及时处理。点击查看详情。"
-

+ 5 - 0
rpc/internal/logic/materialsavelogic.go

@@ -80,6 +80,11 @@ func (l *MaterialSaveLogic) MaterialSave(in *pb.MaterialSaveReq) (*pb.MaterialSa
 				}, nil
 			}
 			//key := up.Key
+			//ossAddr = gconv.String(Ret["downUrl"])
+			//log.Println("url", up.Url)
+			//fileName := filepath.Base(up.Url)
+			//downUrl := fmt.Sprintf("%s/jyoss/ml/attachment/%s", IC.IC.JyWebDomain, fileName)
+			//log.Println("downUrl:", downUrl)
 			ok := service.PersonImageSave(up.Url, msgId, gconv.Int64(positionArr[k]), mid)
 			if !ok {
 				return &pb.MaterialSaveResp{

+ 3 - 1
service/material.go

@@ -62,7 +62,9 @@ func MaterialSave(in *pb.MaterialSaveReq, title, content string) (msgId, mId int
 func GetSendUserId(positionIds string, entId int64) []string {
 	//拿职位id找mgoid
 	userIdArr := []string{}
-	useridMap := entity.JyBiTidb.SelectBySql("SELECT userid FROM `dwd_f_userbase_id_mapping` WHERE position_id in (?) AND ent_id = ?", positionIds, entId)
+	query := fmt.Sprintf("SELECT userid FROM `dwd_f_userbase_id_mapping` WHERE position_id in (%s) AND ent_id = %d", positionIds, entId)
+	log.Println("查找分发人的sql", query)
+	useridMap := entity.JyBiTidb.SelectBySql(query)
 	if useridMap != nil && len(*useridMap) > 0 {
 		for _, val := range *useridMap {
 			userIdArr = append(userIdArr, gconv.String(val["userid"]))