| 22 | } |
| 23 | |
| 24 | func FromModel(m *publish.Publish, versionRemark string) *Publish { |
| 25 | |
| 26 | p := &Publish{ |
| 27 | Id: m.Id, |
| 28 | Version: m.Version, |
| 29 | Remark: m.Remark, |
| 30 | VersionRemark: versionRemark, |
| 31 | Comments: m.Comments, |
| 32 | Service: auto.UUID(m.Service), |
| 33 | Applicant: auto.UUID(m.Applicant), |
| 34 | Release: auto.UUID(m.Release), |
| 35 | |
| 36 | Status: m.Status, |
| 37 | ApplyTIme: auto.TimeLabel(m.ApplyTime), |
| 38 | ApproveTime: auto.TimeLabel(m.ApproveTime), |
| 39 | } |
| 40 | if m.Approver != "" { |
| 41 | p.Approver = auto.UUIDP(m.Approver) |
| 42 | } |
| 43 | if m.Previous != "" { |
| 44 | p.Previous = auto.UUIDP(m.Previous) |
| 45 | } |
| 46 | return p |
| 47 | } |
| 48 | |
| 49 | type PublishDetail struct { |
| 50 | *Publish |