|
|
|
@@ -21,6 +21,14 @@ const ( |
|
|
|
COMMA = "," |
|
|
|
) |
|
|
|
|
|
|
|
var ( |
|
|
|
OctImgStatus = map[int32]string{ |
|
|
|
1: "未上传", |
|
|
|
3: "制作完成", |
|
|
|
4: "制作失败", |
|
|
|
} |
|
|
|
) |
|
|
|
|
|
|
|
type StoreLink struct { |
|
|
|
ILinkage Linkage |
|
|
|
} |
|
|
|
@@ -37,14 +45,30 @@ func ConvertType[T any](in *T) (interface{}, error) { |
|
|
|
var resp types.GetLinkImageListResp |
|
|
|
inresp := (interface{})(in).(*octopus.GetUserImageListResp) |
|
|
|
resp.Success = inresp.Success |
|
|
|
resp.ErrorMsg = inresp.Error.Message |
|
|
|
if inresp.Error == nil { |
|
|
|
resp.ErrorMsg = "" |
|
|
|
} else { |
|
|
|
resp.ErrorMsg = inresp.Error.Message |
|
|
|
} |
|
|
|
for _, v := range inresp.Payload.Images { |
|
|
|
var image types.ImageSl |
|
|
|
image.ImageId = v.Image.Id |
|
|
|
image.ImageName = v.Image.ImageName |
|
|
|
image.ImageStatus = OctImgStatus[v.Image.ImageStatus] |
|
|
|
resp.Images = append(resp.Images, image) |
|
|
|
} |
|
|
|
|
|
|
|
return resp, nil |
|
|
|
case *octopus.DeleteImageResp: |
|
|
|
var resp types.DeleteLinkImageResp |
|
|
|
return resp, nil |
|
|
|
case *octopus.CreateTrainJobResp: |
|
|
|
var resp types.SubmitLinkTaskResp |
|
|
|
return resp, nil |
|
|
|
case *octopus.GetTrainJobResp: |
|
|
|
var resp types.GetLinkTaskResp |
|
|
|
return resp, nil |
|
|
|
case *octopus.DeleteTrainJobResp: |
|
|
|
var resp types.DeleteLinkTaskResp |
|
|
|
return resp, nil |
|
|
|
default: |
|
|
|
return nil, errors.New("type convert fail") |
|
|
|
|