From 48a529e08d58095b658b40faf040be044caaeec4 Mon Sep 17 00:00:00 2001 From: tzwang Date: Tue, 10 Oct 2023 16:52:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=98=E7=AE=97=E8=81=94=E5=8A=A8=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 617e29e56c27fc6057e8d720c1b671440388bdbb --- api/desc/storelink/pcm-storelink.api | 17 ++++++++++++++++- api/internal/storeLink/storeLink.go | 7 +++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/api/desc/storelink/pcm-storelink.api b/api/desc/storelink/pcm-storelink.api index 41f1eab5..7871c6e3 100644 --- a/api/desc/storelink/pcm-storelink.api +++ b/api/desc/storelink/pcm-storelink.api @@ -99,7 +99,8 @@ type ( } GetParticipantsResp { - + Success bool `json:"success"` + Participants []Participant `json:"participant"` } GetResourceSpecsReq { @@ -107,6 +108,20 @@ type ( } GetResourceSpecsResp { + Success bool `json:"success"` + ResourceSpecs []ResourceSpec `json:"resourceSpecs"` + } + ResourceSpec { + ParticipantId string `json:"participantId"` + ParticipantName string `json:"participantName"` + SpecName string `json:"resourceSpecName"` + SpecId string `json:"resourceSpecId"` + } + + Participant { + ParticipantId string `json:"id"` + ParticipantName string `json:"name"` + ParticipantType string `json:"type"` } ) \ No newline at end of file diff --git a/api/internal/storeLink/storeLink.go b/api/internal/storeLink/storeLink.go index 4e387304..3ab543f1 100644 --- a/api/internal/storeLink/storeLink.go +++ b/api/internal/storeLink/storeLink.go @@ -5,6 +5,7 @@ import ( "github.com/pkg/errors" "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc" "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types" + "gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/models" "gitlink.org.cn/jcce-pcm/pcm-participant-octopus/octopus" ) @@ -33,9 +34,11 @@ type StoreLink struct { ILinkage Linkage } -// todo 根据participantId 创建对应对象 func NewStoreLink(ctx context.Context, svcCtx *svc.ServiceContext, partId int64) *StoreLink { - linkStruct := NewOctopusLink(ctx, svcCtx, "hanwuji") + var participant models.ScParticipantPhyInfo + svcCtx.DbEngin.Raw("select * from sc_participant_phy_info where id = ?", partId).Scan(&participant) + + linkStruct := NewOctopusLink(ctx, svcCtx, participant.Name) return &StoreLink{ILinkage: linkStruct} }