Skip to content

Commit

Permalink
Update good middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
kikakkz committed Sep 10, 2023
1 parent 493df64 commit 1b11a25
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ go 1.17
require (
github.com/NpoolPlatform/account-middleware v0.0.0-20230908122122-cd58a2b8c771
github.com/NpoolPlatform/appuser-middleware v0.0.0-20230513100509-b19f356ebd4b
github.com/NpoolPlatform/basal-middleware v0.0.0-20230518061816-62bd589c0f63
github.com/NpoolPlatform/basal-middleware v0.0.0-20230908131959-b37594a23afd
github.com/NpoolPlatform/chain-middleware v0.0.0-20230906092012-a63f3a7b0b54
github.com/NpoolPlatform/dtm-cluster v0.0.0-20230901092100-75e025eff821
github.com/NpoolPlatform/go-service-framework v0.0.0-20230814035104-e1466b5c157e
github.com/NpoolPlatform/good-middleware v0.0.0-20230908123355-e4a2233e306b
github.com/NpoolPlatform/good-middleware v0.0.0-20230910065023-298572ba5a77
github.com/NpoolPlatform/inspire-middleware v0.0.0-20230907035923-c90b50a84df2
github.com/NpoolPlatform/ledger-middleware v0.0.0-20230908093825-dace2fee13a1
github.com/NpoolPlatform/libent-cruder v0.0.0-20230825073905-d23e4d838f99
github.com/NpoolPlatform/message v0.0.0-20230908170250-6063a3722b70
github.com/NpoolPlatform/order-middleware v0.0.0-20230908170451-ffbcce45da8b
github.com/NpoolPlatform/message v0.0.0-20230910084107-20b881ec2c83
github.com/NpoolPlatform/order-middleware v0.0.0-20230910084334-a36daf34001f
github.com/NpoolPlatform/sphinx-proxy v0.0.0-20230216075025-a90a86bfd19b
github.com/dtm-labs/dtm v1.17.1
github.com/go-resty/resty/v2 v2.7.0
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,26 @@ github.com/NpoolPlatform/account-middleware v0.0.0-20230908122122-cd58a2b8c771 h
github.com/NpoolPlatform/account-middleware v0.0.0-20230908122122-cd58a2b8c771/go.mod h1:5Labnj7w3bY+FKWSDGu/bRasE2obtkfSbYlcrvYJaaI=
github.com/NpoolPlatform/appuser-middleware v0.0.0-20230513100509-b19f356ebd4b h1:YmlmVjzJLebnrNl9dtFiJ6bfgqoH++uFe91esScPanE=
github.com/NpoolPlatform/appuser-middleware v0.0.0-20230513100509-b19f356ebd4b/go.mod h1:BzT48sEK4KSO6Gy8VJQa5rOuO5JpXib/cmLGHWt4Aqc=
github.com/NpoolPlatform/basal-middleware v0.0.0-20230518061816-62bd589c0f63 h1:wQ+crGIMDqv7919i5slVz8liCjBhCZz8xZxHWC3N8uA=
github.com/NpoolPlatform/basal-middleware v0.0.0-20230518061816-62bd589c0f63/go.mod h1:3sHDVUUQHRkZsCiBFI6CdCL2HWf3cO7/E2DZU3nHMfE=
github.com/NpoolPlatform/basal-middleware v0.0.0-20230908131959-b37594a23afd h1:lAg78Zw3w8WbcJ+D9mMO0SdVPAzePNYL33Cqc9l4PP8=
github.com/NpoolPlatform/basal-middleware v0.0.0-20230908131959-b37594a23afd/go.mod h1:XN8xmZjgdG3M4NvPAx4eadIVok/LUJ76DlnQyXOy38M=
github.com/NpoolPlatform/chain-middleware v0.0.0-20230906092012-a63f3a7b0b54 h1:wnYxTar4XI8M+c7ECl52S9emUwiSDdf/etIlLcMv5L4=
github.com/NpoolPlatform/chain-middleware v0.0.0-20230906092012-a63f3a7b0b54/go.mod h1:y3bX+6Yt8cz5s6aQypnqbQzttbwVTOuhK++LU1OBvxA=
github.com/NpoolPlatform/dtm-cluster v0.0.0-20230901092100-75e025eff821 h1:JEoN8rpjyJOpbXXLhL5J6Fjw+/bOTwMNci6CL7G02zQ=
github.com/NpoolPlatform/dtm-cluster v0.0.0-20230901092100-75e025eff821/go.mod h1:ZBvGIj+zt7VT6WbnIeU/fhiI/dEoNK4JqcXE1EIblpQ=
github.com/NpoolPlatform/go-service-framework v0.0.0-20230814035104-e1466b5c157e h1:17BGexCmCdOOBXKYogP8RNE+pAHRu2N4LKq9znPJ4vc=
github.com/NpoolPlatform/go-service-framework v0.0.0-20230814035104-e1466b5c157e/go.mod h1:Kh7DMkWnYOMHxEKq7QfJqbxm1HaUPkhTNN74lfHQxyE=
github.com/NpoolPlatform/good-middleware v0.0.0-20230908123355-e4a2233e306b h1:lhqocEijsl91RaayJaouDH8J55kdoloQNmKW/bFB+DA=
github.com/NpoolPlatform/good-middleware v0.0.0-20230908123355-e4a2233e306b/go.mod h1:mkTS2pNQhZjEZ/P6CDrD/Xn6cJsv404TWVjtOvvbFDM=
github.com/NpoolPlatform/good-middleware v0.0.0-20230910065023-298572ba5a77 h1:0L1GcpIks4L7KaD4Fdb6gnZjBHziNKMwYb2q0yZ01lg=
github.com/NpoolPlatform/good-middleware v0.0.0-20230910065023-298572ba5a77/go.mod h1:PaLlBl1fmKHfpzLOXFblfaaosElBa7XXRYaZYv7Lu0Y=
github.com/NpoolPlatform/inspire-middleware v0.0.0-20230907035923-c90b50a84df2 h1:gFrEiTDDu+F1F9XfrCyOjf+iVwpDRGddCaFxFNPHnp4=
github.com/NpoolPlatform/inspire-middleware v0.0.0-20230907035923-c90b50a84df2/go.mod h1:r8yyPbydrlL5MXMDT90qgqx/Y6mkCFEfOPdjxNavhJQ=
github.com/NpoolPlatform/ledger-middleware v0.0.0-20230908093825-dace2fee13a1 h1:tv2Ze+8CzrUvfN4/I57fn3Z6KHJwSTZNi3NsFG78G9Q=
github.com/NpoolPlatform/ledger-middleware v0.0.0-20230908093825-dace2fee13a1/go.mod h1:t484//GSJFuy3Flc9puq2MJ628QotxoqA8Gy1Cou0W4=
github.com/NpoolPlatform/libent-cruder v0.0.0-20230825073905-d23e4d838f99 h1:boB4NuhQxXWeV0Z1qSxgIqbiMYU30dqFGDLtgNTqYbE=
github.com/NpoolPlatform/libent-cruder v0.0.0-20230825073905-d23e4d838f99/go.mod h1:1B4hvnPiGavpCYaEjW5H6xDz+UizFdRTIRBtNIGbx5s=
github.com/NpoolPlatform/message v0.0.0-20230908170250-6063a3722b70 h1:JzRJbaI+wPS/tAi9MCiPOCIcvfVE1Zm5Ng/zHvVGbCM=
github.com/NpoolPlatform/message v0.0.0-20230908170250-6063a3722b70/go.mod h1:PxJpF0vSSOke+NJskbRBRQ2fK2K3SRe8zaEja+GxSHk=
github.com/NpoolPlatform/order-middleware v0.0.0-20230908170451-ffbcce45da8b h1:W/SaTmeFGmU8aCWyH8hDvQyTMb+XLI+oO1WABnHMqiU=
github.com/NpoolPlatform/order-middleware v0.0.0-20230908170451-ffbcce45da8b/go.mod h1:DLqs5/NTMeLI3EBq8ivyIO9HHQ7zNHegtw5vFb3GUKU=
github.com/NpoolPlatform/message v0.0.0-20230910084107-20b881ec2c83 h1:jzgG9DtFrh5BJ7PQASgq9zRt8d0zFk3hR0jPgSRFIJY=
github.com/NpoolPlatform/message v0.0.0-20230910084107-20b881ec2c83/go.mod h1:PxJpF0vSSOke+NJskbRBRQ2fK2K3SRe8zaEja+GxSHk=
github.com/NpoolPlatform/order-middleware v0.0.0-20230910084334-a36daf34001f h1:+gVM4RAJbTuvf33Yhh+yMQLX/ElasCFB4X5Pfli1d5c=
github.com/NpoolPlatform/order-middleware v0.0.0-20230910084334-a36daf34001f/go.mod h1:JuuoEDzZCP1oFXI6aosXytD85iz7w3pUs+geEkjvaWQ=
github.com/NpoolPlatform/sphinx-proxy v0.0.0-20230216075025-a90a86bfd19b h1:Ks5kNee/mPcBnjdBugi/VC1mdcsWxETagVL3a+0e3v0=
github.com/NpoolPlatform/sphinx-proxy v0.0.0-20230216075025-a90a86bfd19b/go.mod h1:9C9XDi7c0szxcLdJGDDFuo3/KtC74yWiyUM2fR+i0ww=
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
Expand Down
5 changes: 0 additions & 5 deletions pkg/order/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ func (h *updateHandler) checkOrderType() error {
case ordertypes.OrderType_Normal:
switch h.order.OrderState {
case ordertypes.OrderState_OrderStateWaitPayment:
fallthrough //nolint
case ordertypes.OrderState_OrderStateCheckPayment:
if h.AdminSetCanceled != nil {
return fmt.Errorf("permission denied")
}
Expand Down Expand Up @@ -143,7 +141,6 @@ func (h *updateHandler) checkGood(ctx context.Context) error {
}
switch good.RewardState {
case goodtypes.BenefitState_BenefitWait:
case goodtypes.BenefitState_BenefitCheckWait:
default:
return fmt.Errorf("permission denied")
}
Expand All @@ -160,8 +157,6 @@ func (h *updateHandler) checkCancelable(ctx context.Context) error {

switch h.order.OrderState {

Check failure on line 158 in pkg/order/update.go

View workflow job for this annotation

GitHub Actions / test-cache

singleCaseSwitch: should rewrite switch statement to if statement (gocritic)

Check failure on line 158 in pkg/order/update.go

View workflow job for this annotation

GitHub Actions / test (1.17.x, ubuntu-latest)

singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
case ordertypes.OrderState_OrderStateWaitPayment:
fallthrough //nolint
case ordertypes.OrderState_OrderStateCheckPayment:
return nil
}

Expand Down

0 comments on commit 1b11a25

Please sign in to comment.