|
@@ -36,24 +36,31 @@ func (l *GetSopStageByIdLogic) GetSopStageById(req *types.IDReq) (*types.SopStag
|
|
|
return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
|
|
|
}
|
|
|
|
|
|
- conditionList := make([]types.Condition, len(data.ConditionList))
|
|
|
- for i, condition := range data.ConditionList {
|
|
|
- conditionList[i] = types.Condition{
|
|
|
- Equal: condition.Equal,
|
|
|
- LabelIdList: condition.LabelIdList,
|
|
|
+ var conditionList []types.Condition
|
|
|
+ if len(data.ConditionList) > 0 {
|
|
|
+ conditionList = make([]types.Condition, len(data.ConditionList))
|
|
|
+ for i, condition := range data.ConditionList {
|
|
|
+ conditionList[i] = types.Condition{
|
|
|
+ Equal: condition.Equal,
|
|
|
+ LabelIdList: condition.LabelIdList,
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- actionMessage := make([]types.Action, len(data.ActionMessage))
|
|
|
- for i, condition := range data.ActionMessage {
|
|
|
- actionMessage[i] = types.Action{
|
|
|
- Type: condition.Type,
|
|
|
- Content: condition.Content,
|
|
|
+ var actionMessage []types.Action
|
|
|
+ if len(data.ActionMessage) > 0 {
|
|
|
+ actionMessage = make([]types.Action, len(data.ActionMessage))
|
|
|
+ for i, condition := range data.ActionMessage {
|
|
|
+ actionMessage[i] = types.Action{
|
|
|
+ Type: condition.Type,
|
|
|
+ Content: condition.Content,
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- nodeList := make([]types.SopNodeInfo, 0)
|
|
|
+ var nodeList []types.SopNodeInfo
|
|
|
if data.Edges.StageNodes != nil {
|
|
|
+ nodeList = make([]types.SopNodeInfo, 0)
|
|
|
for _, sn := range data.Edges.StageNodes {
|
|
|
nodeList = append(nodeList, types.SopNodeInfo{
|
|
|
BaseIDInfo: types.BaseIDInfo{
|