generated from PenaSide/GolangTemplate
merge dev into testSSE
This commit is contained in:
commit
cba42f2135
@ -3,8 +3,10 @@ JWT_ISSUER="pena-auth-service"
|
|||||||
JWT_AUDIENCE="pena"
|
JWT_AUDIENCE="pena"
|
||||||
JWT_PUBLIC_KEY="-----BEGIN PUBLIC KEY-----\nMIGeMA0GCSqGSIb3DQEBAQUAA4GMADCBiAKBgHgnvr7O2tiApjJfid1orFnIGm69\n80fZp+Lpbjo+NC/0whMFga2Biw5b1G2Q/B2u0tpO1Fs/E8z7Lv1nYfr5jx2S8x6B\ndA4TS2kB9Kf0wn0+7wSlyikHoKhbtzwXHZl17GsyEi6wHnsqNBSauyIWhpha8i+Y\n+3GyaOY536H47qyXAgMBAAE=\n-----END PUBLIC KEY-----"
|
JWT_PUBLIC_KEY="-----BEGIN PUBLIC KEY-----\nMIGeMA0GCSqGSIb3DQEBAQUAA4GMADCBiAKBgHgnvr7O2tiApjJfid1orFnIGm69\n80fZp+Lpbjo+NC/0whMFga2Biw5b1G2Q/B2u0tpO1Fs/E8z7Lv1nYfr5jx2S8x6B\ndA4TS2kB9Kf0wn0+7wSlyikHoKhbtzwXHZl17GsyEi6wHnsqNBSauyIWhpha8i+Y\n+3GyaOY536H47qyXAgMBAAE=\n-----END PUBLIC KEY-----"
|
||||||
|
|
||||||
HTTP_HOST=0.0.0.0
|
EXTERNAL_HTTP_HOST=0.0.0.0
|
||||||
HTTP_PORT=8082
|
EXTERNAL_HTTP_PORT=8082
|
||||||
|
INTERNAL_HTTP_HOST=0.0.0.0
|
||||||
|
INTERNAL_HTTP_PORT=8083
|
||||||
|
|
||||||
GRPC_HOST=0.0.0.0
|
GRPC_HOST=0.0.0.0
|
||||||
GRPC_PORT=9001
|
GRPC_PORT=9001
|
||||||
|
27
.gitea/workflows/deploy.yml
Normal file
27
.gitea/workflows/deploy.yml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
name: Deploy
|
||||||
|
run-name: ${{ gitea.actor }} build image and push to container registry
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
- 'staging'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
CreateImage:
|
||||||
|
runs-on: [hubstaging]
|
||||||
|
uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/build-image.yml@v1.0.1
|
||||||
|
with:
|
||||||
|
runner: hubstaging
|
||||||
|
secrets:
|
||||||
|
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
|
||||||
|
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
DeployService:
|
||||||
|
runs-on: [hubstaging]
|
||||||
|
needs: CreateImage
|
||||||
|
uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/deploy.yml@v1.0.3
|
||||||
|
with:
|
||||||
|
runner: hubstaging
|
||||||
|
actionid: ${{ gitea.run_id }}
|
||||||
|
|
||||||
|
|
14
.gitea/workflows/lint.yml
Normal file
14
.gitea/workflows/lint.yml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
name: Lint
|
||||||
|
run-name: ${{ gitea.actor }} produce linting
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'dev'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Lint:
|
||||||
|
runs-on: [hubstaging]
|
||||||
|
uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/lint.yml@v1.1.0
|
||||||
|
with:
|
||||||
|
runner: hubstaging
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
|||||||
# Dependency directories (remove the comment below to include it)
|
# Dependency directories (remove the comment below to include it)
|
||||||
|
main
|
||||||
vendor/
|
vendor/
|
||||||
.idea/
|
.idea/
|
||||||
.vscode
|
.vscode
|
||||||
|
@ -3,9 +3,18 @@ include:
|
|||||||
file: "/templates/docker/build-template.gitlab-ci.yml"
|
file: "/templates/docker/build-template.gitlab-ci.yml"
|
||||||
- project: "devops/pena-continuous-integration"
|
- project: "devops/pena-continuous-integration"
|
||||||
file: "/templates/docker/deploy-template.gitlab-ci.yml"
|
file: "/templates/docker/deploy-template.gitlab-ci.yml"
|
||||||
|
- project: "devops/pena-continuous-integration"
|
||||||
|
file: "/templates/docker/golint.gitlab-ci.yml"
|
||||||
|
- project: "devops/pena-continuous-integration"
|
||||||
|
file: "/templates/docker/service-discovery.gitlab-ci.yml"
|
||||||
stages:
|
stages:
|
||||||
|
- lint
|
||||||
- build
|
- build
|
||||||
- deploy
|
- deploy
|
||||||
|
- service-discovery
|
||||||
|
|
||||||
|
lint:
|
||||||
|
extends: .golint_template
|
||||||
|
|
||||||
build-app:
|
build-app:
|
||||||
extends: .build_template
|
extends: .build_template
|
||||||
@ -21,3 +30,7 @@ deploy-to-prod:
|
|||||||
tags:
|
tags:
|
||||||
- prod
|
- prod
|
||||||
extends: .deploy_template
|
extends: .deploy_template
|
||||||
|
|
||||||
|
service-discovery:
|
||||||
|
extends: .sd_artefacts_template
|
||||||
|
|
||||||
|
12
CHANGELOG.md
Normal file
12
CHANGELOG.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#v1.0.1
|
||||||
|
|
||||||
|
INTERNAL:
|
||||||
|
|
||||||
|
- Добавлено версионирование модели данных. На данный момент модель под версией 1
|
||||||
|
|
||||||
|
|
||||||
|
FIX:
|
||||||
|
|
||||||
|
- При пустой корзине во время оплаты(/cart/pay) больше не будет возвращаться 500, а будет возвращаться 406
|
||||||
|
|
||||||
|
#v1.0.0
|
@ -1,5 +1,5 @@
|
|||||||
# BUILD
|
# BUILD
|
||||||
FROM golang:1.22.0-alpine AS build
|
FROM penahub.gitlab.yandexcloud.net:5050/devops/dockerhub-backup/golang:main.3862 AS build
|
||||||
|
|
||||||
# Update packages and clear cache
|
# Update packages and clear cache
|
||||||
RUN apk add --no-cache curl
|
RUN apk add --no-cache curl
|
||||||
@ -21,7 +21,7 @@ RUN go mod download
|
|||||||
RUN GOOS=linux go build -o bin ./...
|
RUN GOOS=linux go build -o bin ./...
|
||||||
|
|
||||||
# PRODUCTION
|
# PRODUCTION
|
||||||
FROM alpine:3.18.3 AS production
|
FROM penahub.gitlab.yandexcloud.net:5050/devops/dockerhub-backup/alpine:main.3862 AS production
|
||||||
|
|
||||||
# Install packages
|
# Install packages
|
||||||
RUN apk --no-cache add ca-certificates
|
RUN apk --no-cache add ca-certificates
|
||||||
|
24
Taskfile.dist.yml
Normal file
24
Taskfile.dist.yml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
vars:
|
||||||
|
VERSION:
|
||||||
|
sh: head -n 1 ./CHANGELOG.md | cut -c 2-
|
||||||
|
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
update-linter:
|
||||||
|
cmds:
|
||||||
|
- go get -u penahub.gitlab.yandexcloud.net/devops/linters/golang.git
|
||||||
|
lint:
|
||||||
|
cmds:
|
||||||
|
- task: update-linter
|
||||||
|
- cmd: golangci-lint run -v -c $(go list -f '{{"{{"}}.Dir{{"}}"}}' -m gitea.pena/PenaSide/linters-golang)/.golangci.yml
|
||||||
|
version:
|
||||||
|
cmds:
|
||||||
|
- echo "{{.VERSION}}"
|
||||||
|
tag-create:
|
||||||
|
cmds:
|
||||||
|
- git tag {{.VERSION}}
|
||||||
|
tag-remove:
|
||||||
|
cmds:
|
||||||
|
- git tag -d {{.VERSION}}
|
@ -118,7 +118,7 @@ paths:
|
|||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/Error"
|
||||||
|
|
||||||
/accounts:
|
/getList:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- account
|
- account
|
||||||
@ -412,6 +412,12 @@ paths:
|
|||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/Error"
|
$ref: "#/components/schemas/Error"
|
||||||
|
"406":
|
||||||
|
description: корзина пустая
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/Error"
|
||||||
|
|
||||||
/wallet:
|
/wallet:
|
||||||
patch:
|
patch:
|
||||||
|
@ -11,12 +11,21 @@ message MainPaymentSettings {
|
|||||||
string ReturnURL = 4;
|
string ReturnURL = 4;
|
||||||
string UserID = 5;
|
string UserID = 5;
|
||||||
string ClientIP = 6;
|
string ClientIP = 6;
|
||||||
|
Customer Customer = 7;
|
||||||
|
repeated Item Items = 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
message BankCardInformation {
|
message Customer {
|
||||||
string Number = 1;
|
string FullName = 1;
|
||||||
string ExpiryYear = 2;
|
string INN = 2;
|
||||||
string ExpiryMonth = 3;
|
string Email = 3;
|
||||||
optional string CSC = 4;
|
string Phone = 4;
|
||||||
optional string CardHolderName = 5;
|
}
|
||||||
}
|
|
||||||
|
message Item {
|
||||||
|
string Description = 1;
|
||||||
|
string Measure = 2;
|
||||||
|
string Quantity = 3;
|
||||||
|
string Money = 4;
|
||||||
|
string Currency = 5;
|
||||||
|
}
|
||||||
|
@ -8,33 +8,22 @@ import "treasurer/payment.model.proto";
|
|||||||
option go_package = "./treasurer";
|
option go_package = "./treasurer";
|
||||||
|
|
||||||
service TreasurerService {
|
service TreasurerService {
|
||||||
rpc GetPaymentLinkBankCard(GetBankCardPaymentLinkRequest) returns (GetPaymentLinkResponse) {}
|
rpc GetPaymentLinkBankCard(GetPaymentLinkRequest) returns (GetPaymentLinkResponse) {}
|
||||||
rpc GetPaymentLinkYooMoney(GetPaymentLinkBody) returns (GetPaymentLinkResponse) {}
|
rpc GetPaymentLinkYooMoney(GetPaymentLinkRequest) returns (GetPaymentLinkResponse) {}
|
||||||
rpc GetPaymentLinkSberPay(GetPaymentLinkBody) returns (GetPaymentLinkResponse) {}
|
rpc GetPaymentLinkTinkoff(GetPaymentLinkRequest) returns (GetPaymentLinkResponse) {}
|
||||||
rpc GetPaymentLinkTinkoff(GetPaymentLinkBody) returns (GetPaymentLinkResponse) {}
|
rpc GetPaymentLinkSberbankB2B(GetPaymentLinkRequest) returns (GetPaymentLinkResponse) {}
|
||||||
rpc GetPaymentLinkSberbankB2B(GetPaymentLinkBody) returns (GetPaymentLinkResponse) {}
|
rpc GetPaymentLinkSBP(GetPaymentLinkRequest) returns (GetPaymentLinkResponse) {}
|
||||||
rpc GetPaymentLinkSBP(GetPaymentLinkBody) returns (GetPaymentLinkResponse) {}
|
rpc GetPaymentLinkSberPay(GetPaymentLinkRequest) returns (GetPaymentLinkResponse) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetBankCardPaymentLinkRequest {
|
message GetBankCardPaymentLinkRequest {
|
||||||
MainPaymentSettings MainSettings = 1;
|
MainPaymentSettings MainSettings = 1;
|
||||||
BankCardInformation BankCard = 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetPaymentLinkBody {
|
message GetPaymentLinkRequest {
|
||||||
MainPaymentSettings MainSettings = 1;
|
MainPaymentSettings MainSettings = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetPhonePaymentLinkRequest {
|
|
||||||
MainPaymentSettings MainSettings = 1;
|
|
||||||
string Phone = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetLoginPaymentLinkRequest {
|
|
||||||
MainPaymentSettings MainSettings = 1;
|
|
||||||
string Login = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetB2BPaymentLinkRequest {
|
message GetB2BPaymentLinkRequest {
|
||||||
MainPaymentSettings MainSettings = 1;
|
MainPaymentSettings MainSettings = 1;
|
||||||
string PaymentPurpose = 2;
|
string PaymentPurpose = 2;
|
||||||
|
@ -8,8 +8,10 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/app"
|
"gitea.pena/PenaSide/customer/internal/app"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/initialize"
|
"gitea.pena/PenaSide/customer/internal/initialize"
|
||||||
|
// import for automatically updating linter rules
|
||||||
|
_ "gitea.pena/PenaSide/linters-golang/pkg/dummy"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -1,18 +1,20 @@
|
|||||||
version: "3.3"
|
version: "3.3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
customer-app-staging:
|
customer-appv1.0.0:
|
||||||
hostname: customer-service-staging
|
hostname: customer-servicev1.0.0
|
||||||
container_name: customer-service-staging
|
container_name: customer-servicev1.0.0
|
||||||
image: $CI_REGISTRY_IMAGE/main:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID
|
image: $CI_REGISTRY_IMAGE/main:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID
|
||||||
tty: true
|
tty: true
|
||||||
environment:
|
environment:
|
||||||
- HTTP_HOST=0.0.0.0
|
- CLIENT_HTTP_HOST=0.0.0.0
|
||||||
- HTTP_PORT=8065
|
- CLIENT_HTTP_PORT=8065
|
||||||
|
- ADMIN_HTTP_HOST=0.0.0.0
|
||||||
|
- ADMIN_HTTP_PORT=8066
|
||||||
|
|
||||||
- GRPC_HOST=0.0.0.0
|
- GRPC_HOST=0.0.0.0
|
||||||
- GRPC_PORT=9085
|
- GRPC_PORT=9065
|
||||||
- GRPC_DOMEN=http://customer-service:9085
|
- GRPC_DOMEN=10.8.0.8:9065
|
||||||
|
|
||||||
- MONGO_HOST=10.8.0.8
|
- MONGO_HOST=10.8.0.8
|
||||||
- MONGO_PORT=27017
|
- MONGO_PORT=27017
|
||||||
@ -20,6 +22,7 @@ services:
|
|||||||
- MONGO_PASSWORD=$MONGO_PASSWORD
|
- MONGO_PASSWORD=$MONGO_PASSWORD
|
||||||
- MONGO_DB_NAME=customer
|
- MONGO_DB_NAME=customer
|
||||||
- MONGO_AUTH=customer
|
- MONGO_AUTH=customer
|
||||||
|
- NOTIFICATION_RS_PAY_CHANNEL=-1002338593104
|
||||||
|
|
||||||
- KAFKA_BROKERS=10.8.0.8:9092
|
- KAFKA_BROKERS=10.8.0.8:9092
|
||||||
- KAFKA_TOPIC_TARIFF=tariffs
|
- KAFKA_TOPIC_TARIFF=tariffs
|
||||||
@ -31,13 +34,28 @@ services:
|
|||||||
- PAYMENT_MICROSERVICE_GRPC_HOST=10.8.0.8:9085
|
- PAYMENT_MICROSERVICE_GRPC_HOST=10.8.0.8:9085
|
||||||
- VERIFICATION_MICROSERVICE_USER_URL=http://10.8.0.8:7035/verification
|
- VERIFICATION_MICROSERVICE_USER_URL=http://10.8.0.8:7035/verification
|
||||||
- TEMPLATEGEN_MICROSERVICE_URL=10.6.0.17
|
- TEMPLATEGEN_MICROSERVICE_URL=10.6.0.17
|
||||||
|
- CODEWORD_MICROSERVICE_GRPC_HOST=10.8.0.8:59665
|
||||||
|
- API_URL=https://api.smtp.bz/v1/smtp/send
|
||||||
|
- MAIL_SENDER=noreply@noreply.pena.digital
|
||||||
|
- MAIL_API_KEY=8tv2xcsfCMBX3TCQxzgeeEwAEYyQrPUp0ggw
|
||||||
|
- MAIL_AUTH_USERNAME=team@pena.digital
|
||||||
|
- MAIL_AUTH_PASSWORD=AyMfwqA9LkQH
|
||||||
|
- MAIL_ADDRESS=sells@pena.digital
|
||||||
|
|
||||||
|
|
||||||
- JWT_PUBLIC_KEY=$JWT_PUBLIC_KEY
|
- JWT_PUBLIC_KEY=$JWT_PUBLIC_KEY
|
||||||
- JWT_ISSUER=pena-auth-service
|
- JWT_ISSUER=pena-auth-service
|
||||||
- JWT_AUDIENCE=pena
|
- JWT_AUDIENCE=pena
|
||||||
|
- PUBLIC_KEY=$USER_PKEY
|
||||||
|
- PRIVATE_KEY=$USER_PRIVATEKEY
|
||||||
|
- ADMIN_FRONT_URL=https://admin.pena
|
||||||
|
- TRASH_LOG_HOST=10.8.0.15:7113
|
||||||
|
- MODULE_LOGGER=customer-main
|
||||||
|
- NOTIFICATION_CHANNEL=-1002017928045
|
||||||
|
- NOTIFICATION_BOT_TOKEN=6112841016:AAH2nO1c6mqfMewBvHwdXCDp5PCclOuc99s
|
||||||
ports:
|
ports:
|
||||||
- 10.8.0.8:8065:8065
|
- 10.8.0.8:8066:8065
|
||||||
- 10.8.0.8:9065:9065
|
- 10.8.0.8:8031:8066
|
||||||
|
- 10.8.0.8:9066:9065
|
||||||
networks:
|
networks:
|
||||||
- default
|
- default
|
||||||
|
@ -1,25 +1,30 @@
|
|||||||
version: "3.3"
|
version: "3.3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
customer-app-stagingv1.0.0:
|
customer-app-stagingv1.0.1:
|
||||||
hostname: customer-service-stagingv1.0.0
|
hostname: customerv1.0.1
|
||||||
container_name: customer-service-stagingv1.0.0
|
container_name: customerv1.0.1
|
||||||
image: $CI_REGISTRY_IMAGE/staging:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID
|
image: $CI_REGISTRY_IMAGE/staging:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID
|
||||||
tty: true
|
tty: true
|
||||||
|
labels:
|
||||||
|
com.pena.allowed_headers: content-type,authorization,response-type
|
||||||
environment:
|
environment:
|
||||||
- HTTP_HOST=0.0.0.0
|
- CLIENT_HTTP_HOST=0.0.0.0
|
||||||
- HTTP_PORT=8065
|
- CLIENT_HTTP_PORT=8065
|
||||||
|
- ADMIN_HTTP_HOST=0.0.0.0
|
||||||
|
- ADMIN_HTTP_PORT=8066
|
||||||
|
|
||||||
- GRPC_HOST=0.0.0.0
|
- GRPC_HOST=0.0.0.0
|
||||||
- GRPC_PORT=9065
|
- GRPC_PORT=9065
|
||||||
- GRPC_DOMEN=10.8.0.6:9065
|
- GRPC_DOMEN=10.8.0.6:9060
|
||||||
|
|
||||||
- MONGO_HOST=10.8.0.6
|
- MONGO_HOST=10.7.0.4
|
||||||
- MONGO_PORT=27017
|
- MONGO_PORT=27017
|
||||||
- MONGO_USER=$MONGO_USER
|
- MONGO_USER=$MONGO_USER
|
||||||
- MONGO_PASSWORD=$MONGO_PASSWORD
|
- MONGO_PASSWORD=$MONGO_PASSWORD
|
||||||
- MONGO_DB_NAME=customer
|
- MONGO_DB_NAME=customer
|
||||||
- MONGO_AUTH=customer
|
- MONGO_AUTH=customer
|
||||||
|
- NOTIFICATION_RS_PAY_CHANNEL=-1002338593104
|
||||||
|
|
||||||
- KAFKA_BROKERS=10.8.0.6:9092
|
- KAFKA_BROKERS=10.8.0.6:9092
|
||||||
- KAFKA_TOPIC_TARIFF=tariffs
|
- KAFKA_TOPIC_TARIFF=tariffs
|
||||||
@ -29,7 +34,7 @@ services:
|
|||||||
- CURRENCY_MICROSERVICE_TRANSLATE_URL=http://10.8.0.6:3131/change
|
- CURRENCY_MICROSERVICE_TRANSLATE_URL=http://10.8.0.6:3131/change
|
||||||
- DISCOUNT_MICROSERVICE_GRPC_HOST=10.8.0.6:9001
|
- DISCOUNT_MICROSERVICE_GRPC_HOST=10.8.0.6:9001
|
||||||
- PAYMENT_MICROSERVICE_GRPC_HOST=10.8.0.6:9085
|
- PAYMENT_MICROSERVICE_GRPC_HOST=10.8.0.6:9085
|
||||||
- VERIFICATION_MICROSERVICE_USER_URL=http://10.8.0.6:7035/verification
|
- VERIFICATION_MICROSERVICE_USER_URL=http://10.8.0.6:7036/verification
|
||||||
- TEMPLATEGEN_MICROSERVICE_URL=http://10.6.0.17/generator/service
|
- TEMPLATEGEN_MICROSERVICE_URL=http://10.6.0.17/generator/service
|
||||||
- API_URL=https://api.smtp.bz/v1/smtp/send
|
- API_URL=https://api.smtp.bz/v1/smtp/send
|
||||||
- CODEWORD_MICROSERVICE_GRPC_HOST=10.8.0.6:59665
|
- CODEWORD_MICROSERVICE_GRPC_HOST=10.8.0.6:59665
|
||||||
@ -44,10 +49,13 @@ services:
|
|||||||
- JWT_AUDIENCE=pena
|
- JWT_AUDIENCE=pena
|
||||||
- PUBLIC_KEY=$USER_PKEY
|
- PUBLIC_KEY=$USER_PKEY
|
||||||
- PRIVATE_KEY=$USER_PRIVATEKEY
|
- PRIVATE_KEY=$USER_PRIVATEKEY
|
||||||
|
- ADMIN_FRONT_URL=https://sadmin.pena
|
||||||
- TRASH_LOG_HOST=10.8.0.15:7113
|
- TRASH_LOG_HOST=10.8.0.15:7113
|
||||||
- MODULE_LOGGER=customer-staging
|
- MODULE_LOGGER=customer-staging
|
||||||
|
- NOTIFICATION_BOT_TOKEN=6112841016:AAH2nO1c6mqfMewBvHwdXCDp5PCclOuc99s
|
||||||
ports:
|
ports:
|
||||||
- 10.8.0.6:8066:8065
|
- 10.8.0.6:8067:8065
|
||||||
- 10.8.0.6:9066:9065
|
- 10.8.0.6:8070:8066
|
||||||
|
- 10.8.0.6:9060:9065
|
||||||
networks:
|
networks:
|
||||||
- default
|
- default
|
||||||
|
16
go.mod
16
go.mod
@ -1,8 +1,9 @@
|
|||||||
module penahub.gitlab.yandexcloud.net/pena-services/customer
|
module gitea.pena/PenaSide/customer
|
||||||
|
|
||||||
go 1.22.0
|
go 1.22.0
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
gitea.pena/PenaSide/linters-golang v0.0.0-20241114215743-9a8e7d58cf96
|
||||||
github.com/go-resty/resty/v2 v2.11.0
|
github.com/go-resty/resty/v2 v2.11.0
|
||||||
github.com/gofiber/fiber/v2 v2.52.1
|
github.com/gofiber/fiber/v2 v2.52.1
|
||||||
github.com/golang-jwt/jwt/v5 v5.2.0
|
github.com/golang-jwt/jwt/v5 v5.2.0
|
||||||
@ -20,9 +21,10 @@ require (
|
|||||||
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157
|
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157
|
||||||
google.golang.org/grpc v1.65.0
|
google.golang.org/grpc v1.65.0
|
||||||
google.golang.org/protobuf v1.34.2
|
google.golang.org/protobuf v1.34.2
|
||||||
|
gopkg.in/tucnak/telebot.v2 v2.5.0
|
||||||
penahub.gitlab.yandexcloud.net/backend/penahub_common v0.0.0-20240607202348-efe5f2bf3e8c
|
penahub.gitlab.yandexcloud.net/backend/penahub_common v0.0.0-20240607202348-efe5f2bf3e8c
|
||||||
penahub.gitlab.yandexcloud.net/backend/quiz/common.git v0.0.0-20240520145524-451212248881
|
penahub.gitlab.yandexcloud.net/backend/quiz/common.git v0.0.0-20240520145524-451212248881
|
||||||
penahub.gitlab.yandexcloud.net/external/trashlog.git v0.1.2-0.20240615192328-b2f5dffe92ae
|
penahub.gitlab.yandexcloud.net/external/trashlog v0.1.5
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
@ -59,13 +61,13 @@ require (
|
|||||||
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect
|
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect
|
||||||
go.etcd.io/bbolt v1.3.10 // indirect
|
go.etcd.io/bbolt v1.3.10 // indirect
|
||||||
go.uber.org/multierr v1.11.0 // indirect
|
go.uber.org/multierr v1.11.0 // indirect
|
||||||
golang.org/x/crypto v0.24.0 // indirect
|
golang.org/x/crypto v0.25.0 // indirect
|
||||||
golang.org/x/net v0.26.0 // indirect
|
golang.org/x/net v0.27.0 // indirect
|
||||||
golang.org/x/sync v0.7.0 // indirect
|
golang.org/x/sync v0.7.0 // indirect
|
||||||
golang.org/x/sys v0.21.0 // indirect
|
golang.org/x/sys v0.22.0 // indirect
|
||||||
golang.org/x/text v0.16.0 // indirect
|
golang.org/x/text v0.16.0 // indirect
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf // indirect
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
|
||||||
gopkg.in/tucnak/telebot.v2 v2.5.0 // indirect
|
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
|
penahub.gitlab.yandexcloud.net/devops/linters/golang.git v0.0.0-20240829220549-d35409b619a3 // indirect
|
||||||
)
|
)
|
||||||
|
24
go.sum
24
go.sum
@ -1,4 +1,6 @@
|
|||||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||||
|
gitea.pena/PenaSide/linters-golang v0.0.0-20241114215743-9a8e7d58cf96 h1:m4EMXEhsA/glI6eJeZnRGUhYPSQdcWj3hzT2IDNlWS0=
|
||||||
|
gitea.pena/PenaSide/linters-golang v0.0.0-20241114215743-9a8e7d58cf96/go.mod h1:gdd+vOT6up9STkEbxa2qESLIMZFjCmRbkcheFQCVgZU=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/ClickHouse/clickhouse-go v1.5.4 h1:cKjXeYLNWVJIx2J1K6H2CqyRmfwVJVY1OV1coaaFcI0=
|
github.com/ClickHouse/clickhouse-go v1.5.4 h1:cKjXeYLNWVJIx2J1K6H2CqyRmfwVJVY1OV1coaaFcI0=
|
||||||
github.com/ClickHouse/clickhouse-go v1.5.4/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI=
|
github.com/ClickHouse/clickhouse-go v1.5.4/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI=
|
||||||
@ -184,8 +186,8 @@ golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPh
|
|||||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||||
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
|
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
|
||||||
golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI=
|
golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
|
||||||
golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM=
|
golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
|
||||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||||
@ -209,8 +211,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
|
|||||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||||
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
|
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
|
||||||
golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ=
|
golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
|
||||||
golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE=
|
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
@ -236,8 +238,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|||||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
|
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
|
||||||
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||||
@ -280,8 +282,8 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98
|
|||||||
google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 h1:7whR9kGa5LUwFtpLm2ArCEejtnxlGeLbAyjFY8sGNFw=
|
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 h1:7whR9kGa5LUwFtpLm2ArCEejtnxlGeLbAyjFY8sGNFw=
|
||||||
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157/go.mod h1:99sLkeliLXfdj2J75X3Ho+rrVCaJze0uwN7zDDkjPVU=
|
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157/go.mod h1:99sLkeliLXfdj2J75X3Ho+rrVCaJze0uwN7zDDkjPVU=
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 h1:BwIjyKYGsK9dMCBOorzRri8MQwmi7mT9rGHsCEinZkA=
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf h1:liao9UHurZLtiEwBgT9LMOnKYsHze6eA6w1KQCMVN2Q=
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY=
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY=
|
||||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||||
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
|
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
|
||||||
@ -316,5 +318,7 @@ penahub.gitlab.yandexcloud.net/backend/penahub_common v0.0.0-20240607202348-efe5
|
|||||||
penahub.gitlab.yandexcloud.net/backend/penahub_common v0.0.0-20240607202348-efe5f2bf3e8c/go.mod h1:+bPxq2wfW5S1gd+83vZYmHm33AE7nEBfznWS8AM1TKE=
|
penahub.gitlab.yandexcloud.net/backend/penahub_common v0.0.0-20240607202348-efe5f2bf3e8c/go.mod h1:+bPxq2wfW5S1gd+83vZYmHm33AE7nEBfznWS8AM1TKE=
|
||||||
penahub.gitlab.yandexcloud.net/backend/quiz/common.git v0.0.0-20240520145524-451212248881 h1:U1/WGQdwZsmrV/ta7Uqm13Dg07IPN/5omS8gzBJYZv4=
|
penahub.gitlab.yandexcloud.net/backend/quiz/common.git v0.0.0-20240520145524-451212248881 h1:U1/WGQdwZsmrV/ta7Uqm13Dg07IPN/5omS8gzBJYZv4=
|
||||||
penahub.gitlab.yandexcloud.net/backend/quiz/common.git v0.0.0-20240520145524-451212248881/go.mod h1:oRyhT55ctjqp/7ZxIzkR7OsQ7T/NLibsfrbb7Ytns64=
|
penahub.gitlab.yandexcloud.net/backend/quiz/common.git v0.0.0-20240520145524-451212248881/go.mod h1:oRyhT55ctjqp/7ZxIzkR7OsQ7T/NLibsfrbb7Ytns64=
|
||||||
penahub.gitlab.yandexcloud.net/external/trashlog.git v0.1.2-0.20240615192328-b2f5dffe92ae h1:vlGInCsQSDA464q7OMv3EWGUviQWQdEcpLc8HIRo+rE=
|
penahub.gitlab.yandexcloud.net/devops/linters/golang.git v0.0.0-20240829220549-d35409b619a3 h1:sf6e2mp582L3i/FMDd2q6QuWm1njRXzYpIX0SipsvM4=
|
||||||
penahub.gitlab.yandexcloud.net/external/trashlog.git v0.1.2-0.20240615192328-b2f5dffe92ae/go.mod h1:3ml0dAGT8U8RhpevKBfRgG6yKZum8EI2uJxAb2WCIy4=
|
penahub.gitlab.yandexcloud.net/devops/linters/golang.git v0.0.0-20240829220549-d35409b619a3/go.mod h1:i7M72RIpkSjcQtHID6KKj9RT/EYZ1rxS6tIPKWa/BSY=
|
||||||
|
penahub.gitlab.yandexcloud.net/external/trashlog v0.1.5 h1:amsK0bkSJxBisk334aFo5ZmVPvN1dBT0Sv5j3V5IsT8=
|
||||||
|
penahub.gitlab.yandexcloud.net/external/trashlog v0.1.5/go.mod h1:J8kQNEP4bL7ZNKHxuT4tfe6a3FHyovpAPkyytN4qllc=
|
||||||
|
@ -6,22 +6,23 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"github.com/themakers/hlog"
|
"github.com/themakers/hlog"
|
||||||
"go.uber.org/zap/zapcore"
|
"go.uber.org/zap/zapcore"
|
||||||
|
tb "gopkg.in/tucnak/telebot.v2"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"penahub.gitlab.yandexcloud.net/backend/penahub_common/mongo"
|
"penahub.gitlab.yandexcloud.net/backend/penahub_common/mongo"
|
||||||
"penahub.gitlab.yandexcloud.net/external/trashlog.git/app"
|
"penahub.gitlab.yandexcloud.net/external/trashlog/app"
|
||||||
"penahub.gitlab.yandexcloud.net/external/trashlog.git/wrappers/zaptrashlog"
|
"penahub.gitlab.yandexcloud.net/external/trashlog/wrappers/zaptrashlog"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/controller/http"
|
"gitea.pena/PenaSide/customer/internal/interface/controller/http"
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/twmb/franz-go/pkg/kgo"
|
"github.com/twmb/franz-go/pkg/kgo"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
qutils "penahub.gitlab.yandexcloud.net/backend/quiz/common.git/utils"
|
qutils "penahub.gitlab.yandexcloud.net/backend/quiz/common.git/utils"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/initialize"
|
"gitea.pena/PenaSide/customer/internal/initialize"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/server"
|
"gitea.pena/PenaSide/customer/internal/server"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/closer"
|
"gitea.pena/PenaSide/customer/pkg/closer"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/kafka"
|
"gitea.pena/PenaSide/customer/pkg/kafka"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -52,18 +53,6 @@ func Run(config *models.Config, logger *zap.Logger, build Build) (appErr error)
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
//telegrammLogger, err := zaptg.NewCore(ctx,
|
|
||||||
// zap.InfoLevel,
|
|
||||||
// "1408111289:AAHfWZRiBQRncb2gl2LtU8OeASjfJi4e8YE",
|
|
||||||
// build.Version,
|
|
||||||
// build.Commit,
|
|
||||||
// build.BuildTime,
|
|
||||||
// -1001256687920,
|
|
||||||
//)
|
|
||||||
//if err != nil {
|
|
||||||
// panic(err)
|
|
||||||
//}
|
|
||||||
|
|
||||||
loggerForHlog := logger.WithOptions(zap.WrapCore(func(core zapcore.Core) zapcore.Core {
|
loggerForHlog := logger.WithOptions(zap.WrapCore(func(core zapcore.Core) zapcore.Core {
|
||||||
return zapcore.NewTee(core, clickHouseLogger)
|
return zapcore.NewTee(core, clickHouseLogger)
|
||||||
}), zap.AddCallerSkip(2))
|
}), zap.AddCallerSkip(2))
|
||||||
@ -72,7 +61,7 @@ func Run(config *models.Config, logger *zap.Logger, build Build) (appErr error)
|
|||||||
loggerHlog.With(models.AllFields{})
|
loggerHlog.With(models.AllFields{})
|
||||||
loggerHlog.Emit(app.InfoSvcStarted{})
|
loggerHlog.Emit(app.InfoSvcStarted{})
|
||||||
|
|
||||||
if err := kafka.Initialize(ctx, config.Service.Kafka.Brokers, []string{
|
if err = kafka.Initialize(ctx, config.Service.Kafka.Brokers, []string{
|
||||||
config.Service.Kafka.Tariff.Topic,
|
config.Service.Kafka.Tariff.Topic,
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
return fmt.Errorf("failed initialize kafka: %w", err)
|
return fmt.Errorf("failed initialize kafka: %w", err)
|
||||||
@ -106,6 +95,19 @@ func Run(config *models.Config, logger *zap.Logger, build Build) (appErr error)
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
notificationBot, err := tb.NewBot(tb.Settings{
|
||||||
|
Token: config.Service.NotificationBotToken,
|
||||||
|
Verbose: false,
|
||||||
|
ParseMode: tb.ModeHTML,
|
||||||
|
Poller: &tb.LongPoller{
|
||||||
|
Timeout: time.Second,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
//logger.Emit(json.Token(err))
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
clients := initialize.NewClients(initialize.ClientsDeps{
|
clients := initialize.NewClients(initialize.ClientsDeps{
|
||||||
Logger: logger,
|
Logger: logger,
|
||||||
AuthURL: &config.Service.AuthMicroservice.URL,
|
AuthURL: &config.Service.AuthMicroservice.URL,
|
||||||
@ -117,6 +119,8 @@ func Run(config *models.Config, logger *zap.Logger, build Build) (appErr error)
|
|||||||
TemplategenURL: &config.Service.TemplategenMicroserviceURL.URL,
|
TemplategenURL: &config.Service.TemplategenMicroserviceURL.URL,
|
||||||
MailClient: &config.Service.Mail,
|
MailClient: &config.Service.Mail,
|
||||||
CodewordServiceHost: &config.Service.CodewordMicroservice,
|
CodewordServiceHost: &config.Service.CodewordMicroservice,
|
||||||
|
Notifier: notificationBot,
|
||||||
|
NotificationRsPayChannel: config.Service.NotificationRsPayChannel,
|
||||||
})
|
})
|
||||||
|
|
||||||
repositories := initialize.NewRepositories(initialize.RepositoriesDeps{
|
repositories := initialize.NewRepositories(initialize.RepositoriesDeps{
|
||||||
@ -125,11 +129,14 @@ func Run(config *models.Config, logger *zap.Logger, build Build) (appErr error)
|
|||||||
})
|
})
|
||||||
|
|
||||||
services := initialize.NewServices(initialize.ServicesDeps{
|
services := initialize.NewServices(initialize.ServicesDeps{
|
||||||
Logger: logger,
|
Logger: logger,
|
||||||
Repositories: repositories,
|
Repositories: repositories,
|
||||||
Clients: clients,
|
Clients: clients,
|
||||||
ConfigurationGRPC: &config.GRPC,
|
ConfigurationGRPC: &config.GRPC,
|
||||||
Brokers: brokers,
|
Brokers: brokers,
|
||||||
|
Notifier: notificationBot,
|
||||||
|
NotificationChannel: config.Service.NotificationChannel,
|
||||||
|
AdminURL: config.Service.AdminURL,
|
||||||
})
|
})
|
||||||
|
|
||||||
rpcControllers := initialize.NewRpcControllers(initialize.RpcControllersDeps{
|
rpcControllers := initialize.NewRpcControllers(initialize.RpcControllersDeps{
|
||||||
@ -152,14 +159,22 @@ func Run(config *models.Config, logger *zap.Logger, build Build) (appErr error)
|
|||||||
MiddleWare: middleWare,
|
MiddleWare: middleWare,
|
||||||
})
|
})
|
||||||
|
|
||||||
serverHTTP := server.NewServer(server.ServerConfig{
|
serverClientHTTP := server.NewServer(server.ServerConfig{
|
||||||
Logger: logger,
|
Logger: logger,
|
||||||
Hlog: loggerHlog,
|
Hlog: loggerHlog,
|
||||||
Controllers: []server.Controller{httpControllers.CurrencyController, httpControllers.HistoryController, httpControllers.CartController, httpControllers.WalletController, httpControllers.AccountController},
|
Controllers: []server.Controller{httpControllers.CurrencyClientController, httpControllers.HistoryClientController, httpControllers.CartClientController, httpControllers.WalletClientController, httpControllers.AccountClientController},
|
||||||
JWTConfig: &config.Service.JWT,
|
JWTConfig: &config.Service.JWT,
|
||||||
})
|
})
|
||||||
|
|
||||||
serverHTTP.ListRoutes()
|
serverAdminHTTP := server.NewServer(server.ServerConfig{
|
||||||
|
Logger: logger,
|
||||||
|
Hlog: loggerHlog,
|
||||||
|
Controllers: []server.Controller{httpControllers.AccountAdminController, httpControllers.CurrencyAdminController, httpControllers.HistoryAdminController},
|
||||||
|
JWTConfig: &config.Service.JWT,
|
||||||
|
})
|
||||||
|
|
||||||
|
serverClientHTTP.ListRoutes()
|
||||||
|
serverAdminHTTP.ListRoutes()
|
||||||
|
|
||||||
serverGRPC, grpcErr := server.NewGRPC(server.DepsGRPC{Logger: logger})
|
serverGRPC, grpcErr := server.NewGRPC(server.DepsGRPC{Logger: logger})
|
||||||
if grpcErr != nil {
|
if grpcErr != nil {
|
||||||
@ -169,8 +184,15 @@ func Run(config *models.Config, logger *zap.Logger, build Build) (appErr error)
|
|||||||
serverGRPC.Register(rpcControllers)
|
serverGRPC.Register(rpcControllers)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
if err := serverHTTP.Start(config.HTTP.Host + ":" + config.HTTP.Port); err != nil {
|
if err := serverClientHTTP.Start(config.HTTP.ClientHost + ":" + config.HTTP.ClientPort); err != nil {
|
||||||
logger.Error("Server startup error", zap.Error(err))
|
logger.Error("Server external startup error", zap.Error(err))
|
||||||
|
cancel()
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
if err := serverAdminHTTP.Start(config.HTTP.AdminHost + ":" + config.HTTP.AdminPort); err != nil {
|
||||||
|
logger.Error("Server internal startup error", zap.Error(err))
|
||||||
cancel()
|
cancel()
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
@ -178,7 +200,8 @@ func Run(config *models.Config, logger *zap.Logger, build Build) (appErr error)
|
|||||||
go serverGRPC.Run(&config.GRPC)
|
go serverGRPC.Run(&config.GRPC)
|
||||||
|
|
||||||
closer.Add(mongoDB.Client().Disconnect)
|
closer.Add(mongoDB.Client().Disconnect)
|
||||||
closer.Add(serverHTTP.Shutdown)
|
closer.Add(serverClientHTTP.Shutdown)
|
||||||
|
closer.Add(serverAdminHTTP.Shutdown)
|
||||||
closer.Add(serverGRPC.Stop)
|
closer.Add(serverGRPC.Stop)
|
||||||
closer.Add(closer.Wrap(kafkaTariffClient.Close))
|
closer.Add(closer.Wrap(kafkaTariffClient.Close))
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
var httpStatuses = map[ErrorType]int{
|
var httpStatuses = map[ErrorType]int{
|
||||||
|
@ -3,7 +3,7 @@ package initialize
|
|||||||
import (
|
import (
|
||||||
"github.com/twmb/franz-go/pkg/kgo"
|
"github.com/twmb/franz-go/pkg/kgo"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/broker/tariff"
|
"gitea.pena/PenaSide/customer/internal/interface/broker/tariff"
|
||||||
)
|
)
|
||||||
|
|
||||||
type BrokersDeps struct {
|
type BrokersDeps struct {
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/twmb/franz-go/pkg/kgo"
|
"github.com/twmb/franz-go/pkg/kgo"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/initialize"
|
"gitea.pena/PenaSide/customer/internal/initialize"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNewBrokers(t *testing.T) {
|
func TestNewBrokers(t *testing.T) {
|
||||||
|
@ -3,8 +3,9 @@ package initialize
|
|||||||
import (
|
import (
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/client"
|
"gopkg.in/tucnak/telebot.v2"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/interface/client"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ClientsDeps struct {
|
type ClientsDeps struct {
|
||||||
@ -18,6 +19,8 @@ type ClientsDeps struct {
|
|||||||
TemplategenURL *models.TemplategenMicroserviceURL
|
TemplategenURL *models.TemplategenMicroserviceURL
|
||||||
MailClient *models.MailConfiguration
|
MailClient *models.MailConfiguration
|
||||||
CodewordServiceHost *models.CodewordMicroserviceConfiguration
|
CodewordServiceHost *models.CodewordMicroserviceConfiguration
|
||||||
|
NotificationRsPayChannel int64
|
||||||
|
Notifier *telebot.Bot
|
||||||
}
|
}
|
||||||
|
|
||||||
type Clients struct {
|
type Clients struct {
|
||||||
@ -30,6 +33,7 @@ type Clients struct {
|
|||||||
TemplateClient *client.TemplateClient
|
TemplateClient *client.TemplateClient
|
||||||
MailClient *client.MailClient
|
MailClient *client.MailClient
|
||||||
CodewordClient *client.CodewordClient
|
CodewordClient *client.CodewordClient
|
||||||
|
TelegramClient *client.TelegramClient
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewClients(deps ClientsDeps) *Clients {
|
func NewClients(deps ClientsDeps) *Clients {
|
||||||
@ -79,5 +83,9 @@ func NewClients(deps ClientsDeps) *Clients {
|
|||||||
Logger: deps.Logger,
|
Logger: deps.Logger,
|
||||||
CodewordServiceHost: deps.CodewordServiceHost.HostGRPC,
|
CodewordServiceHost: deps.CodewordServiceHost.HostGRPC,
|
||||||
}),
|
}),
|
||||||
|
TelegramClient: client.NewTelegramClient(client.TelegramClientDeps{
|
||||||
|
Notifier: deps.Notifier,
|
||||||
|
NotifierPayChannel: deps.NotificationRsPayChannel,
|
||||||
|
}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,8 @@ import (
|
|||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/initialize"
|
"gitea.pena/PenaSide/customer/internal/initialize"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNewClients(t *testing.T) {
|
func TestNewClients(t *testing.T) {
|
||||||
|
@ -4,9 +4,9 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang-jwt/jwt/v5"
|
"github.com/golang-jwt/jwt/v5"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/utils"
|
"gitea.pena/PenaSide/customer/internal/utils"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/env"
|
"gitea.pena/PenaSide/customer/pkg/env"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TODO: обработать возможность читать конфиги ещё по json
|
// TODO: обработать возможность читать конфиги ещё по json
|
||||||
|
@ -7,8 +7,8 @@ import (
|
|||||||
"github.com/golang-jwt/jwt/v5"
|
"github.com/golang-jwt/jwt/v5"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"penahub.gitlab.yandexcloud.net/backend/penahub_common/mongo"
|
"penahub.gitlab.yandexcloud.net/backend/penahub_common/mongo"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/initialize"
|
"gitea.pena/PenaSide/customer/internal/initialize"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestConfiguration(t *testing.T) {
|
func TestConfiguration(t *testing.T) {
|
||||||
@ -62,8 +62,10 @@ func setDefaultTestingENV(t *testing.T) *models.Config {
|
|||||||
|
|
||||||
defaultConfiguration := models.Config{
|
defaultConfiguration := models.Config{
|
||||||
HTTP: models.ConfigurationHTTP{
|
HTTP: models.ConfigurationHTTP{
|
||||||
Host: "localhost",
|
ClientHost: "localhost",
|
||||||
Port: "8080",
|
ClientPort: "8080",
|
||||||
|
AdminHost: "localhost",
|
||||||
|
AdminPort: "8081",
|
||||||
},
|
},
|
||||||
GRPC: models.ConfigurationGRPC{
|
GRPC: models.ConfigurationGRPC{
|
||||||
Host: "localhost",
|
Host: "localhost",
|
||||||
|
@ -4,16 +4,19 @@ import (
|
|||||||
"github.com/themakers/hlog"
|
"github.com/themakers/hlog"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
qutils "penahub.gitlab.yandexcloud.net/backend/quiz/common.git/utils"
|
qutils "penahub.gitlab.yandexcloud.net/backend/quiz/common.git/utils"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/broker/tariff"
|
"gitea.pena/PenaSide/customer/internal/interface/broker/tariff"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/controller/grpc/customer"
|
"gitea.pena/PenaSide/customer/internal/interface/controller/grpc/customer"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/controller/grpc/payment"
|
"gitea.pena/PenaSide/customer/internal/interface/controller/grpc/payment"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/controller/http"
|
"gitea.pena/PenaSide/customer/internal/interface/controller/http"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/controller/http/account"
|
"gitea.pena/PenaSide/customer/internal/interface/controller/http/account_admin"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/controller/http/cart"
|
"gitea.pena/PenaSide/customer/internal/interface/controller/http/account_client"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/controller/http/currency"
|
"gitea.pena/PenaSide/customer/internal/interface/controller/http/cart_client"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/controller/http/history"
|
"gitea.pena/PenaSide/customer/internal/interface/controller/http/currency_admin"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/controller/http/wallet"
|
"gitea.pena/PenaSide/customer/internal/interface/controller/http/currency_client"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/interface/controller/http/history_admin"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/interface/controller/http/history_client"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/interface/controller/http/wallet_client"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
type RpcControllersDeps struct {
|
type RpcControllersDeps struct {
|
||||||
@ -54,23 +57,32 @@ type HttpControllersDeps struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type HttpController struct {
|
type HttpController struct {
|
||||||
AccountController *account.AccountController
|
AccountClientController *account_client.AccountController
|
||||||
CartController *cart.CartController
|
AccountAdminController *account_admin.AccountInternalController
|
||||||
HistoryController *history.HistoryController
|
CartClientController *cart_client.CartController
|
||||||
WalletController *wallet.WalletController
|
CurrencyClientController *currency_client.CurrencyController
|
||||||
CurrencyController *currency.CurrencyController
|
CurrencyAdminController *currency_admin.CurrencyController
|
||||||
|
HistoryAdminController *history_admin.HistoryController
|
||||||
|
HistoryClientController *history_client.HistoryController
|
||||||
|
WalletClientController *wallet_client.WalletController
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewHttpControllers(deps HttpControllersDeps) *HttpController {
|
func NewHttpControllers(deps HttpControllersDeps) *HttpController {
|
||||||
return &HttpController{
|
return &HttpController{
|
||||||
AccountController: account.NewAccountController(account.Deps{
|
AccountClientController: account_client.NewAccountController(account_client.Deps{
|
||||||
MiddleWare: deps.MiddleWare,
|
MiddleWare: deps.MiddleWare,
|
||||||
AccountRepo: deps.Repositories.AccountRepository,
|
AccountRepo: deps.Repositories.AccountRepository,
|
||||||
Logger: deps.Logger,
|
Logger: deps.Logger,
|
||||||
Encrypt: deps.Encrypt,
|
Encrypt: deps.Encrypt,
|
||||||
AuthClient: deps.Clients.AuthClient,
|
AuthClient: deps.Clients.AuthClient,
|
||||||
}),
|
}),
|
||||||
CartController: cart.NewCartController(cart.Deps{
|
AccountAdminController: account_admin.NewAccountInternalController(
|
||||||
|
account_admin.Deps{
|
||||||
|
MiddleWare: deps.MiddleWare,
|
||||||
|
AccountRepo: deps.Repositories.AccountRepository,
|
||||||
|
Logger: deps.Logger,
|
||||||
|
}),
|
||||||
|
CartClientController: cart_client.NewCartController(cart_client.Deps{
|
||||||
MiddleWare: deps.MiddleWare,
|
MiddleWare: deps.MiddleWare,
|
||||||
Logger: deps.Logger,
|
Logger: deps.Logger,
|
||||||
AccountRepo: deps.Repositories.AccountRepository,
|
AccountRepo: deps.Repositories.AccountRepository,
|
||||||
@ -80,7 +92,17 @@ func NewHttpControllers(deps HttpControllersDeps) *HttpController {
|
|||||||
CurrencyClient: deps.Clients.CurrencyClient,
|
CurrencyClient: deps.Clients.CurrencyClient,
|
||||||
Producer: deps.Producer,
|
Producer: deps.Producer,
|
||||||
}),
|
}),
|
||||||
HistoryController: history.NewHistoryController(history.Deps{
|
CurrencyClientController: currency_client.NewCurrencyController(currency_client.Deps{
|
||||||
|
CurrencyRepo: deps.Repositories.CurrencyRepository,
|
||||||
|
MiddleWare: deps.MiddleWare,
|
||||||
|
Logger: deps.Logger,
|
||||||
|
}),
|
||||||
|
CurrencyAdminController: currency_admin.NewCurrencyController(currency_admin.Deps{
|
||||||
|
CurrencyRepo: deps.Repositories.CurrencyRepository,
|
||||||
|
MiddleWare: deps.MiddleWare,
|
||||||
|
Logger: deps.Logger,
|
||||||
|
}),
|
||||||
|
HistoryAdminController: history_admin.NewHistoryController(history_admin.Deps{
|
||||||
MiddleWare: deps.MiddleWare,
|
MiddleWare: deps.MiddleWare,
|
||||||
HistoryRepo: deps.Repositories.HistoryRepository,
|
HistoryRepo: deps.Repositories.HistoryRepository,
|
||||||
AccountRepo: deps.Repositories.AccountRepository,
|
AccountRepo: deps.Repositories.AccountRepository,
|
||||||
@ -90,7 +112,17 @@ func NewHttpControllers(deps HttpControllersDeps) *HttpController {
|
|||||||
CodewordClient: deps.Clients.CodewordClient,
|
CodewordClient: deps.Clients.CodewordClient,
|
||||||
Logger: deps.Logger,
|
Logger: deps.Logger,
|
||||||
}),
|
}),
|
||||||
WalletController: wallet.NewWalletController(wallet.Deps{
|
HistoryClientController: history_client.NewHistoryController(history_client.Deps{
|
||||||
|
MiddleWare: deps.MiddleWare,
|
||||||
|
HistoryRepo: deps.Repositories.HistoryRepository,
|
||||||
|
AccountRepo: deps.Repositories.AccountRepository,
|
||||||
|
VerifyClient: deps.Clients.VerificationClient,
|
||||||
|
AuthClient: deps.Clients.AuthClient,
|
||||||
|
TemplateClient: deps.Clients.TemplateClient,
|
||||||
|
CodewordClient: deps.Clients.CodewordClient,
|
||||||
|
Logger: deps.Logger,
|
||||||
|
}),
|
||||||
|
WalletClientController: wallet_client.NewWalletController(wallet_client.Deps{
|
||||||
MiddleWare: deps.MiddleWare,
|
MiddleWare: deps.MiddleWare,
|
||||||
AuthClient: deps.Clients.AuthClient,
|
AuthClient: deps.Clients.AuthClient,
|
||||||
PaymentClient: deps.Clients.PaymentClient,
|
PaymentClient: deps.Clients.PaymentClient,
|
||||||
@ -100,11 +132,7 @@ func NewHttpControllers(deps HttpControllersDeps) *HttpController {
|
|||||||
VerifyClient: deps.Clients.VerificationClient,
|
VerifyClient: deps.Clients.VerificationClient,
|
||||||
MailClient: deps.Clients.MailClient,
|
MailClient: deps.Clients.MailClient,
|
||||||
Logger: deps.Logger,
|
Logger: deps.Logger,
|
||||||
}),
|
TelegramClient: deps.Clients.TelegramClient,
|
||||||
CurrencyController: currency.NewCurrencyController(currency.Deps{
|
|
||||||
CurrencyRepo: deps.Repositories.CurrencyRepository,
|
|
||||||
MiddleWare: deps.MiddleWare,
|
|
||||||
Logger: deps.Logger,
|
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,11 +4,10 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/twmb/franz-go/pkg/kgo"
|
|
||||||
"go.mongodb.org/mongo-driver/mongo/integration/mtest"
|
"go.mongodb.org/mongo-driver/mongo/integration/mtest"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/initialize"
|
"gitea.pena/PenaSide/customer/internal/initialize"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNewControllers(t *testing.T) {
|
func TestNewControllers(t *testing.T) {
|
||||||
@ -34,22 +33,10 @@ func TestNewControllers(t *testing.T) {
|
|||||||
MongoDB: t.Client.Database("test"),
|
MongoDB: t.Client.Database("test"),
|
||||||
})
|
})
|
||||||
|
|
||||||
brokers := initialize.NewBrokers(initialize.BrokersDeps{
|
controllers := initialize.NewHttpControllers(initialize.HttpControllersDeps{
|
||||||
Logger: logger,
|
Logger: logger,
|
||||||
TariffClient: &kgo.Client{},
|
Repositories: repositories,
|
||||||
})
|
Clients: clients,
|
||||||
|
|
||||||
services := initialize.NewServices(initialize.ServicesDeps{
|
|
||||||
Logger: logger,
|
|
||||||
Clients: clients,
|
|
||||||
Repositories: repositories,
|
|
||||||
Brokers: brokers,
|
|
||||||
ConfigurationGRPC: &models.ConfigurationGRPC{Domen: "http://test:8080"},
|
|
||||||
})
|
|
||||||
|
|
||||||
controllers := initialize.NewControllers(initialize.ControllersDeps{
|
|
||||||
Logger: logger,
|
|
||||||
Services: services,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
assert.NotNil(t, controllers)
|
assert.NotNil(t, controllers)
|
||||||
|
@ -3,7 +3,7 @@ package initialize
|
|||||||
import (
|
import (
|
||||||
"go.mongodb.org/mongo-driver/mongo"
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/repository"
|
"gitea.pena/PenaSide/customer/internal/interface/repository"
|
||||||
)
|
)
|
||||||
|
|
||||||
type RepositoriesDeps struct {
|
type RepositoriesDeps struct {
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"go.mongodb.org/mongo-driver/mongo/integration/mtest"
|
"go.mongodb.org/mongo-driver/mongo/integration/mtest"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/initialize"
|
"gitea.pena/PenaSide/customer/internal/initialize"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNewRepositories(t *testing.T) {
|
func TestNewRepositories(t *testing.T) {
|
||||||
|
@ -2,19 +2,23 @@ package initialize
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
tb "gopkg.in/tucnak/telebot.v2"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/service/broker/tariff"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/service/callback"
|
"gitea.pena/PenaSide/customer/internal/service/broker/tariff"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/service/history"
|
"gitea.pena/PenaSide/customer/internal/service/callback"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/service/wallet"
|
"gitea.pena/PenaSide/customer/internal/service/history"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/service/wallet"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ServicesDeps struct {
|
type ServicesDeps struct {
|
||||||
Logger *zap.Logger
|
Logger *zap.Logger
|
||||||
Repositories *Repositories
|
Repositories *Repositories
|
||||||
Clients *Clients
|
Clients *Clients
|
||||||
Brokers *Brokers
|
Brokers *Brokers
|
||||||
ConfigurationGRPC *models.ConfigurationGRPC
|
ConfigurationGRPC *models.ConfigurationGRPC
|
||||||
|
Notifier *tb.Bot
|
||||||
|
NotificationChannel int64
|
||||||
|
AdminURL string
|
||||||
}
|
}
|
||||||
|
|
||||||
type Services struct {
|
type Services struct {
|
||||||
@ -55,6 +59,9 @@ func NewServices(deps ServicesDeps) *Services {
|
|||||||
AccountRepository: deps.Repositories.AccountRepository,
|
AccountRepository: deps.Repositories.AccountRepository,
|
||||||
WalletService: walletService,
|
WalletService: walletService,
|
||||||
HistoryService: historyService,
|
HistoryService: historyService,
|
||||||
|
Notifier: deps.Notifier,
|
||||||
|
NotifyChannel: deps.NotificationChannel,
|
||||||
|
AdminURL: deps.AdminURL,
|
||||||
}),
|
}),
|
||||||
TariffBrokerService: tariffBrokerService,
|
TariffBrokerService: tariffBrokerService,
|
||||||
}
|
}
|
||||||
|
@ -7,8 +7,8 @@ import (
|
|||||||
"github.com/twmb/franz-go/pkg/kgo"
|
"github.com/twmb/franz-go/pkg/kgo"
|
||||||
"go.mongodb.org/mongo-driver/mongo/integration/mtest"
|
"go.mongodb.org/mongo-driver/mongo/integration/mtest"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/initialize"
|
"gitea.pena/PenaSide/customer/internal/initialize"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNewServices(t *testing.T) {
|
func TestNewServices(t *testing.T) {
|
||||||
|
@ -8,9 +8,9 @@ import (
|
|||||||
"github.com/twmb/franz-go/pkg/kgo"
|
"github.com/twmb/franz-go/pkg/kgo"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/proto/broker"
|
"gitea.pena/PenaSide/customer/internal/proto/broker"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/utils/transfer"
|
"gitea.pena/PenaSide/customer/internal/utils/transfer"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ConsumerDeps struct {
|
type ConsumerDeps struct {
|
||||||
|
@ -8,9 +8,9 @@ import (
|
|||||||
"github.com/twmb/franz-go/pkg/kgo"
|
"github.com/twmb/franz-go/pkg/kgo"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/utils/transfer"
|
"gitea.pena/PenaSide/customer/internal/utils/transfer"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ProducerDeps struct {
|
type ProducerDeps struct {
|
||||||
|
@ -7,10 +7,10 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/utils"
|
"gitea.pena/PenaSide/customer/internal/utils"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/client"
|
"gitea.pena/PenaSide/customer/pkg/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
type AuthClientDeps struct {
|
type AuthClientDeps struct {
|
||||||
|
@ -8,9 +8,9 @@ import (
|
|||||||
"google.golang.org/grpc/credentials/insecure"
|
"google.golang.org/grpc/credentials/insecure"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
codeword_rpc "penahub.gitlab.yandexcloud.net/pena-services/customer/internal/proto/codeword"
|
codeword_rpc "gitea.pena/PenaSide/customer/internal/proto/codeword"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/validate"
|
"gitea.pena/PenaSide/customer/pkg/validate"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CodewordClientDeps struct {
|
type CodewordClientDeps struct {
|
||||||
|
@ -7,10 +7,10 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/utils"
|
"gitea.pena/PenaSide/customer/internal/utils"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/client"
|
"gitea.pena/PenaSide/customer/pkg/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CurrencyClientDeps struct {
|
type CurrencyClientDeps struct {
|
||||||
|
@ -8,9 +8,9 @@ import (
|
|||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/credentials/insecure"
|
"google.golang.org/grpc/credentials/insecure"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/proto/discount"
|
"gitea.pena/PenaSide/customer/internal/proto/discount"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/validate"
|
"gitea.pena/PenaSide/customer/pkg/validate"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DiscountClientDeps struct {
|
type DiscountClientDeps struct {
|
||||||
|
@ -7,10 +7,10 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/utils"
|
"gitea.pena/PenaSide/customer/internal/utils"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/client"
|
"gitea.pena/PenaSide/customer/pkg/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
type HubadminClientDeps struct {
|
type HubadminClientDeps struct {
|
||||||
|
@ -6,8 +6,8 @@ import (
|
|||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"mime/multipart"
|
"mime/multipart"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MailClientDeps struct {
|
type MailClientDeps struct {
|
||||||
@ -36,7 +36,7 @@ func NewMailClient(deps MailClientDeps) *MailClient {
|
|||||||
func (receiver *MailClient) SendMessage(userEmail string, verification *models.Verification, money float32) errors.Error {
|
func (receiver *MailClient) SendMessage(userEmail string, verification *models.Verification, money float32) errors.Error {
|
||||||
body := fmt.Sprintf("<p>Поступила заявка на оплату через Р/С от пользователя с почтой %s (%s)</p>"+
|
body := fmt.Sprintf("<p>Поступила заявка на оплату через Р/С от пользователя с почтой %s (%s)</p>"+
|
||||||
"<p>Вот файлы его верификации:</p>"+
|
"<p>Вот файлы его верификации:</p>"+
|
||||||
"<p>Запрос на оплату: %d рублей</p>", userEmail, verification.UserID, money)
|
"<p>Запрос на оплату: %f рублей</p>", userEmail, verification.UserID, money)
|
||||||
|
|
||||||
for _, file := range verification.Files {
|
for _, file := range verification.Files {
|
||||||
body += fmt.Sprintf("<p>%s: <a href=\"%s\">%s</a></p>", file.Name, file.URL, file.URL)
|
body += fmt.Sprintf("<p>%s: <a href=\"%s\">%s</a></p>", file.Name, file.URL, file.URL)
|
||||||
@ -75,7 +75,7 @@ func (receiver *MailClient) SendMessage(userEmail string, verification *models.V
|
|||||||
}
|
}
|
||||||
|
|
||||||
if statusCode != fiber.StatusOK {
|
if statusCode != fiber.StatusOK {
|
||||||
err := fmt.Errorf("the SMTP service returned an error: %s", statusCode)
|
err := fmt.Errorf("the SMTP service returned an error: %d", statusCode)
|
||||||
return handleError(receiver.deps.Logger, "Error sending email", err)
|
return handleError(receiver.deps.Logger, "Error sending email", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,9 +8,9 @@ import (
|
|||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/credentials/insecure"
|
"google.golang.org/grpc/credentials/insecure"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/proto/treasurer"
|
"gitea.pena/PenaSide/customer/internal/proto/treasurer"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/validate"
|
"gitea.pena/PenaSide/customer/pkg/validate"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PaymentClientDeps struct {
|
type PaymentClientDeps struct {
|
||||||
@ -38,7 +38,7 @@ func NewPaymentClient(deps PaymentClientDeps) *PaymentClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *PaymentClient) GetPaymentLinkBankCard(ctx context.Context, request *treasurer.GetBankCardPaymentLinkRequest) (string, errors.Error) {
|
func (receiver *PaymentClient) GetPaymentLinkBankCard(ctx context.Context, request *treasurer.GetPaymentLinkRequest) (string, errors.Error) {
|
||||||
client, closeConnection, connectErr := receiver.connect(ctx)
|
client, closeConnection, connectErr := receiver.connect(ctx)
|
||||||
if connectErr != nil {
|
if connectErr != nil {
|
||||||
receiver.logger.Error("failed to connect on <GetPaymentLinkBankCard> of <PaymentClient>", zap.Error(connectErr))
|
receiver.logger.Error("failed to connect on <GetPaymentLinkBankCard> of <PaymentClient>", zap.Error(connectErr))
|
||||||
@ -59,7 +59,7 @@ func (receiver *PaymentClient) GetPaymentLinkBankCard(ctx context.Context, reque
|
|||||||
return response.RedirectURL, nil
|
return response.RedirectURL, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *PaymentClient) GetPaymentLinkYooMoney(ctx context.Context, request *treasurer.GetPaymentLinkBody) (string, errors.Error) {
|
func (receiver *PaymentClient) GetPaymentLinkYooMoney(ctx context.Context, request *treasurer.GetPaymentLinkRequest) (string, errors.Error) {
|
||||||
client, closeConnection, connectErr := receiver.connect(ctx)
|
client, closeConnection, connectErr := receiver.connect(ctx)
|
||||||
if connectErr != nil {
|
if connectErr != nil {
|
||||||
receiver.logger.Error("failed to connect on <GetPaymentLinkYooMoney> of <PaymentClient>", zap.Error(connectErr))
|
receiver.logger.Error("failed to connect on <GetPaymentLinkYooMoney> of <PaymentClient>", zap.Error(connectErr))
|
||||||
@ -80,7 +80,7 @@ func (receiver *PaymentClient) GetPaymentLinkYooMoney(ctx context.Context, reque
|
|||||||
return response.RedirectURL, nil
|
return response.RedirectURL, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *PaymentClient) GetPaymentLinkSberPay(ctx context.Context, request *treasurer.GetPaymentLinkBody) (string, errors.Error) {
|
func (receiver *PaymentClient) GetPaymentLinkSberPay(ctx context.Context, request *treasurer.GetPaymentLinkRequest) (string, errors.Error) {
|
||||||
client, closeConnection, connectErr := receiver.connect(ctx)
|
client, closeConnection, connectErr := receiver.connect(ctx)
|
||||||
if connectErr != nil {
|
if connectErr != nil {
|
||||||
receiver.logger.Error("failed to connect on <GetPaymentLinkSberPay> of <PaymentClient>", zap.Error(connectErr))
|
receiver.logger.Error("failed to connect on <GetPaymentLinkSberPay> of <PaymentClient>", zap.Error(connectErr))
|
||||||
@ -101,7 +101,7 @@ func (receiver *PaymentClient) GetPaymentLinkSberPay(ctx context.Context, reques
|
|||||||
return response.RedirectURL, nil
|
return response.RedirectURL, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *PaymentClient) GetPaymentLinkSBP(ctx context.Context, request *treasurer.GetPaymentLinkBody) (string, errors.Error) {
|
func (receiver *PaymentClient) GetPaymentLinkSBP(ctx context.Context, request *treasurer.GetPaymentLinkRequest) (string, errors.Error) {
|
||||||
client, closeConnection, connectErr := receiver.connect(ctx)
|
client, closeConnection, connectErr := receiver.connect(ctx)
|
||||||
if connectErr != nil {
|
if connectErr != nil {
|
||||||
receiver.logger.Error("failed to connect on <GetPaymentLinkSBP> of <PaymentClient>", zap.Error(connectErr))
|
receiver.logger.Error("failed to connect on <GetPaymentLinkSBP> of <PaymentClient>", zap.Error(connectErr))
|
||||||
@ -122,7 +122,7 @@ func (receiver *PaymentClient) GetPaymentLinkSBP(ctx context.Context, request *t
|
|||||||
return response.RedirectURL, nil
|
return response.RedirectURL, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *PaymentClient) GetPaymentLinkTinkoff(ctx context.Context, request *treasurer.GetPaymentLinkBody) (string, errors.Error) {
|
func (receiver *PaymentClient) GetPaymentLinkTinkoff(ctx context.Context, request *treasurer.GetPaymentLinkRequest) (string, errors.Error) {
|
||||||
client, closeConnection, connectErr := receiver.connect(ctx)
|
client, closeConnection, connectErr := receiver.connect(ctx)
|
||||||
if connectErr != nil {
|
if connectErr != nil {
|
||||||
receiver.logger.Error("failed to connect on <GetPaymentLinkTinkoff> of <PaymentClient>", zap.Error(connectErr))
|
receiver.logger.Error("failed to connect on <GetPaymentLinkTinkoff> of <PaymentClient>", zap.Error(connectErr))
|
||||||
@ -143,7 +143,7 @@ func (receiver *PaymentClient) GetPaymentLinkTinkoff(ctx context.Context, reques
|
|||||||
return response.RedirectURL, nil
|
return response.RedirectURL, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *PaymentClient) GetPaymentLinkSberbankB2B(ctx context.Context, request *treasurer.GetPaymentLinkBody) (string, errors.Error) {
|
func (receiver *PaymentClient) GetPaymentLinkSberbankB2B(ctx context.Context, request *treasurer.GetPaymentLinkRequest) (string, errors.Error) {
|
||||||
client, closeConnection, connectErr := receiver.connect(ctx)
|
client, closeConnection, connectErr := receiver.connect(ctx)
|
||||||
if connectErr != nil {
|
if connectErr != nil {
|
||||||
receiver.logger.Error("failed to connect on <GetPaymentLinkSberbankB2B> of <PaymentClient>", zap.Error(connectErr))
|
receiver.logger.Error("failed to connect on <GetPaymentLinkSberbankB2B> of <PaymentClient>", zap.Error(connectErr))
|
||||||
|
49
internal/interface/client/telegram.go
Normal file
49
internal/interface/client/telegram.go
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
package client
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
tb "gopkg.in/tucnak/telebot.v2"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
type TelegramClient struct {
|
||||||
|
notifier *tb.Bot
|
||||||
|
notifierPayChannel int64
|
||||||
|
}
|
||||||
|
|
||||||
|
type TelegramClientDeps struct {
|
||||||
|
Notifier *tb.Bot
|
||||||
|
NotifierPayChannel int64
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewTelegramClient(deps TelegramClientDeps) *TelegramClient {
|
||||||
|
return &TelegramClient{
|
||||||
|
notifier: deps.Notifier,
|
||||||
|
notifierPayChannel: deps.NotifierPayChannel,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *TelegramClient) NotifyRsPay(userEmail string, verification *models.Verification, money float32) errors.Error {
|
||||||
|
message := fmt.Sprintf(
|
||||||
|
"Поступила заявка на оплату через Р/С от пользователя с почтой %s (%s)\n"+
|
||||||
|
"Вот файлы его верификации:\n"+
|
||||||
|
"Запрос на оплату: %f рублей\n",
|
||||||
|
userEmail, verification.UserID, money,
|
||||||
|
)
|
||||||
|
|
||||||
|
for _, file := range verification.Files {
|
||||||
|
message += fmt.Sprintf("%s: %s\n", file.Name, file.URL)
|
||||||
|
}
|
||||||
|
fmt.Println("RSP", t.notifierPayChannel)
|
||||||
|
|
||||||
|
_, err := t.notifier.Send(
|
||||||
|
&tb.Chat{ID: t.notifierPayChannel},
|
||||||
|
message,
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
return errors.New(fmt.Errorf("failed to send tg RS PAY message: %v", err), errors.ErrInternalError)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
37
internal/interface/client/telegram_test.go
Normal file
37
internal/interface/client/telegram_test.go
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
package client
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
tb "gopkg.in/tucnak/telebot.v2"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
|
"testing"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Test_Telegram(t *testing.T) {
|
||||||
|
tbBot, err := tb.NewBot(tb.Settings{
|
||||||
|
Token: "6712573453:AAFqTOsgwe_j48ZQ1GzWKQDT5Nwr-SAWjz8",
|
||||||
|
Verbose: false,
|
||||||
|
ParseMode: tb.ModeHTML,
|
||||||
|
Poller: &tb.LongPoller{
|
||||||
|
Timeout: time.Second,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
tgClient := NewTelegramClient(TelegramClientDeps{
|
||||||
|
Notifier: tbBot,
|
||||||
|
NotifierPayChannel: -1002217604546,
|
||||||
|
})
|
||||||
|
|
||||||
|
err = tgClient.NotifyRsPay("test@email", &models.Verification{UserID: "test"}, 100.11111)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fmt.Println("good")
|
||||||
|
}
|
@ -9,8 +9,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TemplateClientDeps struct {
|
type TemplateClientDeps struct {
|
||||||
|
@ -7,9 +7,9 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/client"
|
"gitea.pena/PenaSide/customer/pkg/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
type VerificationClientDeps struct {
|
type VerificationClientDeps struct {
|
||||||
@ -47,16 +47,17 @@ func (receiver *VerificationClient) GetVerification(ctx context.Context, token,
|
|||||||
}
|
}
|
||||||
|
|
||||||
response, err := client.Get[models.Verification, models.FastifyError](ctx, &client.RequestSettings{
|
response, err := client.Get[models.Verification, models.FastifyError](ctx, &client.RequestSettings{
|
||||||
URL: verifURL,
|
URL: verifURL,
|
||||||
Headers: map[string]string{
|
Headers: map[string]string{
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"Authorization": token,
|
"Authorization": token,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("AAAAAAAAAAAa", err, verifURL, response)
|
if response != nil {
|
||||||
if response.StatusCode == 404 {
|
if response.StatusCode == 404 {
|
||||||
return nil, errors.New(err, errors.ErrNotFound)
|
return &models.Verification{}, nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nil, errors.New(err, errors.ErrInternalError)
|
return nil, errors.New(err, errors.ErrInternalError)
|
||||||
}
|
}
|
||||||
|
@ -4,14 +4,14 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"google.golang.org/protobuf/types/known/timestamppb"
|
"google.golang.org/protobuf/types/known/timestamppb"
|
||||||
"log"
|
"log"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/repository"
|
"gitea.pena/PenaSide/customer/internal/interface/repository"
|
||||||
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"google.golang.org/protobuf/types/known/emptypb"
|
"google.golang.org/protobuf/types/known/emptypb"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/proto/customer"
|
"gitea.pena/PenaSide/customer/internal/proto/customer"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/service/history"
|
"gitea.pena/PenaSide/customer/internal/service/history"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Deps struct {
|
type Deps struct {
|
||||||
|
@ -7,10 +7,10 @@ import (
|
|||||||
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"google.golang.org/protobuf/types/known/emptypb"
|
"google.golang.org/protobuf/types/known/emptypb"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/proto/payment_callback"
|
"gitea.pena/PenaSide/customer/internal/proto/payment_callback"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/service/callback"
|
"gitea.pena/PenaSide/customer/internal/service/callback"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Deps struct {
|
type Deps struct {
|
||||||
|
@ -0,0 +1,99 @@
|
|||||||
|
package account_admin
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"math"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/interface/controller/http"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/interface/repository"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
|
"strconv"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Deps struct {
|
||||||
|
MiddleWare *http.MiddleWare
|
||||||
|
AccountRepo *repository.AccountRepository
|
||||||
|
Logger *zap.Logger
|
||||||
|
}
|
||||||
|
|
||||||
|
type AccountInternalController struct {
|
||||||
|
middleWare *http.MiddleWare
|
||||||
|
accountRepo *repository.AccountRepository
|
||||||
|
logger *zap.Logger
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAccountInternalController(deps Deps) *AccountInternalController {
|
||||||
|
return &AccountInternalController{
|
||||||
|
middleWare: deps.MiddleWare,
|
||||||
|
accountRepo: deps.AccountRepo,
|
||||||
|
logger: deps.Logger,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (receiver *AccountInternalController) DeleteCurrent(ctx *fiber.Ctx) error {
|
||||||
|
userID := ctx.Params("userId")
|
||||||
|
if userID == "" {
|
||||||
|
return receiver.middleWare.Error(ctx, fiber.StatusBadRequest, "invalid format for parameter userId")
|
||||||
|
}
|
||||||
|
|
||||||
|
account, err := receiver.accountRepo.Remove(ctx.Context(), userID)
|
||||||
|
if err != nil {
|
||||||
|
return receiver.middleWare.ErrorOld(ctx, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return ctx.Status(fiber.StatusOK).JSON(account)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (receiver *AccountInternalController) GetCurrent(ctx *fiber.Ctx) error {
|
||||||
|
userID := ctx.Params("userId")
|
||||||
|
if userID == "" {
|
||||||
|
return receiver.middleWare.Error(ctx, fiber.StatusBadRequest, "invalid format for parameter userId")
|
||||||
|
}
|
||||||
|
|
||||||
|
account, err := receiver.accountRepo.FindByUserID(ctx.Context(), userID)
|
||||||
|
if err != nil {
|
||||||
|
return receiver.middleWare.ErrorOld(ctx, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return ctx.Status(fiber.StatusOK).JSON(account)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (receiver *AccountInternalController) Pagination(ctx *fiber.Ctx) error {
|
||||||
|
pageStr := ctx.Query("page", "1")
|
||||||
|
limitStr := ctx.Query("limit", "100")
|
||||||
|
|
||||||
|
page, err := strconv.ParseInt(pageStr, 10, 64)
|
||||||
|
if err != nil || page < 1 {
|
||||||
|
page = 1
|
||||||
|
}
|
||||||
|
limit, err := strconv.ParseInt(limitStr, 10, 64)
|
||||||
|
if err != nil || limit < 1 {
|
||||||
|
limit = models.DefaultLimit
|
||||||
|
} else {
|
||||||
|
limit = int64(math.Min(float64(limit), float64(models.DefaultLimit)))
|
||||||
|
}
|
||||||
|
|
||||||
|
count, err := receiver.accountRepo.CountAll(ctx.Context())
|
||||||
|
if err != nil {
|
||||||
|
return receiver.middleWare.ErrorOld(ctx, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if count == 0 {
|
||||||
|
response := models.PaginationResponse[models.Account]{TotalPages: 0, Records: []models.Account{}}
|
||||||
|
return ctx.Status(fiber.StatusOK).JSON(response)
|
||||||
|
}
|
||||||
|
|
||||||
|
totalPages := int64(math.Ceil(float64(count) / float64(limit)))
|
||||||
|
|
||||||
|
accounts, err := receiver.accountRepo.FindMany(ctx.Context(), page, limit)
|
||||||
|
if err != nil {
|
||||||
|
return receiver.middleWare.ErrorOld(ctx, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
response := models.PaginationResponse[models.Account]{
|
||||||
|
TotalPages: totalPages,
|
||||||
|
Records: accounts,
|
||||||
|
}
|
||||||
|
|
||||||
|
return ctx.Status(fiber.StatusOK).JSON(response)
|
||||||
|
}
|
13
internal/interface/controller/http/account_admin/route.go
Normal file
13
internal/interface/controller/http/account_admin/route.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package account_admin
|
||||||
|
|
||||||
|
import "github.com/gofiber/fiber/v2"
|
||||||
|
|
||||||
|
func (receiver *AccountInternalController) Register(router fiber.Router) {
|
||||||
|
router.Delete("/account/:userId", receiver.DeleteCurrent)
|
||||||
|
router.Get("/account/:userId", receiver.GetCurrent)
|
||||||
|
router.Get("/getList", receiver.Pagination)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (receiver *AccountInternalController) Name() string {
|
||||||
|
return ""
|
||||||
|
}
|
@ -1,20 +1,19 @@
|
|||||||
package account
|
package account_client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/interface/client"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/interface/controller/http"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/interface/repository"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"math"
|
|
||||||
"penahub.gitlab.yandexcloud.net/backend/penahub_common/log_mw"
|
"penahub.gitlab.yandexcloud.net/backend/penahub_common/log_mw"
|
||||||
qutils "penahub.gitlab.yandexcloud.net/backend/quiz/common.git/utils"
|
qutils "penahub.gitlab.yandexcloud.net/backend/quiz/common.git/utils"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/client"
|
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/controller/http"
|
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/repository"
|
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
|
||||||
"strconv"
|
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -180,74 +179,6 @@ func (receiver *AccountController) Create(ctx *fiber.Ctx) error {
|
|||||||
return ctx.Status(fiber.StatusOK).JSON(account)
|
return ctx.Status(fiber.StatusOK).JSON(account)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *AccountController) DeleteCurrent(ctx *fiber.Ctx) error {
|
|
||||||
userID := ctx.Params("userId")
|
|
||||||
if userID == "" {
|
|
||||||
return receiver.middleWare.Error(ctx, fiber.StatusBadRequest, "invalid format for parameter userId")
|
|
||||||
}
|
|
||||||
|
|
||||||
account, err := receiver.accountRepo.Remove(ctx.Context(), userID)
|
|
||||||
if err != nil {
|
|
||||||
return receiver.middleWare.ErrorOld(ctx, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return ctx.Status(fiber.StatusOK).JSON(account)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (receiver *AccountController) GetCurrent(ctx *fiber.Ctx) error {
|
|
||||||
userID := ctx.Params("userId")
|
|
||||||
if userID == "" {
|
|
||||||
return receiver.middleWare.Error(ctx, fiber.StatusBadRequest, "invalid format for parameter userId")
|
|
||||||
}
|
|
||||||
|
|
||||||
account, err := receiver.accountRepo.FindByUserID(ctx.Context(), userID)
|
|
||||||
if err != nil {
|
|
||||||
return receiver.middleWare.ErrorOld(ctx, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return ctx.Status(fiber.StatusOK).JSON(account)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (receiver *AccountController) Pagination(ctx *fiber.Ctx) error {
|
|
||||||
pageStr := ctx.Query("page", "1")
|
|
||||||
limitStr := ctx.Query("limit", "100")
|
|
||||||
|
|
||||||
page, err := strconv.ParseInt(pageStr, 10, 64)
|
|
||||||
if err != nil || page < 1 {
|
|
||||||
page = 1
|
|
||||||
}
|
|
||||||
limit, err := strconv.ParseInt(limitStr, 10, 64)
|
|
||||||
if err != nil || limit < 1 {
|
|
||||||
limit = models.DefaultLimit
|
|
||||||
} else {
|
|
||||||
limit = int64(math.Min(float64(limit), float64(models.DefaultLimit)))
|
|
||||||
}
|
|
||||||
|
|
||||||
count, err := receiver.accountRepo.CountAll(ctx.Context())
|
|
||||||
if err != nil {
|
|
||||||
return receiver.middleWare.ErrorOld(ctx, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if count == 0 {
|
|
||||||
response := models.PaginationResponse[models.Account]{TotalPages: 0, Records: []models.Account{}}
|
|
||||||
return ctx.Status(fiber.StatusOK).JSON(response)
|
|
||||||
}
|
|
||||||
|
|
||||||
totalPages := int64(math.Ceil(float64(count) / float64(limit)))
|
|
||||||
|
|
||||||
accounts, err := receiver.accountRepo.FindMany(ctx.Context(), page, limit)
|
|
||||||
if err != nil {
|
|
||||||
return receiver.middleWare.ErrorOld(ctx, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
response := models.PaginationResponse[models.Account]{
|
|
||||||
TotalPages: totalPages,
|
|
||||||
Records: accounts,
|
|
||||||
}
|
|
||||||
|
|
||||||
return ctx.Status(fiber.StatusOK).JSON(response)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (receiver *AccountController) AccountPipe(ctx *fiber.Ctx) error {
|
func (receiver *AccountController) AccountPipe(ctx *fiber.Ctx) error {
|
||||||
userID, ok := receiver.middleWare.ExtractUserID(ctx)
|
userID, ok := receiver.middleWare.ExtractUserID(ctx)
|
||||||
if !ok || userID == "" {
|
if !ok || userID == "" {
|
@ -1,4 +1,4 @@
|
|||||||
package account
|
package account_client
|
||||||
|
|
||||||
import "github.com/gofiber/fiber/v2"
|
import "github.com/gofiber/fiber/v2"
|
||||||
|
|
||||||
@ -8,10 +8,7 @@ func (receiver *AccountController) Register(router fiber.Router) {
|
|||||||
router.Patch("/account", receiver.Update)
|
router.Patch("/account", receiver.Update)
|
||||||
router.Post("/account", receiver.Create)
|
router.Post("/account", receiver.Create)
|
||||||
router.Get("/account/pipe", receiver.AccountPipe)
|
router.Get("/account/pipe", receiver.AccountPipe)
|
||||||
router.Delete("/account/:userId", receiver.DeleteCurrent)
|
|
||||||
router.Get("/account/:userId", receiver.GetCurrent)
|
|
||||||
router.Patch("/account/:userId", receiver.SetVerificationStatus)
|
router.Patch("/account/:userId", receiver.SetVerificationStatus)
|
||||||
router.Get("/accounts", receiver.Pagination)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *AccountController) Name() string {
|
func (receiver *AccountController) Name() string {
|
@ -1,20 +1,20 @@
|
|||||||
package cart
|
package cart_client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"google.golang.org/protobuf/types/known/timestamppb"
|
"google.golang.org/protobuf/types/known/timestamppb"
|
||||||
"penahub.gitlab.yandexcloud.net/backend/penahub_common/log_mw"
|
"penahub.gitlab.yandexcloud.net/backend/penahub_common/log_mw"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/broker/tariff"
|
"gitea.pena/PenaSide/customer/internal/interface/broker/tariff"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/client"
|
"gitea.pena/PenaSide/customer/internal/interface/client"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/controller/http"
|
"gitea.pena/PenaSide/customer/internal/interface/controller/http"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/repository"
|
"gitea.pena/PenaSide/customer/internal/interface/repository"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/proto/discount"
|
"gitea.pena/PenaSide/customer/internal/proto/discount"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/utils"
|
"gitea.pena/PenaSide/customer/internal/utils"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/utils/transfer"
|
"gitea.pena/PenaSide/customer/internal/utils/transfer"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/validate"
|
"gitea.pena/PenaSide/customer/pkg/validate"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
@ -135,6 +135,10 @@ func (receiver *CartController) Pay(ctx *fiber.Ctx) error {
|
|||||||
|
|
||||||
receiver.logger.Info("account for pay", zap.Any("acc", account))
|
receiver.logger.Info("account for pay", zap.Any("acc", account))
|
||||||
|
|
||||||
|
if len(account.Cart) == 0 {
|
||||||
|
return ctx.Status(fiber.StatusNotAcceptable).SendString("cart is empty")
|
||||||
|
}
|
||||||
|
|
||||||
tariffs, err := receiver.hubAdminClient.GetTariffs(ctx.Context(), accessToken, account.Cart)
|
tariffs, err := receiver.hubAdminClient.GetTariffs(ctx.Context(), accessToken, account.Cart)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return receiver.middleWare.ErrorOld(ctx, err)
|
return receiver.middleWare.ErrorOld(ctx, err)
|
||||||
@ -173,7 +177,7 @@ func (receiver *CartController) Pay(ctx *fiber.Ctx) error {
|
|||||||
hlogger.Emit(models.InfoPayCart{
|
hlogger.Emit(models.InfoPayCart{
|
||||||
CtxUserID: userID,
|
CtxUserID: userID,
|
||||||
CtxAccountID: account.ID,
|
CtxAccountID: account.ID,
|
||||||
KeySuccess: false,
|
KeySuccess: uint8(0),
|
||||||
CtxPrice: int64(discountResponse.Price - uint64(account.Wallet.Money)),
|
CtxPrice: int64(discountResponse.Price - uint64(account.Wallet.Money)),
|
||||||
CtxTariff: strings.Join(account.Cart, ","),
|
CtxTariff: strings.Join(account.Cart, ","),
|
||||||
CtxDiscount: strings.Join(utils.GetAppliedDiscountsIDs(discountResponse.AppliedDiscounts), ","),
|
CtxDiscount: strings.Join(utils.GetAppliedDiscountsIDs(discountResponse.AppliedDiscounts), ","),
|
||||||
@ -294,7 +298,7 @@ func (receiver *CartController) Pay(ctx *fiber.Ctx) error {
|
|||||||
hlogger.Emit(models.InfoPayCart{
|
hlogger.Emit(models.InfoPayCart{
|
||||||
CtxUserID: userID,
|
CtxUserID: userID,
|
||||||
CtxAccountID: updatedAccount.ID,
|
CtxAccountID: updatedAccount.ID,
|
||||||
KeySuccess: true,
|
KeySuccess: uint8(1),
|
||||||
CtxPrice: int64(discountResponse.Price),
|
CtxPrice: int64(discountResponse.Price),
|
||||||
CtxTariff: strings.Join(account.Cart, ","),
|
CtxTariff: strings.Join(account.Cart, ","),
|
||||||
CtxDiscount: strings.Join(utils.GetAppliedDiscountsIDs(discountResponse.AppliedDiscounts), ","),
|
CtxDiscount: strings.Join(utils.GetAppliedDiscountsIDs(discountResponse.AppliedDiscounts), ","),
|
@ -1,4 +1,4 @@
|
|||||||
package cart
|
package cart_client
|
||||||
|
|
||||||
import "github.com/gofiber/fiber/v2"
|
import "github.com/gofiber/fiber/v2"
|
||||||
|
|
@ -1,12 +1,12 @@
|
|||||||
package currency
|
package currency_admin
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/controller/http"
|
"gitea.pena/PenaSide/customer/internal/interface/controller/http"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/repository"
|
"gitea.pena/PenaSide/customer/internal/interface/repository"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Deps struct {
|
type Deps struct {
|
||||||
@ -29,19 +29,6 @@ func NewCurrencyController(deps Deps) *CurrencyController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *CurrencyController) Get(ctx *fiber.Ctx) error {
|
|
||||||
currencyList, err := receiver.currencyRepo.FindCurrenciesList(ctx.Context(), models.DefaultCurrencyListName)
|
|
||||||
if err != nil && err.Type() != errors.ErrNotFound {
|
|
||||||
return receiver.middleWare.ErrorOld(ctx, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if err != nil && err.Type() == errors.ErrNotFound {
|
|
||||||
return ctx.Status(fiber.StatusOK).JSON([]string{})
|
|
||||||
}
|
|
||||||
|
|
||||||
return ctx.Status(fiber.StatusOK).JSON(currencyList)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (receiver *CurrencyController) Update(ctx *fiber.Ctx) error {
|
func (receiver *CurrencyController) Update(ctx *fiber.Ctx) error {
|
||||||
var req struct {
|
var req struct {
|
||||||
items []string
|
items []string
|
@ -1,9 +1,8 @@
|
|||||||
package currency
|
package currency_admin
|
||||||
|
|
||||||
import "github.com/gofiber/fiber/v2"
|
import "github.com/gofiber/fiber/v2"
|
||||||
|
|
||||||
func (receiver *CurrencyController) Register(router fiber.Router) {
|
func (receiver *CurrencyController) Register(router fiber.Router) {
|
||||||
router.Get("/currencies", receiver.Get)
|
|
||||||
router.Put("/currencies", receiver.Update)
|
router.Put("/currencies", receiver.Update)
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,43 @@
|
|||||||
|
package currency_client
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/interface/controller/http"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/interface/repository"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Deps struct {
|
||||||
|
CurrencyRepo *repository.CurrencyRepository
|
||||||
|
MiddleWare *http.MiddleWare
|
||||||
|
Logger *zap.Logger
|
||||||
|
}
|
||||||
|
|
||||||
|
type CurrencyController struct {
|
||||||
|
currencyRepo *repository.CurrencyRepository
|
||||||
|
middleWare *http.MiddleWare
|
||||||
|
logger *zap.Logger
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCurrencyController(deps Deps) *CurrencyController {
|
||||||
|
return &CurrencyController{
|
||||||
|
currencyRepo: deps.CurrencyRepo,
|
||||||
|
middleWare: deps.MiddleWare,
|
||||||
|
logger: deps.Logger,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (receiver *CurrencyController) Get(ctx *fiber.Ctx) error {
|
||||||
|
currencyList, err := receiver.currencyRepo.FindCurrenciesList(ctx.Context(), models.DefaultCurrencyListName)
|
||||||
|
if err != nil && err.Type() != errors.ErrNotFound {
|
||||||
|
return receiver.middleWare.ErrorOld(ctx, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err != nil && err.Type() == errors.ErrNotFound {
|
||||||
|
return ctx.Status(fiber.StatusOK).JSON([]string{})
|
||||||
|
}
|
||||||
|
|
||||||
|
return ctx.Status(fiber.StatusOK).JSON(currencyList)
|
||||||
|
}
|
11
internal/interface/controller/http/currency_client/route.go
Normal file
11
internal/interface/controller/http/currency_client/route.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package currency_client
|
||||||
|
|
||||||
|
import "github.com/gofiber/fiber/v2"
|
||||||
|
|
||||||
|
func (receiver *CurrencyController) Register(router fiber.Router) {
|
||||||
|
router.Get("/currencies", receiver.Get)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (receiver *CurrencyController) Name() string {
|
||||||
|
return ""
|
||||||
|
}
|
166
internal/interface/controller/http/history_admin/controllers.go
Normal file
166
internal/interface/controller/http/history_admin/controllers.go
Normal file
@ -0,0 +1,166 @@
|
|||||||
|
package history_admin
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/interface/client"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/interface/controller/http"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/interface/repository"
|
||||||
|
codeword_rpc "gitea.pena/PenaSide/customer/internal/proto/codeword"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Deps struct {
|
||||||
|
MiddleWare *http.MiddleWare
|
||||||
|
HistoryRepo *repository.HistoryRepository
|
||||||
|
AccountRepo *repository.AccountRepository
|
||||||
|
VerifyClient *client.VerificationClient
|
||||||
|
AuthClient *client.AuthClient
|
||||||
|
TemplateClient *client.TemplateClient
|
||||||
|
CodewordClient *client.CodewordClient
|
||||||
|
Logger *zap.Logger
|
||||||
|
}
|
||||||
|
|
||||||
|
type HistoryController struct {
|
||||||
|
middleWare *http.MiddleWare
|
||||||
|
historyRepo *repository.HistoryRepository
|
||||||
|
accountRepo *repository.AccountRepository
|
||||||
|
verifyClient *client.VerificationClient
|
||||||
|
authClient *client.AuthClient
|
||||||
|
templateClient *client.TemplateClient
|
||||||
|
codewordClient *client.CodewordClient
|
||||||
|
logger *zap.Logger
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewHistoryController(deps Deps) *HistoryController {
|
||||||
|
return &HistoryController{
|
||||||
|
middleWare: deps.MiddleWare,
|
||||||
|
historyRepo: deps.HistoryRepo,
|
||||||
|
authClient: deps.AuthClient,
|
||||||
|
accountRepo: deps.AccountRepo,
|
||||||
|
verifyClient: deps.VerifyClient,
|
||||||
|
templateClient: deps.TemplateClient,
|
||||||
|
codewordClient: deps.CodewordClient,
|
||||||
|
logger: deps.Logger,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (receiver *HistoryController) CalculateLTV(ctx *fiber.Ctx) error {
|
||||||
|
var req struct {
|
||||||
|
From int64 `json:"from"`
|
||||||
|
To int64 `json:"to"`
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := ctx.BodyParser(&req); err != nil {
|
||||||
|
receiver.logger.Error("failed to bind request", zap.Error(err))
|
||||||
|
return receiver.middleWare.Error(ctx, fiber.StatusBadRequest, "failed to bind request")
|
||||||
|
}
|
||||||
|
|
||||||
|
if req.From > req.To && req.To != 0 {
|
||||||
|
receiver.logger.Error("From timestamp must be less than To timestamp unless To is 0")
|
||||||
|
return receiver.middleWare.Error(ctx, fiber.StatusBadRequest, "From timestamp must be less than To timestamp unless To is 0")
|
||||||
|
}
|
||||||
|
|
||||||
|
ltv, err := receiver.historyRepo.CalculateCustomerLTV(ctx.Context(), req.From, req.To)
|
||||||
|
if err != nil {
|
||||||
|
receiver.logger.Error("failed to calculate LTV", zap.Error(err))
|
||||||
|
return receiver.middleWare.ErrorOld(ctx, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
response := struct {
|
||||||
|
LTV int64 `json:"LTV"`
|
||||||
|
}{
|
||||||
|
LTV: ltv,
|
||||||
|
}
|
||||||
|
|
||||||
|
return ctx.Status(fiber.StatusOK).JSON(response)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (receiver *HistoryController) QuizLogoStat(ctx *fiber.Ctx) error {
|
||||||
|
var req struct {
|
||||||
|
From *int `json:"from,omitempty"`
|
||||||
|
Limit *int `json:"limit,omitempty"`
|
||||||
|
Page *int `json:"page,omitempty"`
|
||||||
|
To *int `json:"to,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := ctx.BodyParser(&req); err != nil {
|
||||||
|
receiver.logger.Error("failed to bind request", zap.Error(err))
|
||||||
|
return receiver.middleWare.Error(ctx, fiber.StatusBadRequest, "failed to bind request")
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := receiver.accountRepo.QuizLogoStat(ctx.Context(), repository.QuizLogoStatDeps{
|
||||||
|
Page: req.Page,
|
||||||
|
Limit: req.Limit,
|
||||||
|
From: req.From,
|
||||||
|
To: req.To,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return receiver.middleWare.Error(ctx, fiber.StatusInternalServerError, fmt.Sprint("failed getting quiz logo stat", err.Error()))
|
||||||
|
}
|
||||||
|
|
||||||
|
return ctx.Status(fiber.StatusOK).JSON(result)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (receiver *HistoryController) PromocodeLTV(ctx *fiber.Ctx) error {
|
||||||
|
var req struct {
|
||||||
|
From int `json:"from"`
|
||||||
|
To int `json:"to"`
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := ctx.BodyParser(&req); err != nil {
|
||||||
|
receiver.logger.Error("failed to bind request", zap.Error(err))
|
||||||
|
return receiver.middleWare.Error(ctx, fiber.StatusBadRequest, "failed to bind request")
|
||||||
|
}
|
||||||
|
|
||||||
|
// получаем мапу вида [promoID] = []{userid,timeActivate}
|
||||||
|
// отдаются только первые использованые на аккаунте промокоды, соответсвенно подсчет идет сугубо по ним
|
||||||
|
// если в запросе время различается с временем активации - если меньше, то учитывается только после применения
|
||||||
|
// если больше, то учитывается только с начала переданного from
|
||||||
|
codewordData, err := receiver.codewordClient.GetAllPromoActivations(ctx.Context(), &codeword_rpc.Time{
|
||||||
|
To: int64(req.To),
|
||||||
|
From: int64(req.From),
|
||||||
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return receiver.middleWare.Error(ctx, fiber.StatusInternalServerError, fmt.Sprint("failed getting codeword data", err.Error()))
|
||||||
|
}
|
||||||
|
|
||||||
|
userSumMap, er := receiver.historyRepo.GetPayUsersPromoHistory(ctx.Context(), codewordData, int64(req.From), int64(req.To))
|
||||||
|
if er != nil {
|
||||||
|
return receiver.middleWare.Error(ctx, fiber.StatusInternalServerError, fmt.Sprint("failed calculate promo users paid sum", er.Error()))
|
||||||
|
}
|
||||||
|
|
||||||
|
resp := make(map[string]struct {
|
||||||
|
Regs int
|
||||||
|
Money int64
|
||||||
|
})
|
||||||
|
|
||||||
|
for promoID, data := range codewordData {
|
||||||
|
fmt.Println("PROTOMOTO", promoID, data)
|
||||||
|
for _, value := range data {
|
||||||
|
|
||||||
|
paids, ok := userSumMap[value.UserID]
|
||||||
|
if !ok {
|
||||||
|
paids = 0
|
||||||
|
}
|
||||||
|
fmt.Println("PROTOMOTO1", paids, value)
|
||||||
|
|
||||||
|
if value.Time >= int64(req.From) && value.Time <= int64(req.To) {
|
||||||
|
if _, ok := resp[promoID]; !ok {
|
||||||
|
resp[promoID] = struct {
|
||||||
|
Regs int
|
||||||
|
Money int64
|
||||||
|
}{Regs: 1, Money: paids}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
current := resp[promoID]
|
||||||
|
current.Regs += 1
|
||||||
|
current.Money += paids
|
||||||
|
resp[promoID] = current
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ctx.Status(fiber.StatusOK).JSON(resp)
|
||||||
|
}
|
@ -1,14 +1,11 @@
|
|||||||
package history
|
package history_admin
|
||||||
|
|
||||||
import "github.com/gofiber/fiber/v2"
|
import "github.com/gofiber/fiber/v2"
|
||||||
|
|
||||||
func (receiver *HistoryController) Register(router fiber.Router) {
|
func (receiver *HistoryController) Register(router fiber.Router) {
|
||||||
router.Get("/history", receiver.Get)
|
|
||||||
router.Post("/history/ltv", receiver.CalculateLTV)
|
router.Post("/history/ltv", receiver.CalculateLTV)
|
||||||
router.Post("/promocode/ltv", receiver.PromocodeLTV)
|
router.Post("/promocode/ltv", receiver.PromocodeLTV)
|
||||||
router.Post("/quizlogo/stat", receiver.QuizLogoStat)
|
router.Post("/quizlogo/stat", receiver.QuizLogoStat)
|
||||||
router.Get("/recent", receiver.GetRecentTariffs)
|
|
||||||
router.Post("/sendReport", receiver.SendReport)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *HistoryController) Name() string {
|
func (receiver *HistoryController) Name() string {
|
@ -1,4 +1,4 @@
|
|||||||
package history
|
package history_client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
@ -7,13 +7,12 @@ import (
|
|||||||
"math"
|
"math"
|
||||||
"os"
|
"os"
|
||||||
"penahub.gitlab.yandexcloud.net/backend/penahub_common/log_mw"
|
"penahub.gitlab.yandexcloud.net/backend/penahub_common/log_mw"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/client"
|
"gitea.pena/PenaSide/customer/internal/interface/client"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/controller/http"
|
"gitea.pena/PenaSide/customer/internal/interface/controller/http"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/repository"
|
"gitea.pena/PenaSide/customer/internal/interface/repository"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
codeword_rpc "penahub.gitlab.yandexcloud.net/pena-services/customer/internal/proto/codeword"
|
"gitea.pena/PenaSide/customer/internal/service/history"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/service/history"
|
"gitea.pena/PenaSide/customer/internal/utils"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/utils"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@ -117,37 +116,6 @@ func (receiver *HistoryController) Get(ctx *fiber.Ctx) error {
|
|||||||
return ctx.Status(fiber.StatusOK).JSON(returnHistories)
|
return ctx.Status(fiber.StatusOK).JSON(returnHistories)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *HistoryController) CalculateLTV(ctx *fiber.Ctx) error {
|
|
||||||
var req struct {
|
|
||||||
From int64 `json:"from"`
|
|
||||||
To int64 `json:"to"`
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := ctx.BodyParser(&req); err != nil {
|
|
||||||
receiver.logger.Error("failed to bind request", zap.Error(err))
|
|
||||||
return receiver.middleWare.Error(ctx, fiber.StatusBadRequest, "failed to bind request")
|
|
||||||
}
|
|
||||||
|
|
||||||
if req.From > req.To && req.To != 0 {
|
|
||||||
receiver.logger.Error("From timestamp must be less than To timestamp unless To is 0")
|
|
||||||
return receiver.middleWare.Error(ctx, fiber.StatusBadRequest, "From timestamp must be less than To timestamp unless To is 0")
|
|
||||||
}
|
|
||||||
|
|
||||||
ltv, err := receiver.historyRepo.CalculateCustomerLTV(ctx.Context(), req.From, req.To)
|
|
||||||
if err != nil {
|
|
||||||
receiver.logger.Error("failed to calculate LTV", zap.Error(err))
|
|
||||||
return receiver.middleWare.ErrorOld(ctx, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
response := struct {
|
|
||||||
LTV int64 `json:"LTV"`
|
|
||||||
}{
|
|
||||||
LTV: ltv,
|
|
||||||
}
|
|
||||||
|
|
||||||
return ctx.Status(fiber.StatusOK).JSON(response)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (receiver *HistoryController) GetRecentTariffs(ctx *fiber.Ctx) error {
|
func (receiver *HistoryController) GetRecentTariffs(ctx *fiber.Ctx) error {
|
||||||
userID, ok := receiver.middleWare.ExtractUserID(ctx)
|
userID, ok := receiver.middleWare.ExtractUserID(ctx)
|
||||||
if !ok || userID == "" {
|
if !ok || userID == "" {
|
||||||
@ -294,92 +262,3 @@ func (receiver *HistoryController) SendReport(ctx *fiber.Ctx) error {
|
|||||||
|
|
||||||
return ctx.SendStatus(fiber.StatusOK)
|
return ctx.SendStatus(fiber.StatusOK)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *HistoryController) QuizLogoStat(ctx *fiber.Ctx) error {
|
|
||||||
var req struct {
|
|
||||||
From *int `json:"from,omitempty"`
|
|
||||||
Limit *int `json:"limit,omitempty"`
|
|
||||||
Page *int `json:"page,omitempty"`
|
|
||||||
To *int `json:"to,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := ctx.BodyParser(&req); err != nil {
|
|
||||||
receiver.logger.Error("failed to bind request", zap.Error(err))
|
|
||||||
return receiver.middleWare.Error(ctx, fiber.StatusBadRequest, "failed to bind request")
|
|
||||||
}
|
|
||||||
|
|
||||||
result, err := receiver.accountRepo.QuizLogoStat(ctx.Context(), repository.QuizLogoStatDeps{
|
|
||||||
Page: req.Page,
|
|
||||||
Limit: req.Limit,
|
|
||||||
From: req.From,
|
|
||||||
To: req.To,
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
return receiver.middleWare.Error(ctx, fiber.StatusInternalServerError, fmt.Sprint("failed getting quiz logo stat", err.Error()))
|
|
||||||
}
|
|
||||||
|
|
||||||
return ctx.Status(fiber.StatusOK).JSON(result)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (receiver *HistoryController) PromocodeLTV(ctx *fiber.Ctx) error {
|
|
||||||
var req struct {
|
|
||||||
From int `json:"from"`
|
|
||||||
To int `json:"to"`
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := ctx.BodyParser(&req); err != nil {
|
|
||||||
receiver.logger.Error("failed to bind request", zap.Error(err))
|
|
||||||
return receiver.middleWare.Error(ctx, fiber.StatusBadRequest, "failed to bind request")
|
|
||||||
}
|
|
||||||
|
|
||||||
// получаем мапу вида [promoID] = []{userid,timeActivate}
|
|
||||||
// отдаются только первые использованые на аккаунте промокоды, соответсвенно подсчет идет сугубо по ним
|
|
||||||
// если в запросе время различается с временем активации - если меньше, то учитывается только после применения
|
|
||||||
// если больше, то учитывается только с начала переданного from
|
|
||||||
codewordData, err := receiver.codewordClient.GetAllPromoActivations(ctx.Context(), &codeword_rpc.Time{
|
|
||||||
To: int64(req.To),
|
|
||||||
From: int64(req.From),
|
|
||||||
})
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
return receiver.middleWare.Error(ctx, fiber.StatusInternalServerError, fmt.Sprint("failed getting codeword data", err.Error()))
|
|
||||||
}
|
|
||||||
|
|
||||||
userSumMap, er := receiver.historyRepo.GetPayUsersPromoHistory(ctx.Context(), codewordData, int64(req.From), int64(req.To))
|
|
||||||
if er != nil {
|
|
||||||
return receiver.middleWare.Error(ctx, fiber.StatusInternalServerError, fmt.Sprint("failed calculate promo users paid sum", er.Error()))
|
|
||||||
}
|
|
||||||
|
|
||||||
resp := make(map[string]struct {
|
|
||||||
Regs int
|
|
||||||
Money int64
|
|
||||||
})
|
|
||||||
|
|
||||||
for promoID, data := range codewordData {
|
|
||||||
fmt.Println("PROTOMOTO", promoID, data)
|
|
||||||
for _, value := range data {
|
|
||||||
|
|
||||||
paids, ok := userSumMap[value.UserID]
|
|
||||||
if !ok {
|
|
||||||
paids = 0
|
|
||||||
}
|
|
||||||
fmt.Println("PROTOMOTO1", paids, value)
|
|
||||||
|
|
||||||
if value.Time >= int64(req.From) && value.Time <= int64(req.To) {
|
|
||||||
if _, ok := resp[promoID]; !ok {
|
|
||||||
resp[promoID] = struct {
|
|
||||||
Regs int
|
|
||||||
Money int64
|
|
||||||
}{Regs: 1, Money: paids}
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
current := resp[promoID]
|
|
||||||
current.Regs += 1
|
|
||||||
current.Money += paids
|
|
||||||
resp[promoID] = current
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ctx.Status(fiber.StatusOK).JSON(resp)
|
|
||||||
}
|
|
13
internal/interface/controller/http/history_client/route.go
Normal file
13
internal/interface/controller/http/history_client/route.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package history_client
|
||||||
|
|
||||||
|
import "github.com/gofiber/fiber/v2"
|
||||||
|
|
||||||
|
func (receiver *HistoryController) Register(router fiber.Router) {
|
||||||
|
router.Get("/history", receiver.Get)
|
||||||
|
router.Get("/recent", receiver.GetRecentTariffs)
|
||||||
|
router.Post("/sendReport", receiver.SendReport)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (receiver *HistoryController) Name() string {
|
||||||
|
return ""
|
||||||
|
}
|
@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MiddleWare struct {
|
type MiddleWare struct {
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
package wallet
|
package wallet_client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
"fmt"
|
||||||
"penahub.gitlab.yandexcloud.net/backend/penahub_common/log_mw"
|
"penahub.gitlab.yandexcloud.net/backend/penahub_common/log_mw"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/client"
|
"gitea.pena/PenaSide/customer/internal/interface/client"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/controller/http"
|
"gitea.pena/PenaSide/customer/internal/interface/controller/http"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/repository"
|
"gitea.pena/PenaSide/customer/internal/interface/repository"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/proto/treasurer"
|
"gitea.pena/PenaSide/customer/internal/proto/treasurer"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/utils"
|
"gitea.pena/PenaSide/customer/internal/utils"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/validate"
|
"gitea.pena/PenaSide/customer/pkg/validate"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Deps struct {
|
type Deps struct {
|
||||||
@ -26,6 +26,7 @@ type Deps struct {
|
|||||||
VerifyClient *client.VerificationClient
|
VerifyClient *client.VerificationClient
|
||||||
MailClient *client.MailClient
|
MailClient *client.MailClient
|
||||||
Logger *zap.Logger
|
Logger *zap.Logger
|
||||||
|
TelegramClient *client.TelegramClient
|
||||||
}
|
}
|
||||||
|
|
||||||
type WalletController struct {
|
type WalletController struct {
|
||||||
@ -38,6 +39,7 @@ type WalletController struct {
|
|||||||
verifyClient *client.VerificationClient
|
verifyClient *client.VerificationClient
|
||||||
mailClient *client.MailClient
|
mailClient *client.MailClient
|
||||||
logger *zap.Logger
|
logger *zap.Logger
|
||||||
|
telegramClient *client.TelegramClient
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewWalletController(deps Deps) *WalletController {
|
func NewWalletController(deps Deps) *WalletController {
|
||||||
@ -51,6 +53,7 @@ func NewWalletController(deps Deps) *WalletController {
|
|||||||
verifyClient: deps.VerifyClient,
|
verifyClient: deps.VerifyClient,
|
||||||
mailClient: deps.MailClient,
|
mailClient: deps.MailClient,
|
||||||
logger: deps.Logger,
|
logger: deps.Logger,
|
||||||
|
telegramClient: deps.TelegramClient,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,6 +62,7 @@ func (receiver *WalletController) RequestMoney(ctx *fiber.Ctx) error {
|
|||||||
if !ok || userID == "" {
|
if !ok || userID == "" {
|
||||||
return receiver.middleWare.NoAuth(ctx)
|
return receiver.middleWare.NoAuth(ctx)
|
||||||
}
|
}
|
||||||
|
token, _ := receiver.middleWare.ExtractToken(ctx)
|
||||||
|
|
||||||
hlogger := log_mw.ExtractLogger(ctx)
|
hlogger := log_mw.ExtractLogger(ctx)
|
||||||
|
|
||||||
@ -80,7 +84,7 @@ func (receiver *WalletController) RequestMoney(ctx *fiber.Ctx) error {
|
|||||||
Body: &request,
|
Body: &request,
|
||||||
UserID: userID,
|
UserID: userID,
|
||||||
ClientIP: ctx.IP(),
|
ClientIP: ctx.IP(),
|
||||||
})
|
}, account, token)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return receiver.middleWare.ErrorOld(ctx, err)
|
return receiver.middleWare.ErrorOld(ctx, err)
|
||||||
}
|
}
|
||||||
@ -97,8 +101,9 @@ func (receiver *WalletController) RequestMoney(ctx *fiber.Ctx) error {
|
|||||||
return ctx.Status(fiber.StatusOK).JSON(&models.GetPaymentLinkResponse{Link: link})
|
return ctx.Status(fiber.StatusOK).JSON(&models.GetPaymentLinkResponse{Link: link})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *WalletController) GetPaymentLink(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
func (receiver *WalletController) GetPaymentLink(ctx context.Context, request *models.GetPaymentLinkRequest, account *models.Account, token string) (string, errors.Error) {
|
||||||
if _, userErr := receiver.authClient.GetUser(ctx, request.UserID); userErr != nil {
|
auth, userErr := receiver.authClient.GetUser(ctx, request.UserID)
|
||||||
|
if userErr != nil {
|
||||||
receiver.logger.Error("failed to get user on <GetPaymentLink> on <PaymentService>",
|
receiver.logger.Error("failed to get user on <GetPaymentLink> on <PaymentService>",
|
||||||
zap.Error(userErr),
|
zap.Error(userErr),
|
||||||
zap.String("userID", request.UserID),
|
zap.String("userID", request.UserID),
|
||||||
@ -107,26 +112,37 @@ func (receiver *WalletController) GetPaymentLink(ctx context.Context, request *m
|
|||||||
return "", userErr
|
return "", userErr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if auth.PhoneNumber == "+7" {
|
||||||
|
auth.PhoneNumber = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
verification, err := receiver.verifyClient.GetVerification(ctx, token, request.UserID)
|
||||||
|
if err != nil {
|
||||||
|
verification = &models.Verification{
|
||||||
|
TaxNumber: "",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch request.Body.Type {
|
switch request.Body.Type {
|
||||||
case models.PaymentTypeBankCard:
|
case models.PaymentTypeBankCard:
|
||||||
return receiver.GetPaymentLinkBankCard(ctx, request)
|
return receiver.GetPaymentLinkBankCard(ctx, request, account, auth, verification)
|
||||||
case models.PaymentTypeYoomoney:
|
case models.PaymentTypeYoomoney:
|
||||||
return receiver.GetPaymentLinkYooMoney(ctx, request)
|
return receiver.GetPaymentLinkYooMoney(ctx, request, account, auth, verification)
|
||||||
case models.PaymentTypeSberPay:
|
case models.PaymentTypeSberPay:
|
||||||
return receiver.GetPaymentLinkSberPay(ctx, request)
|
return receiver.GetPaymentLinkSberPay(ctx, request, account, auth, verification)
|
||||||
case models.PaymentTypeTinkoff:
|
case models.PaymentTypeTinkoff:
|
||||||
return receiver.GetPaymentLinkTinkoff(ctx, request)
|
return receiver.GetPaymentLinkTinkoff(ctx, request, account, auth, verification)
|
||||||
case models.PaymentTypeSBP:
|
case models.PaymentTypeSBP:
|
||||||
return receiver.GetPaymentLinkSBP(ctx, request)
|
return receiver.GetPaymentLinkSBP(ctx, request, account, auth, verification)
|
||||||
case models.PaymentTypeSberB2B:
|
case models.PaymentTypeSberB2B:
|
||||||
return receiver.GetPaymentLinkB2B(ctx, request)
|
return receiver.GetPaymentLinkB2B(ctx, request, account, auth, verification)
|
||||||
}
|
}
|
||||||
|
|
||||||
return "", errors.NewWithMessage("invalid payment method type", errors.ErrInvalidArgs)
|
return "", errors.NewWithMessage("invalid payment method type", errors.ErrInvalidArgs)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *WalletController) GetPaymentLinkBankCard(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
func (receiver *WalletController) GetPaymentLinkBankCard(ctx context.Context, request *models.GetPaymentLinkRequest, account *models.Account, auth *models.User, ver *models.Verification) (string, errors.Error) {
|
||||||
link, err := receiver.paymentClient.GetPaymentLinkBankCard(ctx, &treasurer.GetBankCardPaymentLinkRequest{
|
link, err := receiver.paymentClient.GetPaymentLinkBankCard(ctx, &treasurer.GetPaymentLinkRequest{
|
||||||
MainSettings: &treasurer.MainPaymentSettings{
|
MainSettings: &treasurer.MainPaymentSettings{
|
||||||
Currency: request.Body.Currency,
|
Currency: request.Body.Currency,
|
||||||
Amount: request.Body.Amount,
|
Amount: request.Body.Amount,
|
||||||
@ -134,6 +150,17 @@ func (receiver *WalletController) GetPaymentLinkBankCard(ctx context.Context, re
|
|||||||
ClientIP: request.ClientIP,
|
ClientIP: request.ClientIP,
|
||||||
CallbackHostGRPC: []string{receiver.grpc.Domen},
|
CallbackHostGRPC: []string{receiver.grpc.Domen},
|
||||||
ReturnURL: request.Body.ReturnURL,
|
ReturnURL: request.Body.ReturnURL,
|
||||||
|
Customer: &treasurer.Customer{
|
||||||
|
FullName: account.Name.Orgname + ". " + account.Name.FirstName + " " + account.Name.Secondname,
|
||||||
|
Email: auth.Login,
|
||||||
|
Phone: auth.PhoneNumber,
|
||||||
|
},
|
||||||
|
Items: []*treasurer.Item{&treasurer.Item{
|
||||||
|
Description: "Пополнение пользовательского баланса платформы Pena Hub",
|
||||||
|
Quantity: fmt.Sprintf("%.2f", float64(request.Body.Amount)/100),
|
||||||
|
Currency: "RUB",
|
||||||
|
Money: fmt.Sprintf("%.2f", float64(request.Body.Amount)/100),
|
||||||
|
}},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -144,8 +171,8 @@ func (receiver *WalletController) GetPaymentLinkBankCard(ctx context.Context, re
|
|||||||
return link, nil
|
return link, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *WalletController) GetPaymentLinkYooMoney(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
func (receiver *WalletController) GetPaymentLinkYooMoney(ctx context.Context, request *models.GetPaymentLinkRequest, account *models.Account, auth *models.User, ver *models.Verification) (string, errors.Error) {
|
||||||
link, err := receiver.paymentClient.GetPaymentLinkYooMoney(ctx, &treasurer.GetPaymentLinkBody{
|
link, err := receiver.paymentClient.GetPaymentLinkYooMoney(ctx, &treasurer.GetPaymentLinkRequest{
|
||||||
MainSettings: &treasurer.MainPaymentSettings{
|
MainSettings: &treasurer.MainPaymentSettings{
|
||||||
Currency: request.Body.Currency,
|
Currency: request.Body.Currency,
|
||||||
Amount: request.Body.Amount,
|
Amount: request.Body.Amount,
|
||||||
@ -153,6 +180,17 @@ func (receiver *WalletController) GetPaymentLinkYooMoney(ctx context.Context, re
|
|||||||
ClientIP: request.ClientIP,
|
ClientIP: request.ClientIP,
|
||||||
CallbackHostGRPC: []string{receiver.grpc.Domen},
|
CallbackHostGRPC: []string{receiver.grpc.Domen},
|
||||||
ReturnURL: request.Body.ReturnURL,
|
ReturnURL: request.Body.ReturnURL,
|
||||||
|
Customer: &treasurer.Customer{
|
||||||
|
FullName: account.Name.Orgname + ", " + account.Name.FirstName + " " + account.Name.Secondname,
|
||||||
|
Email: auth.Login,
|
||||||
|
Phone: auth.PhoneNumber,
|
||||||
|
},
|
||||||
|
Items: []*treasurer.Item{&treasurer.Item{
|
||||||
|
Description: "Пополнение пользовательского баланса платформы Pena Hub",
|
||||||
|
Quantity: fmt.Sprintf("%.2f", float64(request.Body.Amount)/100),
|
||||||
|
Currency: "RUB",
|
||||||
|
Money: fmt.Sprintf("%.2f", float64(request.Body.Amount)/100),
|
||||||
|
}},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -163,8 +201,8 @@ func (receiver *WalletController) GetPaymentLinkYooMoney(ctx context.Context, re
|
|||||||
return link, nil
|
return link, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *WalletController) GetPaymentLinkSberPay(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
func (receiver *WalletController) GetPaymentLinkSberPay(ctx context.Context, request *models.GetPaymentLinkRequest, account *models.Account, auth *models.User, ver *models.Verification) (string, errors.Error) {
|
||||||
link, err := receiver.paymentClient.GetPaymentLinkSberPay(ctx, &treasurer.GetPaymentLinkBody{
|
link, err := receiver.paymentClient.GetPaymentLinkSberPay(ctx, &treasurer.GetPaymentLinkRequest{
|
||||||
MainSettings: &treasurer.MainPaymentSettings{
|
MainSettings: &treasurer.MainPaymentSettings{
|
||||||
Currency: request.Body.Currency,
|
Currency: request.Body.Currency,
|
||||||
Amount: request.Body.Amount,
|
Amount: request.Body.Amount,
|
||||||
@ -172,6 +210,17 @@ func (receiver *WalletController) GetPaymentLinkSberPay(ctx context.Context, req
|
|||||||
ClientIP: request.ClientIP,
|
ClientIP: request.ClientIP,
|
||||||
CallbackHostGRPC: []string{receiver.grpc.Domen},
|
CallbackHostGRPC: []string{receiver.grpc.Domen},
|
||||||
ReturnURL: request.Body.ReturnURL,
|
ReturnURL: request.Body.ReturnURL,
|
||||||
|
Customer: &treasurer.Customer{
|
||||||
|
FullName: account.Name.Orgname + ", " + account.Name.FirstName + " " + account.Name.Secondname,
|
||||||
|
Email: auth.Login,
|
||||||
|
Phone: auth.PhoneNumber,
|
||||||
|
},
|
||||||
|
Items: []*treasurer.Item{&treasurer.Item{
|
||||||
|
Description: "Пополнение пользовательского баланса платформы Pena Hub",
|
||||||
|
Quantity: fmt.Sprintf("%.2f", float64(request.Body.Amount)/100),
|
||||||
|
Currency: "RUB",
|
||||||
|
Money: fmt.Sprintf("%.2f", float64(request.Body.Amount)/100),
|
||||||
|
}},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -182,8 +231,8 @@ func (receiver *WalletController) GetPaymentLinkSberPay(ctx context.Context, req
|
|||||||
return link, nil
|
return link, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *WalletController) GetPaymentLinkTinkoff(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
func (receiver *WalletController) GetPaymentLinkTinkoff(ctx context.Context, request *models.GetPaymentLinkRequest, account *models.Account, auth *models.User, ver *models.Verification) (string, errors.Error) {
|
||||||
link, err := receiver.paymentClient.GetPaymentLinkTinkoff(ctx, &treasurer.GetPaymentLinkBody{
|
link, err := receiver.paymentClient.GetPaymentLinkTinkoff(ctx, &treasurer.GetPaymentLinkRequest{
|
||||||
MainSettings: &treasurer.MainPaymentSettings{
|
MainSettings: &treasurer.MainPaymentSettings{
|
||||||
Currency: request.Body.Currency,
|
Currency: request.Body.Currency,
|
||||||
Amount: request.Body.Amount,
|
Amount: request.Body.Amount,
|
||||||
@ -191,6 +240,17 @@ func (receiver *WalletController) GetPaymentLinkTinkoff(ctx context.Context, req
|
|||||||
ClientIP: request.ClientIP,
|
ClientIP: request.ClientIP,
|
||||||
CallbackHostGRPC: []string{receiver.grpc.Domen},
|
CallbackHostGRPC: []string{receiver.grpc.Domen},
|
||||||
ReturnURL: request.Body.ReturnURL,
|
ReturnURL: request.Body.ReturnURL,
|
||||||
|
Customer: &treasurer.Customer{
|
||||||
|
FullName: account.Name.Orgname + ", " + account.Name.FirstName + " " + account.Name.Secondname,
|
||||||
|
Email: auth.Login,
|
||||||
|
Phone: auth.PhoneNumber,
|
||||||
|
},
|
||||||
|
Items: []*treasurer.Item{&treasurer.Item{
|
||||||
|
Description: "Пополнение пользовательского баланса платформы Pena Hub",
|
||||||
|
Quantity: fmt.Sprintf("%.2f", float64(request.Body.Amount)/100),
|
||||||
|
Currency: "RUB",
|
||||||
|
Money: fmt.Sprintf("%.2f", float64(request.Body.Amount)/100),
|
||||||
|
}},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -201,8 +261,8 @@ func (receiver *WalletController) GetPaymentLinkTinkoff(ctx context.Context, req
|
|||||||
return link, nil
|
return link, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *WalletController) GetPaymentLinkSBP(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
func (receiver *WalletController) GetPaymentLinkSBP(ctx context.Context, request *models.GetPaymentLinkRequest, account *models.Account, auth *models.User, ver *models.Verification) (string, errors.Error) {
|
||||||
link, err := receiver.paymentClient.GetPaymentLinkSBP(ctx, &treasurer.GetPaymentLinkBody{
|
link, err := receiver.paymentClient.GetPaymentLinkSBP(ctx, &treasurer.GetPaymentLinkRequest{
|
||||||
MainSettings: &treasurer.MainPaymentSettings{
|
MainSettings: &treasurer.MainPaymentSettings{
|
||||||
Currency: request.Body.Currency,
|
Currency: request.Body.Currency,
|
||||||
Amount: request.Body.Amount,
|
Amount: request.Body.Amount,
|
||||||
@ -210,6 +270,17 @@ func (receiver *WalletController) GetPaymentLinkSBP(ctx context.Context, request
|
|||||||
ClientIP: request.ClientIP,
|
ClientIP: request.ClientIP,
|
||||||
CallbackHostGRPC: []string{receiver.grpc.Domen},
|
CallbackHostGRPC: []string{receiver.grpc.Domen},
|
||||||
ReturnURL: request.Body.ReturnURL,
|
ReturnURL: request.Body.ReturnURL,
|
||||||
|
Customer: &treasurer.Customer{
|
||||||
|
FullName: account.Name.Orgname + ", " + account.Name.FirstName + " " + account.Name.Secondname,
|
||||||
|
Email: auth.Login,
|
||||||
|
Phone: auth.PhoneNumber,
|
||||||
|
},
|
||||||
|
Items: []*treasurer.Item{&treasurer.Item{
|
||||||
|
Description: "Пополнение пользовательского баланса платформы Pena Hub",
|
||||||
|
Quantity: fmt.Sprintf("%.2f", float64(request.Body.Amount)/100),
|
||||||
|
Currency: "RUB",
|
||||||
|
Money: fmt.Sprintf("%.2f", float64(request.Body.Amount)/100),
|
||||||
|
}},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -220,8 +291,8 @@ func (receiver *WalletController) GetPaymentLinkSBP(ctx context.Context, request
|
|||||||
return link, nil
|
return link, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *WalletController) GetPaymentLinkB2B(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
func (receiver *WalletController) GetPaymentLinkB2B(ctx context.Context, request *models.GetPaymentLinkRequest, account *models.Account, auth *models.User, ver *models.Verification) (string, errors.Error) {
|
||||||
link, err := receiver.paymentClient.GetPaymentLinkSberbankB2B(ctx, &treasurer.GetPaymentLinkBody{
|
link, err := receiver.paymentClient.GetPaymentLinkSberbankB2B(ctx, &treasurer.GetPaymentLinkRequest{
|
||||||
MainSettings: &treasurer.MainPaymentSettings{
|
MainSettings: &treasurer.MainPaymentSettings{
|
||||||
Currency: request.Body.Currency,
|
Currency: request.Body.Currency,
|
||||||
Amount: request.Body.Amount,
|
Amount: request.Body.Amount,
|
||||||
@ -229,6 +300,17 @@ func (receiver *WalletController) GetPaymentLinkB2B(ctx context.Context, request
|
|||||||
ClientIP: request.ClientIP,
|
ClientIP: request.ClientIP,
|
||||||
CallbackHostGRPC: []string{receiver.grpc.Domen},
|
CallbackHostGRPC: []string{receiver.grpc.Domen},
|
||||||
ReturnURL: request.Body.ReturnURL,
|
ReturnURL: request.Body.ReturnURL,
|
||||||
|
Customer: &treasurer.Customer{
|
||||||
|
FullName: account.Name.Orgname + ", " + account.Name.FirstName + " " + account.Name.Secondname,
|
||||||
|
Email: auth.Login,
|
||||||
|
Phone: auth.PhoneNumber,
|
||||||
|
},
|
||||||
|
Items: []*treasurer.Item{&treasurer.Item{
|
||||||
|
Description: "Пополнение пользовательского баланса платформы Pena Hub",
|
||||||
|
Quantity: fmt.Sprintf("%.2f", float64(request.Body.Amount)/100),
|
||||||
|
Currency: "RUB",
|
||||||
|
Money: fmt.Sprintf("%.2f", float64(request.Body.Amount)/100),
|
||||||
|
}},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -307,18 +389,12 @@ func (receiver *WalletController) PostWalletRspay(ctx *fiber.Ctx) error {
|
|||||||
return receiver.middleWare.Error(ctx, fiber.StatusForbidden, "not allowed for non organizations")
|
return receiver.middleWare.Error(ctx, fiber.StatusForbidden, "not allowed for non organizations")
|
||||||
}
|
}
|
||||||
token := ctx.Get("Authorization")
|
token := ctx.Get("Authorization")
|
||||||
fmt.Println("HEADERS", ctx.Request().Header)
|
|
||||||
|
|
||||||
verification, err := receiver.verifyClient.GetVerification(ctx.Context(), token, userID)
|
verification, err := receiver.verifyClient.GetVerification(ctx.Context(), token, userID)
|
||||||
if err == errors.ErrNotFound {
|
if err == errors.ErrNotFound {
|
||||||
return receiver.middleWare.Error(ctx, fiber.StatusForbidden, "no verification data found")
|
return receiver.middleWare.Error(ctx, fiber.StatusForbidden, "no verification data found")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user.Status == models.AccountStatusOrg && len(verification.Files) != 3) ||
|
|
||||||
(user.Status == models.AccountStatusNko && len(verification.Files) != 4) {
|
|
||||||
return receiver.middleWare.Error(ctx, fiber.StatusForbidden, "not enough verification files")
|
|
||||||
}
|
|
||||||
|
|
||||||
authData, err := receiver.authClient.GetUser(ctx.Context(), userID)
|
authData, err := receiver.authClient.GetUser(ctx.Context(), userID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return receiver.middleWare.ErrorOld(ctx, err)
|
return receiver.middleWare.ErrorOld(ctx, err)
|
||||||
@ -329,6 +405,11 @@ func (receiver *WalletController) PostWalletRspay(ctx *fiber.Ctx) error {
|
|||||||
return receiver.middleWare.ErrorOld(ctx, err)
|
return receiver.middleWare.ErrorOld(ctx, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = receiver.telegramClient.NotifyRsPay(authData.Login, verification, *req.Money)
|
||||||
|
if err != nil {
|
||||||
|
return receiver.middleWare.ErrorOld(ctx, err)
|
||||||
|
}
|
||||||
|
|
||||||
hlogger.Emit(models.InfoRSPay{
|
hlogger.Emit(models.InfoRSPay{
|
||||||
CtxUserID: userID,
|
CtxUserID: userID,
|
||||||
CtxAccountID: user.ID,
|
CtxAccountID: user.ID,
|
@ -1,4 +1,4 @@
|
|||||||
package wallet
|
package wallet_client
|
||||||
|
|
||||||
import "github.com/gofiber/fiber/v2"
|
import "github.com/gofiber/fiber/v2"
|
||||||
|
|
@ -6,15 +6,15 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/fields"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
"go.mongodb.org/mongo-driver/bson"
|
"go.mongodb.org/mongo-driver/bson"
|
||||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||||
"go.mongodb.org/mongo-driver/mongo"
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
"go.mongodb.org/mongo-driver/mongo/options"
|
"go.mongodb.org/mongo-driver/mongo/options"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
mongoWrapper "penahub.gitlab.yandexcloud.net/backend/penahub_common/mongo"
|
mongoWrapper "penahub.gitlab.yandexcloud.net/backend/penahub_common/mongo"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/fields"
|
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type AccountRepositoryDeps struct {
|
type AccountRepositoryDeps struct {
|
||||||
|
@ -11,9 +11,9 @@ import (
|
|||||||
"go.mongodb.org/mongo-driver/mongo"
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
mongoWrapper "penahub.gitlab.yandexcloud.net/backend/penahub_common/mongo"
|
mongoWrapper "penahub.gitlab.yandexcloud.net/backend/penahub_common/mongo"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/fields"
|
"gitea.pena/PenaSide/customer/internal/fields"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CurrencyRepositoryDeps struct {
|
type CurrencyRepositoryDeps struct {
|
||||||
|
@ -4,8 +4,8 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
codeword_rpc "penahub.gitlab.yandexcloud.net/pena-services/customer/internal/proto/codeword"
|
codeword_rpc "gitea.pena/PenaSide/customer/internal/proto/codeword"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/utils"
|
"gitea.pena/PenaSide/customer/internal/utils"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go.mongodb.org/mongo-driver/bson"
|
"go.mongodb.org/mongo-driver/bson"
|
||||||
@ -14,10 +14,10 @@ import (
|
|||||||
"go.mongodb.org/mongo-driver/mongo/options"
|
"go.mongodb.org/mongo-driver/mongo/options"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
mongoWrapper "penahub.gitlab.yandexcloud.net/backend/penahub_common/mongo"
|
mongoWrapper "penahub.gitlab.yandexcloud.net/backend/penahub_common/mongo"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/fields"
|
"gitea.pena/PenaSide/customer/internal/fields"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/service/history"
|
"gitea.pena/PenaSide/customer/internal/service/history"
|
||||||
)
|
)
|
||||||
|
|
||||||
type HistoryRepositoryDeps struct {
|
type HistoryRepositoryDeps struct {
|
||||||
|
@ -15,6 +15,7 @@ type Account struct {
|
|||||||
DeletedAt *time.Time `json:"deletedAt,omitempty" bson:"deletedAt,omitempty"`
|
DeletedAt *time.Time `json:"deletedAt,omitempty" bson:"deletedAt,omitempty"`
|
||||||
From string `json:"from" bson:"from"`
|
From string `json:"from" bson:"from"`
|
||||||
Partner string `json:"partner" bson:"partner"`
|
Partner string `json:"partner" bson:"partner"`
|
||||||
|
Version uint32 `json:"version" bson:"version"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *Account) Sanitize() *Account {
|
func (receiver *Account) Sanitize() *Account {
|
||||||
@ -32,6 +33,7 @@ func (receiver *Account) Sanitize() *Account {
|
|||||||
//receiver.Partner = ""
|
//receiver.Partner = ""
|
||||||
receiver.DeletedAt = nil
|
receiver.DeletedAt = nil
|
||||||
receiver.Deleted = false
|
receiver.Deleted = false
|
||||||
|
receiver.Version = mongoVersion
|
||||||
|
|
||||||
return receiver
|
return receiver
|
||||||
}
|
}
|
||||||
|
@ -15,8 +15,10 @@ type Config struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ConfigurationHTTP struct {
|
type ConfigurationHTTP struct {
|
||||||
Host string `env:"HTTP_HOST,default=localhost"`
|
ClientHost string `env:"CLIENT_HTTP_HOST,default=localhost"`
|
||||||
Port string `env:"HTTP_PORT,default=8080"`
|
ClientPort string `env:"CLIENT_HTTP_PORT,default=8080"`
|
||||||
|
AdminHost string `env:"ADMIN_HTTP_HOST,default=localhost"`
|
||||||
|
AdminPort string `env:"ADMIN_HTTP_PORT,default=8081"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ConfigurationGRPC struct {
|
type ConfigurationGRPC struct {
|
||||||
@ -41,6 +43,10 @@ type ServiceConfiguration struct {
|
|||||||
PubKey string `env:"PUBLIC_KEY"`
|
PubKey string `env:"PUBLIC_KEY"`
|
||||||
PrivKey string `env:"PRIVATE_KEY"`
|
PrivKey string `env:"PRIVATE_KEY"`
|
||||||
ModuleLogger string `env:"MODULE_LOGGER"`
|
ModuleLogger string `env:"MODULE_LOGGER"`
|
||||||
|
NotificationBotToken string `env:"NOTIFICATION_BOT_TOKEN"`
|
||||||
|
NotificationChannel int64 `env:"NOTIFICATION_CHANNEL"`
|
||||||
|
AdminURL string `env:"ADMIN_FRONT_URL"`
|
||||||
|
NotificationRsPayChannel int64 `env:"NOTIFICATION_RS_PAY_CHANNEL"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type KafkaConfiguration struct {
|
type KafkaConfiguration struct {
|
||||||
@ -126,3 +132,5 @@ type PlainAuth struct {
|
|||||||
Username string `env:"MAIL_AUTH_USERNAME,required"`
|
Username string `env:"MAIL_AUTH_USERNAME,required"`
|
||||||
Password string `env:"MAIL_AUTH_PASSWORD,required"`
|
Password string `env:"MAIL_AUTH_PASSWORD,required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const mongoVersion uint32 = 1
|
||||||
|
@ -12,6 +12,7 @@ type CurrencyList struct {
|
|||||||
CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
|
CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
|
||||||
UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"`
|
UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"`
|
||||||
DeletedAt *time.Time `json:"deletedAt,omitempty" bson:"deletedAt,omitempty"`
|
DeletedAt *time.Time `json:"deletedAt,omitempty" bson:"deletedAt,omitempty"`
|
||||||
|
Version uint32 `json:"version" bson:"version"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *CurrencyList) Sanitize() *CurrencyList {
|
func (receiver *CurrencyList) Sanitize() *CurrencyList {
|
||||||
@ -22,6 +23,7 @@ func (receiver *CurrencyList) Sanitize() *CurrencyList {
|
|||||||
receiver.UpdatedAt = now
|
receiver.UpdatedAt = now
|
||||||
receiver.DeletedAt = nil
|
receiver.DeletedAt = nil
|
||||||
receiver.Deleted = false
|
receiver.Deleted = false
|
||||||
|
receiver.Version = mongoVersion
|
||||||
|
|
||||||
return receiver
|
return receiver
|
||||||
}
|
}
|
||||||
|
@ -7,11 +7,12 @@ type History struct {
|
|||||||
UserID string `json:"userId" bson:"userId"`
|
UserID string `json:"userId" bson:"userId"`
|
||||||
Comment string `json:"comment" bson:"comment"`
|
Comment string `json:"comment" bson:"comment"`
|
||||||
Key string `json:"key" bson:"key"`
|
Key string `json:"key" bson:"key"`
|
||||||
RawDetails RawDetails `json:"rawDetails" bson:"rawDetails"`
|
RawDetails RawDetails `json:"rawDetails" bson:"rawDetails"`
|
||||||
Deleted bool `json:"isDeleted" bson:"isDeleted"`
|
Deleted bool `json:"isDeleted" bson:"isDeleted"`
|
||||||
CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
|
CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
|
||||||
UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"`
|
UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"`
|
||||||
DeletedAt *time.Time `json:"deletedAt,omitempty" bson:"deletedAt,omitempty"`
|
DeletedAt *time.Time `json:"deletedAt,omitempty" bson:"deletedAt,omitempty"`
|
||||||
|
Version uint32 `json:"version" bson:"version"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type TariffID struct {
|
type TariffID struct {
|
||||||
@ -33,7 +34,7 @@ type ReportHistory struct {
|
|||||||
type RawDetails struct {
|
type RawDetails struct {
|
||||||
Tariffs []Tariff `json:"tariffs" bson:"tariffs"`
|
Tariffs []Tariff `json:"tariffs" bson:"tariffs"`
|
||||||
Price int64 `json:"price" bson:"price"`
|
Price int64 `json:"price" bson:"price"`
|
||||||
Comment string `json:"comment" bson:"comment"`
|
Comment string `json:"comment" bson:"comment"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *History) Sanitize() *History {
|
func (receiver *History) Sanitize() *History {
|
||||||
@ -44,6 +45,7 @@ func (receiver *History) Sanitize() *History {
|
|||||||
receiver.UpdatedAt = now
|
receiver.UpdatedAt = now
|
||||||
receiver.DeletedAt = nil
|
receiver.DeletedAt = nil
|
||||||
receiver.Deleted = false
|
receiver.Deleted = false
|
||||||
|
receiver.Version = mongoVersion
|
||||||
|
|
||||||
return receiver
|
return receiver
|
||||||
}
|
}
|
||||||
|
@ -5,29 +5,28 @@ type GetPaymentLinkBody struct {
|
|||||||
Currency string `json:"currency"`
|
Currency string `json:"currency"`
|
||||||
Amount int64 `json:"amount"`
|
Amount int64 `json:"amount"`
|
||||||
ReturnURL string `json:"returnUrl,omitempty"`
|
ReturnURL string `json:"returnUrl,omitempty"`
|
||||||
PhoneNumber string `json:"phoneNumber,omitempty"`
|
|
||||||
Login string `json:"login,omitempty"`
|
|
||||||
BankCard *BankCard `json:"bankCard,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetPaymentLinkRequest struct {
|
type GetPaymentLinkRequest struct {
|
||||||
Body *GetPaymentLinkBody
|
Body *GetPaymentLinkBody
|
||||||
ClientIP string
|
ClientIP string
|
||||||
UserID string
|
UserID string
|
||||||
|
Customer Customer
|
||||||
|
Items []Item
|
||||||
|
}
|
||||||
|
|
||||||
|
type Customer struct {
|
||||||
|
FullName, INN, Email, Phone string
|
||||||
|
}
|
||||||
|
|
||||||
|
type Item struct {
|
||||||
|
Description, Measure, Quantity, Money, Currency string
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetPaymentLinkResponse struct {
|
type GetPaymentLinkResponse struct {
|
||||||
Link string `json:"link"`
|
Link string `json:"link"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type BankCard struct {
|
|
||||||
Number string `json:"number"`
|
|
||||||
ExpiryYear string `json:"expiryYear"`
|
|
||||||
ExpiryMonth string `json:"expiryMonth"`
|
|
||||||
CSC *string `json:"csc,omitempty"`
|
|
||||||
CardHolderName *string `json:"cardholder,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type PaymentType string
|
type PaymentType string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -3,7 +3,7 @@ package models
|
|||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/proto/broker"
|
"gitea.pena/PenaSide/customer/internal/proto/broker"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Tariff struct {
|
type Tariff struct {
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package models
|
package models
|
||||||
|
|
||||||
type RespGeneratorService struct {
|
type RespGeneratorService struct {
|
||||||
DocNumber string `json:"docnumber"`
|
DocNumber string `json:"docnumber"`
|
||||||
Date string `json:"date"`
|
Date string `json:"date"`
|
||||||
OrgTaxNum string `json:"orgtaxnum"`
|
OrgTaxNum string `json:"orgtaxnum"`
|
||||||
OrgName string `json:"orgname"`
|
OrgName string `json:"orgname"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Amount string `json:"amount"`
|
Amount string `json:"amount"`
|
||||||
Price string `json:"price"`
|
Price string `json:"price"`
|
||||||
Sum string `json:"sum"`
|
Sum string `json:"sum"`
|
||||||
Unit string `json:"unit"`
|
Unit string `json:"unit"`
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ type AllFields struct {
|
|||||||
CtxPhone string
|
CtxPhone string
|
||||||
KeyCurrency string
|
KeyCurrency string
|
||||||
CtxTariffID string
|
CtxTariffID string
|
||||||
KeySuccess bool
|
KeySuccess uint8
|
||||||
|
|
||||||
CtxPrice int64
|
CtxPrice int64
|
||||||
CtxTariff string
|
CtxTariff string
|
||||||
@ -53,7 +53,7 @@ type InfoAddToCart struct {
|
|||||||
type InfoPayCart struct {
|
type InfoPayCart struct {
|
||||||
CtxUserID string //айдишник юзера из токена
|
CtxUserID string //айдишник юзера из токена
|
||||||
CtxAccountID string // айдишник аккаунта
|
CtxAccountID string // айдишник аккаунта
|
||||||
KeySuccess bool // получилось оплатить или не хватило денег
|
KeySuccess uint8 // получилось оплатить или не хватило денег
|
||||||
CtxPrice int64 // сумма в копейках. если не удалось оплатить - записать сколько денег не хватило
|
CtxPrice int64 // сумма в копейках. если не удалось оплатить - записать сколько денег не хватило
|
||||||
CtxTariff string // через запятую список покупаемых тарифов
|
CtxTariff string // через запятую список покупаемых тарифов
|
||||||
CtxDiscount string // через запятую список применённых скидок
|
CtxDiscount string // через запятую список применённых скидок
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.28.1
|
// protoc-gen-go v1.33.0
|
||||||
// protoc (unknown)
|
// protoc (unknown)
|
||||||
// source: broker/models.proto
|
// source: broker/models.proto
|
||||||
|
|
||||||
|
306
internal/proto/codeword_rpc/promo.pb.go
Normal file
306
internal/proto/codeword_rpc/promo.pb.go
Normal file
@ -0,0 +1,306 @@
|
|||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.33.0
|
||||||
|
// protoc (unknown)
|
||||||
|
// source: codeword/promo.proto
|
||||||
|
|
||||||
|
package codeword_rpc
|
||||||
|
|
||||||
|
import (
|
||||||
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
|
reflect "reflect"
|
||||||
|
sync "sync"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
// Verify that this generated code is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||||
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
|
)
|
||||||
|
|
||||||
|
type Time struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
From int64 `protobuf:"varint,1,opt,name=from,proto3" json:"from,omitempty"`
|
||||||
|
To int64 `protobuf:"varint,2,opt,name=to,proto3" json:"to,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Time) Reset() {
|
||||||
|
*x = Time{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_codeword_promo_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Time) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*Time) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *Time) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_codeword_promo_proto_msgTypes[0]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use Time.ProtoReflect.Descriptor instead.
|
||||||
|
func (*Time) Descriptor() ([]byte, []int) {
|
||||||
|
return file_codeword_promo_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Time) GetFrom() int64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.From
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Time) GetTo() int64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.To
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
type PromoActivationResp struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
|
||||||
|
Users []*PromoActivationResp_UserTime `protobuf:"bytes,2,rep,name=Users,proto3" json:"Users,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PromoActivationResp) Reset() {
|
||||||
|
*x = PromoActivationResp{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_codeword_promo_proto_msgTypes[1]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PromoActivationResp) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*PromoActivationResp) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *PromoActivationResp) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_codeword_promo_proto_msgTypes[1]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use PromoActivationResp.ProtoReflect.Descriptor instead.
|
||||||
|
func (*PromoActivationResp) Descriptor() ([]byte, []int) {
|
||||||
|
return file_codeword_promo_proto_rawDescGZIP(), []int{1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PromoActivationResp) GetID() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.ID
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PromoActivationResp) GetUsers() []*PromoActivationResp_UserTime {
|
||||||
|
if x != nil {
|
||||||
|
return x.Users
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type PromoActivationResp_UserTime struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
UserID string `protobuf:"bytes,1,opt,name=UserID,proto3" json:"UserID,omitempty"`
|
||||||
|
Time int64 `protobuf:"varint,2,opt,name=Time,proto3" json:"Time,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PromoActivationResp_UserTime) Reset() {
|
||||||
|
*x = PromoActivationResp_UserTime{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_codeword_promo_proto_msgTypes[2]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PromoActivationResp_UserTime) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*PromoActivationResp_UserTime) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *PromoActivationResp_UserTime) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_codeword_promo_proto_msgTypes[2]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use PromoActivationResp_UserTime.ProtoReflect.Descriptor instead.
|
||||||
|
func (*PromoActivationResp_UserTime) Descriptor() ([]byte, []int) {
|
||||||
|
return file_codeword_promo_proto_rawDescGZIP(), []int{1, 0}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PromoActivationResp_UserTime) GetUserID() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.UserID
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PromoActivationResp_UserTime) GetTime() int64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Time
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_codeword_promo_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
var file_codeword_promo_proto_rawDesc = []byte{
|
||||||
|
0x0a, 0x14, 0x63, 0x6f, 0x64, 0x65, 0x77, 0x6f, 0x72, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x6d, 0x6f,
|
||||||
|
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x63, 0x6f, 0x64, 0x65, 0x77, 0x6f, 0x72, 0x64,
|
||||||
|
0x22, 0x2a, 0x0a, 0x04, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d,
|
||||||
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02,
|
||||||
|
0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x74, 0x6f, 0x22, 0x9b, 0x01, 0x0a,
|
||||||
|
0x13, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||||
|
0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||||
|
0x52, 0x02, 0x49, 0x44, 0x12, 0x3c, 0x0a, 0x05, 0x55, 0x73, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20,
|
||||||
|
0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x77, 0x6f, 0x72, 0x64, 0x2e, 0x50,
|
||||||
|
0x72, 0x6f, 0x6d, 0x6f, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65,
|
||||||
|
0x73, 0x70, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x05, 0x55, 0x73, 0x65,
|
||||||
|
0x72, 0x73, 0x1a, 0x36, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16,
|
||||||
|
0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
|
||||||
|
0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02,
|
||||||
|
0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x54, 0x69, 0x6d, 0x65, 0x32, 0x5d, 0x0a, 0x10, 0x50, 0x72,
|
||||||
|
0x6f, 0x6d, 0x6f, 0x43, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x49,
|
||||||
|
0x0a, 0x16, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x41, 0x63, 0x74,
|
||||||
|
0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x0e, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x77,
|
||||||
|
0x6f, 0x72, 0x64, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x1a, 0x1d, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x77,
|
||||||
|
0x6f, 0x72, 0x64, 0x2e, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74,
|
||||||
|
0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x30, 0x01, 0x42, 0x10, 0x5a, 0x0e, 0x2e, 0x2f, 0x63,
|
||||||
|
0x6f, 0x64, 0x65, 0x77, 0x6f, 0x72, 0x64, 0x5f, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||||
|
0x74, 0x6f, 0x33,
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_codeword_promo_proto_rawDescOnce sync.Once
|
||||||
|
file_codeword_promo_proto_rawDescData = file_codeword_promo_proto_rawDesc
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_codeword_promo_proto_rawDescGZIP() []byte {
|
||||||
|
file_codeword_promo_proto_rawDescOnce.Do(func() {
|
||||||
|
file_codeword_promo_proto_rawDescData = protoimpl.X.CompressGZIP(file_codeword_promo_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_codeword_promo_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_codeword_promo_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||||
|
var file_codeword_promo_proto_goTypes = []interface{}{
|
||||||
|
(*Time)(nil), // 0: codeword.Time
|
||||||
|
(*PromoActivationResp)(nil), // 1: codeword.PromoActivationResp
|
||||||
|
(*PromoActivationResp_UserTime)(nil), // 2: codeword.PromoActivationResp.UserTime
|
||||||
|
}
|
||||||
|
var file_codeword_promo_proto_depIdxs = []int32{
|
||||||
|
2, // 0: codeword.PromoActivationResp.Users:type_name -> codeword.PromoActivationResp.UserTime
|
||||||
|
0, // 1: codeword.PromoCodeService.GetAllPromoActivations:input_type -> codeword.Time
|
||||||
|
1, // 2: codeword.PromoCodeService.GetAllPromoActivations:output_type -> codeword.PromoActivationResp
|
||||||
|
2, // [2:3] is the sub-list for method output_type
|
||||||
|
1, // [1:2] is the sub-list for method input_type
|
||||||
|
1, // [1:1] is the sub-list for extension type_name
|
||||||
|
1, // [1:1] is the sub-list for extension extendee
|
||||||
|
0, // [0:1] is the sub-list for field type_name
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { file_codeword_promo_proto_init() }
|
||||||
|
func file_codeword_promo_proto_init() {
|
||||||
|
if File_codeword_promo_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_codeword_promo_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*Time); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_codeword_promo_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*PromoActivationResp); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_codeword_promo_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*PromoActivationResp_UserTime); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
type x struct{}
|
||||||
|
out := protoimpl.TypeBuilder{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: file_codeword_promo_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 3,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 1,
|
||||||
|
},
|
||||||
|
GoTypes: file_codeword_promo_proto_goTypes,
|
||||||
|
DependencyIndexes: file_codeword_promo_proto_depIdxs,
|
||||||
|
MessageInfos: file_codeword_promo_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_codeword_promo_proto = out.File
|
||||||
|
file_codeword_promo_proto_rawDesc = nil
|
||||||
|
file_codeword_promo_proto_goTypes = nil
|
||||||
|
file_codeword_promo_proto_depIdxs = nil
|
||||||
|
}
|
134
internal/proto/codeword_rpc/promo_grpc.pb.go
Normal file
134
internal/proto/codeword_rpc/promo_grpc.pb.go
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// - protoc-gen-go-grpc v1.3.0
|
||||||
|
// - protoc (unknown)
|
||||||
|
// source: codeword/promo.proto
|
||||||
|
|
||||||
|
package codeword_rpc
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
const (
|
||||||
|
PromoCodeService_GetAllPromoActivations_FullMethodName = "/codeword.PromoCodeService/GetAllPromoActivations"
|
||||||
|
)
|
||||||
|
|
||||||
|
// PromoCodeServiceClient is the client API for PromoCodeService service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type PromoCodeServiceClient interface {
|
||||||
|
GetAllPromoActivations(ctx context.Context, in *Time, opts ...grpc.CallOption) (PromoCodeService_GetAllPromoActivationsClient, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type promoCodeServiceClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewPromoCodeServiceClient(cc grpc.ClientConnInterface) PromoCodeServiceClient {
|
||||||
|
return &promoCodeServiceClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *promoCodeServiceClient) GetAllPromoActivations(ctx context.Context, in *Time, opts ...grpc.CallOption) (PromoCodeService_GetAllPromoActivationsClient, error) {
|
||||||
|
stream, err := c.cc.NewStream(ctx, &PromoCodeService_ServiceDesc.Streams[0], PromoCodeService_GetAllPromoActivations_FullMethodName, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
x := &promoCodeServiceGetAllPromoActivationsClient{stream}
|
||||||
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if err := x.ClientStream.CloseSend(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return x, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type PromoCodeService_GetAllPromoActivationsClient interface {
|
||||||
|
Recv() (*PromoActivationResp, error)
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type promoCodeServiceGetAllPromoActivationsClient struct {
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *promoCodeServiceGetAllPromoActivationsClient) Recv() (*PromoActivationResp, error) {
|
||||||
|
m := new(PromoActivationResp)
|
||||||
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return m, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// PromoCodeServiceServer is the server API for PromoCodeService service.
|
||||||
|
// All implementations should embed UnimplementedPromoCodeServiceServer
|
||||||
|
// for forward compatibility
|
||||||
|
type PromoCodeServiceServer interface {
|
||||||
|
GetAllPromoActivations(*Time, PromoCodeService_GetAllPromoActivationsServer) error
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedPromoCodeServiceServer should be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedPromoCodeServiceServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedPromoCodeServiceServer) GetAllPromoActivations(*Time, PromoCodeService_GetAllPromoActivationsServer) error {
|
||||||
|
return status.Errorf(codes.Unimplemented, "method GetAllPromoActivations not implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnsafePromoCodeServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to PromoCodeServiceServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafePromoCodeServiceServer interface {
|
||||||
|
mustEmbedUnimplementedPromoCodeServiceServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterPromoCodeServiceServer(s grpc.ServiceRegistrar, srv PromoCodeServiceServer) {
|
||||||
|
s.RegisterService(&PromoCodeService_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _PromoCodeService_GetAllPromoActivations_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||||
|
m := new(Time)
|
||||||
|
if err := stream.RecvMsg(m); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return srv.(PromoCodeServiceServer).GetAllPromoActivations(m, &promoCodeServiceGetAllPromoActivationsServer{stream})
|
||||||
|
}
|
||||||
|
|
||||||
|
type PromoCodeService_GetAllPromoActivationsServer interface {
|
||||||
|
Send(*PromoActivationResp) error
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type promoCodeServiceGetAllPromoActivationsServer struct {
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *promoCodeServiceGetAllPromoActivationsServer) Send(m *PromoActivationResp) error {
|
||||||
|
return x.ServerStream.SendMsg(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// PromoCodeService_ServiceDesc is the grpc.ServiceDesc for PromoCodeService service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var PromoCodeService_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "codeword.PromoCodeService",
|
||||||
|
HandlerType: (*PromoCodeServiceServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{},
|
||||||
|
Streams: []grpc.StreamDesc{
|
||||||
|
{
|
||||||
|
StreamName: "GetAllPromoActivations",
|
||||||
|
Handler: _PromoCodeService_GetAllPromoActivations_Handler,
|
||||||
|
ServerStreams: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Metadata: "codeword/promo.proto",
|
||||||
|
}
|
@ -1,4 +1,8 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// - protoc-gen-go-grpc v1.3.0
|
||||||
|
// - protoc (unknown)
|
||||||
|
// source: customer/service.proto
|
||||||
|
|
||||||
package customer
|
package customer
|
||||||
|
|
||||||
@ -15,6 +19,10 @@ import (
|
|||||||
// Requires gRPC-Go v1.32.0 or later.
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
const _ = grpc.SupportPackageIsVersion7
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
const (
|
||||||
|
CustomerService_InsertHistory_FullMethodName = "/customer.CustomerService/InsertHistory"
|
||||||
|
)
|
||||||
|
|
||||||
// CustomerServiceClient is the client API for CustomerService service.
|
// CustomerServiceClient is the client API for CustomerService service.
|
||||||
//
|
//
|
||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
@ -33,7 +41,7 @@ func NewCustomerServiceClient(cc grpc.ClientConnInterface) CustomerServiceClient
|
|||||||
|
|
||||||
func (c *customerServiceClient) InsertHistory(ctx context.Context, in *History, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
func (c *customerServiceClient) InsertHistory(ctx context.Context, in *History, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||||
out := new(emptypb.Empty)
|
out := new(emptypb.Empty)
|
||||||
err := c.cc.Invoke(ctx, "/customer.CustomerService/InsertHistory", in, out, opts...)
|
err := c.cc.Invoke(ctx, CustomerService_InsertHistory_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -91,7 +99,7 @@ func _CustomerService_InsertHistory_Handler(srv interface{}, ctx context.Context
|
|||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/customer.CustomerService/InsertHistory",
|
FullMethod: CustomerService_InsertHistory_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(CustomerServiceServer).InsertHistory(ctx, req.(*History))
|
return srv.(CustomerServiceServer).InsertHistory(ctx, req.(*History))
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.28.1
|
// protoc-gen-go v1.33.0
|
||||||
// protoc (unknown)
|
// protoc (unknown)
|
||||||
// source: discount/audit.model.proto
|
// source: discount/audit.model.proto
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.28.1
|
// protoc-gen-go v1.33.0
|
||||||
// protoc (unknown)
|
// protoc (unknown)
|
||||||
// source: discount/discount.model.proto
|
// source: discount/discount.model.proto
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.28.1
|
// protoc-gen-go v1.33.0
|
||||||
// protoc (unknown)
|
// protoc (unknown)
|
||||||
// source: discount/service.proto
|
// source: discount/service.proto
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-grpc v1.2.0
|
// - protoc-gen-go-grpc v1.3.0
|
||||||
// - protoc (unknown)
|
// - protoc (unknown)
|
||||||
// source: discount/service.proto
|
// source: discount/service.proto
|
||||||
|
|
||||||
@ -19,6 +19,18 @@ import (
|
|||||||
// Requires gRPC-Go v1.32.0 or later.
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
const _ = grpc.SupportPackageIsVersion7
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
const (
|
||||||
|
DiscountService_GetAllDiscounts_FullMethodName = "/discount.DiscountService/GetAllDiscounts"
|
||||||
|
DiscountService_GetUserDiscounts_FullMethodName = "/discount.DiscountService/GetUserDiscounts"
|
||||||
|
DiscountService_DetermineDiscounts_FullMethodName = "/discount.DiscountService/DetermineDiscounts"
|
||||||
|
DiscountService_ApplyDiscounts_FullMethodName = "/discount.DiscountService/ApplyDiscounts"
|
||||||
|
DiscountService_GetDiscountByID_FullMethodName = "/discount.DiscountService/GetDiscountByID"
|
||||||
|
DiscountService_CreateDiscount_FullMethodName = "/discount.DiscountService/CreateDiscount"
|
||||||
|
DiscountService_ReplaceDiscount_FullMethodName = "/discount.DiscountService/ReplaceDiscount"
|
||||||
|
DiscountService_UpdateDiscount_FullMethodName = "/discount.DiscountService/UpdateDiscount"
|
||||||
|
DiscountService_DeleteDiscount_FullMethodName = "/discount.DiscountService/DeleteDiscount"
|
||||||
|
)
|
||||||
|
|
||||||
// DiscountServiceClient is the client API for DiscountService service.
|
// DiscountServiceClient is the client API for DiscountService service.
|
||||||
//
|
//
|
||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
@ -44,7 +56,7 @@ func NewDiscountServiceClient(cc grpc.ClientConnInterface) DiscountServiceClient
|
|||||||
|
|
||||||
func (c *discountServiceClient) GetAllDiscounts(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Discounts, error) {
|
func (c *discountServiceClient) GetAllDiscounts(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Discounts, error) {
|
||||||
out := new(Discounts)
|
out := new(Discounts)
|
||||||
err := c.cc.Invoke(ctx, "/discount.DiscountService/GetAllDiscounts", in, out, opts...)
|
err := c.cc.Invoke(ctx, DiscountService_GetAllDiscounts_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -53,7 +65,7 @@ func (c *discountServiceClient) GetAllDiscounts(ctx context.Context, in *emptypb
|
|||||||
|
|
||||||
func (c *discountServiceClient) GetUserDiscounts(ctx context.Context, in *GetDiscountByIDRequest, opts ...grpc.CallOption) (*Discounts, error) {
|
func (c *discountServiceClient) GetUserDiscounts(ctx context.Context, in *GetDiscountByIDRequest, opts ...grpc.CallOption) (*Discounts, error) {
|
||||||
out := new(Discounts)
|
out := new(Discounts)
|
||||||
err := c.cc.Invoke(ctx, "/discount.DiscountService/GetUserDiscounts", in, out, opts...)
|
err := c.cc.Invoke(ctx, DiscountService_GetUserDiscounts_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -62,7 +74,7 @@ func (c *discountServiceClient) GetUserDiscounts(ctx context.Context, in *GetDis
|
|||||||
|
|
||||||
func (c *discountServiceClient) DetermineDiscounts(ctx context.Context, in *ApplyDiscountRequest, opts ...grpc.CallOption) (*Discounts, error) {
|
func (c *discountServiceClient) DetermineDiscounts(ctx context.Context, in *ApplyDiscountRequest, opts ...grpc.CallOption) (*Discounts, error) {
|
||||||
out := new(Discounts)
|
out := new(Discounts)
|
||||||
err := c.cc.Invoke(ctx, "/discount.DiscountService/DetermineDiscounts", in, out, opts...)
|
err := c.cc.Invoke(ctx, DiscountService_DetermineDiscounts_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -71,7 +83,7 @@ func (c *discountServiceClient) DetermineDiscounts(ctx context.Context, in *Appl
|
|||||||
|
|
||||||
func (c *discountServiceClient) ApplyDiscounts(ctx context.Context, in *ApplyDiscountRequest, opts ...grpc.CallOption) (*ApplyDiscountResponse, error) {
|
func (c *discountServiceClient) ApplyDiscounts(ctx context.Context, in *ApplyDiscountRequest, opts ...grpc.CallOption) (*ApplyDiscountResponse, error) {
|
||||||
out := new(ApplyDiscountResponse)
|
out := new(ApplyDiscountResponse)
|
||||||
err := c.cc.Invoke(ctx, "/discount.DiscountService/ApplyDiscounts", in, out, opts...)
|
err := c.cc.Invoke(ctx, DiscountService_ApplyDiscounts_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -80,7 +92,7 @@ func (c *discountServiceClient) ApplyDiscounts(ctx context.Context, in *ApplyDis
|
|||||||
|
|
||||||
func (c *discountServiceClient) GetDiscountByID(ctx context.Context, in *GetDiscountByIDRequest, opts ...grpc.CallOption) (*Discount, error) {
|
func (c *discountServiceClient) GetDiscountByID(ctx context.Context, in *GetDiscountByIDRequest, opts ...grpc.CallOption) (*Discount, error) {
|
||||||
out := new(Discount)
|
out := new(Discount)
|
||||||
err := c.cc.Invoke(ctx, "/discount.DiscountService/GetDiscountByID", in, out, opts...)
|
err := c.cc.Invoke(ctx, DiscountService_GetDiscountByID_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -89,7 +101,7 @@ func (c *discountServiceClient) GetDiscountByID(ctx context.Context, in *GetDisc
|
|||||||
|
|
||||||
func (c *discountServiceClient) CreateDiscount(ctx context.Context, in *CreateDiscountRequest, opts ...grpc.CallOption) (*Discount, error) {
|
func (c *discountServiceClient) CreateDiscount(ctx context.Context, in *CreateDiscountRequest, opts ...grpc.CallOption) (*Discount, error) {
|
||||||
out := new(Discount)
|
out := new(Discount)
|
||||||
err := c.cc.Invoke(ctx, "/discount.DiscountService/CreateDiscount", in, out, opts...)
|
err := c.cc.Invoke(ctx, DiscountService_CreateDiscount_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -98,7 +110,7 @@ func (c *discountServiceClient) CreateDiscount(ctx context.Context, in *CreateDi
|
|||||||
|
|
||||||
func (c *discountServiceClient) ReplaceDiscount(ctx context.Context, in *DiscountOptional, opts ...grpc.CallOption) (*Discount, error) {
|
func (c *discountServiceClient) ReplaceDiscount(ctx context.Context, in *DiscountOptional, opts ...grpc.CallOption) (*Discount, error) {
|
||||||
out := new(Discount)
|
out := new(Discount)
|
||||||
err := c.cc.Invoke(ctx, "/discount.DiscountService/ReplaceDiscount", in, out, opts...)
|
err := c.cc.Invoke(ctx, DiscountService_ReplaceDiscount_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -107,7 +119,7 @@ func (c *discountServiceClient) ReplaceDiscount(ctx context.Context, in *Discoun
|
|||||||
|
|
||||||
func (c *discountServiceClient) UpdateDiscount(ctx context.Context, in *DiscountOptional, opts ...grpc.CallOption) (*Discount, error) {
|
func (c *discountServiceClient) UpdateDiscount(ctx context.Context, in *DiscountOptional, opts ...grpc.CallOption) (*Discount, error) {
|
||||||
out := new(Discount)
|
out := new(Discount)
|
||||||
err := c.cc.Invoke(ctx, "/discount.DiscountService/UpdateDiscount", in, out, opts...)
|
err := c.cc.Invoke(ctx, DiscountService_UpdateDiscount_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -116,7 +128,7 @@ func (c *discountServiceClient) UpdateDiscount(ctx context.Context, in *Discount
|
|||||||
|
|
||||||
func (c *discountServiceClient) DeleteDiscount(ctx context.Context, in *GetDiscountByIDRequest, opts ...grpc.CallOption) (*Discount, error) {
|
func (c *discountServiceClient) DeleteDiscount(ctx context.Context, in *GetDiscountByIDRequest, opts ...grpc.CallOption) (*Discount, error) {
|
||||||
out := new(Discount)
|
out := new(Discount)
|
||||||
err := c.cc.Invoke(ctx, "/discount.DiscountService/DeleteDiscount", in, out, opts...)
|
err := c.cc.Invoke(ctx, DiscountService_DeleteDiscount_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -191,7 +203,7 @@ func _DiscountService_GetAllDiscounts_Handler(srv interface{}, ctx context.Conte
|
|||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/discount.DiscountService/GetAllDiscounts",
|
FullMethod: DiscountService_GetAllDiscounts_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(DiscountServiceServer).GetAllDiscounts(ctx, req.(*emptypb.Empty))
|
return srv.(DiscountServiceServer).GetAllDiscounts(ctx, req.(*emptypb.Empty))
|
||||||
@ -209,7 +221,7 @@ func _DiscountService_GetUserDiscounts_Handler(srv interface{}, ctx context.Cont
|
|||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/discount.DiscountService/GetUserDiscounts",
|
FullMethod: DiscountService_GetUserDiscounts_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(DiscountServiceServer).GetUserDiscounts(ctx, req.(*GetDiscountByIDRequest))
|
return srv.(DiscountServiceServer).GetUserDiscounts(ctx, req.(*GetDiscountByIDRequest))
|
||||||
@ -227,7 +239,7 @@ func _DiscountService_DetermineDiscounts_Handler(srv interface{}, ctx context.Co
|
|||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/discount.DiscountService/DetermineDiscounts",
|
FullMethod: DiscountService_DetermineDiscounts_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(DiscountServiceServer).DetermineDiscounts(ctx, req.(*ApplyDiscountRequest))
|
return srv.(DiscountServiceServer).DetermineDiscounts(ctx, req.(*ApplyDiscountRequest))
|
||||||
@ -245,7 +257,7 @@ func _DiscountService_ApplyDiscounts_Handler(srv interface{}, ctx context.Contex
|
|||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/discount.DiscountService/ApplyDiscounts",
|
FullMethod: DiscountService_ApplyDiscounts_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(DiscountServiceServer).ApplyDiscounts(ctx, req.(*ApplyDiscountRequest))
|
return srv.(DiscountServiceServer).ApplyDiscounts(ctx, req.(*ApplyDiscountRequest))
|
||||||
@ -263,7 +275,7 @@ func _DiscountService_GetDiscountByID_Handler(srv interface{}, ctx context.Conte
|
|||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/discount.DiscountService/GetDiscountByID",
|
FullMethod: DiscountService_GetDiscountByID_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(DiscountServiceServer).GetDiscountByID(ctx, req.(*GetDiscountByIDRequest))
|
return srv.(DiscountServiceServer).GetDiscountByID(ctx, req.(*GetDiscountByIDRequest))
|
||||||
@ -281,7 +293,7 @@ func _DiscountService_CreateDiscount_Handler(srv interface{}, ctx context.Contex
|
|||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/discount.DiscountService/CreateDiscount",
|
FullMethod: DiscountService_CreateDiscount_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(DiscountServiceServer).CreateDiscount(ctx, req.(*CreateDiscountRequest))
|
return srv.(DiscountServiceServer).CreateDiscount(ctx, req.(*CreateDiscountRequest))
|
||||||
@ -299,7 +311,7 @@ func _DiscountService_ReplaceDiscount_Handler(srv interface{}, ctx context.Conte
|
|||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/discount.DiscountService/ReplaceDiscount",
|
FullMethod: DiscountService_ReplaceDiscount_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(DiscountServiceServer).ReplaceDiscount(ctx, req.(*DiscountOptional))
|
return srv.(DiscountServiceServer).ReplaceDiscount(ctx, req.(*DiscountOptional))
|
||||||
@ -317,7 +329,7 @@ func _DiscountService_UpdateDiscount_Handler(srv interface{}, ctx context.Contex
|
|||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/discount.DiscountService/UpdateDiscount",
|
FullMethod: DiscountService_UpdateDiscount_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(DiscountServiceServer).UpdateDiscount(ctx, req.(*DiscountOptional))
|
return srv.(DiscountServiceServer).UpdateDiscount(ctx, req.(*DiscountOptional))
|
||||||
@ -335,7 +347,7 @@ func _DiscountService_DeleteDiscount_Handler(srv interface{}, ctx context.Contex
|
|||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/discount.DiscountService/DeleteDiscount",
|
FullMethod: DiscountService_DeleteDiscount_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(DiscountServiceServer).DeleteDiscount(ctx, req.(*GetDiscountByIDRequest))
|
return srv.(DiscountServiceServer).DeleteDiscount(ctx, req.(*GetDiscountByIDRequest))
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.28.1
|
// protoc-gen-go v1.33.0
|
||||||
// protoc (unknown)
|
// protoc (unknown)
|
||||||
// source: google/api/annotations.proto
|
// source: google/api/annotations.proto
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.28.1
|
// protoc-gen-go v1.33.0
|
||||||
// protoc (unknown)
|
// protoc (unknown)
|
||||||
// source: google/api/http.proto
|
// source: google/api/http.proto
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.28.1
|
// protoc-gen-go v1.33.0
|
||||||
// protoc (unknown)
|
// protoc (unknown)
|
||||||
// source: callback/service.proto
|
// source: callback/service.proto
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-grpc v1.2.0
|
// - protoc-gen-go-grpc v1.3.0
|
||||||
// - protoc (unknown)
|
// - protoc (unknown)
|
||||||
// source: callback/service.proto
|
// source: callback/service.proto
|
||||||
|
|
||||||
@ -19,6 +19,11 @@ import (
|
|||||||
// Requires gRPC-Go v1.32.0 or later.
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
const _ = grpc.SupportPackageIsVersion7
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
const (
|
||||||
|
PaymentCallbackService_OnSuccess_FullMethodName = "/payment_callback.PaymentCallbackService/OnSuccess"
|
||||||
|
PaymentCallbackService_OnFailure_FullMethodName = "/payment_callback.PaymentCallbackService/OnFailure"
|
||||||
|
)
|
||||||
|
|
||||||
// PaymentCallbackServiceClient is the client API for PaymentCallbackService service.
|
// PaymentCallbackServiceClient is the client API for PaymentCallbackService service.
|
||||||
//
|
//
|
||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
@ -37,7 +42,7 @@ func NewPaymentCallbackServiceClient(cc grpc.ClientConnInterface) PaymentCallbac
|
|||||||
|
|
||||||
func (c *paymentCallbackServiceClient) OnSuccess(ctx context.Context, in *Event, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
func (c *paymentCallbackServiceClient) OnSuccess(ctx context.Context, in *Event, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||||
out := new(emptypb.Empty)
|
out := new(emptypb.Empty)
|
||||||
err := c.cc.Invoke(ctx, "/payment_callback.PaymentCallbackService/OnSuccess", in, out, opts...)
|
err := c.cc.Invoke(ctx, PaymentCallbackService_OnSuccess_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -46,7 +51,7 @@ func (c *paymentCallbackServiceClient) OnSuccess(ctx context.Context, in *Event,
|
|||||||
|
|
||||||
func (c *paymentCallbackServiceClient) OnFailure(ctx context.Context, in *Event, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
func (c *paymentCallbackServiceClient) OnFailure(ctx context.Context, in *Event, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||||
out := new(emptypb.Empty)
|
out := new(emptypb.Empty)
|
||||||
err := c.cc.Invoke(ctx, "/payment_callback.PaymentCallbackService/OnFailure", in, out, opts...)
|
err := c.cc.Invoke(ctx, PaymentCallbackService_OnFailure_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -93,7 +98,7 @@ func _PaymentCallbackService_OnSuccess_Handler(srv interface{}, ctx context.Cont
|
|||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/payment_callback.PaymentCallbackService/OnSuccess",
|
FullMethod: PaymentCallbackService_OnSuccess_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(PaymentCallbackServiceServer).OnSuccess(ctx, req.(*Event))
|
return srv.(PaymentCallbackServiceServer).OnSuccess(ctx, req.(*Event))
|
||||||
@ -111,7 +116,7 @@ func _PaymentCallbackService_OnFailure_Handler(srv interface{}, ctx context.Cont
|
|||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/payment_callback.PaymentCallbackService/OnFailure",
|
FullMethod: PaymentCallbackService_OnFailure_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(PaymentCallbackServiceServer).OnFailure(ctx, req.(*Event))
|
return srv.(PaymentCallbackServiceServer).OnFailure(ctx, req.(*Event))
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.28.1
|
// protoc-gen-go v1.33.0
|
||||||
// protoc (unknown)
|
// protoc (unknown)
|
||||||
// source: treasurer/payment.model.proto
|
// source: treasurer/payment.model.proto
|
||||||
|
|
||||||
@ -25,12 +25,14 @@ type MainPaymentSettings struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Currency string `protobuf:"bytes,1,opt,name=Currency,proto3" json:"Currency,omitempty"`
|
Currency string `protobuf:"bytes,1,opt,name=Currency,proto3" json:"Currency,omitempty"`
|
||||||
Amount int64 `protobuf:"varint,2,opt,name=Amount,proto3" json:"Amount,omitempty"`
|
Amount int64 `protobuf:"varint,2,opt,name=Amount,proto3" json:"Amount,omitempty"`
|
||||||
CallbackHostGRPC []string `protobuf:"bytes,3,rep,name=CallbackHostGRPC,proto3" json:"CallbackHostGRPC,omitempty"`
|
CallbackHostGRPC []string `protobuf:"bytes,3,rep,name=CallbackHostGRPC,proto3" json:"CallbackHostGRPC,omitempty"`
|
||||||
ReturnURL string `protobuf:"bytes,4,opt,name=ReturnURL,proto3" json:"ReturnURL,omitempty"`
|
ReturnURL string `protobuf:"bytes,4,opt,name=ReturnURL,proto3" json:"ReturnURL,omitempty"`
|
||||||
UserID string `protobuf:"bytes,5,opt,name=UserID,proto3" json:"UserID,omitempty"`
|
UserID string `protobuf:"bytes,5,opt,name=UserID,proto3" json:"UserID,omitempty"`
|
||||||
ClientIP string `protobuf:"bytes,6,opt,name=ClientIP,proto3" json:"ClientIP,omitempty"`
|
ClientIP string `protobuf:"bytes,6,opt,name=ClientIP,proto3" json:"ClientIP,omitempty"`
|
||||||
|
Customer *Customer `protobuf:"bytes,7,opt,name=Customer,proto3" json:"Customer,omitempty"`
|
||||||
|
Items []*Item `protobuf:"bytes,8,rep,name=Items,proto3" json:"Items,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *MainPaymentSettings) Reset() {
|
func (x *MainPaymentSettings) Reset() {
|
||||||
@ -107,20 +109,33 @@ func (x *MainPaymentSettings) GetClientIP() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
type BankCardInformation struct {
|
func (x *MainPaymentSettings) GetCustomer() *Customer {
|
||||||
|
if x != nil {
|
||||||
|
return x.Customer
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MainPaymentSettings) GetItems() []*Item {
|
||||||
|
if x != nil {
|
||||||
|
return x.Items
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type Customer struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Number string `protobuf:"bytes,1,opt,name=Number,proto3" json:"Number,omitempty"`
|
FullName string `protobuf:"bytes,1,opt,name=FullName,proto3" json:"FullName,omitempty"`
|
||||||
ExpiryYear string `protobuf:"bytes,2,opt,name=ExpiryYear,proto3" json:"ExpiryYear,omitempty"`
|
INN string `protobuf:"bytes,2,opt,name=INN,proto3" json:"INN,omitempty"`
|
||||||
ExpiryMonth string `protobuf:"bytes,3,opt,name=ExpiryMonth,proto3" json:"ExpiryMonth,omitempty"`
|
Email string `protobuf:"bytes,3,opt,name=Email,proto3" json:"Email,omitempty"`
|
||||||
CSC *string `protobuf:"bytes,4,opt,name=CSC,proto3,oneof" json:"CSC,omitempty"`
|
Phone string `protobuf:"bytes,4,opt,name=Phone,proto3" json:"Phone,omitempty"`
|
||||||
CardHolderName *string `protobuf:"bytes,5,opt,name=CardHolderName,proto3,oneof" json:"CardHolderName,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *BankCardInformation) Reset() {
|
func (x *Customer) Reset() {
|
||||||
*x = BankCardInformation{}
|
*x = Customer{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_treasurer_payment_model_proto_msgTypes[1]
|
mi := &file_treasurer_payment_model_proto_msgTypes[1]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
@ -128,13 +143,13 @@ func (x *BankCardInformation) Reset() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *BankCardInformation) String() string {
|
func (x *Customer) String() string {
|
||||||
return protoimpl.X.MessageStringOf(x)
|
return protoimpl.X.MessageStringOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*BankCardInformation) ProtoMessage() {}
|
func (*Customer) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *BankCardInformation) ProtoReflect() protoreflect.Message {
|
func (x *Customer) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_treasurer_payment_model_proto_msgTypes[1]
|
mi := &file_treasurer_payment_model_proto_msgTypes[1]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
@ -146,42 +161,114 @@ func (x *BankCardInformation) ProtoReflect() protoreflect.Message {
|
|||||||
return mi.MessageOf(x)
|
return mi.MessageOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: Use BankCardInformation.ProtoReflect.Descriptor instead.
|
// Deprecated: Use Customer.ProtoReflect.Descriptor instead.
|
||||||
func (*BankCardInformation) Descriptor() ([]byte, []int) {
|
func (*Customer) Descriptor() ([]byte, []int) {
|
||||||
return file_treasurer_payment_model_proto_rawDescGZIP(), []int{1}
|
return file_treasurer_payment_model_proto_rawDescGZIP(), []int{1}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *BankCardInformation) GetNumber() string {
|
func (x *Customer) GetFullName() string {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Number
|
return x.FullName
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *BankCardInformation) GetExpiryYear() string {
|
func (x *Customer) GetINN() string {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.ExpiryYear
|
return x.INN
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *BankCardInformation) GetExpiryMonth() string {
|
func (x *Customer) GetEmail() string {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.ExpiryMonth
|
return x.Email
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *BankCardInformation) GetCSC() string {
|
func (x *Customer) GetPhone() string {
|
||||||
if x != nil && x.CSC != nil {
|
if x != nil {
|
||||||
return *x.CSC
|
return x.Phone
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *BankCardInformation) GetCardHolderName() string {
|
type Item struct {
|
||||||
if x != nil && x.CardHolderName != nil {
|
state protoimpl.MessageState
|
||||||
return *x.CardHolderName
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Description string `protobuf:"bytes,1,opt,name=Description,proto3" json:"Description,omitempty"`
|
||||||
|
Measure string `protobuf:"bytes,2,opt,name=Measure,proto3" json:"Measure,omitempty"`
|
||||||
|
Quantity string `protobuf:"bytes,3,opt,name=Quantity,proto3" json:"Quantity,omitempty"`
|
||||||
|
Money string `protobuf:"bytes,4,opt,name=Money,proto3" json:"Money,omitempty"`
|
||||||
|
Currency string `protobuf:"bytes,5,opt,name=Currency,proto3" json:"Currency,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Item) Reset() {
|
||||||
|
*x = Item{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_treasurer_payment_model_proto_msgTypes[2]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Item) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*Item) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *Item) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_treasurer_payment_model_proto_msgTypes[2]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use Item.ProtoReflect.Descriptor instead.
|
||||||
|
func (*Item) Descriptor() ([]byte, []int) {
|
||||||
|
return file_treasurer_payment_model_proto_rawDescGZIP(), []int{2}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Item) GetDescription() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Description
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Item) GetMeasure() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Measure
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Item) GetQuantity() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Quantity
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Item) GetMoney() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Money
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Item) GetCurrency() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Currency
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
@ -191,7 +278,7 @@ var File_treasurer_payment_model_proto protoreflect.FileDescriptor
|
|||||||
var file_treasurer_payment_model_proto_rawDesc = []byte{
|
var file_treasurer_payment_model_proto_rawDesc = []byte{
|
||||||
0x0a, 0x1d, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2f, 0x70, 0x61, 0x79, 0x6d,
|
0x0a, 0x1d, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2f, 0x70, 0x61, 0x79, 0x6d,
|
||||||
0x65, 0x6e, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
0x65, 0x6e, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||||
0x09, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x22, 0xc7, 0x01, 0x0a, 0x13, 0x4d,
|
0x09, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x22, 0x9f, 0x02, 0x0a, 0x13, 0x4d,
|
||||||
0x61, 0x69, 0x6e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e,
|
0x61, 0x69, 0x6e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e,
|
||||||
0x67, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x01,
|
0x67, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x01,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x16,
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x16,
|
||||||
@ -204,20 +291,28 @@ var file_treasurer_payment_model_proto_rawDesc = []byte{
|
|||||||
0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
|
0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
|
||||||
0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x6c, 0x69, 0x65,
|
0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x6c, 0x69, 0x65,
|
||||||
0x6e, 0x74, 0x49, 0x50, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x43, 0x6c, 0x69, 0x65,
|
0x6e, 0x74, 0x49, 0x50, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x43, 0x6c, 0x69, 0x65,
|
||||||
0x6e, 0x74, 0x49, 0x50, 0x22, 0xce, 0x01, 0x0a, 0x13, 0x42, 0x61, 0x6e, 0x6b, 0x43, 0x61, 0x72,
|
0x6e, 0x74, 0x49, 0x50, 0x12, 0x2f, 0x0a, 0x08, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72,
|
||||||
0x64, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06,
|
0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72,
|
||||||
0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x4e, 0x75,
|
0x65, 0x72, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x52, 0x08, 0x43, 0x75, 0x73,
|
||||||
0x6d, 0x62, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79, 0x59, 0x65,
|
0x74, 0x6f, 0x6d, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x08,
|
||||||
0x61, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79,
|
0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72,
|
||||||
0x59, 0x65, 0x61, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79, 0x4d, 0x6f,
|
0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x64, 0x0a, 0x08,
|
||||||
0x6e, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x45, 0x78, 0x70, 0x69, 0x72,
|
0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x46, 0x75, 0x6c, 0x6c,
|
||||||
0x79, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x12, 0x15, 0x0a, 0x03, 0x43, 0x53, 0x43, 0x18, 0x04, 0x20,
|
0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x46, 0x75, 0x6c, 0x6c,
|
||||||
0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x43, 0x53, 0x43, 0x88, 0x01, 0x01, 0x12, 0x2b, 0x0a,
|
0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x49, 0x4e, 0x4e, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||||
0x0e, 0x43, 0x61, 0x72, 0x64, 0x48, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18,
|
0x09, 0x52, 0x03, 0x49, 0x4e, 0x4e, 0x12, 0x14, 0x0a, 0x05, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x18,
|
||||||
0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x0e, 0x43, 0x61, 0x72, 0x64, 0x48, 0x6f, 0x6c,
|
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x14, 0x0a, 0x05,
|
||||||
0x64, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x43,
|
0x50, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x50, 0x68, 0x6f,
|
||||||
0x53, 0x43, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x43, 0x61, 0x72, 0x64, 0x48, 0x6f, 0x6c, 0x64, 0x65,
|
0x6e, 0x65, 0x22, 0x90, 0x01, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x20, 0x0a, 0x0b, 0x44,
|
||||||
0x72, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x2f, 0x74, 0x72, 0x65, 0x61, 0x73,
|
0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||||
|
0x52, 0x0b, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a,
|
||||||
|
0x07, 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
|
||||||
|
0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x51, 0x75, 0x61, 0x6e, 0x74,
|
||||||
|
0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x51, 0x75, 0x61, 0x6e, 0x74,
|
||||||
|
0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01,
|
||||||
|
0x28, 0x09, 0x52, 0x05, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x75, 0x72,
|
||||||
|
0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x43, 0x75, 0x72,
|
||||||
|
0x72, 0x65, 0x6e, 0x63, 0x79, 0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x2f, 0x74, 0x72, 0x65, 0x61, 0x73,
|
||||||
0x75, 0x72, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x75, 0x72, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,17 +328,20 @@ func file_treasurer_payment_model_proto_rawDescGZIP() []byte {
|
|||||||
return file_treasurer_payment_model_proto_rawDescData
|
return file_treasurer_payment_model_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_treasurer_payment_model_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
var file_treasurer_payment_model_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||||
var file_treasurer_payment_model_proto_goTypes = []interface{}{
|
var file_treasurer_payment_model_proto_goTypes = []interface{}{
|
||||||
(*MainPaymentSettings)(nil), // 0: treasurer.MainPaymentSettings
|
(*MainPaymentSettings)(nil), // 0: treasurer.MainPaymentSettings
|
||||||
(*BankCardInformation)(nil), // 1: treasurer.BankCardInformation
|
(*Customer)(nil), // 1: treasurer.Customer
|
||||||
|
(*Item)(nil), // 2: treasurer.Item
|
||||||
}
|
}
|
||||||
var file_treasurer_payment_model_proto_depIdxs = []int32{
|
var file_treasurer_payment_model_proto_depIdxs = []int32{
|
||||||
0, // [0:0] is the sub-list for method output_type
|
1, // 0: treasurer.MainPaymentSettings.Customer:type_name -> treasurer.Customer
|
||||||
0, // [0:0] is the sub-list for method input_type
|
2, // 1: treasurer.MainPaymentSettings.Items:type_name -> treasurer.Item
|
||||||
0, // [0:0] is the sub-list for extension type_name
|
2, // [2:2] is the sub-list for method output_type
|
||||||
0, // [0:0] is the sub-list for extension extendee
|
2, // [2:2] is the sub-list for method input_type
|
||||||
0, // [0:0] is the sub-list for field type_name
|
2, // [2:2] is the sub-list for extension type_name
|
||||||
|
2, // [2:2] is the sub-list for extension extendee
|
||||||
|
0, // [0:2] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_treasurer_payment_model_proto_init() }
|
func init() { file_treasurer_payment_model_proto_init() }
|
||||||
@ -265,7 +363,19 @@ func file_treasurer_payment_model_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_treasurer_payment_model_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_treasurer_payment_model_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*BankCardInformation); i {
|
switch v := v.(*Customer); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_treasurer_payment_model_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*Item); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -277,14 +387,13 @@ func file_treasurer_payment_model_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_treasurer_payment_model_proto_msgTypes[1].OneofWrappers = []interface{}{}
|
|
||||||
type x struct{}
|
type x struct{}
|
||||||
out := protoimpl.TypeBuilder{
|
out := protoimpl.TypeBuilder{
|
||||||
File: protoimpl.DescBuilder{
|
File: protoimpl.DescBuilder{
|
||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_treasurer_payment_model_proto_rawDesc,
|
RawDescriptor: file_treasurer_payment_model_proto_rawDesc,
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 2,
|
NumMessages: 3,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 0,
|
NumServices: 0,
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.28.1
|
// protoc-gen-go v1.33.0
|
||||||
// protoc (unknown)
|
// protoc (unknown)
|
||||||
// source: treasurer/service.proto
|
// source: treasurer/service.proto
|
||||||
|
|
||||||
@ -27,7 +27,6 @@ type GetBankCardPaymentLinkRequest struct {
|
|||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
MainSettings *MainPaymentSettings `protobuf:"bytes,1,opt,name=MainSettings,proto3" json:"MainSettings,omitempty"`
|
MainSettings *MainPaymentSettings `protobuf:"bytes,1,opt,name=MainSettings,proto3" json:"MainSettings,omitempty"`
|
||||||
BankCard *BankCardInformation `protobuf:"bytes,2,opt,name=BankCard,proto3" json:"BankCard,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetBankCardPaymentLinkRequest) Reset() {
|
func (x *GetBankCardPaymentLinkRequest) Reset() {
|
||||||
@ -69,14 +68,7 @@ func (x *GetBankCardPaymentLinkRequest) GetMainSettings() *MainPaymentSettings {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetBankCardPaymentLinkRequest) GetBankCard() *BankCardInformation {
|
type GetPaymentLinkRequest struct {
|
||||||
if x != nil {
|
|
||||||
return x.BankCard
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetPaymentLinkBody struct {
|
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
@ -84,8 +76,8 @@ type GetPaymentLinkBody struct {
|
|||||||
MainSettings *MainPaymentSettings `protobuf:"bytes,1,opt,name=MainSettings,proto3" json:"MainSettings,omitempty"`
|
MainSettings *MainPaymentSettings `protobuf:"bytes,1,opt,name=MainSettings,proto3" json:"MainSettings,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetPaymentLinkBody) Reset() {
|
func (x *GetPaymentLinkRequest) Reset() {
|
||||||
*x = GetPaymentLinkBody{}
|
*x = GetPaymentLinkRequest{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_treasurer_service_proto_msgTypes[1]
|
mi := &file_treasurer_service_proto_msgTypes[1]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
@ -93,13 +85,13 @@ func (x *GetPaymentLinkBody) Reset() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetPaymentLinkBody) String() string {
|
func (x *GetPaymentLinkRequest) String() string {
|
||||||
return protoimpl.X.MessageStringOf(x)
|
return protoimpl.X.MessageStringOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*GetPaymentLinkBody) ProtoMessage() {}
|
func (*GetPaymentLinkRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *GetPaymentLinkBody) ProtoReflect() protoreflect.Message {
|
func (x *GetPaymentLinkRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_treasurer_service_proto_msgTypes[1]
|
mi := &file_treasurer_service_proto_msgTypes[1]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
@ -111,128 +103,18 @@ func (x *GetPaymentLinkBody) ProtoReflect() protoreflect.Message {
|
|||||||
return mi.MessageOf(x)
|
return mi.MessageOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: Use GetPaymentLinkBody.ProtoReflect.Descriptor instead.
|
// Deprecated: Use GetPaymentLinkRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*GetPaymentLinkBody) Descriptor() ([]byte, []int) {
|
func (*GetPaymentLinkRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_treasurer_service_proto_rawDescGZIP(), []int{1}
|
return file_treasurer_service_proto_rawDescGZIP(), []int{1}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetPaymentLinkBody) GetMainSettings() *MainPaymentSettings {
|
func (x *GetPaymentLinkRequest) GetMainSettings() *MainPaymentSettings {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.MainSettings
|
return x.MainSettings
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetPhonePaymentLinkRequest struct {
|
|
||||||
state protoimpl.MessageState
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
|
|
||||||
MainSettings *MainPaymentSettings `protobuf:"bytes,1,opt,name=MainSettings,proto3" json:"MainSettings,omitempty"`
|
|
||||||
Phone string `protobuf:"bytes,2,opt,name=Phone,proto3" json:"Phone,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *GetPhonePaymentLinkRequest) Reset() {
|
|
||||||
*x = GetPhonePaymentLinkRequest{}
|
|
||||||
if protoimpl.UnsafeEnabled {
|
|
||||||
mi := &file_treasurer_service_proto_msgTypes[2]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *GetPhonePaymentLinkRequest) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*GetPhonePaymentLinkRequest) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *GetPhonePaymentLinkRequest) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_treasurer_service_proto_msgTypes[2]
|
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use GetPhonePaymentLinkRequest.ProtoReflect.Descriptor instead.
|
|
||||||
func (*GetPhonePaymentLinkRequest) Descriptor() ([]byte, []int) {
|
|
||||||
return file_treasurer_service_proto_rawDescGZIP(), []int{2}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *GetPhonePaymentLinkRequest) GetMainSettings() *MainPaymentSettings {
|
|
||||||
if x != nil {
|
|
||||||
return x.MainSettings
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *GetPhonePaymentLinkRequest) GetPhone() string {
|
|
||||||
if x != nil {
|
|
||||||
return x.Phone
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetLoginPaymentLinkRequest struct {
|
|
||||||
state protoimpl.MessageState
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
|
|
||||||
MainSettings *MainPaymentSettings `protobuf:"bytes,1,opt,name=MainSettings,proto3" json:"MainSettings,omitempty"`
|
|
||||||
Login string `protobuf:"bytes,2,opt,name=Login,proto3" json:"Login,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *GetLoginPaymentLinkRequest) Reset() {
|
|
||||||
*x = GetLoginPaymentLinkRequest{}
|
|
||||||
if protoimpl.UnsafeEnabled {
|
|
||||||
mi := &file_treasurer_service_proto_msgTypes[3]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *GetLoginPaymentLinkRequest) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*GetLoginPaymentLinkRequest) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *GetLoginPaymentLinkRequest) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_treasurer_service_proto_msgTypes[3]
|
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use GetLoginPaymentLinkRequest.ProtoReflect.Descriptor instead.
|
|
||||||
func (*GetLoginPaymentLinkRequest) Descriptor() ([]byte, []int) {
|
|
||||||
return file_treasurer_service_proto_rawDescGZIP(), []int{3}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *GetLoginPaymentLinkRequest) GetMainSettings() *MainPaymentSettings {
|
|
||||||
if x != nil {
|
|
||||||
return x.MainSettings
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *GetLoginPaymentLinkRequest) GetLogin() string {
|
|
||||||
if x != nil {
|
|
||||||
return x.Login
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetB2BPaymentLinkRequest struct {
|
type GetB2BPaymentLinkRequest struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
@ -246,7 +128,7 @@ type GetB2BPaymentLinkRequest struct {
|
|||||||
func (x *GetB2BPaymentLinkRequest) Reset() {
|
func (x *GetB2BPaymentLinkRequest) Reset() {
|
||||||
*x = GetB2BPaymentLinkRequest{}
|
*x = GetB2BPaymentLinkRequest{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_treasurer_service_proto_msgTypes[4]
|
mi := &file_treasurer_service_proto_msgTypes[2]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -259,7 +141,7 @@ func (x *GetB2BPaymentLinkRequest) String() string {
|
|||||||
func (*GetB2BPaymentLinkRequest) ProtoMessage() {}
|
func (*GetB2BPaymentLinkRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *GetB2BPaymentLinkRequest) ProtoReflect() protoreflect.Message {
|
func (x *GetB2BPaymentLinkRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_treasurer_service_proto_msgTypes[4]
|
mi := &file_treasurer_service_proto_msgTypes[2]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -272,7 +154,7 @@ func (x *GetB2BPaymentLinkRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use GetB2BPaymentLinkRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use GetB2BPaymentLinkRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*GetB2BPaymentLinkRequest) Descriptor() ([]byte, []int) {
|
func (*GetB2BPaymentLinkRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_treasurer_service_proto_rawDescGZIP(), []int{4}
|
return file_treasurer_service_proto_rawDescGZIP(), []int{2}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetB2BPaymentLinkRequest) GetMainSettings() *MainPaymentSettings {
|
func (x *GetB2BPaymentLinkRequest) GetMainSettings() *MainPaymentSettings {
|
||||||
@ -307,7 +189,7 @@ type GetPaymentLinkResponse struct {
|
|||||||
func (x *GetPaymentLinkResponse) Reset() {
|
func (x *GetPaymentLinkResponse) Reset() {
|
||||||
*x = GetPaymentLinkResponse{}
|
*x = GetPaymentLinkResponse{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_treasurer_service_proto_msgTypes[5]
|
mi := &file_treasurer_service_proto_msgTypes[3]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -320,7 +202,7 @@ func (x *GetPaymentLinkResponse) String() string {
|
|||||||
func (*GetPaymentLinkResponse) ProtoMessage() {}
|
func (*GetPaymentLinkResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *GetPaymentLinkResponse) ProtoReflect() protoreflect.Message {
|
func (x *GetPaymentLinkResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_treasurer_service_proto_msgTypes[5]
|
mi := &file_treasurer_service_proto_msgTypes[3]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -333,7 +215,7 @@ func (x *GetPaymentLinkResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use GetPaymentLinkResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use GetPaymentLinkResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*GetPaymentLinkResponse) Descriptor() ([]byte, []int) {
|
func (*GetPaymentLinkResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_treasurer_service_proto_rawDescGZIP(), []int{5}
|
return file_treasurer_service_proto_rawDescGZIP(), []int{3}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetPaymentLinkResponse) GetRedirectURL() string {
|
func (x *GetPaymentLinkResponse) GetRedirectURL() string {
|
||||||
@ -352,91 +234,73 @@ var file_treasurer_service_proto_rawDesc = []byte{
|
|||||||
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||||
0x6f, 0x1a, 0x1d, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2f, 0x70, 0x61, 0x79,
|
0x6f, 0x1a, 0x1d, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2f, 0x70, 0x61, 0x79,
|
||||||
0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
0x22, 0x9f, 0x01, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x42, 0x61, 0x6e, 0x6b, 0x43, 0x61, 0x72, 0x64,
|
0x22, 0x63, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x42, 0x61, 0x6e, 0x6b, 0x43, 0x61, 0x72, 0x64, 0x50,
|
||||||
0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65,
|
0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||||
0x73, 0x74, 0x12, 0x42, 0x0a, 0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e,
|
0x74, 0x12, 0x42, 0x0a, 0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67,
|
||||||
0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73,
|
0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75,
|
||||||
0x75, 0x72, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x69, 0x6e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74,
|
0x72, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x69, 0x6e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53,
|
||||||
0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65,
|
0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74,
|
||||||
0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3a, 0x0a, 0x08, 0x42, 0x61, 0x6e, 0x6b, 0x43, 0x61,
|
0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x5b, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d,
|
||||||
0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73,
|
0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42,
|
||||||
0x75, 0x72, 0x65, 0x72, 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x43, 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66,
|
0x0a, 0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01,
|
||||||
0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x42, 0x61, 0x6e, 0x6b, 0x43, 0x61,
|
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72,
|
||||||
0x72, 0x64, 0x22, 0x58, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74,
|
0x2e, 0x4d, 0x61, 0x69, 0x6e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x74, 0x74,
|
||||||
0x4c, 0x69, 0x6e, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x42, 0x0a, 0x0c, 0x4d, 0x61, 0x69, 0x6e,
|
0x69, 0x6e, 0x67, 0x73, 0x52, 0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e,
|
||||||
0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e,
|
0x67, 0x73, 0x22, 0xb8, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x42, 0x32, 0x42, 0x50, 0x61, 0x79,
|
||||||
0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x69, 0x6e, 0x50,
|
0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
|
||||||
0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0c,
|
0x42, 0x0a, 0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18,
|
||||||
0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x76, 0x0a, 0x1a,
|
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65,
|
||||||
0x47, 0x65, 0x74, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c,
|
0x72, 0x2e, 0x4d, 0x61, 0x69, 0x6e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x74,
|
||||||
0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x0c, 0x4d, 0x61,
|
0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69,
|
||||||
0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
|
0x6e, 0x67, 0x73, 0x12, 0x26, 0x0a, 0x0e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x75,
|
||||||
0x32, 0x1e, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x69,
|
0x72, 0x70, 0x6f, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x50, 0x61, 0x79,
|
||||||
0x6e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73,
|
0x6d, 0x65, 0x6e, 0x74, 0x50, 0x75, 0x72, 0x70, 0x6f, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x56,
|
||||||
0x52, 0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x14,
|
0x61, 0x74, 0x44, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67,
|
||||||
0x0a, 0x05, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x50,
|
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45,
|
||||||
0x68, 0x6f, 0x6e, 0x65, 0x22, 0x76, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e,
|
0x6d, 0x70, 0x74, 0x79, 0x52, 0x07, 0x56, 0x61, 0x74, 0x44, 0x61, 0x74, 0x61, 0x22, 0x3a, 0x0a,
|
||||||
0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65,
|
0x16, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52,
|
||||||
0x73, 0x74, 0x12, 0x42, 0x0a, 0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e,
|
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, 0x64, 0x69, 0x72,
|
||||||
0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73,
|
0x65, 0x63, 0x74, 0x55, 0x52, 0x4c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x52, 0x65,
|
||||||
0x75, 0x72, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x69, 0x6e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74,
|
0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x55, 0x52, 0x4c, 0x32, 0xd4, 0x04, 0x0a, 0x10, 0x54, 0x72,
|
||||||
0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65,
|
0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5f,
|
||||||
0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x18,
|
0x0a, 0x16, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b,
|
||||||
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x22, 0xb8, 0x01, 0x0a,
|
0x42, 0x61, 0x6e, 0x6b, 0x43, 0x61, 0x72, 0x64, 0x12, 0x20, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73,
|
||||||
0x18, 0x47, 0x65, 0x74, 0x42, 0x32, 0x42, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69,
|
0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c,
|
||||||
0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x0c, 0x4d, 0x61, 0x69,
|
0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x74, 0x72, 0x65,
|
||||||
0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
|
||||||
0x1e, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x69, 0x6e,
|
|
||||||
0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52,
|
|
||||||
0x0c, 0x4d, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x26, 0x0a,
|
|
||||||
0x0e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x75, 0x72, 0x70, 0x6f, 0x73, 0x65, 0x18,
|
|
||||||
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x75,
|
|
||||||
0x72, 0x70, 0x6f, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x56, 0x61, 0x74, 0x44, 0x61, 0x74, 0x61,
|
|
||||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
|
|
||||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x07,
|
|
||||||
0x56, 0x61, 0x74, 0x44, 0x61, 0x74, 0x61, 0x22, 0x3a, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x50, 0x61,
|
|
||||||
0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
|
||||||
0x65, 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x55, 0x52, 0x4c,
|
|
||||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x52, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74,
|
|
||||||
0x55, 0x52, 0x4c, 0x32, 0xcd, 0x04, 0x0a, 0x10, 0x54, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65,
|
|
||||||
0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x67, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x50,
|
|
||||||
0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x42, 0x61, 0x6e, 0x6b, 0x43, 0x61,
|
|
||||||
0x72, 0x64, 0x12, 0x28, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47,
|
|
||||||
0x65, 0x74, 0x42, 0x61, 0x6e, 0x6b, 0x43, 0x61, 0x72, 0x64, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e,
|
|
||||||
0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x74,
|
|
||||||
0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d,
|
|
||||||
0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
|
||||||
0x00, 0x12, 0x5c, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c,
|
|
||||||
0x69, 0x6e, 0x6b, 0x59, 0x6f, 0x6f, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x12, 0x1d, 0x2e, 0x74, 0x72,
|
|
||||||
0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65,
|
|
||||||
0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x1a, 0x21, 0x2e, 0x74, 0x72, 0x65,
|
|
||||||
0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e,
|
0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e,
|
||||||
0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
|
0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
|
||||||
0x5b, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e,
|
0x5f, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e,
|
||||||
0x6b, 0x53, 0x62, 0x65, 0x72, 0x50, 0x61, 0x79, 0x12, 0x1d, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73,
|
0x6b, 0x59, 0x6f, 0x6f, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x12, 0x20, 0x2e, 0x74, 0x72, 0x65, 0x61,
|
||||||
0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c,
|
0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74,
|
||||||
0x69, 0x6e, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x1a, 0x21, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75,
|
0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x74, 0x72,
|
||||||
0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69,
|
0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65,
|
||||||
0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x15,
|
0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
|
||||||
0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x54, 0x69,
|
0x12, 0x5e, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69,
|
||||||
0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x12, 0x1d, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65,
|
0x6e, 0x6b, 0x54, 0x69, 0x6e, 0x6b, 0x6f, 0x66, 0x66, 0x12, 0x20, 0x2e, 0x74, 0x72, 0x65, 0x61,
|
||||||
0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b,
|
0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74,
|
||||||
0x42, 0x6f, 0x64, 0x79, 0x1a, 0x21, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72,
|
0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x74, 0x72,
|
||||||
0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52,
|
0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65,
|
||||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5f, 0x0a, 0x19, 0x47, 0x65, 0x74,
|
0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
|
||||||
0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x62, 0x65, 0x72, 0x62,
|
0x12, 0x62, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69,
|
||||||
0x61, 0x6e, 0x6b, 0x42, 0x32, 0x42, 0x12, 0x1d, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72,
|
0x6e, 0x6b, 0x53, 0x62, 0x65, 0x72, 0x62, 0x61, 0x6e, 0x6b, 0x42, 0x32, 0x42, 0x12, 0x20, 0x2e,
|
||||||
0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e,
|
0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79,
|
||||||
0x6b, 0x42, 0x6f, 0x64, 0x79, 0x1a, 0x21, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65,
|
0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||||
0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b,
|
0x21, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50,
|
||||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x11, 0x47, 0x65,
|
0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||||
0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x42, 0x50, 0x12,
|
0x73, 0x65, 0x22, 0x00, 0x12, 0x5a, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65,
|
||||||
0x1d, 0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50,
|
0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x42, 0x50, 0x12, 0x20, 0x2e, 0x74, 0x72, 0x65, 0x61,
|
||||||
0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x1a, 0x21,
|
0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74,
|
||||||
0x2e, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61,
|
0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x74, 0x72,
|
||||||
0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65,
|
||||||
0x65, 0x22, 0x00, 0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x2f, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72,
|
0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
|
||||||
0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x12, 0x5e, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69,
|
||||||
|
0x6e, 0x6b, 0x53, 0x62, 0x65, 0x72, 0x50, 0x61, 0x79, 0x12, 0x20, 0x2e, 0x74, 0x72, 0x65, 0x61,
|
||||||
|
0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74,
|
||||||
|
0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x74, 0x72,
|
||||||
|
0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65,
|
||||||
|
0x6e, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
|
||||||
|
0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x2f, 0x74, 0x72, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x72, 0x62,
|
||||||
|
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -451,43 +315,37 @@ func file_treasurer_service_proto_rawDescGZIP() []byte {
|
|||||||
return file_treasurer_service_proto_rawDescData
|
return file_treasurer_service_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_treasurer_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
var file_treasurer_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||||
var file_treasurer_service_proto_goTypes = []interface{}{
|
var file_treasurer_service_proto_goTypes = []interface{}{
|
||||||
(*GetBankCardPaymentLinkRequest)(nil), // 0: treasurer.GetBankCardPaymentLinkRequest
|
(*GetBankCardPaymentLinkRequest)(nil), // 0: treasurer.GetBankCardPaymentLinkRequest
|
||||||
(*GetPaymentLinkBody)(nil), // 1: treasurer.GetPaymentLinkBody
|
(*GetPaymentLinkRequest)(nil), // 1: treasurer.GetPaymentLinkRequest
|
||||||
(*GetPhonePaymentLinkRequest)(nil), // 2: treasurer.GetPhonePaymentLinkRequest
|
(*GetB2BPaymentLinkRequest)(nil), // 2: treasurer.GetB2BPaymentLinkRequest
|
||||||
(*GetLoginPaymentLinkRequest)(nil), // 3: treasurer.GetLoginPaymentLinkRequest
|
(*GetPaymentLinkResponse)(nil), // 3: treasurer.GetPaymentLinkResponse
|
||||||
(*GetB2BPaymentLinkRequest)(nil), // 4: treasurer.GetB2BPaymentLinkRequest
|
(*MainPaymentSettings)(nil), // 4: treasurer.MainPaymentSettings
|
||||||
(*GetPaymentLinkResponse)(nil), // 5: treasurer.GetPaymentLinkResponse
|
(*emptypb.Empty)(nil), // 5: google.protobuf.Empty
|
||||||
(*MainPaymentSettings)(nil), // 6: treasurer.MainPaymentSettings
|
|
||||||
(*BankCardInformation)(nil), // 7: treasurer.BankCardInformation
|
|
||||||
(*emptypb.Empty)(nil), // 8: google.protobuf.Empty
|
|
||||||
}
|
}
|
||||||
var file_treasurer_service_proto_depIdxs = []int32{
|
var file_treasurer_service_proto_depIdxs = []int32{
|
||||||
6, // 0: treasurer.GetBankCardPaymentLinkRequest.MainSettings:type_name -> treasurer.MainPaymentSettings
|
4, // 0: treasurer.GetBankCardPaymentLinkRequest.MainSettings:type_name -> treasurer.MainPaymentSettings
|
||||||
7, // 1: treasurer.GetBankCardPaymentLinkRequest.BankCard:type_name -> treasurer.BankCardInformation
|
4, // 1: treasurer.GetPaymentLinkRequest.MainSettings:type_name -> treasurer.MainPaymentSettings
|
||||||
6, // 2: treasurer.GetPaymentLinkBody.MainSettings:type_name -> treasurer.MainPaymentSettings
|
4, // 2: treasurer.GetB2BPaymentLinkRequest.MainSettings:type_name -> treasurer.MainPaymentSettings
|
||||||
6, // 3: treasurer.GetPhonePaymentLinkRequest.MainSettings:type_name -> treasurer.MainPaymentSettings
|
5, // 3: treasurer.GetB2BPaymentLinkRequest.VatData:type_name -> google.protobuf.Empty
|
||||||
6, // 4: treasurer.GetLoginPaymentLinkRequest.MainSettings:type_name -> treasurer.MainPaymentSettings
|
1, // 4: treasurer.TreasurerService.GetPaymentLinkBankCard:input_type -> treasurer.GetPaymentLinkRequest
|
||||||
6, // 5: treasurer.GetB2BPaymentLinkRequest.MainSettings:type_name -> treasurer.MainPaymentSettings
|
1, // 5: treasurer.TreasurerService.GetPaymentLinkYooMoney:input_type -> treasurer.GetPaymentLinkRequest
|
||||||
8, // 6: treasurer.GetB2BPaymentLinkRequest.VatData:type_name -> google.protobuf.Empty
|
1, // 6: treasurer.TreasurerService.GetPaymentLinkTinkoff:input_type -> treasurer.GetPaymentLinkRequest
|
||||||
0, // 7: treasurer.TreasurerService.GetPaymentLinkBankCard:input_type -> treasurer.GetBankCardPaymentLinkRequest
|
1, // 7: treasurer.TreasurerService.GetPaymentLinkSberbankB2B:input_type -> treasurer.GetPaymentLinkRequest
|
||||||
1, // 8: treasurer.TreasurerService.GetPaymentLinkYooMoney:input_type -> treasurer.GetPaymentLinkBody
|
1, // 8: treasurer.TreasurerService.GetPaymentLinkSBP:input_type -> treasurer.GetPaymentLinkRequest
|
||||||
1, // 9: treasurer.TreasurerService.GetPaymentLinkSberPay:input_type -> treasurer.GetPaymentLinkBody
|
1, // 9: treasurer.TreasurerService.GetPaymentLinkSberPay:input_type -> treasurer.GetPaymentLinkRequest
|
||||||
1, // 10: treasurer.TreasurerService.GetPaymentLinkTinkoff:input_type -> treasurer.GetPaymentLinkBody
|
3, // 10: treasurer.TreasurerService.GetPaymentLinkBankCard:output_type -> treasurer.GetPaymentLinkResponse
|
||||||
1, // 11: treasurer.TreasurerService.GetPaymentLinkSberbankB2B:input_type -> treasurer.GetPaymentLinkBody
|
3, // 11: treasurer.TreasurerService.GetPaymentLinkYooMoney:output_type -> treasurer.GetPaymentLinkResponse
|
||||||
1, // 12: treasurer.TreasurerService.GetPaymentLinkSBP:input_type -> treasurer.GetPaymentLinkBody
|
3, // 12: treasurer.TreasurerService.GetPaymentLinkTinkoff:output_type -> treasurer.GetPaymentLinkResponse
|
||||||
5, // 13: treasurer.TreasurerService.GetPaymentLinkBankCard:output_type -> treasurer.GetPaymentLinkResponse
|
3, // 13: treasurer.TreasurerService.GetPaymentLinkSberbankB2B:output_type -> treasurer.GetPaymentLinkResponse
|
||||||
5, // 14: treasurer.TreasurerService.GetPaymentLinkYooMoney:output_type -> treasurer.GetPaymentLinkResponse
|
3, // 14: treasurer.TreasurerService.GetPaymentLinkSBP:output_type -> treasurer.GetPaymentLinkResponse
|
||||||
5, // 15: treasurer.TreasurerService.GetPaymentLinkSberPay:output_type -> treasurer.GetPaymentLinkResponse
|
3, // 15: treasurer.TreasurerService.GetPaymentLinkSberPay:output_type -> treasurer.GetPaymentLinkResponse
|
||||||
5, // 16: treasurer.TreasurerService.GetPaymentLinkTinkoff:output_type -> treasurer.GetPaymentLinkResponse
|
10, // [10:16] is the sub-list for method output_type
|
||||||
5, // 17: treasurer.TreasurerService.GetPaymentLinkSberbankB2B:output_type -> treasurer.GetPaymentLinkResponse
|
4, // [4:10] is the sub-list for method input_type
|
||||||
5, // 18: treasurer.TreasurerService.GetPaymentLinkSBP:output_type -> treasurer.GetPaymentLinkResponse
|
4, // [4:4] is the sub-list for extension type_name
|
||||||
13, // [13:19] is the sub-list for method output_type
|
4, // [4:4] is the sub-list for extension extendee
|
||||||
7, // [7:13] is the sub-list for method input_type
|
0, // [0:4] is the sub-list for field type_name
|
||||||
7, // [7:7] is the sub-list for extension type_name
|
|
||||||
7, // [7:7] is the sub-list for extension extendee
|
|
||||||
0, // [0:7] is the sub-list for field type_name
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_treasurer_service_proto_init() }
|
func init() { file_treasurer_service_proto_init() }
|
||||||
@ -510,7 +368,7 @@ func file_treasurer_service_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_treasurer_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_treasurer_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*GetPaymentLinkBody); i {
|
switch v := v.(*GetPaymentLinkRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -522,30 +380,6 @@ func file_treasurer_service_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_treasurer_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
file_treasurer_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*GetPhonePaymentLinkRequest); i {
|
|
||||||
case 0:
|
|
||||||
return &v.state
|
|
||||||
case 1:
|
|
||||||
return &v.sizeCache
|
|
||||||
case 2:
|
|
||||||
return &v.unknownFields
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
file_treasurer_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
|
||||||
switch v := v.(*GetLoginPaymentLinkRequest); i {
|
|
||||||
case 0:
|
|
||||||
return &v.state
|
|
||||||
case 1:
|
|
||||||
return &v.sizeCache
|
|
||||||
case 2:
|
|
||||||
return &v.unknownFields
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
file_treasurer_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
|
||||||
switch v := v.(*GetB2BPaymentLinkRequest); i {
|
switch v := v.(*GetB2BPaymentLinkRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@ -557,7 +391,7 @@ func file_treasurer_service_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_treasurer_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
file_treasurer_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*GetPaymentLinkResponse); i {
|
switch v := v.(*GetPaymentLinkResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@ -576,7 +410,7 @@ func file_treasurer_service_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_treasurer_service_proto_rawDesc,
|
RawDescriptor: file_treasurer_service_proto_rawDesc,
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 6,
|
NumMessages: 4,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 1,
|
NumServices: 1,
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-grpc v1.2.0
|
// - protoc-gen-go-grpc v1.3.0
|
||||||
// - protoc (unknown)
|
// - protoc (unknown)
|
||||||
// source: treasurer/service.proto
|
// source: treasurer/service.proto
|
||||||
|
|
||||||
@ -18,16 +18,25 @@ import (
|
|||||||
// Requires gRPC-Go v1.32.0 or later.
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
const _ = grpc.SupportPackageIsVersion7
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
const (
|
||||||
|
TreasurerService_GetPaymentLinkBankCard_FullMethodName = "/treasurer.TreasurerService/GetPaymentLinkBankCard"
|
||||||
|
TreasurerService_GetPaymentLinkYooMoney_FullMethodName = "/treasurer.TreasurerService/GetPaymentLinkYooMoney"
|
||||||
|
TreasurerService_GetPaymentLinkTinkoff_FullMethodName = "/treasurer.TreasurerService/GetPaymentLinkTinkoff"
|
||||||
|
TreasurerService_GetPaymentLinkSberbankB2B_FullMethodName = "/treasurer.TreasurerService/GetPaymentLinkSberbankB2B"
|
||||||
|
TreasurerService_GetPaymentLinkSBP_FullMethodName = "/treasurer.TreasurerService/GetPaymentLinkSBP"
|
||||||
|
TreasurerService_GetPaymentLinkSberPay_FullMethodName = "/treasurer.TreasurerService/GetPaymentLinkSberPay"
|
||||||
|
)
|
||||||
|
|
||||||
// TreasurerServiceClient is the client API for TreasurerService service.
|
// TreasurerServiceClient is the client API for TreasurerService service.
|
||||||
//
|
//
|
||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
type TreasurerServiceClient interface {
|
type TreasurerServiceClient interface {
|
||||||
GetPaymentLinkBankCard(ctx context.Context, in *GetBankCardPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
GetPaymentLinkBankCard(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
||||||
GetPaymentLinkYooMoney(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
GetPaymentLinkYooMoney(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
||||||
GetPaymentLinkSberPay(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
GetPaymentLinkTinkoff(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
||||||
GetPaymentLinkTinkoff(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
GetPaymentLinkSberbankB2B(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
||||||
GetPaymentLinkSberbankB2B(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
GetPaymentLinkSBP(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
||||||
GetPaymentLinkSBP(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
GetPaymentLinkSberPay(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type treasurerServiceClient struct {
|
type treasurerServiceClient struct {
|
||||||
@ -38,54 +47,54 @@ func NewTreasurerServiceClient(cc grpc.ClientConnInterface) TreasurerServiceClie
|
|||||||
return &treasurerServiceClient{cc}
|
return &treasurerServiceClient{cc}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *treasurerServiceClient) GetPaymentLinkBankCard(ctx context.Context, in *GetBankCardPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
func (c *treasurerServiceClient) GetPaymentLinkBankCard(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||||
out := new(GetPaymentLinkResponse)
|
out := new(GetPaymentLinkResponse)
|
||||||
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkBankCard", in, out, opts...)
|
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkBankCard_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *treasurerServiceClient) GetPaymentLinkYooMoney(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
func (c *treasurerServiceClient) GetPaymentLinkYooMoney(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||||
out := new(GetPaymentLinkResponse)
|
out := new(GetPaymentLinkResponse)
|
||||||
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkYooMoney", in, out, opts...)
|
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkYooMoney_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *treasurerServiceClient) GetPaymentLinkSberPay(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
func (c *treasurerServiceClient) GetPaymentLinkTinkoff(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||||
out := new(GetPaymentLinkResponse)
|
out := new(GetPaymentLinkResponse)
|
||||||
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkSberPay", in, out, opts...)
|
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkTinkoff_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *treasurerServiceClient) GetPaymentLinkTinkoff(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
func (c *treasurerServiceClient) GetPaymentLinkSberbankB2B(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||||
out := new(GetPaymentLinkResponse)
|
out := new(GetPaymentLinkResponse)
|
||||||
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkTinkoff", in, out, opts...)
|
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkSberbankB2B_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *treasurerServiceClient) GetPaymentLinkSberbankB2B(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
func (c *treasurerServiceClient) GetPaymentLinkSBP(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||||
out := new(GetPaymentLinkResponse)
|
out := new(GetPaymentLinkResponse)
|
||||||
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkSberbankB2B", in, out, opts...)
|
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkSBP_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *treasurerServiceClient) GetPaymentLinkSBP(ctx context.Context, in *GetPaymentLinkBody, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
func (c *treasurerServiceClient) GetPaymentLinkSberPay(ctx context.Context, in *GetPaymentLinkRequest, opts ...grpc.CallOption) (*GetPaymentLinkResponse, error) {
|
||||||
out := new(GetPaymentLinkResponse)
|
out := new(GetPaymentLinkResponse)
|
||||||
err := c.cc.Invoke(ctx, "/treasurer.TreasurerService/GetPaymentLinkSBP", in, out, opts...)
|
err := c.cc.Invoke(ctx, TreasurerService_GetPaymentLinkSberPay_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -96,36 +105,36 @@ func (c *treasurerServiceClient) GetPaymentLinkSBP(ctx context.Context, in *GetP
|
|||||||
// All implementations should embed UnimplementedTreasurerServiceServer
|
// All implementations should embed UnimplementedTreasurerServiceServer
|
||||||
// for forward compatibility
|
// for forward compatibility
|
||||||
type TreasurerServiceServer interface {
|
type TreasurerServiceServer interface {
|
||||||
GetPaymentLinkBankCard(context.Context, *GetBankCardPaymentLinkRequest) (*GetPaymentLinkResponse, error)
|
GetPaymentLinkBankCard(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error)
|
||||||
GetPaymentLinkYooMoney(context.Context, *GetPaymentLinkBody) (*GetPaymentLinkResponse, error)
|
GetPaymentLinkYooMoney(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error)
|
||||||
GetPaymentLinkSberPay(context.Context, *GetPaymentLinkBody) (*GetPaymentLinkResponse, error)
|
GetPaymentLinkTinkoff(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error)
|
||||||
GetPaymentLinkTinkoff(context.Context, *GetPaymentLinkBody) (*GetPaymentLinkResponse, error)
|
GetPaymentLinkSberbankB2B(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error)
|
||||||
GetPaymentLinkSberbankB2B(context.Context, *GetPaymentLinkBody) (*GetPaymentLinkResponse, error)
|
GetPaymentLinkSBP(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error)
|
||||||
GetPaymentLinkSBP(context.Context, *GetPaymentLinkBody) (*GetPaymentLinkResponse, error)
|
GetPaymentLinkSberPay(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnimplementedTreasurerServiceServer should be embedded to have forward compatible implementations.
|
// UnimplementedTreasurerServiceServer should be embedded to have forward compatible implementations.
|
||||||
type UnimplementedTreasurerServiceServer struct {
|
type UnimplementedTreasurerServiceServer struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (UnimplementedTreasurerServiceServer) GetPaymentLinkBankCard(context.Context, *GetBankCardPaymentLinkRequest) (*GetPaymentLinkResponse, error) {
|
func (UnimplementedTreasurerServiceServer) GetPaymentLinkBankCard(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetPaymentLinkBankCard not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetPaymentLinkBankCard not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedTreasurerServiceServer) GetPaymentLinkYooMoney(context.Context, *GetPaymentLinkBody) (*GetPaymentLinkResponse, error) {
|
func (UnimplementedTreasurerServiceServer) GetPaymentLinkYooMoney(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetPaymentLinkYooMoney not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetPaymentLinkYooMoney not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedTreasurerServiceServer) GetPaymentLinkSberPay(context.Context, *GetPaymentLinkBody) (*GetPaymentLinkResponse, error) {
|
func (UnimplementedTreasurerServiceServer) GetPaymentLinkTinkoff(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetPaymentLinkSberPay not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedTreasurerServiceServer) GetPaymentLinkTinkoff(context.Context, *GetPaymentLinkBody) (*GetPaymentLinkResponse, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetPaymentLinkTinkoff not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetPaymentLinkTinkoff not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedTreasurerServiceServer) GetPaymentLinkSberbankB2B(context.Context, *GetPaymentLinkBody) (*GetPaymentLinkResponse, error) {
|
func (UnimplementedTreasurerServiceServer) GetPaymentLinkSberbankB2B(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetPaymentLinkSberbankB2B not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetPaymentLinkSberbankB2B not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedTreasurerServiceServer) GetPaymentLinkSBP(context.Context, *GetPaymentLinkBody) (*GetPaymentLinkResponse, error) {
|
func (UnimplementedTreasurerServiceServer) GetPaymentLinkSBP(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetPaymentLinkSBP not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetPaymentLinkSBP not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedTreasurerServiceServer) GetPaymentLinkSberPay(context.Context, *GetPaymentLinkRequest) (*GetPaymentLinkResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetPaymentLinkSberPay not implemented")
|
||||||
|
}
|
||||||
|
|
||||||
// UnsafeTreasurerServiceServer may be embedded to opt out of forward compatibility for this service.
|
// UnsafeTreasurerServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||||
// Use of this interface is not recommended, as added methods to TreasurerServiceServer will
|
// Use of this interface is not recommended, as added methods to TreasurerServiceServer will
|
||||||
@ -139,7 +148,7 @@ func RegisterTreasurerServiceServer(s grpc.ServiceRegistrar, srv TreasurerServic
|
|||||||
}
|
}
|
||||||
|
|
||||||
func _TreasurerService_GetPaymentLinkBankCard_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _TreasurerService_GetPaymentLinkBankCard_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(GetBankCardPaymentLinkRequest)
|
in := new(GetPaymentLinkRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -148,16 +157,16 @@ func _TreasurerService_GetPaymentLinkBankCard_Handler(srv interface{}, ctx conte
|
|||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkBankCard",
|
FullMethod: TreasurerService_GetPaymentLinkBankCard_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(TreasurerServiceServer).GetPaymentLinkBankCard(ctx, req.(*GetBankCardPaymentLinkRequest))
|
return srv.(TreasurerServiceServer).GetPaymentLinkBankCard(ctx, req.(*GetPaymentLinkRequest))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _TreasurerService_GetPaymentLinkYooMoney_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _TreasurerService_GetPaymentLinkYooMoney_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(GetPaymentLinkBody)
|
in := new(GetPaymentLinkRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -166,34 +175,16 @@ func _TreasurerService_GetPaymentLinkYooMoney_Handler(srv interface{}, ctx conte
|
|||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkYooMoney",
|
FullMethod: TreasurerService_GetPaymentLinkYooMoney_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(TreasurerServiceServer).GetPaymentLinkYooMoney(ctx, req.(*GetPaymentLinkBody))
|
return srv.(TreasurerServiceServer).GetPaymentLinkYooMoney(ctx, req.(*GetPaymentLinkRequest))
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _TreasurerService_GetPaymentLinkSberPay_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(GetPaymentLinkBody)
|
|
||||||
if err := dec(in); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if interceptor == nil {
|
|
||||||
return srv.(TreasurerServiceServer).GetPaymentLinkSberPay(ctx, in)
|
|
||||||
}
|
|
||||||
info := &grpc.UnaryServerInfo{
|
|
||||||
Server: srv,
|
|
||||||
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkSberPay",
|
|
||||||
}
|
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
||||||
return srv.(TreasurerServiceServer).GetPaymentLinkSberPay(ctx, req.(*GetPaymentLinkBody))
|
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _TreasurerService_GetPaymentLinkTinkoff_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _TreasurerService_GetPaymentLinkTinkoff_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(GetPaymentLinkBody)
|
in := new(GetPaymentLinkRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -202,16 +193,16 @@ func _TreasurerService_GetPaymentLinkTinkoff_Handler(srv interface{}, ctx contex
|
|||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkTinkoff",
|
FullMethod: TreasurerService_GetPaymentLinkTinkoff_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(TreasurerServiceServer).GetPaymentLinkTinkoff(ctx, req.(*GetPaymentLinkBody))
|
return srv.(TreasurerServiceServer).GetPaymentLinkTinkoff(ctx, req.(*GetPaymentLinkRequest))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _TreasurerService_GetPaymentLinkSberbankB2B_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _TreasurerService_GetPaymentLinkSberbankB2B_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(GetPaymentLinkBody)
|
in := new(GetPaymentLinkRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -220,16 +211,16 @@ func _TreasurerService_GetPaymentLinkSberbankB2B_Handler(srv interface{}, ctx co
|
|||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkSberbankB2B",
|
FullMethod: TreasurerService_GetPaymentLinkSberbankB2B_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(TreasurerServiceServer).GetPaymentLinkSberbankB2B(ctx, req.(*GetPaymentLinkBody))
|
return srv.(TreasurerServiceServer).GetPaymentLinkSberbankB2B(ctx, req.(*GetPaymentLinkRequest))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _TreasurerService_GetPaymentLinkSBP_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _TreasurerService_GetPaymentLinkSBP_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(GetPaymentLinkBody)
|
in := new(GetPaymentLinkRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -238,10 +229,28 @@ func _TreasurerService_GetPaymentLinkSBP_Handler(srv interface{}, ctx context.Co
|
|||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/treasurer.TreasurerService/GetPaymentLinkSBP",
|
FullMethod: TreasurerService_GetPaymentLinkSBP_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(TreasurerServiceServer).GetPaymentLinkSBP(ctx, req.(*GetPaymentLinkBody))
|
return srv.(TreasurerServiceServer).GetPaymentLinkSBP(ctx, req.(*GetPaymentLinkRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _TreasurerService_GetPaymentLinkSberPay_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetPaymentLinkRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(TreasurerServiceServer).GetPaymentLinkSberPay(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: TreasurerService_GetPaymentLinkSberPay_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(TreasurerServiceServer).GetPaymentLinkSberPay(ctx, req.(*GetPaymentLinkRequest))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
@ -261,10 +270,6 @@ var TreasurerService_ServiceDesc = grpc.ServiceDesc{
|
|||||||
MethodName: "GetPaymentLinkYooMoney",
|
MethodName: "GetPaymentLinkYooMoney",
|
||||||
Handler: _TreasurerService_GetPaymentLinkYooMoney_Handler,
|
Handler: _TreasurerService_GetPaymentLinkYooMoney_Handler,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
MethodName: "GetPaymentLinkSberPay",
|
|
||||||
Handler: _TreasurerService_GetPaymentLinkSberPay_Handler,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
MethodName: "GetPaymentLinkTinkoff",
|
MethodName: "GetPaymentLinkTinkoff",
|
||||||
Handler: _TreasurerService_GetPaymentLinkTinkoff_Handler,
|
Handler: _TreasurerService_GetPaymentLinkTinkoff_Handler,
|
||||||
@ -277,6 +282,10 @@ var TreasurerService_ServiceDesc = grpc.ServiceDesc{
|
|||||||
MethodName: "GetPaymentLinkSBP",
|
MethodName: "GetPaymentLinkSBP",
|
||||||
Handler: _TreasurerService_GetPaymentLinkSBP_Handler,
|
Handler: _TreasurerService_GetPaymentLinkSBP_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetPaymentLinkSberPay",
|
||||||
|
Handler: _TreasurerService_GetPaymentLinkSberPay_Handler,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc.StreamDesc{},
|
Streams: []grpc.StreamDesc{},
|
||||||
Metadata: "treasurer/service.proto",
|
Metadata: "treasurer/service.proto",
|
||||||
|
@ -11,11 +11,11 @@ import (
|
|||||||
grpc_recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery"
|
grpc_recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/initialize"
|
"gitea.pena/PenaSide/customer/internal/initialize"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/proto/customer"
|
"gitea.pena/PenaSide/customer/internal/proto/customer"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/proto/payment_callback"
|
"gitea.pena/PenaSide/customer/internal/proto/payment_callback"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DepsGRPC struct {
|
type DepsGRPC struct {
|
||||||
|
@ -7,8 +7,8 @@ import (
|
|||||||
"github.com/themakers/hlog"
|
"github.com/themakers/hlog"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"penahub.gitlab.yandexcloud.net/backend/penahub_common/log_mw"
|
"penahub.gitlab.yandexcloud.net/backend/penahub_common/log_mw"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/utils"
|
"gitea.pena/PenaSide/customer/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ServerConfig struct {
|
type ServerConfig struct {
|
||||||
|
@ -6,8 +6,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
type consumer interface {
|
type consumer interface {
|
||||||
|
@ -3,10 +3,12 @@ package callback
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"log"
|
"log"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
|
tb "gopkg.in/tucnak/telebot.v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
type accountRepository interface {
|
type accountRepository interface {
|
||||||
@ -26,6 +28,9 @@ type PaymentCallbackServiceDeps struct {
|
|||||||
AccountRepository accountRepository
|
AccountRepository accountRepository
|
||||||
WalletService walletService
|
WalletService walletService
|
||||||
HistoryService historyService
|
HistoryService historyService
|
||||||
|
Notifier *tb.Bot
|
||||||
|
NotifyChannel int64
|
||||||
|
AdminURL string
|
||||||
}
|
}
|
||||||
|
|
||||||
type PaymentCallbackService struct {
|
type PaymentCallbackService struct {
|
||||||
@ -33,6 +38,9 @@ type PaymentCallbackService struct {
|
|||||||
accountRepository accountRepository
|
accountRepository accountRepository
|
||||||
walletService walletService
|
walletService walletService
|
||||||
historyService historyService
|
historyService historyService
|
||||||
|
notifier *tb.Bot
|
||||||
|
notifyChannel int64
|
||||||
|
adminURL string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewPaymentCallbackService(deps PaymentCallbackServiceDeps) *PaymentCallbackService {
|
func NewPaymentCallbackService(deps PaymentCallbackServiceDeps) *PaymentCallbackService {
|
||||||
@ -57,6 +65,9 @@ func NewPaymentCallbackService(deps PaymentCallbackServiceDeps) *PaymentCallback
|
|||||||
accountRepository: deps.AccountRepository,
|
accountRepository: deps.AccountRepository,
|
||||||
walletService: deps.WalletService,
|
walletService: deps.WalletService,
|
||||||
historyService: deps.HistoryService,
|
historyService: deps.HistoryService,
|
||||||
|
notifier: deps.Notifier,
|
||||||
|
notifyChannel: deps.NotifyChannel,
|
||||||
|
adminURL: deps.AdminURL,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,29 +94,33 @@ func (receiver *PaymentCallbackService) SuccessEvent(ctx context.Context, event
|
|||||||
}
|
}
|
||||||
|
|
||||||
//go func() {
|
//go func() {
|
||||||
if _, err := receiver.historyService.CreateHistory(ctx, &models.History{
|
if _, err := receiver.historyService.CreateHistory(ctx, &models.History{
|
||||||
UserID: account.UserID,
|
UserID: account.UserID,
|
||||||
Comment: event.Message,
|
Comment: event.Message,
|
||||||
Key: event.Key,
|
Key: event.Key,
|
||||||
RawDetails: models.RawDetails{
|
RawDetails: models.RawDetails{
|
||||||
Price: event.Amount,
|
Price: event.Amount,
|
||||||
Comment: event.Type + ":" + event.Currency,
|
Comment: event.Type + ":" + event.Currency,
|
||||||
},
|
},
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
receiver.logger.Error("failed to create history on <SuccessEvent> of <PaymentCallbackService>", zap.Error(err))
|
receiver.logger.Error("failed to create history on <SuccessEvent> of <PaymentCallbackService>", zap.Error(err))
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
//}()
|
//}()
|
||||||
|
go func () {
|
||||||
|
if _, err := receiver.notifier.Send(tb.ChatID(receiver.notifyChannel), fmt.Sprintf(`Внесены деньги %.2f, пользователем %s`,float64(event.Amount/100), receiver.adminURL + "/users/" + account.UserID)); err != nil {
|
||||||
|
fmt.Println("TBOER", err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (receiver *PaymentCallbackService) FailureEvent(ctx context.Context, event *models.PaymentEvent) errors.Error {
|
func (receiver *PaymentCallbackService) FailureEvent(ctx context.Context, event *models.PaymentEvent) errors.Error {
|
||||||
if _, err := receiver.historyService.CreateHistory(ctx, &models.History{
|
if _, err := receiver.historyService.CreateHistory(ctx, &models.History{
|
||||||
UserID: event.UserID,
|
UserID: event.UserID,
|
||||||
Comment: event.Message,
|
Comment: event.Message,
|
||||||
Key: event.Key,
|
Key: event.Key,
|
||||||
// RawDetails: fmt.Sprintf("%d%s", event.Amount, event.Currency),
|
// RawDetails: fmt.Sprintf("%d%s", event.Amount, event.Currency),
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
receiver.logger.Error("failed to create history on <FailureEvent> of <PaymentCallbackService>", zap.Error(err))
|
receiver.logger.Error("failed to create history on <FailureEvent> of <PaymentCallbackService>", zap.Error(err))
|
||||||
return err
|
return err
|
||||||
|
@ -5,9 +5,9 @@ import (
|
|||||||
"go.mongodb.org/mongo-driver/bson"
|
"go.mongodb.org/mongo-driver/bson"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"log"
|
"log"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/fields"
|
"gitea.pena/PenaSide/customer/internal/fields"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
type GetHistories struct {
|
type GetHistories struct {
|
||||||
|
162
internal/service/payment/payment.go
Normal file
162
internal/service/payment/payment.go
Normal file
@ -0,0 +1,162 @@
|
|||||||
|
package payment
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
|
"gitea.pena/PenaSide/customer/internal/proto/treasurer"
|
||||||
|
)
|
||||||
|
|
||||||
|
type paymentClient interface {
|
||||||
|
GetPaymentLinkBankCard(ctx context.Context, request *treasurer.GetPaymentLinkRequest) (string, errors.Error)
|
||||||
|
GetPaymentLinkYooMoney(ctx context.Context, request *treasurer.GetPaymentLinkRequest) (string, errors.Error)
|
||||||
|
GetPaymentLinkSberPay(ctx context.Context, request *treasurer.GetPaymentLinkRequest) (string, errors.Error)
|
||||||
|
GetPaymentLinkTinkoff(ctx context.Context, request *treasurer.GetPaymentLinkRequest) (string, errors.Error)
|
||||||
|
GetPaymentLinkSberbankB2B(ctx context.Context, request *treasurer.GetPaymentLinkRequest) (string, errors.Error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type authClient interface {
|
||||||
|
GetUser(ctx context.Context, userID string) (*models.User, errors.Error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type Deps struct {
|
||||||
|
Logger *zap.Logger
|
||||||
|
ConfigurationGRPC *models.ConfigurationGRPC
|
||||||
|
PaymentClient paymentClient
|
||||||
|
AuthClient authClient
|
||||||
|
}
|
||||||
|
|
||||||
|
type Service struct {
|
||||||
|
logger *zap.Logger
|
||||||
|
configurationGRPC *models.ConfigurationGRPC
|
||||||
|
paymentClient paymentClient
|
||||||
|
authClient authClient
|
||||||
|
}
|
||||||
|
|
||||||
|
func New(deps Deps) *Service {
|
||||||
|
if deps.Logger == nil {
|
||||||
|
log.Panicln("logger is nil on <New (payment service)>")
|
||||||
|
}
|
||||||
|
|
||||||
|
if deps.ConfigurationGRPC == nil {
|
||||||
|
log.Panicln("ConfigurationGRPC is nil on <New (payment service)>")
|
||||||
|
}
|
||||||
|
|
||||||
|
if deps.PaymentClient == nil {
|
||||||
|
log.Panicln("PaymentClient is nil on <New (payment service)>")
|
||||||
|
}
|
||||||
|
|
||||||
|
if deps.AuthClient == nil {
|
||||||
|
log.Panicln("AuthClient is nil on <New (payment service)>")
|
||||||
|
}
|
||||||
|
|
||||||
|
return &Service{
|
||||||
|
logger: deps.Logger,
|
||||||
|
paymentClient: deps.PaymentClient,
|
||||||
|
authClient: deps.AuthClient,
|
||||||
|
configurationGRPC: deps.ConfigurationGRPC,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (receiver *Service) GetPaymentLink(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
||||||
|
if _, userErr := receiver.authClient.GetUser(ctx, request.UserID); userErr != nil {
|
||||||
|
receiver.logger.Error("failed to get user on <GetPaymentLink> on <PaymentService>",
|
||||||
|
zap.Error(userErr),
|
||||||
|
zap.String("userID", request.UserID),
|
||||||
|
)
|
||||||
|
|
||||||
|
return "", userErr
|
||||||
|
}
|
||||||
|
|
||||||
|
switch request.Body.Type {
|
||||||
|
case models.PaymentTypeBankCard:
|
||||||
|
return receiver.GetPaymentLinkBankCard(ctx, request)
|
||||||
|
case models.PaymentTypeYoomoney:
|
||||||
|
return receiver.GetPaymentLinkYooMoney(ctx, request)
|
||||||
|
case models.PaymentTypeSberPay:
|
||||||
|
return receiver.GetPaymentLinkSberPay(ctx, request)
|
||||||
|
case models.PaymentTypeTinkoff:
|
||||||
|
return receiver.GetPaymentLinkTinkoff(ctx, request)
|
||||||
|
}
|
||||||
|
|
||||||
|
return "", errors.NewWithMessage("invalid payment method type", errors.ErrInvalidArgs)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (receiver *Service) GetPaymentLinkBankCard(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
||||||
|
link, err := receiver.paymentClient.GetPaymentLinkBankCard(ctx, &treasurer.GetPaymentLinkRequest{
|
||||||
|
MainSettings: &treasurer.MainPaymentSettings{
|
||||||
|
Currency: request.Body.Currency,
|
||||||
|
Amount: request.Body.Amount,
|
||||||
|
UserID: request.UserID,
|
||||||
|
ClientIP: request.ClientIP,
|
||||||
|
CallbackHostGRPC: []string{receiver.configurationGRPC.Domen},
|
||||||
|
ReturnURL: request.Body.ReturnURL,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
receiver.logger.Error("failed to get bankcard payment link on <GetPaymentLinkBankCard> of <PaymentService>", zap.Error(err))
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
return link, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (receiver *Service) GetPaymentLinkYooMoney(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
||||||
|
link, err := receiver.paymentClient.GetPaymentLinkYooMoney(ctx, &treasurer.GetPaymentLinkRequest{
|
||||||
|
MainSettings: &treasurer.MainPaymentSettings{
|
||||||
|
Currency: request.Body.Currency,
|
||||||
|
Amount: request.Body.Amount,
|
||||||
|
UserID: request.UserID,
|
||||||
|
ClientIP: request.ClientIP,
|
||||||
|
CallbackHostGRPC: []string{receiver.configurationGRPC.Domen},
|
||||||
|
ReturnURL: request.Body.ReturnURL,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
receiver.logger.Error("failed to get yoomoney payment link on <GetPaymentLinkYooMoney> of <PaymentService>", zap.Error(err))
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
return link, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (receiver *Service) GetPaymentLinkSberPay(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
||||||
|
link, err := receiver.paymentClient.GetPaymentLinkSberPay(ctx, &treasurer.GetPaymentLinkRequest{
|
||||||
|
MainSettings: &treasurer.MainPaymentSettings{
|
||||||
|
Currency: request.Body.Currency,
|
||||||
|
Amount: request.Body.Amount,
|
||||||
|
UserID: request.UserID,
|
||||||
|
ClientIP: request.ClientIP,
|
||||||
|
CallbackHostGRPC: []string{receiver.configurationGRPC.Domen},
|
||||||
|
ReturnURL: request.Body.ReturnURL,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
receiver.logger.Error("failed to get sberpay payment link on <GetPaymentLinkSberPay> of <PaymentService>", zap.Error(err))
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
return link, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (receiver *Service) GetPaymentLinkTinkoff(ctx context.Context, request *models.GetPaymentLinkRequest) (string, errors.Error) {
|
||||||
|
link, err := receiver.paymentClient.GetPaymentLinkTinkoff(ctx, &treasurer.GetPaymentLinkRequest{
|
||||||
|
MainSettings: &treasurer.MainPaymentSettings{
|
||||||
|
Currency: request.Body.Currency,
|
||||||
|
Amount: request.Body.Amount,
|
||||||
|
UserID: request.UserID,
|
||||||
|
ClientIP: request.ClientIP,
|
||||||
|
CallbackHostGRPC: []string{receiver.configurationGRPC.Domen},
|
||||||
|
ReturnURL: request.Body.ReturnURL,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
receiver.logger.Error("failed to get tinkoff payment link on <GetPaymentLinkTinkoff> of <PaymentService>", zap.Error(err))
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
return link, nil
|
||||||
|
}
|
@ -4,10 +4,10 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"log"
|
"log"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/interface/client"
|
"gitea.pena/PenaSide/customer/internal/interface/client"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/validate"
|
"gitea.pena/PenaSide/customer/pkg/validate"
|
||||||
)
|
)
|
||||||
|
|
||||||
type accountRepository interface {
|
type accountRepository interface {
|
||||||
@ -116,7 +116,7 @@ func (receiver *Service) ReplenishAccountWallet(ctx context.Context, request *mo
|
|||||||
updatedAccount, changeErr := receiver.repository.ChangeWallet(ctx, request.Account.UserID, &models.Wallet{
|
updatedAccount, changeErr := receiver.repository.ChangeWallet(ctx, request.Account.UserID, &models.Wallet{
|
||||||
Cash: request.Account.Wallet.Cash + cash,
|
Cash: request.Account.Wallet.Cash + cash,
|
||||||
Money: request.Account.Wallet.Money + request.Cash,
|
Money: request.Account.Wallet.Money + request.Cash,
|
||||||
Spent: request.Account.Wallet.Spent,
|
Spent: request.Account.Wallet.Spent,
|
||||||
PurchasesAmount: request.Account.Wallet.PurchasesAmount,
|
PurchasesAmount: request.Account.Wallet.PurchasesAmount,
|
||||||
Currency: request.Account.Wallet.Currency,
|
Currency: request.Account.Wallet.Currency,
|
||||||
LastPaymentID: request.PaymentID,
|
LastPaymentID: request.PaymentID,
|
||||||
|
@ -5,8 +5,8 @@ import (
|
|||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -3,7 +3,7 @@ package utils
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/errors"
|
"gitea.pena/PenaSide/customer/internal/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
var clientErrors = map[int]error{
|
var clientErrors = map[int]error{
|
||||||
|
@ -2,8 +2,8 @@ package utils
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/proto/discount"
|
"gitea.pena/PenaSide/customer/internal/proto/discount"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetAppliedDiscountsIDs(appliedDiscounts []*discount.Discount) []string {
|
func GetAppliedDiscountsIDs(appliedDiscounts []*discount.Discount) []string {
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang-jwt/jwt/v5"
|
"github.com/golang-jwt/jwt/v5"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
type JWT struct {
|
type JWT struct {
|
||||||
|
@ -7,8 +7,8 @@ import (
|
|||||||
|
|
||||||
"github.com/golang-jwt/jwt/v5"
|
"github.com/golang-jwt/jwt/v5"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
"gitea.pena/PenaSide/customer/internal/models"
|
||||||
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/utils"
|
"gitea.pena/PenaSide/customer/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestJWT(t *testing.T) {
|
func TestJWT(t *testing.T) {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user