Skip to content

Commit

Permalink
Use new mdining api
Browse files Browse the repository at this point in the history
  • Loading branch information
anders617 committed Oct 14, 2020
1 parent 677f3a5 commit c5652eb
Show file tree
Hide file tree
Showing 16 changed files with 489 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Use a remote cache to speed up builds
build --remote_cache=http://michigan-dining-api.bazel-cache.andersboberg.com:5555
# build --remote_cache=http://michigan-dining-api.bazel-cache.andersboberg.com:5555
build:container --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64
35 changes: 20 additions & 15 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Download the Go rules
http_archive(
name = "io_bazel_rules_go",
sha256 = "b9aa86ec08a292b97ec4591cf578e020b35f98e12173bbd4a921f84f583aebd9",
urls = [
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/v0.20.2/rules_go-v0.20.2.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.20.2/rules_go-v0.20.2.tar.gz",
],
sha256 = "b9aa86ec08a292b97ec4591cf578e020b35f98e12173bbd4a921f84f583aebd9",
)

# Load and call the dependencies
Expand Down Expand Up @@ -58,11 +58,11 @@ docker_toolchain_configure(

http_archive(
name = "bazel_gazelle",
sha256 = "41bff2a0b32b02f20c227d234aa25ef3783998e5453f7eade929704dcff7cd4b",
urls = [
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/bazel-gazelle/releases/download/v0.19.0/bazel-gazelle-v0.19.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.19.0/bazel-gazelle-v0.19.0.tar.gz",
],
sha256 = "41bff2a0b32b02f20c227d234aa25ef3783998e5453f7eade929704dcff7cd4b",
)

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
Expand Down Expand Up @@ -130,8 +130,8 @@ http_archive(
go_repository(
name = "com_github_golang_protobuf",
importpath = "github.com/golang/protobuf",
sum = "h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=",
version = "v1.3.2",
sum = "h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=",
version = "v1.4.2",
)

go_repository(
Expand All @@ -145,22 +145,22 @@ go_repository(
name = "org_golang_google_grpc",
build_file_proto_mode = "disable",
importpath = "google.golang.org/grpc",
sum = "h1:vb/1TCsVn3DcJlQ0Gs1yB1pKI6Do2/QNwxdKqmc/b0s=",
version = "v1.24.0",
sum = "h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg=",
version = "v1.27.0",
)

go_repository(
name = "org_golang_x_net",
importpath = "golang.org/x/net",
sum = "h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=",
version = "v0.0.0-20190311183353-d8887717615a",
sum = "h1:pNX+40auqi2JqRfOP1akLGtYcn15TUbkhwuCO3foqqM=",
version = "v0.0.0-20200602114024-627f9648deb9",
)

go_repository(
name = "org_golang_x_text",
importpath = "golang.org/x/text",
sum = "h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=",
version = "v0.3.0",
sum = "h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=",
version = "v0.3.2",
)

go_repository(
Expand All @@ -177,8 +177,8 @@ go_repositories()
go_repository(
name = "org_golang_google_genproto",
importpath = "google.golang.org/genproto",
sum = "h1:4HYDjxeNXAOTv3o1N2tjo8UUSlhQgAD52FVkwxnWgM8=",
version = "v0.0.0-20191009194640-548a555dbc03",
sum = "h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY=",
version = "v0.0.0-20200526211855-cb27e3aa2013",
)

go_repository(
Expand Down Expand Up @@ -233,20 +233,25 @@ go_repository(
go_repository(
name = "com_github_anders617_mdining_proto",
importpath = "github.com/anders617/mdining-proto",
sum = "h1:EqFtsULZ1MWoAAJKotZvMwR351syYg9eiDdBm1pBf78=",
version = "v0.2.2",
sum = "h1:ZBySPHoi5ijqb/iPIgutNbMwTexhTZbtki/D3eshgfI=",
version = "v0.3.1",
)

load("@com_github_anders617_mdining_proto//rules:rule_deps.bzl", "rule_dependencies")

rule_dependencies()

load("@com_github_anders617_mdining_proto//rules:proto_deps.bzl", "proto_dependencies")

proto_dependencies()

load("@com_github_anders617_mdining_proto//rules:go_deps.bzl", "go_dependencies")

go_dependencies()

go_repository(
name = "com_github_google_uuid",
importpath = "github.com/google/uuid",
sum = "h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=",
version = "v1.1.1",
version = "v2",
)
2 changes: 1 addition & 1 deletion api/analytics/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ go_library(
deps = [
"@com_github_golang_glog//:go_default_library",
"@com_github_google_uuid//:go_default_library",
]
],
)
22 changes: 21 additions & 1 deletion api/mdining/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,27 @@ go_library(
"@com_github_aws_aws_sdk_go_v2//service/dynamodb:go_default_library",
"@com_github_aws_aws_sdk_go_v2//service/dynamodb/dynamodbattribute:go_default_library",
"@com_github_golang_glog//:go_default_library",
"@com_github_golang_protobuf//jsonpb:go_default_library",
"@com_github_golang_protobuf//proto:go_default_library",
],
)

go_library(
name = "mdiningclient2",
srcs = ["mdiningclient2.go"],
importpath = "github.com/MichiganDiningAPI/api/mdining/mdiningclient2",
visibility = ["//visibility:public"],
deps = [
"//internal/util:date",
"@com_github_anders617_mdining_proto//proto:mdining_go_proto",
"@com_github_anders617_mdining_proto//proto:mdiningapi2_go_proto",
"@com_github_aws_aws_sdk_go_v2//aws:go_default_library",
"@com_github_aws_aws_sdk_go_v2//aws/endpoints:go_default_library",
"@com_github_aws_aws_sdk_go_v2//aws/external:go_default_library",
"@com_github_aws_aws_sdk_go_v2//service/dynamodb:go_default_library",
"@com_github_aws_aws_sdk_go_v2//service/dynamodb/dynamodbattribute:go_default_library",
"@com_github_golang_glog//:go_default_library",
"@com_github_golang_protobuf//jsonpb:go_default_library",
]
"@com_github_golang_protobuf//proto:go_default_library",
],
)
9 changes: 9 additions & 0 deletions api/mdining/mdiningclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ const (
DiningHallGroupName = "DINING HALLS"
)

// https://prod-dining-services.webplatformsunpublished.umich.edu/
/**
https://prod-dining-services.webplatformsunpublished.umich.edu/dining/menu?key=093665d6ab069c859267fd4001c3c562ba805539ed852978&location=Bursley%20Dining%20Hall&date=11-10-2020&meal=BREAKFAST
https://prod-dining-services.webplatformsunpublished.umich.edu/dining/menu?key=093665d6ab069c859267fd4001c3c562ba805539ed852978&location=Bursley%20Dining%20Hall&date=11-10-2020&meal=BREAKFAST
https://prod-dining-services.webplatformsunpublished.umich.edu/dining/locations?key=093665d6ab069c859267fd4001c3c562ba805539ed852978
https://prod-dining-services.webplatformsunpublished.umich.edu/dining/meal-hours?key=093665d6ab069c859267fd4001c3c562ba805539ed852978&location=Java%20Blu%20At%20Sph&date=11-10-2020
https://prod-dining-services.webplatformsunpublished.umich.edu/dining/capacity?key=093665d6ab069c859267fd4001c3c562ba805539ed852978
*/
var (
DiningHallListUrl = urlFrom("https://mobile.its.umich.edu/michigan/services/dining/shallowDiningHallGroups")
DiningHallMenuBaseUrl = urlFrom("https://mobile.its.umich.edu/michigan/services/dining/shallowMenusByDiningHall")
Expand Down
Loading

0 comments on commit c5652eb

Please sign in to comment.