package participantservicelogic import ( "context" "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/internal/svc" "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/pcmCore" "github.com/zeromicro/go-zero/core/logx" ) type ApplyListLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } func NewApplyListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ApplyListLogic { return &ApplyListLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } // applyList 执行任务列表 func (l *ApplyListLogic) ApplyList(in *pcmCore.ApplyListReq) (*pcmCore.ApplyListResp, error) { result := pcmCore.ApplyListResp{} l.svcCtx.DbEngin.Raw("SELECT sppi.`name` as participantName,c.yaml_string as yamlString FROM cloud c,sc_participant_phy_info sppi where c.`status` = 'Saved' and sppi.id = c.participant_id").Scan(&result.InfoList) if len(result.InfoList) != 0 { l.svcCtx.DbEngin.Exec("update cloud set status = ? where status = ?", "Issued", "Saved") } return &result, nil }