diff --git a/client/_proto/spec/v1/userdata_pb.d.ts b/client/_proto/spec/v1/userdata_pb.d.ts index c875568cb..6d82b7a31 100644 --- a/client/_proto/spec/v1/userdata_pb.d.ts +++ b/client/_proto/spec/v1/userdata_pb.d.ts @@ -1147,11 +1147,11 @@ export declare class EditRaceRequest extends Message { description?: string; /** - * 出走表決定も着順確定も同じフィールドを使うけどとりあえずは運用でカバーします + * 馬のidの配列で指定 * - * @generated from field: repeated spec.v1.RaceDetail.Member members = 6; + * @generated from field: repeated uint32 members = 6; */ - members: RaceDetail_Member[]; + members: number[]; /** * admin JWT diff --git a/client/_proto/spec/v1/userdata_pb.js b/client/_proto/spec/v1/userdata_pb.js index 8a089bd79..5fc1e0114 100644 --- a/client/_proto/spec/v1/userdata_pb.js +++ b/client/_proto/spec/v1/userdata_pb.js @@ -432,7 +432,7 @@ export const EditRaceRequest = proto3.makeMessageType( { no: 3, name: "order", kind: "scalar", T: 13 /* ScalarType.UINT32 */, opt: true }, { no: 4, name: "start", kind: "message", T: Timestamp, opt: true }, { no: 5, name: "description", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, - { no: 6, name: "members", kind: "message", T: RaceDetail_Member, repeated: true }, + { no: 6, name: "members", kind: "scalar", T: 13 /* ScalarType.UINT32 */, repeated: true }, { no: 7, name: "admin_jwt", kind: "message", T: JWT }, ], ); diff --git a/client/package.json b/client/package.json index 36b18a36a..3b673300c 100644 --- a/client/package.json +++ b/client/package.json @@ -4,7 +4,7 @@ "devDependencies": { "@bufbuild/protoc-gen-connect-web": "0.2.1", "@bufbuild/protoc-gen-es": "0.1.1", - "eslint": "8.25.0", + "eslint": "8.26.0", "eslint-config-next": "12.3.1" }, "dependencies": { @@ -18,7 +18,7 @@ "react": "18.2.0", "react-dom": "18.2.0", "sass": "1.55.0", - "sharp": "^0.31.1", + "sharp": "0.31.1", "typescript": "4.8.4" }, "scripts": { diff --git a/client/src/components/RegisterField.tsx b/client/src/components/RegisterField.tsx new file mode 100644 index 000000000..60e1d7f9f --- /dev/null +++ b/client/src/components/RegisterField.tsx @@ -0,0 +1,355 @@ +import { FC, useState } from "react"; +import { createPromiseClient } from "@bufbuild/connect-web"; +import { Timestamp } from "@bufbuild/protobuf"; +import { + HorseDataService, + RaceDataService, +} from "../../_proto/spec/v1/userdata_connectweb"; +import { HorseDetail_Image, JWT } from "../../_proto/spec/v1/userdata_pb"; +import { transport } from "../util/use-client"; +import { stringToImageType } from "../util/util"; + +const horseClient = createPromiseClient(HorseDataService, transport); +const raceClient = createPromiseClient(RaceDataService, transport); + +const RegisterRaceField: FC<{ jwt: JWT | null }> = ({ jwt }) => { + const [name, setName] = useState(""); + const [order, setOrder] = useState(0); + const [date, setDate] = useState(""); + const [time, setTime] = useState(""); + const [description, setDescription] = useState(""); + return ( +
+ レース登録 +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ +
+ ); +}; + +const EditRaceField: FC<{ jwt: JWT | null }> = ({ jwt }) => { + const [id, setId] = useState(0); + const [name, setName] = useState(""); + const [order, setOrder] = useState(0); + const [date, setDate] = useState(""); + const [time, setTime] = useState(""); + const [member, setMember] = useState(""); + const [description, setDescription] = useState(""); + return ( +
+ レース編集 +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ +
+ ); +}; + +const RegisterHorseField: FC<{ jwt: JWT | null }> = ({ jwt }) => { + const [name, setName] = useState(""); + const [owner, setOwner] = useState(""); + return ( +
+ 競争馬登録 +
+ +
+
+ +
+ +
+ ); +}; + +const EditHorseField: FC<{ jwt: JWT | null }> = ({ jwt }) => { + const [id, setId] = useState(0); + const [name, setName] = useState(""); + const [owner, setOwner] = useState(""); + const [image, setImage] = useState( + undefined + ); + return ( +
+ 競争馬編集 +
+ +
+
+ +
+
+ +
+
+ +
+ +
+ ); +}; + +export { RegisterRaceField, EditRaceField, RegisterHorseField, EditHorseField }; diff --git a/client/src/pages/admin.tsx b/client/src/pages/admin.tsx index f61a53bb0..e7990590e 100644 --- a/client/src/pages/admin.tsx +++ b/client/src/pages/admin.tsx @@ -1,52 +1,20 @@ import { createPromiseClient } from "@bufbuild/connect-web"; -import { Timestamp } from "@bufbuild/protobuf"; import { FC, useEffect, useState } from "react"; -import { - HorseDataService, - RaceDataService, - UserDataService, -} from "../../_proto/spec/v1/userdata_connectweb"; -import { - HorseDetail_Image, - HorseDetail_Image_ImageType, - JWT, -} from "../../_proto/spec/v1/userdata_pb"; +import { UserDataService } from "../../_proto/spec/v1/userdata_connectweb"; +import { JWT } from "../../_proto/spec/v1/userdata_pb"; import { transport } from "../util/use-client"; -const stringToImageType = (str: string): HorseDetail_Image_ImageType => { - if (str === "gif") { - return HorseDetail_Image_ImageType.GIF; - } else if (str === "jpeg") { - return HorseDetail_Image_ImageType.JPEG; - } else if (str === "png") { - return HorseDetail_Image_ImageType.PNG; - } - throw new Error(); -}; +import { + RegisterHorseField, + EditRaceField, + RegisterRaceField, + EditHorseField, +} from "../components/RegisterField"; const AdminPage: FC<{}> = () => { const [jwt, setJwt] = useState(null); - const [registerHorseName, setRegisterHorseName] = useState(""); - const [registerOwnerName, setRegisterOwnerName] = useState(""); - - const [editHorseId, setEditHorseId] = useState(0); - const [editHorseName, setEditHorseName] = useState(""); - const [editOwnerName, setEditOwnerName] = useState(""); - const [editHorseImage, setEditHorseImage] = useState< - HorseDetail_Image | undefined - >(undefined); - - const [registerRaceName, setRegisterRaceName] = useState(""); - const [registerRaceOrder, setRegisterRaceOrder] = useState(0); - const [registerRaceDate, setRegisterRaceDate] = useState(""); - const [registerRaceTime, setRegisterRaceTime] = useState(""); - const [registerRaceDescription, setRegisterRaceDescription] = - useState(""); - const userClient = createPromiseClient(UserDataService, transport); - const horseClient = createPromiseClient(HorseDataService, transport); - const raceClient = createPromiseClient(RaceDataService, transport); useEffect(() => { const token = localStorage.getItem("token"); if (!token) return; @@ -77,227 +45,13 @@ const AdminPage: FC<{}> = () => { : {jwt ? "ログイン済" : "未ログイン"} -
- レース登録 -
- -
-
- -
-
- -
-
- -
-
- -
- -
+ -
- 競争馬登録 -
- -
-
- -
- -
+ -
- 競争馬編集 -
- -
-
- -
-
- -
-
- -
- -
+ + + ); }; diff --git a/client/src/pages/race/[id].tsx b/client/src/pages/race/[id].tsx index 616f98368..887daba8b 100644 --- a/client/src/pages/race/[id].tsx +++ b/client/src/pages/race/[id].tsx @@ -54,25 +54,18 @@ const RaceDetailPage: FC = ({ json }) => { 着順 馬番 馬名 - オッズ - 人気 - {race.members.map((e) => ( + {race.members.map((e, i) => ( - {raceOrderToString(e.order!)} + {e.order ? raceOrderToString(e.order) : ""} + {i + 1} {e.horse!.name} - - {Number.isInteger(e.odds) - ? `${e.odds}.0` - : e.odds} - - {e.popularity} ))} diff --git a/client/src/util/util.ts b/client/src/util/util.ts index 879c08c36..c4564ceff 100644 --- a/client/src/util/util.ts +++ b/client/src/util/util.ts @@ -1,5 +1,8 @@ import { RaceOrder } from "../../_proto/spec/v1/userdata_pb"; -import { RaceOrder_NoteType } from "../../_proto/spec/v1/userdata_pb"; +import { + RaceOrder_NoteType, + HorseDetail_Image_ImageType, +} from "../../_proto/spec/v1/userdata_pb"; const raceOrderToString = (order: RaceOrder): string => { const type = order.orderOneof.case; @@ -20,4 +23,15 @@ const raceOrderToString = (order: RaceOrder): string => { } }; -export { raceOrderToString }; +const stringToImageType = (str: string): HorseDetail_Image_ImageType => { + if (str === "gif") { + return HorseDetail_Image_ImageType.GIF; + } else if (str === "jpeg") { + return HorseDetail_Image_ImageType.JPEG; + } else if (str === "png") { + return HorseDetail_Image_ImageType.PNG; + } + throw new Error(); +}; + +export { raceOrderToString, stringToImageType }; diff --git a/client/yarn.lock b/client/yarn.lock index 85d875ecc..321e69ed6 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -108,14 +108,14 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/config-array@npm:^0.10.5": - version: 0.10.5 - resolution: "@humanwhocodes/config-array@npm:0.10.5" +"@humanwhocodes/config-array@npm:^0.11.6": + version: 0.11.6 + resolution: "@humanwhocodes/config-array@npm:0.11.6" dependencies: "@humanwhocodes/object-schema": ^1.2.1 debug: ^4.1.1 minimatch: ^3.0.4 - checksum: af4fa2633c57414be22ddba0a072cc611ef9a07104542fa24bde918a0153b89b6e08ca6a20ccc9079de6079e219e2406e38414d1b662db8bb59a3ba9d6eee6e3 + checksum: 2fb7288638968dfeec27f06aef52f043726edd126ac47f24b54256902fdb35b3bf9863d4a4caf0423dccca5dd1354ca5899f3ac047b56774641ca0c4cbedb104 languageName: node linkType: hard @@ -257,7 +257,7 @@ __metadata: languageName: node linkType: hard -"@nodelib/fs.walk@npm:^1.2.3": +"@nodelib/fs.walk@npm:^1.2.3, @nodelib/fs.walk@npm:^1.2.8": version: 1.2.8 resolution: "@nodelib/fs.walk@npm:1.2.8" dependencies: @@ -804,14 +804,14 @@ __metadata: "@types/node": 18.7.16 "@types/react": 18.0.21 "@types/react-dom": 18.0.6 - eslint: 8.25.0 + eslint: 8.26.0 eslint-config-next: 12.3.1 next: 12.3.1 prettier: 2.7.1 react: 18.2.0 react-dom: 18.2.0 sass: 1.55.0 - sharp: ^0.31.1 + sharp: 0.31.1 typescript: 4.8.4 languageName: unknown linkType: soft @@ -1297,13 +1297,14 @@ __metadata: languageName: node linkType: hard -"eslint@npm:8.25.0": - version: 8.25.0 - resolution: "eslint@npm:8.25.0" +"eslint@npm:8.26.0": + version: 8.26.0 + resolution: "eslint@npm:8.26.0" dependencies: "@eslint/eslintrc": ^1.3.3 - "@humanwhocodes/config-array": ^0.10.5 + "@humanwhocodes/config-array": ^0.11.6 "@humanwhocodes/module-importer": ^1.0.1 + "@nodelib/fs.walk": ^1.2.8 ajv: ^6.10.0 chalk: ^4.0.0 cross-spawn: ^7.0.2 @@ -1319,14 +1320,14 @@ __metadata: fast-deep-equal: ^3.1.3 file-entry-cache: ^6.0.1 find-up: ^5.0.0 - glob-parent: ^6.0.1 + glob-parent: ^6.0.2 globals: ^13.15.0 - globby: ^11.1.0 grapheme-splitter: ^1.0.4 ignore: ^5.2.0 import-fresh: ^3.0.0 imurmurhash: ^0.1.4 is-glob: ^4.0.0 + is-path-inside: ^3.0.3 js-sdsl: ^4.1.4 js-yaml: ^4.1.0 json-stable-stringify-without-jsonify: ^1.0.1 @@ -1341,7 +1342,7 @@ __metadata: text-table: ^0.2.0 bin: eslint: bin/eslint.js - checksum: 7acf2693b522b573657b53d2245b5522d3a131e4224b1cbf01e2c3579632fdbf62599284f68bc483e6e4eba23ae3643c9544744e0214a86e727cc361cedcd0fa + checksum: a2aced939ea060f77d10dcfced5cfeb940f63f383fd7ab1decadea64170ab552582e1c5909db1db641d4283178c9bc569f19b0f8900e00314a5f783e4b3f759d languageName: node linkType: hard @@ -1604,7 +1605,7 @@ __metadata: languageName: node linkType: hard -"glob-parent@npm:^6.0.1": +"glob-parent@npm:^6.0.2": version: 6.0.2 resolution: "glob-parent@npm:6.0.2" dependencies: @@ -1999,6 +2000,13 @@ __metadata: languageName: node linkType: hard +"is-path-inside@npm:^3.0.3": + version: 3.0.3 + resolution: "is-path-inside@npm:3.0.3" + checksum: abd50f06186a052b349c15e55b182326f1936c89a78bf6c8f2b707412517c097ce04bc49a0ca221787bc44e1049f51f09a2ffb63d22899051988d3a618ba13e9 + languageName: node + linkType: hard + "is-regex@npm:^1.1.4": version: 1.1.4 resolution: "is-regex@npm:1.1.4" @@ -3063,7 +3071,7 @@ __metadata: languageName: node linkType: hard -"sharp@npm:^0.31.1": +"sharp@npm:0.31.1": version: 0.31.1 resolution: "sharp@npm:0.31.1" dependencies: diff --git a/docs/protobuf.md b/docs/protobuf.md index f4c3dc9de..2af96f530 100644 --- a/docs/protobuf.md +++ b/docs/protobuf.md @@ -181,7 +181,7 @@ | order | [uint32](#uint32) | optional | 第nレースのnのように、その日の何番目のレースなのかを指定する。1オリジン。 | | start | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | optional | | | description | [string](#string) | optional | | -| members | [RaceDetail.Member](#spec-v1-RaceDetail-Member) | repeated | 出走表決定も着順確定も同じフィールドを使うけどとりあえずは運用でカバーします | +| members | [uint32](#uint32) | repeated | 馬のidの配列で指定 | | admin_jwt | [JWT](#spec-v1-JWT) | | admin JWT | diff --git a/go/_proto/spec/v1/userdata.pb.go b/go/_proto/spec/v1/userdata.pb.go index 93da32116..2cce68e27 100644 --- a/go/_proto/spec/v1/userdata.pb.go +++ b/go/_proto/spec/v1/userdata.pb.go @@ -1867,8 +1867,8 @@ type EditRaceRequest struct { Order *uint32 `protobuf:"varint,3,opt,name=order,proto3,oneof" json:"order,omitempty"` Start *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=start,proto3,oneof" json:"start,omitempty"` Description *string `protobuf:"bytes,5,opt,name=description,proto3,oneof" json:"description,omitempty"` - // 出走表決定も着順確定も同じフィールドを使うけどとりあえずは運用でカバーします - Members []*RaceDetail_Member `protobuf:"bytes,6,rep,name=members,proto3" json:"members,omitempty"` + // 馬のidの配列で指定 + Members []uint32 `protobuf:"varint,6,rep,packed,name=members,proto3" json:"members,omitempty"` // admin JWT AdminJwt *JWT `protobuf:"bytes,7,opt,name=admin_jwt,json=adminJwt,proto3" json:"admin_jwt,omitempty"` } @@ -1940,7 +1940,7 @@ func (x *EditRaceRequest) GetDescription() string { return "" } -func (x *EditRaceRequest) GetMembers() []*RaceDetail_Member { +func (x *EditRaceRequest) GetMembers() []uint32 { if x != nil { return x.Members } @@ -2449,7 +2449,7 @@ var file_spec_v1_userdata_proto_rawDesc = []byte{ 0x4e, 0x4f, 0x54, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x47, 0x49, 0x56, 0x45, 0x55, 0x50, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x4e, 0x4f, 0x54, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x43, 0x4c, 0x55, 0x44, 0x45, 0x10, 0x03, 0x42, 0x12, 0x0a, 0x0b, 0x6f, 0x72, 0x64, - 0x65, 0x72, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0xd3, 0x03, + 0x65, 0x72, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0xa6, 0x03, 0x0a, 0x0a, 0x52, 0x61, 0x63, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x2b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x63, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, @@ -2467,161 +2467,156 @@ var file_spec_v1_userdata_proto_rawDesc = []byte{ 0x6e, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xfa, 0x42, 0x05, 0xb2, 0x01, 0x02, 0x08, 0x01, 0x52, 0x07, - 0x76, 0x6f, 0x74, 0x65, 0x45, 0x6e, 0x64, 0x1a, 0xb9, 0x01, 0x0a, 0x06, 0x4d, 0x65, 0x6d, 0x62, - 0x65, 0x72, 0x12, 0x32, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x76, 0x6f, 0x74, 0x65, 0x45, 0x6e, 0x64, 0x1a, 0x8c, 0x01, 0x0a, 0x06, 0x4d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x12, 0x28, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x63, 0x65, - 0x4f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, - 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x05, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, - 0x48, 0x6f, 0x72, 0x73, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, - 0x05, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x01, 0x42, 0x0e, 0xfa, 0x42, 0x0b, 0x12, 0x09, 0x29, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xf0, 0x3f, 0x52, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x12, 0x27, 0x0a, 0x0a, 0x70, 0x6f, - 0x70, 0x75, 0x6c, 0x61, 0x72, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x07, - 0xfa, 0x42, 0x04, 0x2a, 0x02, 0x28, 0x01, 0x52, 0x0a, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x72, - 0x69, 0x74, 0x79, 0x22, 0x45, 0x0a, 0x0b, 0x52, 0x61, 0x63, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, - 0x6c, 0x73, 0x12, 0x36, 0x0a, 0x0c, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, - 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, - 0x76, 0x31, 0x2e, 0x52, 0x61, 0x63, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x0b, 0x72, - 0x61, 0x63, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x2a, 0x0a, 0x0f, 0x52, 0x61, - 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x2a, 0x02, - 0x28, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x3b, 0x0a, 0x10, 0x52, 0x61, 0x63, 0x65, 0x44, 0x61, - 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x04, 0x72, 0x61, - 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, - 0x76, 0x31, 0x2e, 0x52, 0x61, 0x63, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x04, 0x72, - 0x61, 0x63, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x41, 0x6c, 0x6c, 0x52, 0x61, 0x63, 0x65, 0x44, 0x61, - 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3a, 0x0a, 0x13, 0x41, 0x6c, 0x6c, - 0x52, 0x61, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x23, 0x0a, 0x05, 0x72, 0x61, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x0d, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x63, 0x65, 0x52, 0x05, - 0x72, 0x61, 0x63, 0x65, 0x73, 0x22, 0xe4, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x65, 0x72, 0x52, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, - 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x05, 0x6f, 0x72, - 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x2a, 0x02, - 0x28, 0x01, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x05, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xfa, 0x42, 0x05, 0xb2, 0x01, 0x02, 0x08, 0x01, 0x52, 0x05, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x09, 0x61, 0x64, 0x6d, 0x69, 0x6e, - 0x5f, 0x6a, 0x77, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x73, 0x70, 0x65, - 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4a, 0x57, 0x54, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, - 0x10, 0x01, 0x52, 0x08, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x4a, 0x77, 0x74, 0x22, 0x16, 0x0a, 0x14, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9f, 0x01, 0x0a, 0x19, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x52, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x07, - 0xfa, 0x42, 0x04, 0x2a, 0x02, 0x28, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x34, 0x0a, 0x07, 0x6d, - 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, - 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x63, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, - 0x6c, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, - 0x73, 0x12, 0x33, 0x0a, 0x09, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x6a, 0x77, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4a, - 0x57, 0x54, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x08, 0x61, 0x64, - 0x6d, 0x69, 0x6e, 0x4a, 0x77, 0x74, 0x22, 0x1c, 0x0a, 0x1a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x65, 0x72, 0x52, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xd4, 0x02, 0x0a, 0x0f, 0x45, 0x64, 0x69, 0x74, 0x52, 0x61, 0x63, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x2a, 0x02, 0x28, 0x01, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x6f, 0x72, - 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x01, 0x52, 0x05, 0x6f, 0x72, 0x64, - 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x35, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x48, 0x02, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x88, 0x01, 0x01, 0x12, 0x25, 0x0a, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x48, 0x03, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x88, 0x01, 0x01, 0x12, 0x34, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x06, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, - 0x61, 0x63, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, - 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x33, 0x0a, 0x09, 0x61, 0x64, 0x6d, - 0x69, 0x6e, 0x5f, 0x6a, 0x77, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x73, - 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4a, 0x57, 0x54, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, - 0x01, 0x02, 0x10, 0x01, 0x52, 0x08, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x4a, 0x77, 0x74, 0x42, 0x07, - 0x0a, 0x05, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x6f, 0x72, 0x64, 0x65, - 0x72, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x12, 0x0a, 0x10, 0x45, - 0x64, 0x69, 0x74, 0x52, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x57, 0x0a, 0x0b, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, - 0x0a, 0x04, 0x72, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x72, 0x61, - 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x05, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x03, 0x6a, 0x77, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, - 0x4a, 0x57, 0x54, 0x52, 0x03, 0x6a, 0x77, 0x74, 0x22, 0x0e, 0x0a, 0x0c, 0x56, 0x6f, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xec, 0x01, 0x0a, 0x0f, 0x55, 0x73, 0x65, - 0x72, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x41, 0x0a, 0x08, - 0x55, 0x73, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x18, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, - 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, - 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x47, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x2e, - 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x73, 0x70, 0x65, 0x63, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, - 0x6e, 0x41, 0x73, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x1c, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, - 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x73, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, - 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x73, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x32, 0xbf, 0x02, 0x0a, 0x10, 0x48, 0x6f, 0x72, 0x73, - 0x65, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x44, 0x0a, 0x09, - 0x48, 0x6f, 0x72, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x19, 0x2e, 0x73, 0x70, 0x65, 0x63, - 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x72, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x48, - 0x6f, 0x72, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0c, 0x41, 0x6c, 0x6c, 0x48, 0x6f, 0x72, 0x73, 0x65, 0x44, 0x61, - 0x74, 0x61, 0x12, 0x1c, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6c, 0x6c, - 0x48, 0x6f, 0x72, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1d, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6c, 0x6c, 0x48, 0x6f, - 0x72, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x50, 0x0a, 0x0d, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x48, 0x6f, 0x72, - 0x73, 0x65, 0x12, 0x1d, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x65, 0x72, 0x48, 0x6f, 0x72, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1e, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x65, 0x72, 0x48, 0x6f, 0x72, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x09, 0x45, 0x64, 0x69, 0x74, 0x48, 0x6f, 0x72, 0x73, 0x65, - 0x12, 0x19, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x48, - 0x6f, 0x72, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x73, 0x70, - 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x48, 0x6f, 0x72, 0x73, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x32, 0x93, 0x03, 0x0a, 0x0f, 0x52, 0x61, - 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4a, 0x0a, - 0x0b, 0x41, 0x6c, 0x6c, 0x52, 0x61, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1b, 0x2e, 0x73, - 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6c, 0x6c, 0x52, 0x61, 0x63, 0x65, 0x44, 0x61, - 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x73, 0x70, 0x65, 0x63, - 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6c, 0x6c, 0x52, 0x61, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x08, 0x52, 0x61, 0x63, - 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x18, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, - 0x52, 0x61, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x19, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x63, 0x65, 0x44, 0x61, - 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0c, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x61, 0x63, 0x65, 0x12, 0x1c, 0x2e, 0x73, - 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, - 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x73, 0x70, 0x65, - 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x61, 0x63, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5f, 0x0a, 0x12, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x12, 0x22, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, + 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x05, + 0x68, 0x6f, 0x72, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x70, + 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x72, 0x73, 0x65, 0x52, 0x05, 0x68, 0x6f, 0x72, + 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, + 0x52, 0x04, 0x6f, 0x64, 0x64, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, + 0x72, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x70, 0x6f, 0x70, 0x75, + 0x6c, 0x61, 0x72, 0x69, 0x74, 0x79, 0x22, 0x45, 0x0a, 0x0b, 0x52, 0x61, 0x63, 0x65, 0x44, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x36, 0x0a, 0x0c, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x64, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x70, + 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x63, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x52, 0x0b, 0x72, 0x61, 0x63, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x2a, 0x0a, + 0x0f, 0x52, 0x61, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x07, 0xfa, 0x42, + 0x04, 0x2a, 0x02, 0x28, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x3b, 0x0a, 0x10, 0x52, 0x61, 0x63, + 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, + 0x04, 0x72, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x70, + 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x63, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x52, 0x04, 0x72, 0x61, 0x63, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x41, 0x6c, 0x6c, 0x52, 0x61, 0x63, + 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3a, 0x0a, 0x13, + 0x41, 0x6c, 0x6c, 0x52, 0x61, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x05, 0x72, 0x61, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x63, + 0x65, 0x52, 0x05, 0x72, 0x61, 0x63, 0x65, 0x73, 0x22, 0xe4, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, + 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, + 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x07, 0xfa, 0x42, + 0x04, 0x2a, 0x02, 0x28, 0x01, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x05, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xfa, 0x42, 0x05, 0xb2, 0x01, 0x02, 0x08, + 0x01, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x09, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x5f, 0x6a, 0x77, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, + 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4a, 0x57, 0x54, 0x42, 0x08, 0xfa, 0x42, 0x05, + 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x08, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x4a, 0x77, 0x74, 0x22, + 0x16, 0x0a, 0x14, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x61, 0x63, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9f, 0x01, 0x0a, 0x19, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x08, - 0x45, 0x64, 0x69, 0x74, 0x52, 0x61, 0x63, 0x65, 0x12, 0x18, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, - 0x76, 0x31, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x52, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x64, 0x69, - 0x74, 0x52, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x32, - 0x44, 0x0a, 0x0b, 0x56, 0x6f, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x35, - 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x14, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, - 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x73, - 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x65, 0x63, 0x6b, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x63, 0x68, 0x6f, - 0x66, 0x75, 0x2d, 0x72, 0x61, 0x63, 0x65, 0x2d, 0x63, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x2f, 0x67, - 0x6f, 0x2f, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x2f, 0x76, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x2a, 0x02, 0x28, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x34, + 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x63, 0x65, 0x44, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x07, 0x6d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x73, 0x12, 0x33, 0x0a, 0x09, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x6a, 0x77, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, + 0x31, 0x2e, 0x4a, 0x57, 0x54, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, + 0x08, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x4a, 0x77, 0x74, 0x22, 0x1c, 0x0a, 0x1a, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xb8, 0x02, 0x0a, 0x0f, 0x45, 0x64, 0x69, 0x74, + 0x52, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x2a, 0x02, 0x28, 0x01, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, + 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x01, 0x52, 0x05, + 0x6f, 0x72, 0x64, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x35, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x48, 0x02, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x88, 0x01, 0x01, 0x12, + 0x25, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, + 0x12, 0x33, 0x0a, 0x09, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x6a, 0x77, 0x74, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4a, 0x57, + 0x54, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x08, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x4a, 0x77, 0x74, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x08, + 0x0a, 0x06, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0x12, 0x0a, 0x10, 0x45, 0x64, 0x69, 0x74, 0x52, 0x61, 0x63, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x57, 0x0a, 0x0b, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x04, 0x72, 0x61, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x68, 0x6f, 0x72, + 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x12, + 0x1e, 0x0a, 0x03, 0x6a, 0x77, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x73, + 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4a, 0x57, 0x54, 0x52, 0x03, 0x6a, 0x77, 0x74, 0x22, + 0x0e, 0x0a, 0x0c, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, + 0xec, 0x01, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x41, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x18, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x44, 0x61, + 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x73, 0x70, 0x65, 0x63, + 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1b, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x4d, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x73, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, + 0x1c, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x41, + 0x73, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, + 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x73, 0x41, + 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x32, 0xbf, + 0x02, 0x0a, 0x10, 0x48, 0x6f, 0x72, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x44, 0x0a, 0x09, 0x48, 0x6f, 0x72, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, + 0x12, 0x19, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x72, 0x73, 0x65, + 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x73, 0x70, + 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x72, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0c, 0x41, 0x6c, 0x6c, + 0x48, 0x6f, 0x72, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1c, 0x2e, 0x73, 0x70, 0x65, 0x63, + 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6c, 0x6c, 0x48, 0x6f, 0x72, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, + 0x31, 0x2e, 0x41, 0x6c, 0x6c, 0x48, 0x6f, 0x72, 0x73, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x50, 0x0a, 0x0d, 0x52, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x65, 0x72, 0x48, 0x6f, 0x72, 0x73, 0x65, 0x12, 0x1d, 0x2e, 0x73, 0x70, 0x65, 0x63, + 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x48, 0x6f, 0x72, 0x73, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, + 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x48, 0x6f, 0x72, 0x73, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x09, 0x45, 0x64, + 0x69, 0x74, 0x48, 0x6f, 0x72, 0x73, 0x65, 0x12, 0x19, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, + 0x31, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x48, 0x6f, 0x72, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x64, 0x69, + 0x74, 0x48, 0x6f, 0x72, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x32, 0x93, 0x03, 0x0a, 0x0f, 0x52, 0x61, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x4a, 0x0a, 0x0b, 0x41, 0x6c, 0x6c, 0x52, 0x61, 0x63, 0x65, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x1b, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6c, + 0x6c, 0x52, 0x61, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1c, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6c, 0x6c, 0x52, 0x61, + 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x41, 0x0a, 0x08, 0x52, 0x61, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x18, 0x2e, 0x73, + 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, + 0x2e, 0x52, 0x61, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, + 0x61, 0x63, 0x65, 0x12, 0x1c, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1d, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x65, 0x72, 0x52, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x5f, 0x0a, 0x12, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x61, + 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x22, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, + 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x61, 0x63, 0x65, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, + 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, + 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x08, 0x45, 0x64, 0x69, 0x74, 0x52, 0x61, 0x63, 0x65, 0x12, + 0x18, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x52, 0x61, + 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x73, 0x70, 0x65, 0x63, + 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x52, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x32, 0x44, 0x0a, 0x0b, 0x56, 0x6f, 0x74, 0x65, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x35, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x14, 0x2e, + 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x6f, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x39, 0x5a, 0x37, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x65, 0x63, 0x6b, 0x6f, + 0x6b, 0x65, 0x6e, 0x2f, 0x63, 0x68, 0x6f, 0x66, 0x75, 0x2d, 0x72, 0x61, 0x63, 0x65, 0x2d, 0x63, + 0x6f, 0x75, 0x72, 0x73, 0x65, 0x2f, 0x67, 0x6f, 0x2f, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x73, 0x70, 0x65, 0x63, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2713,45 +2708,44 @@ var file_spec_v1_userdata_proto_depIdxs = []int32{ 40, // 27: spec.v1.RegisterRaceResultRequest.members:type_name -> spec.v1.RaceDetail.Member 5, // 28: spec.v1.RegisterRaceResultRequest.admin_jwt:type_name -> spec.v1.JWT 41, // 29: spec.v1.EditRaceRequest.start:type_name -> google.protobuf.Timestamp - 40, // 30: spec.v1.EditRaceRequest.members:type_name -> spec.v1.RaceDetail.Member - 5, // 31: spec.v1.EditRaceRequest.admin_jwt:type_name -> spec.v1.JWT - 5, // 32: spec.v1.VoteRequest.jwt:type_name -> spec.v1.JWT - 0, // 33: spec.v1.HorseDetail.Image.type:type_name -> spec.v1.HorseDetail.Image.ImageType - 22, // 34: spec.v1.HorseDetail.History.race:type_name -> spec.v1.Race - 23, // 35: spec.v1.HorseDetail.History.result:type_name -> spec.v1.RaceOrder - 23, // 36: spec.v1.RaceDetail.Member.order:type_name -> spec.v1.RaceOrder - 11, // 37: spec.v1.RaceDetail.Member.horse:type_name -> spec.v1.Horse - 4, // 38: spec.v1.UserDataService.UserData:input_type -> spec.v1.UserDataRequest - 7, // 39: spec.v1.UserDataService.CreateUser:input_type -> spec.v1.CreateUserRequest - 9, // 40: spec.v1.UserDataService.LoginAsAdmin:input_type -> spec.v1.LoginAsAdminRequest - 14, // 41: spec.v1.HorseDataService.HorseData:input_type -> spec.v1.HorseDataRequest - 16, // 42: spec.v1.HorseDataService.AllHorseData:input_type -> spec.v1.AllHorseDataRequest - 18, // 43: spec.v1.HorseDataService.RegisterHorse:input_type -> spec.v1.RegisterHorseRequest - 20, // 44: spec.v1.HorseDataService.EditHorse:input_type -> spec.v1.EditHorseRequest - 28, // 45: spec.v1.RaceDataService.AllRaceData:input_type -> spec.v1.AllRaceDataRequest - 26, // 46: spec.v1.RaceDataService.RaceData:input_type -> spec.v1.RaceDataRequest - 30, // 47: spec.v1.RaceDataService.RegisterRace:input_type -> spec.v1.RegisterRaceRequest - 32, // 48: spec.v1.RaceDataService.RegisterRaceResult:input_type -> spec.v1.RegisterRaceResultRequest - 34, // 49: spec.v1.RaceDataService.EditRace:input_type -> spec.v1.EditRaceRequest - 36, // 50: spec.v1.VoteService.Vote:input_type -> spec.v1.VoteRequest - 6, // 51: spec.v1.UserDataService.UserData:output_type -> spec.v1.UserDataResponse - 8, // 52: spec.v1.UserDataService.CreateUser:output_type -> spec.v1.CreateUserResponse - 10, // 53: spec.v1.UserDataService.LoginAsAdmin:output_type -> spec.v1.LoginAsAdminResponse - 15, // 54: spec.v1.HorseDataService.HorseData:output_type -> spec.v1.HorseDataResponse - 17, // 55: spec.v1.HorseDataService.AllHorseData:output_type -> spec.v1.AllHorseDataResponse - 19, // 56: spec.v1.HorseDataService.RegisterHorse:output_type -> spec.v1.RegisterHorseResponse - 21, // 57: spec.v1.HorseDataService.EditHorse:output_type -> spec.v1.EditHorseResponse - 29, // 58: spec.v1.RaceDataService.AllRaceData:output_type -> spec.v1.AllRaceDataResponse - 27, // 59: spec.v1.RaceDataService.RaceData:output_type -> spec.v1.RaceDataResponse - 31, // 60: spec.v1.RaceDataService.RegisterRace:output_type -> spec.v1.RegisterRaceResponse - 33, // 61: spec.v1.RaceDataService.RegisterRaceResult:output_type -> spec.v1.RegisterRaceResultResponse - 35, // 62: spec.v1.RaceDataService.EditRace:output_type -> spec.v1.EditRaceResponse - 37, // 63: spec.v1.VoteService.Vote:output_type -> spec.v1.VoteResponse - 51, // [51:64] is the sub-list for method output_type - 38, // [38:51] is the sub-list for method input_type - 38, // [38:38] is the sub-list for extension type_name - 38, // [38:38] is the sub-list for extension extendee - 0, // [0:38] is the sub-list for field type_name + 5, // 30: spec.v1.EditRaceRequest.admin_jwt:type_name -> spec.v1.JWT + 5, // 31: spec.v1.VoteRequest.jwt:type_name -> spec.v1.JWT + 0, // 32: spec.v1.HorseDetail.Image.type:type_name -> spec.v1.HorseDetail.Image.ImageType + 22, // 33: spec.v1.HorseDetail.History.race:type_name -> spec.v1.Race + 23, // 34: spec.v1.HorseDetail.History.result:type_name -> spec.v1.RaceOrder + 23, // 35: spec.v1.RaceDetail.Member.order:type_name -> spec.v1.RaceOrder + 11, // 36: spec.v1.RaceDetail.Member.horse:type_name -> spec.v1.Horse + 4, // 37: spec.v1.UserDataService.UserData:input_type -> spec.v1.UserDataRequest + 7, // 38: spec.v1.UserDataService.CreateUser:input_type -> spec.v1.CreateUserRequest + 9, // 39: spec.v1.UserDataService.LoginAsAdmin:input_type -> spec.v1.LoginAsAdminRequest + 14, // 40: spec.v1.HorseDataService.HorseData:input_type -> spec.v1.HorseDataRequest + 16, // 41: spec.v1.HorseDataService.AllHorseData:input_type -> spec.v1.AllHorseDataRequest + 18, // 42: spec.v1.HorseDataService.RegisterHorse:input_type -> spec.v1.RegisterHorseRequest + 20, // 43: spec.v1.HorseDataService.EditHorse:input_type -> spec.v1.EditHorseRequest + 28, // 44: spec.v1.RaceDataService.AllRaceData:input_type -> spec.v1.AllRaceDataRequest + 26, // 45: spec.v1.RaceDataService.RaceData:input_type -> spec.v1.RaceDataRequest + 30, // 46: spec.v1.RaceDataService.RegisterRace:input_type -> spec.v1.RegisterRaceRequest + 32, // 47: spec.v1.RaceDataService.RegisterRaceResult:input_type -> spec.v1.RegisterRaceResultRequest + 34, // 48: spec.v1.RaceDataService.EditRace:input_type -> spec.v1.EditRaceRequest + 36, // 49: spec.v1.VoteService.Vote:input_type -> spec.v1.VoteRequest + 6, // 50: spec.v1.UserDataService.UserData:output_type -> spec.v1.UserDataResponse + 8, // 51: spec.v1.UserDataService.CreateUser:output_type -> spec.v1.CreateUserResponse + 10, // 52: spec.v1.UserDataService.LoginAsAdmin:output_type -> spec.v1.LoginAsAdminResponse + 15, // 53: spec.v1.HorseDataService.HorseData:output_type -> spec.v1.HorseDataResponse + 17, // 54: spec.v1.HorseDataService.AllHorseData:output_type -> spec.v1.AllHorseDataResponse + 19, // 55: spec.v1.HorseDataService.RegisterHorse:output_type -> spec.v1.RegisterHorseResponse + 21, // 56: spec.v1.HorseDataService.EditHorse:output_type -> spec.v1.EditHorseResponse + 29, // 57: spec.v1.RaceDataService.AllRaceData:output_type -> spec.v1.AllRaceDataResponse + 27, // 58: spec.v1.RaceDataService.RaceData:output_type -> spec.v1.RaceDataResponse + 31, // 59: spec.v1.RaceDataService.RegisterRace:output_type -> spec.v1.RegisterRaceResponse + 33, // 60: spec.v1.RaceDataService.RegisterRaceResult:output_type -> spec.v1.RegisterRaceResultResponse + 35, // 61: spec.v1.RaceDataService.EditRace:output_type -> spec.v1.EditRaceResponse + 37, // 62: spec.v1.VoteService.Vote:output_type -> spec.v1.VoteResponse + 50, // [50:63] is the sub-list for method output_type + 37, // [37:50] is the sub-list for method input_type + 37, // [37:37] is the sub-list for extension type_name + 37, // [37:37] is the sub-list for extension extendee + 0, // [0:37] is the sub-list for field type_name } func init() { file_spec_v1_userdata_proto_init() } diff --git a/go/_proto/spec/v1/userdata.pb.validate.go b/go/_proto/spec/v1/userdata.pb.validate.go index 7b31b5eb7..4df4963ac 100644 --- a/go/_proto/spec/v1/userdata.pb.validate.go +++ b/go/_proto/spec/v1/userdata.pb.validate.go @@ -4418,40 +4418,6 @@ func (m *EditRaceRequest) validate(all bool) error { errors = append(errors, err) } - for idx, item := range m.GetMembers() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, EditRaceRequestValidationError{ - field: fmt.Sprintf("Members[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, EditRaceRequestValidationError{ - field: fmt.Sprintf("Members[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return EditRaceRequestValidationError{ - field: fmt.Sprintf("Members[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - if m.GetAdminJwt() == nil { err := EditRaceRequestValidationError{ field: "AdminJwt", @@ -5300,17 +5266,6 @@ func (m *RaceDetail_Member) validate(all bool) error { var errors []error - if m.GetOrder() == nil { - err := RaceDetail_MemberValidationError{ - field: "Order", - reason: "value is required", - } - if !all { - return err - } - errors = append(errors, err) - } - if all { switch v := interface{}(m.GetOrder()).(type) { case interface{ ValidateAll() error }: @@ -5340,17 +5295,6 @@ func (m *RaceDetail_Member) validate(all bool) error { } } - if m.GetHorse() == nil { - err := RaceDetail_MemberValidationError{ - field: "Horse", - reason: "value is required", - } - if !all { - return err - } - errors = append(errors, err) - } - if all { switch v := interface{}(m.GetHorse()).(type) { case interface{ ValidateAll() error }: @@ -5380,27 +5324,9 @@ func (m *RaceDetail_Member) validate(all bool) error { } } - if m.GetOdds() < 1 { - err := RaceDetail_MemberValidationError{ - field: "Odds", - reason: "value must be greater than or equal to 1", - } - if !all { - return err - } - errors = append(errors, err) - } + // no validation rules for Odds - if m.GetPopularity() < 1 { - err := RaceDetail_MemberValidationError{ - field: "Popularity", - reason: "value must be greater than or equal to 1", - } - if !all { - return err - } - errors = append(errors, err) - } + // no validation rules for Popularity if len(errors) > 0 { return RaceDetail_MemberMultiError(errors) diff --git a/go/go.mod b/go/go.mod index 5d0e4700a..d2f593c0c 100644 --- a/go/go.mod +++ b/go/go.mod @@ -17,6 +17,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/stretchr/objx v0.4.0 // indirect golang.org/x/text v0.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go/go.sum b/go/go.sum index 35b4f1cc5..0dea4aca4 100644 --- a/go/go.sum +++ b/go/go.sum @@ -38,8 +38,6 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/bufbuild/connect-go v1.0.0 h1:htSflKUT8y1jxhoPhPYTZMrsY3ipUXjjrbcZR5O2cVo= -github.com/bufbuild/connect-go v1.0.0/go.mod h1:9iNvh/NOsfhNBUH5CtvXeVUskQO1xsrEviH7ZArwZ3I= github.com/bufbuild/connect-go v1.1.0 h1:AUgqqO2ePdOJSpPOep6BPYz5v2moW1Lb8sQh0EeRzQ8= github.com/bufbuild/connect-go v1.1.0/go.mod h1:9iNvh/NOsfhNBUH5CtvXeVUskQO1xsrEviH7ZArwZ3I= github.com/caarlos0/env/v6 v6.10.1 h1:t1mPSxNpei6M5yAeu1qtRdPAK29Nbcf/n3G7x+b3/II= @@ -156,6 +154,7 @@ github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= @@ -252,12 +251,6 @@ golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220907135653-1e95f45603a7/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20221014081412-f15817d10f9b h1:tvrvnPFcdzp294diPnrdZZZ8XUt2Tyj7svb7X52iDuU= -golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20221017152216-f25eb7ecb193 h1:3Moaxt4TfzNcQH6DWvlYKraN1ozhBXQHcgvXjRGeim0= -golang.org/x/net v0.0.0-20221017152216-f25eb7ecb193/go.mod h1:RpDiru2p0u2F0lLpEoqnP2+7xs0ifAuOcJ442g6GU2s= -golang.org/x/net v0.0.0-20221019024206-cb67ada4b0ad h1:Zx6wVVDwwNJFWXNIvDi7o952w3/1ckSwYk/7eykRmjM= -golang.org/x/net v0.0.0-20221019024206-cb67ada4b0ad/go.mod h1:RpDiru2p0u2F0lLpEoqnP2+7xs0ifAuOcJ442g6GU2s= golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -326,7 +319,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= diff --git a/go/pkg/handler/raceDataService.go b/go/pkg/handler/raceDataService.go index 5ef6933e9..4be7ac167 100644 --- a/go/pkg/handler/raceDataService.go +++ b/go/pkg/handler/raceDataService.go @@ -147,7 +147,11 @@ func (r *Race) EditRace(ctx context.Context, req *connect_go.Request[v1.EditRace oldRec.Description = req.Msg.GetDescription() } if editFields&EditRaceRequestMembers != 0 { - oldRec.Members = req.Msg.GetMembers() + ms, err := r.fetchMembers(req.Msg.GetMembers()) + if err != nil { + return nil, err + } + oldRec.Members = ms } if err := r.store.Race.Update(oldRec); err != nil { @@ -156,6 +160,18 @@ func (r *Race) EditRace(ctx context.Context, req *connect_go.Request[v1.EditRace return connect_go.NewResponse(&v1.EditRaceResponse{}), nil } +func (r *Race) fetchMembers(horseIDs []uint32) ([]*v1.RaceDetail_Member, error) { + res := make([]*v1.RaceDetail_Member, len(horseIDs)) + for i, horseID := range horseIDs { + h, err := r.store.Horse.GetByID(horseID) + if err != nil { + return nil, err + } + res[i] = &v1.RaceDetail_Member{Horse: horseDetail2horse(h)} + } + return res, nil +} + type EditRaceRequestField int const ( diff --git a/go/pkg/handler/raceDataService_test.go b/go/pkg/handler/raceDataService_test.go new file mode 100644 index 000000000..45a46c8cb --- /dev/null +++ b/go/pkg/handler/raceDataService_test.go @@ -0,0 +1,73 @@ +package handler_test + +import ( + "context" + "testing" + + "github.com/bufbuild/connect-go" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + v1 "github.com/ueckoken/chofu-race-course/go/_proto/spec/v1" + "github.com/ueckoken/chofu-race-course/go/pkg/authorizer" + "github.com/ueckoken/chofu-race-course/go/pkg/handler" + "google.golang.org/protobuf/types/known/timestamppb" +) + +type horseStoreMock struct { + mock.Mock + handler.HorseStore +} + +func (h *horseStoreMock) GetByID(id uint32) (*v1.HorseDetail, error) { + return &v1.HorseDetail{ + Data: &v1.Horse{Id: id, Name: "バメイ"}, + Image: &v1.HorseDetail_Image{}, + Wins: 0, + Matches: 0, + Histories: []*v1.HorseDetail_History{}, + }, nil +} + +type raceStoreMock struct { + handler.RaceStore + mock.Mock +} + +func (r *raceStoreMock) GetByID(id uint32) (*v1.RaceDetail, error) { + rd := &v1.RaceDetail{ + Data: &v1.Race{Id: id, Name: "ホゲ", Order: 1, Start: ×tamppb.Timestamp{}, IsFinished: false}, + VoteBegin: ×tamppb.Timestamp{}, + VoteEnd: ×tamppb.Timestamp{}, + } + return rd, nil +} +func (r *raceStoreMock) Create(req *v1.RaceDetail) error { return req.ValidateAll() } +func (r *raceStoreMock) Update(req *v1.RaceDetail) error { return req.ValidateAll() } + +type auth struct { + authorizer.AdminAuthorizer + mock.Mock +} + +func (a *auth) Verify(j string) (username string, ok bool, err error) { + args := a.Called(j) + return args.String(0), args.Bool(1), args.Error(2) +} + +func TestEditRace(t *testing.T) { + a := &auth{} + a.On("Verify", "token").Return("ok", true, nil) + store := handler.DataStore{Race: &raceStoreMock{}, Horse: &horseStoreMock{}} + r, err := handler.NewRaceServer(store, a) + require.NotNil(t, r) + require.NoError(t, err) + + res, err := r.EditRace(context.TODO(), connect.NewRequest(&v1.EditRaceRequest{ + Id: 1, + Members: []uint32{1, 2, 3, 4}, + AdminJwt: &v1.JWT{Token: "token"}, + })) + assert.NoError(t, err) + assert.NotNil(t, res) +} diff --git a/manifests/flux-system/gotk-components.yaml b/manifests/flux-system/gotk-components.yaml index 155201c4f..874a4b996 100644 --- a/manifests/flux-system/gotk-components.yaml +++ b/manifests/flux-system/gotk-components.yaml @@ -7640,7 +7640,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - image: ghcr.io/fluxcd/helm-controller:v0.25.0 + image: ghcr.io/fluxcd/helm-controller:v0.26.0 imagePullPolicy: IfNotPresent livenessProbe: httpGet: @@ -7723,7 +7723,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - image: ghcr.io/fluxcd/image-automation-controller:v0.26.0 + image: ghcr.io/fluxcd/image-automation-controller:v0.26.1 imagePullPolicy: IfNotPresent livenessProbe: httpGet: @@ -7806,7 +7806,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - image: ghcr.io/fluxcd/image-reflector-controller:v0.22.0 + image: ghcr.io/fluxcd/image-reflector-controller:v0.22.1 imagePullPolicy: IfNotPresent livenessProbe: httpGet: @@ -7893,7 +7893,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - image: ghcr.io/fluxcd/kustomize-controller:v0.29.0 + image: ghcr.io/fluxcd/kustomize-controller:v0.30.0 imagePullPolicy: IfNotPresent livenessProbe: httpGet: @@ -7975,7 +7975,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - image: ghcr.io/fluxcd/notification-controller:v0.27.0 + image: ghcr.io/fluxcd/notification-controller:v0.28.0 imagePullPolicy: IfNotPresent livenessProbe: httpGet: @@ -8070,7 +8070,7 @@ spec: fieldPath: metadata.namespace - name: TUF_ROOT value: /tmp/.sigstore - image: ghcr.io/fluxcd/source-controller:v0.30.1 + image: ghcr.io/fluxcd/source-controller:v0.31.0 imagePullPolicy: IfNotPresent livenessProbe: httpGet: diff --git a/manifests/manifests/api-server/api.yaml b/manifests/manifests/api-server/api.yaml index e7696177c..d8b223cbc 100644 --- a/manifests/manifests/api-server/api.yaml +++ b/manifests/manifests/api-server/api.yaml @@ -29,7 +29,7 @@ spec: name: database containers: - name: api - image: ghcr.io/ueckoken/chofu-race-course-api:7f507d5-1666276125 # {"$imagepolicy": "flux-system:api"} + image: ghcr.io/ueckoken/chofu-race-course-api:2d6b32d-1666277363 # {"$imagepolicy": "flux-system:api"} ports: - containerPort: 8080 volumeMounts: diff --git a/manifests/manifests/nextjs/next.yaml b/manifests/manifests/nextjs/next.yaml index 2d7d859c4..174c3e1e5 100644 --- a/manifests/manifests/nextjs/next.yaml +++ b/manifests/manifests/nextjs/next.yaml @@ -22,7 +22,7 @@ spec: spec: containers: - name: webapp - image: ghcr.io/ueckoken/chofu-race-course-webapp:7f507d5-1666276114 # {"$imagepolicy": "flux-system:webapp"} + image: ghcr.io/ueckoken/chofu-race-course-webapp:2d6b32d-1666277396 # {"$imagepolicy": "flux-system:webapp"} ports: - containerPort: 3000 --- diff --git a/proto/spec/v1/userdata.proto b/proto/spec/v1/userdata.proto index 8d367544a..7a238bbbc 100644 --- a/proto/spec/v1/userdata.proto +++ b/proto/spec/v1/userdata.proto @@ -16,6 +16,7 @@ service UserDataService { // 管理者としてログインを試みる rpc LoginAsAdmin(LoginAsAdminRequest) returns (LoginAsAdminResponse) {} } + // ユーザを表現する型 message User { // ユーザID。他のIDはuint32であるが、ユーザIDのみJWTを使う都合上string。 @@ -30,11 +31,10 @@ message Users { message UserDataRequest { JWT jwt = 1 [(validate.rules).message.required = true]; } + // JWTトークン message JWT { - string token = 1 [(validate.rules).string = { - min_len: 1 - }]; + string token = 1 [(validate.rules).string = {min_len: 1}]; } message UserDataResponse { User user = 1; @@ -79,9 +79,7 @@ message HorseDetail { } // 拡張子 ImageType type = 1 [(validate.rules).enum = { - not_in: [ - 0 - ], + not_in: [0], defined_only: true, }]; // 画像のデータ bytes(img) @@ -124,6 +122,7 @@ message AllHorseDataResponse { // 登録している馬が1頭もいない場合はエラーではなく[]を返す。 repeated Horse horses = 1; } + // HorseDetailの初期値 id: id++, image: null, wins: 0, matches: 0, next: null, // histories: [] message RegisterHorseRequest { @@ -184,9 +183,7 @@ message RaceOrder { uint32 order = 1 [(validate.rules).uint32.gte = 1]; NoteType note = 2 [(validate.rules).enum = { defined_only: true, - not_in: [ - 0 - ] + not_in: [0] }]; } } @@ -194,10 +191,10 @@ message RaceDetail { Race data = 1 [(validate.rules).message.required = true]; string description = 2; message Member { - RaceOrder order = 1 [(validate.rules).message.required = true]; - Horse horse = 2 [(validate.rules).message.required = true]; - double odds = 3 [(validate.rules).double.gte = 1]; - uint32 popularity = 4 [(validate.rules).uint32.gte = 1]; + RaceOrder order = 1; + Horse horse = 2; + double odds = 3; + uint32 popularity = 4; } repeated Member members = 4; google.protobuf.Timestamp vote_begin = 5 [(validate.rules).timestamp.required = true]; @@ -217,6 +214,7 @@ message AllRaceDataRequest {} message AllRaceDataResponse { repeated Race races = 1; } + // RaceDetailの初期値 id: id++, is_finished: false, members: [], vote_begin: // start - n, vote_end: start - m message RegisterRaceRequest { @@ -239,6 +237,7 @@ message RegisterRaceResultRequest { JWT admin_jwt = 3 [(validate.rules).message.required = true]; } message RegisterRaceResultResponse {} + // 値が入ってたら更新する。 message EditRaceRequest { // 対象を指定するため必須 @@ -248,8 +247,8 @@ message EditRaceRequest { optional uint32 order = 3; optional google.protobuf.Timestamp start = 4; optional string description = 5; - // 出走表決定も着順確定も同じフィールドを使うけどとりあえずは運用でカバーします - repeated RaceDetail.Member members = 6; + // 馬のidの配列で指定 + repeated uint32 members = 6; // admin JWT JWT admin_jwt = 7 [(validate.rules).message.required = true]; }