Skip to content

Commit

Permalink
Merge pull request #21 from resonatecoop/address_links_tags
Browse files Browse the repository at this point in the history
Add usergroup links and tags feature
  • Loading branch information
auggod authored Feb 16, 2022
2 parents 20bb31f + 442bd0c commit 7e4ff46
Show file tree
Hide file tree
Showing 12 changed files with 554 additions and 172 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/golang/protobuf v1.4.3
github.com/google/go-cmp v0.5.5 // indirect
github.com/google/uuid v1.1.2
github.com/goware/urlx v0.3.1 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4
github.com/grpc-ecosystem/grpc-gateway/v2 v2.0.1
github.com/jackc/pgx/v4 v4.11.0
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go
github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
Expand Down Expand Up @@ -212,6 +216,8 @@ github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/goware/urlx v0.3.1 h1:BbvKl8oiXtJAzOzMqAQ0GfIhf96fKeNEZfm9ocNSUBI=
github.com/goware/urlx v0.3.1/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4 h1:z53tR0945TRRQO/fLEVPI6SMv7ZflF0TEaTAoU7tOzg=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
Expand Down
2 changes: 1 addition & 1 deletion proto/user/address.validator.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/user/streetaddress.validator.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/user/user.validator.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

328 changes: 178 additions & 150 deletions proto/user/usergroup_messages.pb.go

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions proto/user/usergroup_messages.proto
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ message UserGroupCreateRequest {
string avatar = 5; // UUID
string banner = 6; // UUID
string group_type = 8; // required UUID
repeated Tag tags = 9; // optional UUIDs
repeated string tags = 9; // optional UUIDs
string group_email = 10; // optional
repeated string links = 11;
// repeated User followers = 9;
// repeated UserGroup members = 10;
// repeated UserGroup memberOfGroups = 11;
// repeated Link links = 12;
//StreetAddress address = 14;
//Privacy privacy = 15;
//repeated RelatedUserGroup recommended_artists = 16;
Expand All @@ -72,14 +72,15 @@ message UserGroupUpdateRequest {
optional string group_type = 7;
optional string group_email = 9;
optional string owner_id = 10;
repeated string links = 11;
repeated string tags = 12;

//optional StreetAddress address = 8;
//optional string owner_id = 7; // required

// repeated User followers = 9;
// repeated UserGroup members = 10;
// repeated UserGroup memberOfGroups = 11;
// repeated Link links = 12;
// repeated Tag tags = 13;

// Privacy privacy = 15;
// repeated RelatedUserGroup recommended_artists = 16;
Expand Down Expand Up @@ -127,7 +128,7 @@ message UserGroupPublicResponse {
repeated string followers = 9;
repeated string members = 10;
repeated string memberOfGroups = 11;
repeated string links = 12;
repeated Link links = 12;
repeated string tags = 13;
// repeated RelatedUserGroup recommended_artists = 17;
// map<string, string> publisher = 21;
Expand Down
14 changes: 7 additions & 7 deletions proto/user/usergroup_messages.validator.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions server/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ func (s *Server) AddUser(ctx context.Context, user *pbUser.UserAddRequest) (*pbU
Country: user.Country,
NewsletterNotification: user.NewsletterNotification,
}

newUser.ID = uuid.Must(uuid.NewRandom())

_, err = s.db.NewInsert().
Column(
"id",
Expand Down
Loading

0 comments on commit 7e4ff46

Please sign in to comment.