上QQ阅读APP看书,第一时间看更新
The OrgAsset entity
All assets should have an Id field to identify them. Each device also has a physical device ID (DeviceId) that indicates the type of device, such as iPhone, iPad, or macOS. During the IT asset management flow process, the device is transferred from one entity to another, and the Location of the device keeps changing. Each processor may want to enter Comment to provide additional information at each step. Based on this, we can define the OrgAsset entity as follows:
type OrgAsset struct {
Id string `json:"id"` //the assetId
AssetType string `json:"assetType"` //type of device
Status string `json:"status"` //status of asset
Location string `json:"location"` //device location
DeviceId string `json:"deviceId"` //DeviceId
Comment string `json:"comment"` //comment
From string `json:"from"` //from
To string `json:"to"` //to
}
After we have defined the OrgAsset entity, we will take a look at the implementation of the Init function.