mirror of
https://github.com/valitydev/liminator-proto.git
synced 2024-11-06 02:35:16 +00:00
TD-955: Redecorate LimitRequest. Add additional exceptions (#5)
This commit is contained in:
parent
63529e6608
commit
3e2cc0182b
2
.github/workflows/erlang-pr.yml
vendored
2
.github/workflows/erlang-pr.yml
vendored
@ -10,7 +10,7 @@ jobs:
|
||||
uses: valitydev/erlang-workflows/.github/workflows/erlang-simple-build.yml@v1
|
||||
with:
|
||||
otp-version: 24
|
||||
rebar-version: 3
|
||||
rebar-version: 3.18
|
||||
use-thrift: true
|
||||
thrift-version: 0.14.2.3
|
||||
run-eunit: false
|
||||
|
@ -17,6 +17,9 @@ typedef i64 Value
|
||||
typedef i64 Timestamp
|
||||
|
||||
exception LimitNotFound {}
|
||||
exception OperationNotFound {}
|
||||
exception OperationAlreadyInFinalState {}
|
||||
exception DuplicateOperation {}
|
||||
exception DuplicateLimitName {}
|
||||
|
||||
struct CreateLimitRequest {
|
||||
@ -25,9 +28,9 @@ struct CreateLimitRequest {
|
||||
}
|
||||
|
||||
struct LimitRequest {
|
||||
1: required LimitName limit_name
|
||||
2: required OperationId operation_id
|
||||
3: required Value value
|
||||
1: required OperationId operation_id
|
||||
2: required Value value
|
||||
3: required list<LimitName> limit_names
|
||||
}
|
||||
|
||||
struct LimitResponse {
|
||||
@ -42,14 +45,18 @@ service LiminatorService {
|
||||
LimitResponse Create(CreateLimitRequest request) throws (1: DuplicateLimitName ex1)
|
||||
|
||||
/* Добавить значение */
|
||||
list<LimitResponse> Hold(list<LimitRequest> request) throws (1: LimitNotFound ex1)
|
||||
list<LimitResponse> Hold(LimitRequest request)
|
||||
throws (1: LimitNotFound ex1, 2: DuplicateOperation ex2, 3: OperationAlreadyInFinalState ex3)
|
||||
|
||||
/* Применить значение */
|
||||
bool Commit(list<LimitRequest> request) throws (1: LimitNotFound ex1)
|
||||
void Commit(LimitRequest request) throws (1: LimitNotFound ex1, 2: OperationNotFound ex2)
|
||||
|
||||
/* Отменить добавление */
|
||||
bool Rollback(list<LimitRequest> request) throws (1: LimitNotFound ex1)
|
||||
void Rollback(LimitRequest request) throws (1: LimitNotFound ex1, 2: OperationNotFound ex2)
|
||||
|
||||
/* Получить значение */
|
||||
list<LimitResponse> Get(list<LimitName> limit_names) throws (1: LimitNotFound ex1)
|
||||
/* Получить значения лимитов */
|
||||
list<LimitResponse> Get(LimitRequest request) throws (1: LimitNotFound ex1)
|
||||
|
||||
/* Получить актуальные значения лимитов на текущий момент */
|
||||
list<LimitResponse> GetLastLimitsValues(list<LimitName> limit_names) throws (1: LimitNotFound ex1)
|
||||
}
|
Loading…
Reference in New Issue
Block a user