You've already forked golang-saas-starter-kit
mirror of
https://github.com/raseels-repos/golang-saas-starter-kit.git
synced 2025-08-06 22:32:51 +02:00
completed project section
This commit is contained in:
@ -53,7 +53,7 @@ func (m *UserAccount) Response(ctx context.Context) *UserAccountResponse {
|
||||
UserID: m.UserID,
|
||||
AccountID: m.AccountID,
|
||||
Roles: m.Roles,
|
||||
Status: web.NewEnumResponse(ctx, m.Status, UserAccountStatus_Values),
|
||||
Status: web.NewEnumResponse(ctx, m.Status, UserAccountStatus_ValuesInterface()...),
|
||||
CreatedAt: web.NewTimeResponse(ctx, m.CreatedAt),
|
||||
UpdatedAt: web.NewTimeResponse(ctx, m.UpdatedAt),
|
||||
}
|
||||
@ -169,6 +169,15 @@ var UserAccountStatus_Values = []UserAccountStatus{
|
||||
UserAccountStatus_Disabled,
|
||||
}
|
||||
|
||||
// UserAccountStatus_ValuesInterface returns the UserAccountStatus options as a slice interface.
|
||||
func UserAccountStatus_ValuesInterface() []interface{} {
|
||||
var l []interface{}
|
||||
for _, v := range UserAccountStatus_Values {
|
||||
l = append(l, v.String())
|
||||
}
|
||||
return l
|
||||
}
|
||||
|
||||
// Scan supports reading the UserAccountStatus value from the database.
|
||||
func (s *UserAccountStatus) Scan(value interface{}) error {
|
||||
asBytes, ok := value.([]byte)
|
||||
@ -217,6 +226,15 @@ var UserAccountRole_Values = []UserAccountRole{
|
||||
UserAccountRole_User,
|
||||
}
|
||||
|
||||
// UserAccountRole_ValuesInterface returns the UserAccountRole options as a slice interface.
|
||||
func UserAccountRole_ValuesInterface() []interface{} {
|
||||
var l []interface{}
|
||||
for _, v := range UserAccountRole_Values {
|
||||
l = append(l, v.String())
|
||||
}
|
||||
return l
|
||||
}
|
||||
|
||||
// String converts the UserAccountRole value to a string.
|
||||
func (s UserAccountRole) String() string {
|
||||
return string(s)
|
||||
|
Reference in New Issue
Block a user