Skip to content

Commit f745b82

Browse files
committed
feat: upgrade protos to v0.3.9
1 parent 0a1b1cb commit f745b82

23 files changed

Lines changed: 561 additions & 161 deletions

app/sephirah/internal/data/internal/converter/biz_to_ent.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"github.com/tuihub/librarian/app/sephirah/internal/data/internal/ent"
55
"github.com/tuihub/librarian/app/sephirah/internal/data/internal/ent/app"
66
"github.com/tuihub/librarian/app/sephirah/internal/data/internal/ent/apppackage"
7+
"github.com/tuihub/librarian/app/sephirah/internal/data/internal/ent/deviceinfo"
78
"github.com/tuihub/librarian/app/sephirah/internal/data/internal/ent/feedconfig"
89
"github.com/tuihub/librarian/app/sephirah/internal/data/internal/ent/image"
910
"github.com/tuihub/librarian/app/sephirah/internal/data/internal/ent/notifyflow"
@@ -27,6 +28,7 @@ import (
2728
// goverter:extend ToEntAppPackageSource
2829
// goverter:extend ToEntFeedConfigStatus
2930
// goverter:extend ToEntNotifyTargetStatus
31+
// goverter:extend ToEntSystemType
3032
type toEntConverter interface { //nolint:unused // used by generator
3133
ToEntUserTypeList([]libauth.UserType) []user.Type
3234
ToEntUserStatusList([]modeltiphereth.UserStatus) []user.Status
@@ -160,3 +162,24 @@ func ToEntImageStatus(s modelchesed.ImageStatus) image.Status {
160162
return ""
161163
}
162164
}
165+
166+
func ToEntSystemType(s modeltiphereth.SystemType) deviceinfo.SystemType {
167+
switch s {
168+
case modeltiphereth.SystemTypeUnspecified:
169+
return deviceinfo.SystemTypeUnknown
170+
case modeltiphereth.SystemTypeIOS:
171+
return deviceinfo.SystemTypeIos
172+
case modeltiphereth.SystemTypeAndroid:
173+
return deviceinfo.SystemTypeAndroid
174+
case modeltiphereth.SystemTypeWindows:
175+
return deviceinfo.SystemTypeWindows
176+
case modeltiphereth.SystemTypeMacOS:
177+
return deviceinfo.SystemTypeMacos
178+
case modeltiphereth.SystemTypeLinux:
179+
return deviceinfo.SystemTypeLinux
180+
case modeltiphereth.SystemTypeWeb:
181+
return deviceinfo.SystemTypeWeb
182+
default:
183+
return deviceinfo.SystemTypeUnknown
184+
}
185+
}

app/sephirah/internal/data/internal/converter/ent_to_biz.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"github.com/tuihub/librarian/app/sephirah/internal/data/internal/ent"
77
"github.com/tuihub/librarian/app/sephirah/internal/data/internal/ent/app"
88
"github.com/tuihub/librarian/app/sephirah/internal/data/internal/ent/apppackage"
9+
"github.com/tuihub/librarian/app/sephirah/internal/data/internal/ent/deviceinfo"
910
"github.com/tuihub/librarian/app/sephirah/internal/data/internal/ent/feedconfig"
1011
"github.com/tuihub/librarian/app/sephirah/internal/data/internal/ent/image"
1112
"github.com/tuihub/librarian/app/sephirah/internal/data/internal/ent/notifyflow"
@@ -41,6 +42,7 @@ type toBizConverter interface { //nolint:unused // used by generator
4142
ToBizUserSessionList([]*ent.UserSession) []*modeltiphereth.UserSession
4243

4344
// goverter:matchIgnoreCase
45+
// goverter:map SystemType | ToBizSystemType
4446
ToBizDeviceInfo(*ent.DeviceInfo) *modeltiphereth.DeviceInfo
4547

4648
// goverter:matchIgnoreCase
@@ -50,6 +52,7 @@ type toBizConverter interface { //nolint:unused // used by generator
5052

5153
// goverter:matchIgnoreCase
5254
// goverter:map Status | ToBizPorterStatus
55+
// goverter:ignore ConnectionStatus
5356
ToBizPorter(*ent.PorterInstance) *modeltiphereth.PorterInstance
5457
ToBizPorterList([]*ent.PorterInstance) []*modeltiphereth.PorterInstance
5558

@@ -210,3 +213,24 @@ func ToBizImageStatus(s image.Status) modelchesed.ImageStatus {
210213
return modelchesed.ImageStatusUnspecified
211214
}
212215
}
216+
217+
func ToBizSystemType(s deviceinfo.SystemType) modeltiphereth.SystemType {
218+
switch s {
219+
case deviceinfo.SystemTypeUnknown:
220+
return modeltiphereth.SystemTypeUnspecified
221+
case deviceinfo.SystemTypeIos:
222+
return modeltiphereth.SystemTypeIOS
223+
case deviceinfo.SystemTypeAndroid:
224+
return modeltiphereth.SystemTypeAndroid
225+
case deviceinfo.SystemTypeWeb:
226+
return modeltiphereth.SystemTypeWeb
227+
case deviceinfo.SystemTypeWindows:
228+
return modeltiphereth.SystemTypeWindows
229+
case deviceinfo.SystemTypeMacos:
230+
return modeltiphereth.SystemTypeMacOS
231+
case deviceinfo.SystemTypeLinux:
232+
return modeltiphereth.SystemTypeLinux
233+
default:
234+
return modeltiphereth.SystemTypeUnspecified
235+
}
236+
}

app/sephirah/internal/data/internal/converter/generated.go

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/sephirah/internal/data/internal/ent/deviceinfo.go

Lines changed: 19 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/sephirah/internal/data/internal/ent/deviceinfo/deviceinfo.go

Lines changed: 43 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/sephirah/internal/data/internal/ent/deviceinfo/where.go

Lines changed: 62 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)