Generator Changes at 11/16/2025 12:48:45 AM +03:30
This commit is contained in:
108
src/CMSMicroservice.Protobuf/Protos/contract.proto
Normal file
108
src/CMSMicroservice.Protobuf/Protos/contract.proto
Normal file
@@ -0,0 +1,108 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package contract;
|
||||
|
||||
import "public_messages.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "google/protobuf/duration.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.Contract";
|
||||
|
||||
service ContractContract
|
||||
{
|
||||
rpc CreateNewContract(CreateNewContractRequest) returns (CreateNewContractResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/CreateNewContract"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc UpdateContract(UpdateContractRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
put: "/UpdateContract"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc DeleteContract(DeleteContractRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
delete: "/DeleteContract"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc GetContract(GetContractRequest) returns (GetContractResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetContract"
|
||||
|
||||
};
|
||||
};
|
||||
rpc GetAllContractByFilter(GetAllContractByFilterRequest) returns (GetAllContractByFilterResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetAllContractByFilter"
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
message CreateNewContractRequest
|
||||
{
|
||||
string title = 1;
|
||||
string description = 2;
|
||||
string html_content = 3;
|
||||
Unknown type = 4;
|
||||
}
|
||||
message CreateNewContractResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message UpdateContractRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
string title = 2;
|
||||
string description = 3;
|
||||
string html_content = 4;
|
||||
Unknown type = 5;
|
||||
}
|
||||
message DeleteContractRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message GetContractRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message GetContractResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
string title = 2;
|
||||
string description = 3;
|
||||
string html_content = 4;
|
||||
Unknown type = 5;
|
||||
}
|
||||
message GetAllContractByFilterRequest
|
||||
{
|
||||
messages.PaginationState pagination_state = 1;
|
||||
google.protobuf.StringValue sort_by = 2;
|
||||
GetAllContractByFilterFilter filter = 3;
|
||||
}
|
||||
message GetAllContractByFilterFilter
|
||||
{
|
||||
google.protobuf.Int64Value id = 1;
|
||||
google.protobuf.StringValue title = 2;
|
||||
google.protobuf.StringValue description = 3;
|
||||
google.protobuf.StringValue html_content = 4;
|
||||
Unknown type = 5;
|
||||
}
|
||||
message GetAllContractByFilterResponse
|
||||
{
|
||||
messages.MetaData meta_data = 1;
|
||||
repeated GetAllContractByFilterResponseModel models = 2;
|
||||
}
|
||||
message GetAllContractByFilterResponseModel
|
||||
{
|
||||
int64 id = 1;
|
||||
string title = 2;
|
||||
string description = 3;
|
||||
string html_content = 4;
|
||||
Unknown type = 5;
|
||||
}
|
||||
@@ -36,7 +36,6 @@ message CreateNewOtpTokenRequest
|
||||
{
|
||||
string mobile = 1;
|
||||
string purpose = 2;
|
||||
google.protobuf.StringValue extra_info = 3;
|
||||
}
|
||||
message CreateNewOtpTokenResponse
|
||||
{
|
||||
|
||||
108
src/CMSMicroservice.Protobuf/Protos/usercontract.proto
Normal file
108
src/CMSMicroservice.Protobuf/Protos/usercontract.proto
Normal file
@@ -0,0 +1,108 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package usercontract;
|
||||
|
||||
import "public_messages.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "google/protobuf/duration.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.UserContract";
|
||||
|
||||
service UserContractContract
|
||||
{
|
||||
rpc CreateNewUserContract(CreateNewUserContractRequest) returns (CreateNewUserContractResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/CreateNewUserContract"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc UpdateUserContract(UpdateUserContractRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
put: "/UpdateUserContract"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc DeleteUserContract(DeleteUserContractRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
delete: "/DeleteUserContract"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc GetUserContract(GetUserContractRequest) returns (GetUserContractResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetUserContract"
|
||||
|
||||
};
|
||||
};
|
||||
rpc GetAllUserContractByFilter(GetAllUserContractByFilterRequest) returns (GetAllUserContractByFilterResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetAllUserContractByFilter"
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
message CreateNewUserContractRequest
|
||||
{
|
||||
int64 user_id = 1;
|
||||
int64 contract_id = 2;
|
||||
string sign_guid = 3;
|
||||
string signed_pdf_file = 4;
|
||||
}
|
||||
message CreateNewUserContractResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message UpdateUserContractRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 user_id = 2;
|
||||
int64 contract_id = 3;
|
||||
string sign_guid = 4;
|
||||
string signed_pdf_file = 5;
|
||||
}
|
||||
message DeleteUserContractRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message GetUserContractRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message GetUserContractResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 user_id = 2;
|
||||
int64 contract_id = 3;
|
||||
string sign_guid = 4;
|
||||
string signed_pdf_file = 5;
|
||||
}
|
||||
message GetAllUserContractByFilterRequest
|
||||
{
|
||||
messages.PaginationState pagination_state = 1;
|
||||
google.protobuf.StringValue sort_by = 2;
|
||||
GetAllUserContractByFilterFilter filter = 3;
|
||||
}
|
||||
message GetAllUserContractByFilterFilter
|
||||
{
|
||||
google.protobuf.Int64Value id = 1;
|
||||
google.protobuf.Int64Value user_id = 2;
|
||||
google.protobuf.Int64Value contract_id = 3;
|
||||
google.protobuf.StringValue sign_guid = 4;
|
||||
google.protobuf.StringValue signed_pdf_file = 5;
|
||||
}
|
||||
message GetAllUserContractByFilterResponse
|
||||
{
|
||||
messages.MetaData meta_data = 1;
|
||||
repeated GetAllUserContractByFilterResponseModel models = 2;
|
||||
}
|
||||
message GetAllUserContractByFilterResponseModel
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 user_id = 2;
|
||||
int64 contract_id = 3;
|
||||
string sign_guid = 4;
|
||||
string signed_pdf_file = 5;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.Contract;
|
||||
namespace CMSMicroservice.Protobuf.Validator.Contract;
|
||||
|
||||
public class CreateNewContractRequestValidator : AbstractValidator<CreateNewContractRequest>
|
||||
{
|
||||
public CreateNewContractRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Title)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.Description)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.HtmlContent)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.Type)
|
||||
.IsInEnum()
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<CreateNewContractRequest>.CreateWithOptions((CreateNewContractRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.Contract;
|
||||
namespace CMSMicroservice.Protobuf.Validator.Contract;
|
||||
|
||||
public class DeleteContractRequestValidator : AbstractValidator<DeleteContractRequest>
|
||||
{
|
||||
public DeleteContractRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<DeleteContractRequest>.CreateWithOptions((DeleteContractRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.Contract;
|
||||
namespace CMSMicroservice.Protobuf.Validator.Contract;
|
||||
|
||||
public class GetAllContractByFilterRequestValidator : AbstractValidator<GetAllContractByFilterRequest>
|
||||
{
|
||||
public GetAllContractByFilterRequestValidator()
|
||||
{
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GetAllContractByFilterRequest>.CreateWithOptions((GetAllContractByFilterRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.Contract;
|
||||
namespace CMSMicroservice.Protobuf.Validator.Contract;
|
||||
|
||||
public class GetContractRequestValidator : AbstractValidator<GetContractRequest>
|
||||
{
|
||||
public GetContractRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GetContractRequest>.CreateWithOptions((GetContractRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.Contract;
|
||||
namespace CMSMicroservice.Protobuf.Validator.Contract;
|
||||
|
||||
public class UpdateContractRequestValidator : AbstractValidator<UpdateContractRequest>
|
||||
{
|
||||
public UpdateContractRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
RuleFor(model => model.Title)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.Description)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.HtmlContent)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.Type)
|
||||
.IsInEnum()
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<UpdateContractRequest>.CreateWithOptions((UpdateContractRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.UserContract;
|
||||
namespace CMSMicroservice.Protobuf.Validator.UserContract;
|
||||
|
||||
public class CreateNewUserContractRequestValidator : AbstractValidator<CreateNewUserContractRequest>
|
||||
{
|
||||
public CreateNewUserContractRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.UserId)
|
||||
.NotNull();
|
||||
RuleFor(model => model.ContractId)
|
||||
.NotNull();
|
||||
RuleFor(model => model.SignGuid)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.SignedPdfFile)
|
||||
.NotEmpty();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<CreateNewUserContractRequest>.CreateWithOptions((CreateNewUserContractRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.UserContract;
|
||||
namespace CMSMicroservice.Protobuf.Validator.UserContract;
|
||||
|
||||
public class DeleteUserContractRequestValidator : AbstractValidator<DeleteUserContractRequest>
|
||||
{
|
||||
public DeleteUserContractRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<DeleteUserContractRequest>.CreateWithOptions((DeleteUserContractRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.UserContract;
|
||||
namespace CMSMicroservice.Protobuf.Validator.UserContract;
|
||||
|
||||
public class GetAllUserContractByFilterRequestValidator : AbstractValidator<GetAllUserContractByFilterRequest>
|
||||
{
|
||||
public GetAllUserContractByFilterRequestValidator()
|
||||
{
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GetAllUserContractByFilterRequest>.CreateWithOptions((GetAllUserContractByFilterRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.UserContract;
|
||||
namespace CMSMicroservice.Protobuf.Validator.UserContract;
|
||||
|
||||
public class GetUserContractRequestValidator : AbstractValidator<GetUserContractRequest>
|
||||
{
|
||||
public GetUserContractRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<GetUserContractRequest>.CreateWithOptions((GetUserContractRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.UserContract;
|
||||
namespace CMSMicroservice.Protobuf.Validator.UserContract;
|
||||
|
||||
public class UpdateUserContractRequestValidator : AbstractValidator<UpdateUserContractRequest>
|
||||
{
|
||||
public UpdateUserContractRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
RuleFor(model => model.UserId)
|
||||
.NotNull();
|
||||
RuleFor(model => model.ContractId)
|
||||
.NotNull();
|
||||
RuleFor(model => model.SignGuid)
|
||||
.NotEmpty();
|
||||
RuleFor(model => model.SignedPdfFile)
|
||||
.NotEmpty();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<UpdateUserContractRequest>.CreateWithOptions((UpdateUserContractRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user