CategoriesServiceProtoRpc.proto 5.36 KB
syntax = "proto3";

option java_multiple_files = true;
option java_package = "com.infoloop.tianting";
option java_outer_classname = "CategoriesServiceProto";
option objc_class_prefix = "OP";

package com.infoloop.tianting;

service CategoriesServiceProtoRpc {
  rpc GetCategoriesById (GetCategoriesServiceByIdRpcRequest) returns (GetCategoriesServiceByIdRpcResponse) {}
  rpc GetCategoriesByIds (GetCategoriesServiceByIdsRpcRequest) returns (GetCategoriesServiceByIdsRpcResponse) {}
  rpc QueryCategoriesByCondition (QueryCategoriesServiceByConditionRpcRequest) returns (QueryCategoriesServiceByConditionRpcResponse) {}
  rpc CreateCategories (CreateCategoriesServiceRpcRequest) returns (CreateCategoriesServiceRpcResponse) {}
  rpc BatchCreateCategories (BatchCreateCategoriesServiceRpcRequest) returns (BatchCreateCategoriesServiceRpcResponse) {}
  rpc UpdateCategories (UpdateCategoriesServiceRpcRequest) returns (UpdateCategoriesServiceRpcResponse) {}
  rpc BatchUpdateCategories (BatchUpdateCategoriesServiceRpcRequest) returns (BatchUpdateCategoriesServiceRpcResponse) {}
  rpc DeleteCategoriesByIds (DeleteCategoriesServiceByIdsRpcRequest) returns (DeleteCategoriesServiceRpcResponse) {}
  // 查询品类
  rpc QueryCategoriesAll (QueryCategoriesServiceAllRpcRequest) returns (QueryCategoriesServiceAllRpcResponse) {}

}

message QueryCategoriesServiceAllRpcRequest {
  int32 enterpriseId = 1;
}

message QueryCategoriesServiceAllRpcResponse {
  repeated SingleCategoriesAllRpcResponse responses = 1;
}
message SingleCategoriesResponse {
  int32 id = 1;
  int32 enterpriseId = 2;
  int32 parentId = 3;
  string code = 4;
  string name = 5;
  int32 status = 6;
  int32 standardCategoryId = 7;
  int64 createdAt = 8;
  int64 updatedAt = 9;
  bool isDeleted = 10;
  int64 deletedAt = 11;
  bool isBOM = 12;
  bool isImageSet = 13;
  string image = 14;
  int32 sourceType = 15;
  int32 sourceId = 16;
}
message GetCategoriesServiceByIdRpcRequest {
  int32 id = 1;
  int32 enterpriseId = 2;
  bool includeDeleted = 3;
}

message GetCategoriesServiceByIdRpcResponse {
  SingleCategoriesServiceRpcResponse response = 1;
}
message SingleCategoriesAllRpcResponse {
  int32 id = 1;
  int32 enterpriseId = 2;
  string code = 3;
  string name = 4;
  int64 createdAt = 5;
  int64 updatedAt = 6;
}
message SingleCategoriesServiceRpcResponse {
  int32 id = 1;
  int32 enterpriseId = 2;
  string code = 3;
  string name = 4;
  int32 parentId = 5;
  int32 status = 6;
  int32 standardCategoryId = 7;
  int64 createdAt = 8;
  int64 updatedAt = 9;
  bool isDeleted = 10;
  int64 deletedAt = 11;
  bool isBOM = 12;
  bool isImageSet = 13;
  string image = 14;
  int32 sourceType = 15;
  int32 sourceId = 16;

}

message GetCategoriesServiceByIdsRpcRequest {
  repeated int32 ids = 1;
  int32 enterpriseId = 2;
  bool includeDeleted = 3;
}

message GetCategoriesServiceByIdsRpcResponse {
  repeated SingleCategoriesServiceRpcResponse responses = 1;
}

message QueryCategoriesServiceByConditionRpcRequest {
  int32 enterpriseId = 1;
  bool shouldFilterDish = 2;
  string dish = 3;
  bool includeDeleted = 4;
  bool shouldFilterFlag = 5;
  bool shouldFilterCode = 6;
  string code = 7;
  bool shouldFilterName = 8;
  string name = 9;
  DishCategoriesType type = 10;
}

message QueryCategoriesServiceByConditionRpcResponse {
  repeated SingleCategoriesServiceRpcResponse responses = 1;
}

message CreateCategoriesServiceRpcRequest {
  CategoriesServiceCreation creation = 1;
  int32 enterpriseId = 2;
  int32 createdBy = 3;
  int32 creationSource = 4;
}

message CategoriesServiceCreation{
  string code = 1;
  string name = 2;
  int32 parentId = 3;
  int32 status = 4;
  int32 standardCategoryId = 5;
  int64 createdAt = 6;
  int64 updatedAt = 7;
  bool isDeleted = 8;
  int64 deletedAt = 9;
  bool isBOM = 10;
  bool isImageSet = 11;
  string image = 12;
  int32 sourceType = 13;
  int32 sourceId = 14;
  int32 createdBy = 15;
}
enum DishCategoriesType{
  UNKNOWN_CATEGORIES_TYPE = 0;
  DISH_CATEGORIES_TYPE = 1; // 菜品品类
}
message CreateCategoriesServiceRpcResponse {
  int32 id = 1;
  bool isCreated = 2;
}

message BatchCreateCategoriesServiceRpcRequest {
  repeated CategoriesServiceCreation creations = 1;
  int32 enterpriseId = 2;
  int32 createdBy = 3;
  int32 creationSource = 4;
}

message BatchCreateCategoriesServiceRpcResponse {
  repeated int32 ids = 1;
  bool isCreated = 2;
}

message UpdateCategoriesServiceRpcRequest {
  CategoriesServiceModification modification = 1;
  int32 enterpriseId = 2;
  int32 updatedBy = 3;
  int32 updateSource = 4;
}

message CategoriesServiceModification {
  int32 id = 1;
  bool shouldFilterName = 2;
  string name = 3;
  int32 parentId = 4;
  bool  shouldFilterParentId = 5;
  DishCategoriesStatus status = 6;
  bool  shouldFilterStatus = 7;

}
enum DishCategoriesStatus{
  UNKNOWN_CATEGORIES_STATUS = 0;
  ENABLE_CATEGORIES_STATUS = 1; // 启用
  DEACTIVATE_CATEGORIES_STATUS = 3; //停用
}
message UpdateCategoriesServiceRpcResponse {
  bool isUpdated = 1;
}

message BatchUpdateCategoriesServiceRpcRequest {
  repeated CategoriesServiceModification modifications = 1;
  int32 enterpriseId = 2;
  int32 updatedBy = 3;
  int32 updateSource = 4;
}

message BatchUpdateCategoriesServiceRpcResponse {
  bool isUpdated = 1;
}

message DeleteCategoriesServiceByIdsRpcRequest {
  repeated int32 ids = 1;
  int32 enterpriseId = 2;
  int32 updatedBy = 3;
  int32 updateSource = 4;
}

message DeleteCategoriesServiceRpcResponse {
  bool isDeleted = 1;
}