Skip to content

Commit 898a084

Browse files
feat: save user info from google (#1254)
1 parent 7fa2280 commit 898a084

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+7534
-2897
lines changed

api-description/web-api.swagger.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2802,6 +2802,20 @@ definitions:
28022802
items:
28032803
type: object
28042804
$ref: '#/definitions/accountSearchFilter'
2805+
firstName:
2806+
type: string
2807+
lastName:
2808+
type: string
2809+
language:
2810+
type: string
2811+
lastSeen:
2812+
type: string
2813+
format: int64
2814+
avatarFileType:
2815+
type: string
2816+
avatarImage:
2817+
type: string
2818+
format: byte
28052819
accountAccountV2EnvironmentRole:
28062820
type: object
28072821
properties:
@@ -2825,6 +2839,14 @@ definitions:
28252839
type: string
28262840
accountChangeAPIKeyNameResponse:
28272841
type: object
2842+
accountChangeAccountV2AvatarCommand:
2843+
type: object
2844+
properties:
2845+
avatarImage:
2846+
type: string
2847+
format: byte
2848+
avatarFileType:
2849+
type: string
28282850
accountChangeAccountV2AvatarImageUrlCommand:
28292851
type: object
28302852
properties:
@@ -2840,6 +2862,27 @@ definitions:
28402862
$ref: '#/definitions/accountAccountV2EnvironmentRole'
28412863
writeType:
28422864
$ref: '#/definitions/ChangeAccountV2EnvironmentRolesCommandWriteType'
2865+
accountChangeAccountV2FirstNameCommand:
2866+
type: object
2867+
properties:
2868+
firstName:
2869+
type: string
2870+
accountChangeAccountV2LanguageCommand:
2871+
type: object
2872+
properties:
2873+
language:
2874+
type: string
2875+
accountChangeAccountV2LastNameCommand:
2876+
type: object
2877+
properties:
2878+
lastName:
2879+
type: string
2880+
accountChangeAccountV2LastSeenCommand:
2881+
type: object
2882+
properties:
2883+
lastSeen:
2884+
type: string
2885+
format: int64
28432886
accountChangeAccountV2NameCommand:
28442887
type: object
28452888
properties:
@@ -2896,6 +2939,17 @@ definitions:
28962939
items:
28972940
type: object
28982941
$ref: '#/definitions/accountSearchFilter'
2942+
firstName:
2943+
type: string
2944+
lastName:
2945+
type: string
2946+
language:
2947+
type: string
2948+
avatarFileType:
2949+
type: string
2950+
avatarImage:
2951+
type: string
2952+
format: byte
28992953
accountConsoleAccountEnvironmentRole:
29002954
type: object
29012955
properties:
@@ -2940,6 +2994,12 @@ definitions:
29402994
items:
29412995
type: object
29422996
$ref: '#/definitions/accountAccountV2EnvironmentRole'
2997+
firstName:
2998+
type: string
2999+
lastName:
3000+
type: string
3001+
language:
3002+
type: string
29433003
accountCreateAccountV2Request:
29443004
type: object
29453005
properties:
@@ -3287,6 +3347,16 @@ definitions:
32873347
$ref: '#/definitions/accountChangeAccountV2OrganizationRoleCommand'
32883348
changeEnvironmentRolesCommand:
32893349
$ref: '#/definitions/accountChangeAccountV2EnvironmentRolesCommand'
3350+
changeFirstNameCommand:
3351+
$ref: '#/definitions/accountChangeAccountV2FirstNameCommand'
3352+
changeLastNameCommand:
3353+
$ref: '#/definitions/accountChangeAccountV2LastNameCommand'
3354+
changeLanguageCommand:
3355+
$ref: '#/definitions/accountChangeAccountV2LanguageCommand'
3356+
changeLastSeenCommand:
3357+
$ref: '#/definitions/accountChangeAccountV2LastSeenCommand'
3358+
changeAvatarCommand:
3359+
$ref: '#/definitions/accountChangeAccountV2AvatarCommand'
32903360
accountUpdateAccountV2Response:
32913361
type: object
32923362
accountUpdateSearchFilterRequest:

manifests/bucketeer/charts/web/values.yaml

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
-- Modify "account_v2" table
2+
ALTER TABLE `account_v2`
3+
MODIFY COLUMN `name` varchar(255) NOT NULL DEFAULT '',
4+
ADD COLUMN `first_name` varchar(255) NOT NULL DEFAULT '',
5+
ADD COLUMN `last_name` varchar(255) NOT NULL DEFAULT '',
6+
ADD COLUMN `language` varchar(10) NOT NULL DEFAULT '',
7+
ADD COLUMN `last_seen` bigint NOT NULL DEFAULT 0,
8+
ADD COLUMN `avatar_file_type` varchar(50) NOT NULL DEFAULT '',
9+
ADD COLUMN `avatar_image` mediumblob NULL;

migration/mysql/atlas.sum

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
h1:9wo673Ths79dPcKmvtNWbDDlrhFu0PGPeD5OZWeXrgk=
1+
h1:QhwvjbonVnTnhoP1B+NuVN3Z5x+XXOBK+5vT9u7rBF4=
22
20240626022133_initialization.sql h1:u9qmPkwWX7PN92qEcDDfR92lrMpwadQSMxUJgv6LjQ0=
33
20240708065726_update_audit_log_table.sql h1:k7gK8Njv1yHMsYXAQtSgMaSbXy4lxyZ9MPzbJyMyyoM=
44
20240815043128_update_auto_ops_rule_table.sql h1:6ib+XfS1uu9AUO3qESvkpUfOu3qUsLwHm9KHcrGEz0E=
@@ -9,3 +9,4 @@ h1:9wo673Ths79dPcKmvtNWbDDlrhFu0PGPeD5OZWeXrgk=
99
20240827085123_update_environment_id_table.sql h1:VbtGa+UP5wjRjrffXtLTg9eWSZZH047MzMaT4c3JJSE=
1010
20240923154451_update_organization_table.sql h1:AmFazbhx6ZzuW+JMcrpX2kyAKx7TUMUnASJIePRuvBk=
1111
20241028031327_add_org_url_unique.sql h1:Xn0Pilm+RRseqZZXdsIdXulwy+R69xIC6ygA8MD19CM=
12+
20241029011618_update_account_v2_table.sql h1:vcQDt2A4WdC0DP/SdZNjsl/T4oVrIVITgPRgc773Hn4=

pkg/account/api/account.go

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,15 @@ func (s *AccountService) CreateAccountV2(
5858
return nil, err
5959
}
6060
account := domain.NewAccountV2(
61-
req.Command.Email, req.Command.Name, req.Command.AvatarImageUrl, req.OrganizationId,
62-
req.Command.OrganizationRole, req.Command.EnvironmentRoles,
61+
req.Command.Email,
62+
req.Command.Name,
63+
req.Command.FirstName,
64+
req.Command.LastName,
65+
req.Command.Language,
66+
req.Command.AvatarImageUrl,
67+
req.OrganizationId,
68+
req.Command.OrganizationRole,
69+
req.Command.EnvironmentRoles,
6370
)
6471
err = s.accountStorage.RunInTransaction(ctx, func() error {
6572
// TODO: temporary implementation: double write account v2 ---
@@ -183,15 +190,30 @@ func (s *AccountService) getUpdateAccountV2Commands(req *accountproto.UpdateAcco
183190
if req.ChangeNameCommand != nil {
184191
commands = append(commands, req.ChangeNameCommand)
185192
}
193+
if req.ChangeFirstNameCommand != nil {
194+
commands = append(commands, req.ChangeFirstNameCommand)
195+
}
196+
if req.ChangeLastNameCommand != nil {
197+
commands = append(commands, req.ChangeLastNameCommand)
198+
}
199+
if req.ChangeLanguageCommand != nil {
200+
commands = append(commands, req.ChangeLanguageCommand)
201+
}
186202
if req.ChangeAvatarUrlCommand != nil {
187203
commands = append(commands, req.ChangeAvatarUrlCommand)
188204
}
205+
if req.ChangeAvatarCommand != nil {
206+
commands = append(commands, req.ChangeAvatarCommand)
207+
}
189208
if req.ChangeOrganizationRoleCommand != nil {
190209
commands = append(commands, req.ChangeOrganizationRoleCommand)
191210
}
192211
if req.ChangeEnvironmentRolesCommand != nil {
193212
commands = append(commands, req.ChangeEnvironmentRolesCommand)
194213
}
214+
if req.ChangeLastSeenCommand != nil {
215+
commands = append(commands, req.ChangeLastSeenCommand)
216+
}
195217
return commands
196218
}
197219

0 commit comments

Comments
 (0)