1
0
mirror of https://github.com/goharbor/harbor synced 2025-04-23 19:57:18 +00:00
Wang Yan deaecf2de5
add subject artifact repo ()
add suject_artifact_repo column in the table artifact_accessory

Signed-off-by: Wang Yan <wangyan@vmware.com>
2023-03-22 21:48:09 +08:00

35 lines
876 B
Go

package model
import (
"github.com/go-openapi/strfmt"
"github.com/goharbor/harbor/src/pkg/accessory/model"
"github.com/goharbor/harbor/src/server/v2.0/models"
)
// Accessory model
type Accessory struct {
model.AccessoryData
}
// ToSwagger converts the label to the swagger model
func (a *Accessory) ToSwagger() *models.Accessory {
return &models.Accessory{
ID: a.ID,
ArtifactID: a.ArtifactID,
SubjectArtifactID: a.SubArtifactID,
SubjectArtifactRepo: a.SubArtifactRepo,
SubjectArtifactDigest: a.SubArtifactDigest,
Size: a.Size,
Digest: a.Digest,
Type: a.Type,
Icon: a.Icon,
CreationTime: strfmt.DateTime(a.CreatTime),
}
}
// NewAccessory ...
func NewAccessory(a model.AccessoryData) *Accessory {
return &Accessory{AccessoryData: a}
}