Initial cloud-services repo - gateway service + pkg modules
This commit is contained in:
32
pkg/common/approval_update.go
Normal file
32
pkg/common/approval_update.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package common
|
||||
|
||||
func NewApprovalUpdates(cu *CarUpdate) ApprovalUpdate {
|
||||
a := ApprovalUpdate{}
|
||||
a.Update(cu)
|
||||
return a
|
||||
}
|
||||
|
||||
type ApprovalUpdate struct {
|
||||
ID int64 `json:"id,omitempty"`
|
||||
VIN string `json:"vin"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Version string `json:"version,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
ReleaseNotes string `json:"release_notes,omitempty"`
|
||||
}
|
||||
|
||||
func (a *ApprovalUpdate) Update(cu *CarUpdate) {
|
||||
a.ID = cu.ID
|
||||
a.VIN = cu.VIN
|
||||
|
||||
if cu.UpdateManifest == nil {
|
||||
return
|
||||
}
|
||||
|
||||
m := cu.UpdateManifest
|
||||
|
||||
a.Name = m.Name
|
||||
a.Version = m.Version
|
||||
a.Description = m.Description
|
||||
a.ReleaseNotes = m.ReleaseNotes
|
||||
}
|
||||
Reference in New Issue
Block a user