Skip to content

Commit

Permalink
Update buf.gen.yaml and page.tsx files
Browse files Browse the repository at this point in the history
  • Loading branch information
csenet committed Nov 21, 2023
1 parent 4da1bbf commit 18de977
Show file tree
Hide file tree
Showing 13 changed files with 1,257 additions and 71 deletions.
136 changes: 68 additions & 68 deletions backend/spec/state/v1/statev1connect/state.connect.go

Large diffs are not rendered by default.

22 changes: 21 additions & 1 deletion frontend/dashboard/app/test/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
"use client";
import {createPromiseClient} from "@connectrpc/connect";
import {StateManagerService} from "@/proto/state/v1/state_connectweb";
import {createConnectTransport} from "@bufbuild/connect-web";

export default function Test() {

const transport = createConnectTransport(
{
// baseUrl: process.env.NEXT_PUBLIC_API_ENDPOINT!,
baseUrl: "http://localhost:8080",
});
const sendData = () => {
(async () => {
const client = createPromiseClient(StateManagerService, transport);
const res = await client.getBlockStates({});
console.log(res);
})();
}

return (
<div>

<h1>Test</h1>
<button onClick={sendData}>Test</button>
</div>
)
}
163 changes: 163 additions & 0 deletions frontend/dashboard/proto/state/v1/block_pb.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
//
//Block Proto
//閉塞の状態を扱うプロトコル

// @generated by protoc-gen-es v1.4.2 with parameter "target=dts+js"
// @generated from file state/v1/block.proto (package state.v1, syntax proto3)
/* eslint-disable */
// @ts-nocheck

import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
import { Message, proto3 } from "@bufbuild/protobuf";

/**
* @generated from enum state.v1.BlockStateEnum
*/
export declare enum BlockStateEnum {
/**
* @generated from enum value: BLOCK_STATE_UNKNOWN = 0;
*/
BLOCK_STATE_UNKNOWN = 0,

/**
* 閉塞が開の状態(列車がいない)
*
* @generated from enum value: BLOCK_STATE_OPEN = 1;
*/
BLOCK_STATE_OPEN = 1,

/**
* 閉塞が閉の状態(列車がいない)
*
* @generated from enum value: BLOCK_STATE_CLOSE = 2;
*/
BLOCK_STATE_CLOSE = 2,
}

/**
* 閉塞の状態
*
* @generated from message state.v1.BlockState
*/
export declare class BlockState extends Message<BlockState> {
/**
* 閉塞のID
*
* @generated from field: string block_id = 1;
*/
blockId: string;

/**
* 閉塞の状態
*
* @generated from field: state.v1.BlockStateEnum state = 2;
*/
state: BlockStateEnum;

constructor(data?: PartialMessage<BlockState>);

static readonly runtime: typeof proto3;
static readonly typeName = "state.v1.BlockState";
static readonly fields: FieldList;

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): BlockState;

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): BlockState;

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): BlockState;

static equals(a: BlockState | PlainMessage<BlockState> | undefined, b: BlockState | PlainMessage<BlockState> | undefined): boolean;
}

/**
*
* GetBlockStates : 閉塞の状態を取得するAPI
*
* @generated from message state.v1.GetBlockStatesRequest
*/
export declare class GetBlockStatesRequest extends Message<GetBlockStatesRequest> {
constructor(data?: PartialMessage<GetBlockStatesRequest>);

static readonly runtime: typeof proto3;
static readonly typeName = "state.v1.GetBlockStatesRequest";
static readonly fields: FieldList;

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GetBlockStatesRequest;

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): GetBlockStatesRequest;

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): GetBlockStatesRequest;

static equals(a: GetBlockStatesRequest | PlainMessage<GetBlockStatesRequest> | undefined, b: GetBlockStatesRequest | PlainMessage<GetBlockStatesRequest> | undefined): boolean;
}

/**
* @generated from message state.v1.GetBlockStatesResponse
*/
export declare class GetBlockStatesResponse extends Message<GetBlockStatesResponse> {
/**
* @generated from field: repeated state.v1.BlockState states = 1;
*/
states: BlockState[];

constructor(data?: PartialMessage<GetBlockStatesResponse>);

static readonly runtime: typeof proto3;
static readonly typeName = "state.v1.GetBlockStatesResponse";
static readonly fields: FieldList;

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GetBlockStatesResponse;

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): GetBlockStatesResponse;

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): GetBlockStatesResponse;

static equals(a: GetBlockStatesResponse | PlainMessage<GetBlockStatesResponse> | undefined, b: GetBlockStatesResponse | PlainMessage<GetBlockStatesResponse> | undefined): boolean;
}

/**
*
* UpdateBLockState: 閉塞の状態を更新するAPI
*
* @generated from message state.v1.UpdateBlockStateRequest
*/
export declare class UpdateBlockStateRequest extends Message<UpdateBlockStateRequest> {
/**
* @generated from field: state.v1.BlockState state = 1;
*/
state?: BlockState;

constructor(data?: PartialMessage<UpdateBlockStateRequest>);

static readonly runtime: typeof proto3;
static readonly typeName = "state.v1.UpdateBlockStateRequest";
static readonly fields: FieldList;

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): UpdateBlockStateRequest;

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): UpdateBlockStateRequest;

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): UpdateBlockStateRequest;

static equals(a: UpdateBlockStateRequest | PlainMessage<UpdateBlockStateRequest> | undefined, b: UpdateBlockStateRequest | PlainMessage<UpdateBlockStateRequest> | undefined): boolean;
}

/**
* @generated from message state.v1.UpdateBlockStateResponse
*/
export declare class UpdateBlockStateResponse extends Message<UpdateBlockStateResponse> {
constructor(data?: PartialMessage<UpdateBlockStateResponse>);

static readonly runtime: typeof proto3;
static readonly typeName = "state.v1.UpdateBlockStateResponse";
static readonly fields: FieldList;

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): UpdateBlockStateResponse;

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): UpdateBlockStateResponse;

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): UpdateBlockStateResponse;

static equals(a: UpdateBlockStateResponse | PlainMessage<UpdateBlockStateResponse> | undefined, b: UpdateBlockStateResponse | PlainMessage<UpdateBlockStateResponse> | undefined): boolean;
}

78 changes: 78 additions & 0 deletions frontend/dashboard/proto/state/v1/block_pb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
//
//Block Proto
//閉塞の状態を扱うプロトコル

// @generated by protoc-gen-es v1.4.2 with parameter "target=dts+js"
// @generated from file state/v1/block.proto (package state.v1, syntax proto3)
/* eslint-disable */
// @ts-nocheck

import { proto3 } from "@bufbuild/protobuf";

/**
* @generated from enum state.v1.BlockStateEnum
*/
export const BlockStateEnum = proto3.makeEnum(
"state.v1.BlockStateEnum",
[
{no: 0, name: "BLOCK_STATE_UNKNOWN"},
{no: 1, name: "BLOCK_STATE_OPEN"},
{no: 2, name: "BLOCK_STATE_CLOSE"},
],
);

/**
* 閉塞の状態
*
* @generated from message state.v1.BlockState
*/
export const BlockState = proto3.makeMessageType(
"state.v1.BlockState",
() => [
{ no: 1, name: "block_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 2, name: "state", kind: "enum", T: proto3.getEnumType(BlockStateEnum) },
],
);

/**
*
* GetBlockStates : 閉塞の状態を取得するAPI
*
* @generated from message state.v1.GetBlockStatesRequest
*/
export const GetBlockStatesRequest = proto3.makeMessageType(
"state.v1.GetBlockStatesRequest",
[],
);

/**
* @generated from message state.v1.GetBlockStatesResponse
*/
export const GetBlockStatesResponse = proto3.makeMessageType(
"state.v1.GetBlockStatesResponse",
() => [
{ no: 1, name: "states", kind: "message", T: BlockState, repeated: true },
],
);

/**
*
* UpdateBLockState: 閉塞の状態を更新するAPI
*
* @generated from message state.v1.UpdateBlockStateRequest
*/
export const UpdateBlockStateRequest = proto3.makeMessageType(
"state.v1.UpdateBlockStateRequest",
() => [
{ no: 1, name: "state", kind: "message", T: BlockState },
],
);

/**
* @generated from message state.v1.UpdateBlockStateResponse
*/
export const UpdateBlockStateResponse = proto3.makeMessageType(
"state.v1.UpdateBlockStateResponse",
[],
);

Loading

0 comments on commit 18de977

Please sign in to comment.