syntax = "proto3";

option go_package ="./pb";

package pb;

// ------------------------------------ 
// Messages
// ------------------------------------ 

//--------------------------------games--------------------------------
message Games {
  int64 id = 1; //id
  string name = 2; //name
  string icon = 3; //icon
  string category = 4; //category
  int64 sortOrder = 5; //sortOrder
  bool isActive = 6; //isActive
  int64 createdAt = 7; //createdAt
  int64 updatedAt = 8; //updatedAt
}

message AddGamesReq {
  string name = 1; //name
  string icon = 2; //icon
  string category = 3; //category
  int64 sortOrder = 4; //sortOrder
  bool isActive = 5; //isActive
  int64 createdAt = 6; //createdAt
  int64 updatedAt = 7; //updatedAt
}

message AddGamesResp {
  Games games = 1; //games
}

message UpdateGamesReq {
  int64 id = 1; //id
  string name = 2; //name
  string icon = 3; //icon
  string category = 4; //category
  int64 sortOrder = 5; //sortOrder
  bool isActive = 6; //isActive
  int64 createdAt = 7; //createdAt
  int64 updatedAt = 8; //updatedAt
}

message UpdateGamesResp {
}

message DelGamesReq {
  int64 id = 1; //id
}

message DelGamesResp {
}

message GetGamesByIdReq {
  int64 id = 1; //id
}

message GetGamesByIdResp {
  Games games = 1; //games
}

message SearchGamesReq {
  int64 offset = 1; //offset
  int64 limit = 2; //limit
  int64 id = 3; //id
  optional string name = 4; //name
  optional string icon = 5; //icon
  optional string category = 6; //category
  optional int64 sortOrder = 7; //sortOrder
  optional bool isActive = 8; //isActive
  optional int64 createdAt = 9; //createdAt
  optional int64 updatedAt = 10; //updatedAt
}

message SearchGamesResp {
  repeated Games games = 1; //games
}



// ------------------------------------ 
// Rpc Func
// ------------------------------------ 

service GameService {

	 //-----------------------games----------------------- 
	 rpc AddGames(AddGamesReq) returns (AddGamesResp); 
	 rpc UpdateGames(UpdateGamesReq) returns (UpdateGamesResp); 
	 rpc DelGames(DelGamesReq) returns (DelGamesResp); 
	 rpc GetGamesById(GetGamesByIdReq) returns (GetGamesByIdResp); 
	 rpc SearchGames(SearchGamesReq) returns (SearchGamesResp); 

}
