Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- syntax = "proto3";
- enum QRType {
- TARGET = 1;
- INTERSECTION = 2;
- }
- message Location {
- string name = 2;
- repeated QR qrs = 1;
- }
- message Array2D {}
- message QR {
- int32 id = 1;
- int32 map_y = 5;
- int32 map_x = 6;
- QRType type = 4;
- }
- // GET /search GetSearchRequest : GetSearchResponse
- // ini gunanya buat search di autocomplete, given a query string, return array of search result
- // yang di return cuma QR dengan type target, type intersection gk di return
- message GetSearchRequest {
- string query = 1;
- }
- message GetSearchResponse {
- message SearchResult {
- int32 id = 1; // QR code id
- string name = 2;
- }
- repeated SearchResult result = 1;
- }
- // GET /query/{qr_id}/ None : GetQueryQRResponse
- // ini gunanya buat given sebuah QR, tanpa target, return semua general direction dari posisi QR ini
- // yang di return adalah GeneralArrow untuk QR ini
- message GetQueryQRResponse {
- message GeneralArrow {
- int32 id = 1;
- string name = 2;
- int32 direction = 3; // float multiplied by 10000
- }
- repeated GeneralArrow result = 1;
- }
- // GET /query/{qr_id}/target/{target_qr_id} None : GetQueryTargetQRResponse
- // ini gunanya adalah untuk query direction yang dimunculin di sebuah qr dengan id {qr_id} untuk mencapai qr {target_qr_id}
- message GetQueryTargetQRResponse {
- QR next_qr = 1;
- int32 direction = 3; // float multiplied by 10000
- }
- // GET /query/{qr_id}/map None : GetQRMapResponse
- // ini gunanya adalah untuk ngambil map building dimana qr dengan id {qr_id} berada
- message GetQRMapResponse {
- // sementara pake URL dulu, nanti kalo emang mau dibikin grid baru diganti
- string url = 1;
- }
- // GET /admin/map : GetMapResponse
- // ini gunanya buat ambil map yg udh ke save
- message GetMapResponse {
- message TargetQR {
- int32 y = 1;
- int32 x = 2;
- }
- message Location {
- string name = 1;
- repeated QR qrs = 2;
- }
- Array2D grid = 1; // . # o x
- repeated Location locations = 2;
- }
- // POST /admin/map/ EditMapRequest : GetMapResponse
- // ini gunanya buat edit map
- message EditMapRequest {
- message TargetQR {
- int32 y = 1;
- int32 x = 2;
- }
- message Location {
- string name = 1;
- repeated QR qrs = 2;
- }
- Array2D grid = 1; // . # o x
- repeated Location locations = 2;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement