commit
ab2d3c1ac6
569 changed files with 162383 additions and 0 deletions
@ -0,0 +1,38 @@ |
|||
# Reference https://github.com/github/gitignore/blob/master/Go.gitignore |
|||
# Binaries for programs and plugins |
|||
*.exe |
|||
*.exe~ |
|||
*.dll |
|||
*.dylib |
|||
|
|||
# Test binary, built with `go test -c` |
|||
*.test |
|||
|
|||
# Output of the go coverage tool, specifically when used with LiteIDE |
|||
*.out |
|||
|
|||
# Dependency directories (remove the comment below to include it) |
|||
vendor/ |
|||
|
|||
# Go workspace file |
|||
go.work |
|||
|
|||
# Compiled Object files, Static and Dynamic libs (Shared Objects) |
|||
*.o |
|||
*.a |
|||
*.so |
|||
|
|||
# OS General |
|||
Thumbs.db |
|||
.DS_Store |
|||
|
|||
# project |
|||
*.cert |
|||
*.key |
|||
*.log |
|||
bin/ |
|||
|
|||
# Develop tools |
|||
.vscode/ |
|||
.idea/ |
|||
*.swp |
@ -0,0 +1,24 @@ |
|||
FROM golang:1.21 AS builder |
|||
|
|||
COPY . /src |
|||
WORKDIR /src |
|||
|
|||
RUN GOPROXY=https://goproxy.cn make build |
|||
|
|||
FROM debian:stable-slim |
|||
|
|||
RUN apt-get update && apt-get install -y --no-install-recommends \ |
|||
ca-certificates \ |
|||
netbase \ |
|||
&& rm -rf /var/lib/apt/lists/ \ |
|||
&& apt-get autoremove -y && apt-get autoclean -y |
|||
|
|||
COPY --from=builder /src/bin /app |
|||
|
|||
WORKDIR /app |
|||
|
|||
EXPOSE 8000 |
|||
EXPOSE 9000 |
|||
VOLUME /data/conf |
|||
|
|||
CMD ["./server", "-conf", "/data/conf"] |
@ -0,0 +1,21 @@ |
|||
MIT License |
|||
|
|||
Copyright (c) 2020 go-kratos |
|||
|
|||
Permission is hereby granted, free of charge, to any person obtaining a copy |
|||
of this software and associated documentation files (the "Software"), to deal |
|||
in the Software without restriction, including without limitation the rights |
|||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|||
copies of the Software, and to permit persons to whom the Software is |
|||
furnished to do so, subject to the following conditions: |
|||
|
|||
The above copyright notice and this permission notice shall be included in all |
|||
copies or substantial portions of the Software. |
|||
|
|||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
|||
SOFTWARE. |
@ -0,0 +1,107 @@ |
|||
GOHOSTOS:=$(shell go env GOHOSTOS) |
|||
GOPATH:=$(shell go env GOPATH) |
|||
VERSION=$(shell git describe --tags --always) |
|||
|
|||
ifeq ($(GOHOSTOS), windows) |
|||
#the `find.exe` is different from `find` in bash/shell. |
|||
#to see https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/find. |
|||
#changed to use git-bash.exe to run find cli or other cli friendly, caused of every developer has a Git. |
|||
Git_Bash=$(subst \,/,$(subst cmd\,bin\bash.exe,$(dir $(shell where git)))) |
|||
INTERNAL_PROTO_FILES=$(shell $(Git_Bash) -c "find internal -name *.proto") |
|||
API_PROTO_FILES=$(shell $(Git_Bash) -c "find api -name *.proto") |
|||
else |
|||
INTERNAL_PROTO_FILES=$(shell find internal -name *.proto) |
|||
API_PROTO_FILES=$(shell find api -name *.proto) |
|||
endif |
|||
|
|||
.PHONY: init |
|||
# init env
|
|||
init: |
|||
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest |
|||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest |
|||
go install github.com/go-kratos/kratos/cmd/kratos/v2@latest |
|||
go install github.com/go-kratos/kratos/cmd/protoc-gen-go-http/v2@latest |
|||
go install github.com/google/gnostic/cmd/protoc-gen-openapi@latest |
|||
go install github.com/google/wire/cmd/wire@latest |
|||
|
|||
.PHONY: errors |
|||
# generate errors code
|
|||
errors: |
|||
protoc --proto_path=. \
|
|||
--proto_path=./third_party \
|
|||
--go_out=paths=source_relative:. \
|
|||
--go-errors_out=paths=source_relative:. \
|
|||
$(API_PROTO_FILES) |
|||
|
|||
.PHONY: config |
|||
# generate internal proto
|
|||
config: |
|||
protoc --proto_path=./internal \
|
|||
--proto_path=./third_party \
|
|||
--go_out=paths=source_relative:./internal \
|
|||
$(INTERNAL_PROTO_FILES) |
|||
|
|||
.PHONY: api |
|||
# generate api proto
|
|||
api: |
|||
protoc --proto_path=./api \
|
|||
--proto_path=./third_party \
|
|||
--go_out=paths=source_relative:./api \
|
|||
--go-http_out=paths=source_relative:./api \
|
|||
--go-grpc_out=paths=source_relative:./api \
|
|||
--openapi_out=fq_schema_naming=true,default_response=false:. \
|
|||
$(API_PROTO_FILES) |
|||
|
|||
.PHONY: build |
|||
# generate build
|
|||
build: |
|||
mkdir -p bin/ && go build -ldflags "-X main.Version=$(VERSION)" -o ./bin/ ./... |
|||
|
|||
.PHONY: win_build |
|||
# generate win_build
|
|||
win_build: |
|||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X main.Version=$(VERSION)" -o ./bin/ ./... |
|||
|
|||
.PHONY: generate |
|||
# generate
|
|||
generate: |
|||
go mod tidy |
|||
go get github.com/google/wire/cmd/wire@latest |
|||
go generate ./... |
|||
|
|||
.PHONY: wire |
|||
# generate wire
|
|||
wire: |
|||
cd cmd/matchmaking-system/ && wire |
|||
|
|||
.PHONY: run |
|||
# generate run
|
|||
run: |
|||
kratos run |
|||
|
|||
.PHONY: all |
|||
# generate all
|
|||
all: |
|||
make api; |
|||
make errors; |
|||
make config; |
|||
make generate; |
|||
|
|||
# show help
|
|||
help: |
|||
@echo '' |
|||
@echo 'Usage:' |
|||
@echo ' make [target]' |
|||
@echo '' |
|||
@echo 'Targets:' |
|||
@awk '/^[a-zA-Z\-\_0-9]+:/ { \
|
|||
helpMessage = match(lastLine, /^# (.*)/); \
|
|||
if (helpMessage) { \
|
|||
helpCommand = substr($$1, 0, index($$1, ":")); \
|
|||
helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \
|
|||
printf "\033[36m%-22s\033[0m %s\n", helpCommand,helpMessage; \
|
|||
} \
|
|||
} \
|
|||
{ lastLine = $$0 }' $(MAKEFILE_LIST) |
|||
|
|||
.DEFAULT_GOAL := help |
@ -0,0 +1,94 @@ |
|||
# kratos-matchmaking system |
|||
kratos Framework creation transaction service project |
|||
> Note: In this project, if Kratos provides packages, they will not package third-party packages themselves. |
|||
|
|||
# kratos-matchmaking remarks |
|||
``` |
|||
Branch: |
|||
1、main |
|||
2、other_main (P1 and P2 project apply) |
|||
3、latest_main (other project apply) |
|||
``` |
|||
|
|||
The specific directory structure design of the project is as follows: |
|||
|
|||
``` |
|||
|-- kratos-matchmakingSystem |
|||
|-- wss service |
|||
|-- AdminWss // Administrator subscription |
|||
|-- AdminBlkWss // Administrator block subscription |
|||
|-- SpotsWss // Spot subscription |
|||
|-- ContractWss // Contract subscription |
|||
|-- SecondWss // Second contract subscription |
|||
|-- ShareUsWss // US stock subscription |
|||
|-- ShareMysWss // Horse stock subscription |
|||
|-- ShareThaWss // Thai stock subscription |
|||
|-- ShareIdnWss // Indonesian stock subscription |
|||
|-- ShareInrWss // Indian stock subscription |
|||
|-- ShareSgdWss // Singapore Stock Subscription |
|||
|-- ShareHkdWss // Hong Kong Stock Subscription |
|||
|-- ShareGbxWss // Hong Uk Subscription |
|||
|-- ShareBlkWss // Block Stock Subscription |
|||
|-- OptionInrWss // Options (India) Stock Subscription |
|||
|
|||
|-- api service // Transaction API service (TODO: can be changed to microservices, currently also compiled for multi-service deployment) |
|||
├── api |
|||
│ ├── v1 |
|||
│ │ └── option |
|||
│ │ └── optionInr // Options (Indian stock) |
|||
│ │ └── order |
|||
│ │ └── order // New stock subscription (US, Malaysian, Thai, Indonesian, Indian, Singapore, Hong Kong) |
|||
│ │ └── share |
|||
│ │ └── shareUs // US stock |
|||
│ │ └── shareMys // Malaysian stock |
|||
│ │ └── shareTha // Thai stock |
|||
│ │ └── shareIdn // Indonesian stock |
|||
│ │ └── shareInr // Indian stock |
|||
│ │ └── shareSgd // Singapore stock |
|||
│ │ └── shareHkd // Hong Kong stock |
|||
│ │ └── shareGbx // Uk stock |
|||
│ │ └── virtually |
|||
│ │ └── spots // Spots |
|||
│ │ └── contract // Contract |
|||
│ │ └── second // Second contract |
|||
│ │ └── block |
|||
│ │ └── shareBlock // Block stock |
|||
|
|||
|-- monitor service // Initialize | Entrust | Position |
|||
├── start |
|||
│ ├── user |
|||
│ │ └── init |
|||
│ │ └── virtually // Digital currency (spot | contract | second contract) |
|||
│ │ └── option // Options (India) |
|||
│ │ └── share // Stocks (US, Malaysian, Thai, Indonesian, Indian, Singapore, Hong Kong, options, new stock subscription) |
|||
│ │ └── option |
|||
│ │ └── optionInr // Options (Indian stock) |
|||
│ │ └── order |
|||
│ │ └── order // New stock subscription (US, Malaysian, Thai, Indonesian, Indian, Singapore, Hong Kong) |
|||
│ │ └── share |
|||
│ │ └── shareUs // US stock |
|||
│ │ └── shareMys // Malaysian stock |
|||
│ │ └── shareTha // Thai stock |
|||
│ │ └── shareIdn // Indonesian stock |
|||
│ │ └── shareInr // Indian stock |
|||
│ │ └── shareSgd // Singapore stock |
|||
│ │ └── shareHkd // Hong Kong stock |
|||
│ │ └── shareGbx // Uk stock |
|||
│ │ └── virtually |
|||
│ │ └── contract // Spots |
|||
│ │ └── second // Contract |
|||
│ │ └── block |
|||
│ │ └── shareBlock // Block stock |
|||
│ ├── admin |
|||
│ │ └── contract // Contract |
|||
│ │ └── second // Second contract |
|||
│ │ └── shareUs // US stock |
|||
│ │ └── shareMys // Malaysian stock |
|||
│ │ └── shareTha // Thai stock |
|||
│ │ └── shareIdn // Indonesian stock |
|||
│ │ └── shareInr // Indian stock |
|||
│ │ └── shareSgd // Singapore stock |
|||
│ │ └── shareHkd // Hong Kong stock |
|||
│ │ └── shareGbx // Uk stock |
|||
│ │ └── shareBlk // Block stock |
|||
``` |
@ -0,0 +1,205 @@ |
|||
公司无线密码: |
|||
账号1:H3C_2202-5G-1 |
|||
密码:A13b142202) |
|||
账号2:ssid |
|||
密码:Meetingyou0) |
|||
------------------------------------------------------------------------------------------------------------------------------------------------- |
|||
|
|||
1、美股数据接入账号: |
|||
https://polygon.io/dashboard/api-keys |
|||
账号:rnldburn@gmail.com |
|||
密码: Meetingyou0 |
|||
key: CDGMfPJmyiEX5dbjagLSEipf5Y4XbXVb |
|||
|
|||
2、亚马逊oss接入: |
|||
myaccesspoint |
|||
桶名称:log-aws-bucket-2023 |
|||
S3: s3://arn:aws:s3:ap-southeast-1:297182325232:accesspoint/myaccesspoint |
|||
ARN: arn:aws:s3:ap-southeast-1:297182325232:accesspoint/myaccesspoint |
|||
别名:myaccesspoint-9kcrj5icrgdejw1fydhda6n6rfcjkaps1a-s3alias |
|||
|
|||
3、区域:ap-southeast-1 |
|||
aws_access_key_id:AKIAUKMLSNHYAP7EOBDE |
|||
aws_secret_access_key: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 |
|||
endpoint:s3.ap-southeast-1.amazonaws.com |
|||
|
|||
4、阿里云(测试服务器) |
|||
网址:https://account.alibabacloud.com/login/login.htm |
|||
账户:ouanczqrouoydxc@outlook.com |
|||
密码:Meetingyou0)) |
|||
------------------------------------------------------------------------------------------------------------------------------------------------ |
|||
|
|||
1、域名解析: |
|||
cotelaiamelia@gmail.com |
|||
Meetingyou0)(*& |
|||
|
|||
2、GCP-谷歌云-测试环境: |
|||
项目名称:SC Project 47850 |
|||
LoginAccount:zajdelvipondespq9931@gmail.com |
|||
邮箱密码:7ae8b5w0u0z |
|||
访问地址:https://cloud.google.com/?hl=zh-CN |
|||
|
|||
3、GCP-谷歌云-正式环境: |
|||
项目名称:SC Project 51416 |
|||
登录邮箱:cloudrun40@gmail.com |
|||
邮箱密码:Meetingyou0 |
|||
辅助邮箱:rnldburn@gmail.com |
|||
访问地址:https://cloud.google.com/?hl=zh-CN |
|||
|
|||
4、跳板机 |
|||
ec2-13-212-72-30.ap-southeast-1.compute.amazonaws.com |
|||
用户名:Administrator |
|||
密码:J.RUhgy8hHf?QsaK50cckzv3ynl7X.W= |
|||
|
|||
5、YAPI |
|||
管理员账号:admin@admin.com |
|||
管理员密码:Meetingyou0)) |
|||
------------------------------------------------------------------------------------------------------------------------------------------------ |
|||
|
|||
1、测试服务接口是否正常 |
|||
curl -X POST -H 'Content-Type: application/json' -d '{ "status": "0","pageSize": "10","pageCount": "1"}' http://10.160.0.2:8003/order_shareus/share_list |
|||
curl -X POST -H 'Content-Type: application/json' -d '{ "status": "0","pageSize": "10","pageCount": "1"}' http://trade.lazardinvestgroup.net/order_shareus/share_list |
|||
curl -X POST -H 'Content-Type: application/json' -d '{ "status": "0","pageSize": "10","pageCount": "1"}' http://10.160.0.2:8002/order_contract/contract_list |
|||
curl -X POST -H 'Content-Type: application/json' -d '{ "status": "0","pageSize": "10","pageCount": "1"}' http://trade.chdh.me/order_contract/contract_list |
|||
curl -X POST -H 'Content-Type: application/json' -d '{ "status": "0","pageSize": "10","pageCount": "1"}' https://172.23.48.59:8004/order_sharemys/share_list |
|||
curl -X POST -H 'Content-Type: application/json' -d '{ }' http://172.26.45.215:8022/order_backend/update_is_real |
|||
curl -X POST -H 'Content-Type: application/json' -d '{ "code": "BSE:IXIGO","id": "80","stock": "7"}' http://10.160.0.17:8000/order_sharepre/share_pre_trade |
|||
|
|||
2、初始化股票数据 34.100.189.47 |
|||
./shareUs -conf /home/ubuntu/service/config/shareUs.yaml -check shareUs -network onLine |
|||
./digitalInit -conf /home/ubuntu/service/config/digitalInit.yaml -check digitalInit -network onLine |
|||
./optionInr -conf /home/ubuntu/service/config/optionInr.yaml -check optionInr -network onLine |
|||
./shareClearCache -conf /home/ubuntu/service/config/shareInit.yaml -check shareClearCache -network onLine |
|||
./contract -conf /home/ubuntu/service/config/contract.yaml -check contract -network onLine |
|||
./second -conf /home/ubuntu/service/config/second.yaml -check second -network onLine |
|||
./shareCache -conf /home/ubuntu/service/config/shareCache.yaml -check shareCache -network onLine |
|||
./wssPool --check tickDB --hostS 0.0.0.0 --addrS :1000 --model allUs --config /home/ubuntu/wss-server/config/config06.yaml |
|||
./wssPool --check tickDB --hostS 0.0.0.0 --addrS :1000 --model Us --config /home/ubuntu/wss-server/config/config06.yaml |
|||
./wssPool --check tickDB --hostS 0.0.0.0 --addrS :1000 --model allUs --config /home/ubuntu/wss-server/config/config06.yaml |
|||
./wssPool --check stockDataUs --hostS 0.0.0.0 --addrS :1000 --project US --config /home/ubuntu/wss-server/config/config.yaml |
|||
./wssPool --check tickDB --hostS 0.0.0.0 --addrS :1000 --model updateStockUsCode --config /home/ubuntu/wss-server/config/config06.yaml |
|||
./wssPool --check stockCode --hostS 0.0.0.0 --addrS :7777 --project US --config /home/ubuntu/wss-server/config/config06.yaml |
|||
|
|||
3、mysql-生成model |
|||
./xorm.exe reverse mysql admin:Meetingyou0@\(dbtest.crsocbk1nt38.ap-southeast-1.rds.amazonaws.com:3306\)/bourse?charset=utf8 templates/goxorm |
|||
./xorm.exe reverse mysql admin:Meetingyou0@\(ubsfim.c59brkvf12hq.ap-southeast-3.rds.amazonaws.com:3306\)/bourse?charset=utf8 templates/goxorm |
|||
./xorm.exe reverse mysql root:'q7%B/$o>ck5r]{x<'@\(35.186.154.125:3306\)/bourse?charset=utf8 templates/goxorm |
|||
./xorm.exe reverse mysql root:123456789@\(127.0.0.1:13306\)/bourse?charset=utf8 templates/goxorm |
|||
|
|||
4、本地环境-docker启动服务 |
|||
docker run --name mysql -p 13306:3306 -e MYSQL_ROOT_PASSWORD=12345678 mysql:8.0.28 |
|||
docker run --name f2ad9f23df82a3e5efabd1574b862a94c0657c73a6179efec07d5cf9ae5a307f -p 13306:3306 -e MYSQL_ROOT_PASSWORD=123456789 -d mysql:8.0.28 |
|||
docker run --name my-redis -p 6379:6379 -d redis --requirepass "123456" |
|||
----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|||
|
|||
服务器环境部署: |
|||
1、redis部署 |
|||
sudo apt update |
|||
sudo apt-get install redis-server |
|||
|
|||
2、mongod部署 |
|||
sudo apt update |
|||
wget -qO- https://get.docker.com/ | sh |
|||
apt install docker-compose |
|||
docker-compose up -d |
|||
docker-compose down |
|||
|
|||
3、安装supervisor |
|||
sudo apt update |
|||
apt install supervisor |
|||
|
|||
4、安装nginxs |
|||
sudo apt update |
|||
sudo apt install nginx |
|||
sudo systemctl start nginx |
|||
sudo service nginx reload {start|stop|restart|reload|force-reload|status|configtest|rotate|upgrade) |
|||
|
|||
5、设置最大链接数 |
|||
vim /etc/profile |
|||
ulimit -n 1000000 |
|||
source /etc/profile |
|||
|
|||
6、初始化服务器 |
|||
切换用户:sudo -i |
|||
修改登录权限:vim /etc/ssh/sshd_config |
|||
修改配置:PasswordAuthentication yes |
|||
修改配置: ChallengeResponseAuthentication yes |
|||
重启ssh服务:service ssh restart |
|||
修改密码:passwd |
|||
|
|||
7、修改服务器时区 |
|||
sudo timedatectl set-timezone Asia/Shanghai |
|||
|
|||
8、查看redis链接数 |
|||
netstat -an | grep :26379 | wc -l |
|||
netstat -tuln | grep :80 |
|||
|
|||
9、corn 定时器 |
|||
sudo systemctl status cron |
|||
sudo systemctl stop cron |
|||
sudo systemctl enable cron |
|||
sudo service cron restart |
|||
----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|||
|
|||
1、市场总资产: 冻结 + 可用 + 持仓市值 |
|||
2、市场可用资产: 可用 |
|||
3、市场累计盈亏(订单表-->平仓状态): |
|||
1、买涨:订单量 * (平仓价 - 开仓价) |
|||
2、买跌:订单量 * (开仓价 - 平仓价) |
|||
4、市场冻结资产: 冻结 |
|||
5、市场总手续费(统计订单表-->【持仓和平仓】状态): |
|||
1、交易手续费:bot_stock_fur_trade ------ sum(service_cost + closing_cost) |
|||
2、申购手续费:bot_user_fur_pre_stock_order ----- sum(get_fee) |
|||
----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|||
|
|||
目前杠杆设置注解: |
|||
1、全市场杠杆倍数设置——》针对所有市场股票给的默认杠杆倍数(目前设置的是1,可修改),且不需要关闭,当然也不影响用户单独设置其他杠杆倍数; |
|||
2、用户杠杆倍数设置——》如果用户通过了申请且满足了后台设置触发杠杆的条件(例如:1、是否开启杠杆,2、是否达到最小面值,3、是否满足设置杠杆的范围(最大和最小)),就会使用这个用户单独设置的杠杆倍数; |
|||
----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|||
|
|||
docker save liuqingzheng/yapi:latest > yapi_latest.tar |
|||
docker save mongo:latest > mongo_latest.tar |
|||
|
|||
docker save gitea/gitea:latest > gitea_latest.tar |
|||
docker save mysql:5.7 > mysql.tar |
|||
|
|||
scp -P 31544 mongo_latest.tar mysql.tar gitea_latest.tar yapi_latest.tar root@154.86.0.30:/root |
|||
docker load < mongo_latest.tar mysql.tar gitea_latest.tar yapi_latest.tar |
|||
|
|||
docker run -d --name yapi-mongo -e MONGO_INITDB_ROOT_USERNAME=admin@admin.com -e MONGO_INITDB_ROOT_PASSWORD=admin mongo:latest |
|||
docker run -d --name yapi-mongo mongo:latest |
|||
docker run -d --name yapi-web -p 3001:3000 liuqingzheng/yapi:latest |
|||
|
|||
find / -name config.json 2>/dev/null |
|||
|
|||
docker run -d --name gitea_server_1 -p 3000:3000 -p 222:31544 gitea/gitea:latest |
|||
docker run -d --name gitea_db_1 -p 3306:3306 -p 33060:33060 mysql/mysql:5.7 |
|||
|
|||
文档|git |
|||
yapi:http://154.86.0.30:3001/ |
|||
git:http://103.71.254.42:3000/ |
|||
----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|||
|
|||
cron 执行定时任务; cat /etc/crontab |
|||
// 行情报警、指数、泰股、马股、港股、印度股、印尼股、新加坡股、英股、德股、法股 |
|||
*/20 * * * 1-5 root /home/ubuntu/wss-server/checkStock --check tickDB --model checkStock --config /home/ubuntu/wss-server/config/config06.yaml>>/var/log/checkStock.log 2>&1 & |
|||
*/5 * * * 1-6 root /home/ubuntu/wss-server/stockIndex --check tickDB --model stockIndex --config /home/ubuntu/wss-server/config/config06.yaml>>/var/log/stockIndex.log 2>&1 & |
|||
*/5 * * * 1-5 root /home/ubuntu/wss-server/thailandStock --check tickDB --model southAsiaStock --contract Thailand --hostS 0.0.0.0.0 --addrS :289 --config /home/ubuntu/wss-server/config/config06.yaml>>/var/log/thailandStock.log 2>&1 & |
|||
*/5 * * * 1-5 root /home/ubuntu/wss-server/malaysiaStock --check tickDB --model southAsiaStock --contract Malaysia --hostS 0.0.0.0.0 --addrS :299 --config /home/ubuntu/wss-server/config/config06.yaml>>/var/log/malaysiaStock.log 2>&1 |
|||
*/5 * * * 1-5 root /home/ubuntu/wss-server/hongkongStock --check tickDB --model southAsiaStock --contract HongKong --config /home/ubuntu/wss-server/config/config06.yaml>>/var/log/hongkongStock.log 2>&1 & |
|||
*/5 * * * 1-5 root /home/ubuntu/wss-server/indiaStock --check tickDB --model southAsiaStock --contract India --config /home/ubuntu/wss-server/config/config06.yaml>>/var/log/indiaStock.log 2>&1 & |
|||
*/5 * * * 1-5 root /home/ubuntu/wss-server/indonesiaStock --check tickDB --model southAsiaStock --contract Indonesia --config /home/ubuntu/wss-server/config/config06.yaml>>/var/log/indonesiaStock.log 2>&1 & |
|||
*/5 * * * 1-5 root /home/ubuntu/wss-server/singaporeStock --check tickDB --model southAsiaStock --contract Singapore --config /home/ubuntu/wss-server/config/config06.yaml>>/var/log/singaporeStock.log 2>&1 & |
|||
*/5 * * * 1-5 root /home/ubuntu/wss-server/ukStock --check tickDB --model southAsiaStock --contract UK --config=/home/ubuntu/wss-server/config/config06.yaml>>/var/log/ukStock.log 2>&1 & |
|||
*/5 * * * 1-5 root /home/ubuntu/wss-server/germanyStock --check tickDB --model southAsiaStock --contract Germany --config=/home/ubuntu/wss-server/config/config06.yaml>>/var/log/germanyStock.log 2>&1 & |
|||
*/5 * * * 1-5 root /home/ubuntu/wss-server/franceStock --check tickDB --model southAsiaStock --contract France --config=/home/ubuntu/wss-server/config/config06.yaml>>/var/log/franceStock.log 2>&1 & |
|||
|
|||
// 更新上一次行情价格 |
|||
8 9 * * * root /home/ubuntu/wss-server/preClose --check=tickDB --model=previousClose --config=/home/ubuntu/wss-server/config/config06.yaml>>/var/log/preClose.log 2>&1 & |
|||
|
|||
// 数据清理 |
|||
12 22 * * 2-5 root /home/ubuntu/wss-server/deleteSpot --check=tickDB --model=deleteSpot --contract=false --config /home/ubuntu/wss-server/config/config06.yaml>>/var/log/deleteSpot.log 2>&1 & |
|||
|
|||
// 插针数据推送 |
|||
*/1 * * * * root /home/ubuntu/wss-server/stockCloseData --check=tickDB --model=stockCloseData --config=/home/ubuntu/wss-server/config/config06.yaml>>/var/log/stockCloseData.log 2>&1 & |
|||
----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@ -0,0 +1,73 @@ |
|||
------------------------------------------------------------------------------------------------------------------------------------------------ |
|||
|
|||
test(谷歌云)服务器(域名:jdtest88.com) |
|||
web-mysql 47.237.29.68(公) 172.26.45.216(私有) |
|||
trade-quotes 47.237.64.60(公) 172.26.45.215(私有) |
|||
mongo 8.222.169.172(公) 172.26.45.217(私有) |
|||
|
|||
msyql |
|||
host:47.237.29.68(公) 172.26.45.216(私有) |
|||
user:root |
|||
密码:Meetingyou0)) |
|||
|
|||
redis |
|||
host:47.237.29.68(公) 172.26.45.216(私有) |
|||
密码:MRrfvtyujnb&hg56 |
|||
端口:6379 |
|||
|
|||
mongodb数据库 |
|||
host:8.222.169.172(公) 172.26.45.217(私有) |
|||
账号:pqRRVamndJ |
|||
密码:35LlW3pXF76&WD!OOlnI |
|||
------------------------------------------------------------------------------------------------------------------------------------------------ |
|||
|
|||
project01-新服务器(域名:macquariegig.com) |
|||
p1-web 10.148.0.8 (nic0) 34.87.157.112 (nic0) |
|||
p1-mongo 10.148.0.11 (nic0) 35.186.148.111 (nic0) |
|||
p1-quotes 10.148.0.10 (nic0) 35.240.154.77 (nic0) |
|||
p1-trade 10.148.0.9 (nic0) 34.87.42.105 (nic0) |
|||
|
|||
mysql |
|||
host: 10.148.0.8 (nic0) 34.87.157.112 (nic0) |
|||
user:root |
|||
pwd: Meetingyou0))2024$ |
|||
port:23306 |
|||
|
|||
redis |
|||
host: 10.148.0.8 (nic0) 34.87.157.112 (nic0) |
|||
port:26379 |
|||
pwd:7d00cb62-1d1c-4c86-b50a-ebf9f00cc9fd |
|||
|
|||
mongodb |
|||
host: 10.148.0.11 (nic0) 35.186.148.111 (nic0) |
|||
port:28075 |
|||
user:pqRRVamndJ |
|||
pwd:35LlW3pXF76&WD!OOlnI |
|||
------------------------------------------------------------------------------------------------------------------------------------------------ |
|||
|
|||
project06-新服务器(域名:yrsig.com) |
|||
p6-mongo 10.154.0.10 (nic0) 35.189.116.242 (nic0) |
|||
p6-quotes 10.154.0.8 (nic0) 35.246.61.201 (nic0) |
|||
p6-trade 10.154.0.7 (nic0) 35.246.63.137 (nic0) |
|||
p6-web 10.154.0.9 (nic0) 34.105.182.222 (nic0) |
|||
|
|||
用户名:root |
|||
密码:Meetingyou0)) |
|||
|
|||
mysql |
|||
IP: 10.154.0.9(nic0) 34.105.182.222(nic0) |
|||
port: 23306 |
|||
USER: root |
|||
PWD: Meetingyou0))2024$ |
|||
|
|||
redis |
|||
IP: 10.154.0.9(nic0) 34.105.182.222(nic0) |
|||
port :26379 |
|||
PWD: 7d00cb62-1d1c-4c86-b50a-ebf9f00cc9fd |
|||
|
|||
mongodb |
|||
host:10.154.0.10(nic0) 35.189.116.242 (nic0) |
|||
port:28075 |
|||
user:pqRRVamndJ |
|||
pwd:35LlW3pXF76&WD!OOlnI |
|||
------------------------------------------------------------------------------------------------------------------------------------------------ |
@ -0,0 +1,159 @@ |
|||
|
|||
------------------------------------------------------------------------------------------------------------------------------------------------ |
|||
p7正式环境,美股|泰股|马股|港股|IPO交易服务更新 |
|||
服务部署完毕(2024-06-21) |
|||
此次更新功能包含: |
|||
1、部署美股、泰股、马股、港股、IPO交易服务 |
|||
2、访问地址 |
|||
1>交易订单域名: https://trade.tdcowengroup.com |
|||
2>交易订单Wss: wss://trade.tdcowengroup.com |
|||
3、相关API文档参见 |
|||
1>http://103.71.254.42:3001/project/56/interface/api |
|||
2>http://103.71.254.42:3001/project/56/interface/api/cat_88 |
|||
------------------------------------------------------------------------------------------------------------------------------------------------ |
|||
|
|||
测试|正式环境,德股|法股交易服务更新 |
|||
服务部署完毕(2024-06-24) |
|||
此次更新功能包含: |
|||
1、部署德股、法股交易服务 |
|||
2、测试访问地址 |
|||
1>交易订单域名: https://trade.jdtest88.com |
|||
2>交易订单Wss: wss://trade.jdtest88.com |
|||
3、线上访问地址 |
|||
1>交易订单域名: https://trade.twinim.com |
|||
2>交易订单Wss: wss://trade.twinim.com |
|||
4、相关API文档参见 |
|||
1>http://103.71.254.42:3001/project/56/interface/api/cat_807 |
|||
2>http://103.71.254.42:3001/project/56/interface/api/cat_799 |
|||
3>http://103.71.254.42:3001/project/56/interface/api/cat_88 |
|||
------------------------------------------------------------------------------------------------------------------------------------------------ |
|||
|
|||
测试|p6正式环境,股票交易服务更新 |
|||
服务部署完毕(2024-06-27) |
|||
此次更新功能包含: |
|||
1、统一股票订单列表时间格式 |
|||
------------------------------------------------------------------------------------------------------------------------------------------------ |
|||
|
|||
p2|p7正式环境,股票交易服务更新 |
|||
服务部署完毕(2024-07-01) |
|||
此次更新功能包含: |
|||
1、更新通过配置股票插针进行后台交易 |
|||
------------------------------------------------------------------------------------------------------------------------------------------------ |
|||
|
|||
p8正式环境,数字币交易服务更新 |
|||
服务部署完毕(2024-07-02) |
|||
此次更新功能包含: |
|||
1、部署合约、现货、秒合约交易服务 |
|||
2、线上访问地址 |
|||
1>交易订单域名: https://trade.chdh.me |
|||
2>交易订单Wss: wss://trade.chdh.me |
|||
3、相关API文档参见 |
|||
1>http://103.71.254.42:3001/project/56/interface/api/cat_519 |
|||
2>http://103.71.254.42:3001/project/56/interface/api/cat_74 |
|||
3>http://103.71.254.42:3001/project/56/interface/api/cat_81 |
|||
------------------------------------------------------------------------------------------------------------------------------------------------ |
|||
|
|||
关于插针改动(p2\p6\p7): |
|||
1、前端/后端-(订单wss订阅|浮动盈亏wss订阅|市场总金额浮动盈亏wss订阅)取值为:实时价、闭盘价(优先级:实时价 > 闭盘价) |
|||
2、盘中插针(优先级:插针价 > 实时价) |
|||
1>设置时:交易开仓取值为:插针价 |
|||
2>未设置时:交易开仓取值为:实时价 |
|||
3、盘前|盘后插针 (在设置容许下单的前提下:例如调整开盘时间等) |
|||
1>设置时:交易开仓取值为:插针价 |
|||
------------------------------------------------------------------------------------------------------------------------------------------------ |
|||
|
|||
测试环境,股票交易统计服务更新 |
|||
服务部署完毕(2024-07-10) |
|||
此次更新功能包含: |
|||
1、新增股票各个市场订阅统计服务(包含:用户市场总资产、用户市场总可用余额、用户市场冻结、用户市场累计盈亏、用户市场总手续费、用户市场总浮动盈亏) |
|||
2、相关API文档参见 |
|||
1>http://103.71.254.42:3001/project/56/interface/api/cat_88 |
|||
------------------------------------------------------------------------------------------------------------------------------------------------ |
|||
|
|||
FB |
|||
应用编号:489884953731337 |
|||
应用密钥:77fcf7fe8f8b1ba26ad622b537e321c9 |
|||
gg |
|||
客户端ID: 220504529176-bl8cfsr1dktbebl1qo1km6mu02lfdjaa.apps.googleusercontent.com |
|||
客户端密钥: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 |
|||
------------------------------------------------------------------------------------------------------------------------------------------------ |
|||
|
|||
p6正式环境,股票交易服务更新 |
|||
服务部署完毕(2024-08-02) |
|||
此次更新功能包含: |
|||
1、新增股票市场IPO欠款功能 |
|||
------------------------------------------------------------------------------------------------------------------------------------------------ |
|||
|
|||
正式环境,p9股票交易服务更新 |
|||
服务部署完毕(2024-08-13) |
|||
此次更新功能包含: |
|||
1、部署美股、泰股、巴西股交易服务 |
|||
2、线上访问地址 |
|||
1>交易订单域名: https://trade.wedbushig.com |
|||
2>交易订单Wss: wss://trade.wedbushig.com |
|||
3、相关API文档参见 |
|||
1>订单api:http://103.71.254.42:3001/project/56/interface/api/cat_808 |
|||
2>订单订阅:http://103.71.254.42:3001/project/56/interface/api/4543 |
|||
3>管理员|浮动盈亏订阅:http://103.71.254.42:3001/project/56/interface/api/519 |
|||
------------------------------------------------------------------------------------------------------------------------------------------------ |
|||
|
|||
正式|测试(美股\德股\法股\英股)环境,p6股票交易服务更新 |
|||
服务部署完毕(2024-08-14) |
|||
此次更新功能包含: |
|||
1、修改股票交易杠杆取值逻辑 |
|||
------------------------------------------------------------------------------------------------------------------------------------------------ |
|||
|
|||
目前杠杆开启的条件: |
|||
1、申请杠杆(开启杠杆) |
|||
2、是否满足设置杠杆的最小购买量 |
|||
3、设置杠杆倍数是否满足区间范围(最小~最大) |
|||
|
|||
杠杆优先级: |
|||
1、设置默认杠杆 |
|||
2、设置单个用户杠杆 |
|||
3、优先级:设置单个用户杠杆 > 默认值 |
|||
------------------------------------------------------------------------------------------------------------------------------------------------ |
|||
|
|||
p9测试环境,数字币交易服务更新 |
|||
服务部署完毕(2024-09-19) |
|||
此次更新功能包含: |
|||
1、部署合约、现货、秒合约交易服务 |
|||
2、交易访问地址 |
|||
1>交易订单域名: https://trade.jdtest88.com |
|||
2>交易订单Wss: wss://trade.jdtest88.com |
|||
3、行情访问地址 |
|||
1>行情订单域名: https://quotes.jdtest88.com |
|||
2>行情订单Wss: wss://quotes.jdtest88.com |
|||
|
|||
------------------------------------------------------------------------------------------------------------------------------------------------ |
|||
|
|||
外汇交易服务更新 |
|||
服务部署完毕(2024-10-27) |
|||
此次更新功能包含: |
|||
1、部署外汇交易、行情服务 |
|||
2、交易访问地址 |
|||
1>交易订单域名: https://trade.jdtest88.com |
|||
2>交易订单Wss: wss://trade.jdtest88.com |
|||
3、行情访问地址 |
|||
1>行情订单域名: https://quotes.jdtest88.com |
|||
2>行情订单Wss: wss://quotes.jdtest88.com |
|||
3、相关API文档参见 |
|||
1>行情API:http://154.86.0.30:3001/project/65/interface/api/cat_812 |
|||
2>行情订阅:http://154.86.0.30:3001/project/65/interface/api/cat_158 |
|||
3>交易API:http://154.86.0.30:3001/project/56/interface/api/cat_814 |
|||
4>交易订单订阅:http://154.86.0.30:3001/project/56/interface/api/4621 |
|||
5>管理员|浮动盈亏订阅:http://154.86.0.30:3001/project/56/interface/api/cat_88 |
|||
------------------------------------------------------------------------------------------------------------------------------------------------ |
|||
|
|||
p1外汇交易服务更新 |
|||
服务部署完毕(2024-12-14) |
|||
此次更新功能包含: |
|||
1、部署p1外汇交易 |
|||
2、交易访问地址 |
|||
1>交易订单域名: https://trade.jdtest88.com |
|||
2>交易订单Wss: wss://trade.jdtest88.com |
|||
3、相关API文档参见 |
|||
1>交易API:http://154.86.0.30:3001/project/56/interface/api/cat_818 |
|||
2>交易订单订阅:http://154.86.0.30:3001/project/56/interface/api/4657 |
|||
3>管理员|浮动盈亏订阅:http://154.86.0.30:3001/project/56/interface/api/519 |
|||
------------------------------------------------------------------------------------------------------------------------------------------------ |
@ -0,0 +1,37 @@ |
|||
# 项目api管理 |
|||
|
|||
## 金融市场-数字币(virtually) |
|||
``` |
|||
1、现货 spots |
|||
2、合约 cntract |
|||
3、秒合约 second |
|||
``` |
|||
|
|||
## 金融市场-股票(share) |
|||
``` |
|||
1、美股 shareUs |
|||
2、泰股 shareTha |
|||
3、马股 shareMys |
|||
4、印度股 shareInr |
|||
5、印尼股 shareIdn |
|||
6、新加坡股 shareSgd |
|||
7、港股 shareHkd |
|||
8、英股 shareGbx |
|||
``` |
|||
|
|||
## 金融市场-大宗交易(block) |
|||
``` |
|||
1、美股 shareBlk |
|||
2、泰股 shareBlk |
|||
3、马股 shareBlk |
|||
4、印尼股 shareBlk |
|||
5、印度股 shareBlk |
|||
6、新加坡股 shareBlk |
|||
7、港股 shareBlk |
|||
8、英股 shareGbx |
|||
``` |
|||
|
|||
## 金融市场-期权(option) |
|||
``` |
|||
1、印度股 optionInr |
|||
``` |
@ -0,0 +1,231 @@ |
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|||
// versions:
|
|||
// protoc-gen-go v1.34.2
|
|||
// protoc v5.27.1
|
|||
// source: matchmaking/v1/backend/backend.proto
|
|||
|
|||
package v1 |
|||
|
|||
import ( |
|||
_ "google.golang.org/genproto/googleapis/api/annotations" |
|||
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 BotUsersReply struct { |
|||
state protoimpl.MessageState |
|||
sizeCache protoimpl.SizeCache |
|||
unknownFields protoimpl.UnknownFields |
|||
|
|||
Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // 状态码
|
|||
Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // 返回结果
|
|||
Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` // 返回消息提示
|
|||
} |
|||
|
|||
func (x *BotUsersReply) Reset() { |
|||
*x = BotUsersReply{} |
|||
if protoimpl.UnsafeEnabled { |
|||
mi := &file_matchmaking_v1_backend_backend_proto_msgTypes[0] |
|||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
|||
ms.StoreMessageInfo(mi) |
|||
} |
|||
} |
|||
|
|||
func (x *BotUsersReply) String() string { |
|||
return protoimpl.X.MessageStringOf(x) |
|||
} |
|||
|
|||
func (*BotUsersReply) ProtoMessage() {} |
|||
|
|||
func (x *BotUsersReply) ProtoReflect() protoreflect.Message { |
|||
mi := &file_matchmaking_v1_backend_backend_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 BotUsersReply.ProtoReflect.Descriptor instead.
|
|||
func (*BotUsersReply) Descriptor() ([]byte, []int) { |
|||
return file_matchmaking_v1_backend_backend_proto_rawDescGZIP(), []int{0} |
|||
} |
|||
|
|||
func (x *BotUsersReply) GetCode() int64 { |
|||
if x != nil { |
|||
return x.Code |
|||
} |
|||
return 0 |
|||
} |
|||
|
|||
func (x *BotUsersReply) GetData() string { |
|||
if x != nil { |
|||
return x.Data |
|||
} |
|||
return "" |
|||
} |
|||
|
|||
func (x *BotUsersReply) GetMessage() string { |
|||
if x != nil { |
|||
return x.Message |
|||
} |
|||
return "" |
|||
} |
|||
|
|||
type BotUsersNullRequest struct { |
|||
state protoimpl.MessageState |
|||
sizeCache protoimpl.SizeCache |
|||
unknownFields protoimpl.UnknownFields |
|||
} |
|||
|
|||
func (x *BotUsersNullRequest) Reset() { |
|||
*x = BotUsersNullRequest{} |
|||
if protoimpl.UnsafeEnabled { |
|||
mi := &file_matchmaking_v1_backend_backend_proto_msgTypes[1] |
|||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
|||
ms.StoreMessageInfo(mi) |
|||
} |
|||
} |
|||
|
|||
func (x *BotUsersNullRequest) String() string { |
|||
return protoimpl.X.MessageStringOf(x) |
|||
} |
|||
|
|||
func (*BotUsersNullRequest) ProtoMessage() {} |
|||
|
|||
func (x *BotUsersNullRequest) ProtoReflect() protoreflect.Message { |
|||
mi := &file_matchmaking_v1_backend_backend_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 BotUsersNullRequest.ProtoReflect.Descriptor instead.
|
|||
func (*BotUsersNullRequest) Descriptor() ([]byte, []int) { |
|||
return file_matchmaking_v1_backend_backend_proto_rawDescGZIP(), []int{1} |
|||
} |
|||
|
|||
var File_matchmaking_v1_backend_backend_proto protoreflect.FileDescriptor |
|||
|
|||
var file_matchmaking_v1_backend_backend_proto_rawDesc = []byte{ |
|||
0x0a, 0x24, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x6d, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, |
|||
0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, |
|||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x6d, 0x61, 0x6b, |
|||
0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, |
|||
0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, |
|||
0x72, 0x6f, 0x74, 0x6f, 0x22, 0x51, 0x0a, 0x0d, 0x42, 0x6f, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, |
|||
0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, |
|||
0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, |
|||
0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, |
|||
0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, |
|||
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x15, 0x0a, 0x13, 0x42, 0x6f, 0x74, 0x55, 0x73, |
|||
0x65, 0x72, 0x73, 0x4e, 0x75, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x32, 0x92, |
|||
0x01, 0x0a, 0x07, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x12, 0x86, 0x01, 0x0a, 0x16, 0x55, |
|||
0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x6f, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x42, 0x79, 0x49, |
|||
0x73, 0x52, 0x65, 0x61, 0x6c, 0x12, 0x23, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x6d, 0x61, 0x6b, |
|||
0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x4e, |
|||
0x75, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x61, 0x74, |
|||
0x63, 0x68, 0x6d, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x74, 0x55, |
|||
0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, |
|||
0x22, 0x3a, 0x01, 0x2a, 0x22, 0x1d, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x61, 0x63, |
|||
0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x73, 0x5f, 0x72, |
|||
0x65, 0x61, 0x6c, 0x42, 0x2a, 0x5a, 0x28, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x6d, 0x61, 0x6b, 0x69, |
|||
0x6e, 0x67, 0x2d, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, |
|||
0x74, 0x63, 0x68, 0x6d, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, |
|||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, |
|||
} |
|||
|
|||
var ( |
|||
file_matchmaking_v1_backend_backend_proto_rawDescOnce sync.Once |
|||
file_matchmaking_v1_backend_backend_proto_rawDescData = file_matchmaking_v1_backend_backend_proto_rawDesc |
|||
) |
|||
|
|||
func file_matchmaking_v1_backend_backend_proto_rawDescGZIP() []byte { |
|||
file_matchmaking_v1_backend_backend_proto_rawDescOnce.Do(func() { |
|||
file_matchmaking_v1_backend_backend_proto_rawDescData = protoimpl.X.CompressGZIP(file_matchmaking_v1_backend_backend_proto_rawDescData) |
|||
}) |
|||
return file_matchmaking_v1_backend_backend_proto_rawDescData |
|||
} |
|||
|
|||
var file_matchmaking_v1_backend_backend_proto_msgTypes = make([]protoimpl.MessageInfo, 2) |
|||
var file_matchmaking_v1_backend_backend_proto_goTypes = []any{ |
|||
(*BotUsersReply)(nil), // 0: matchmaking.v1.BotUsersReply
|
|||
(*BotUsersNullRequest)(nil), // 1: matchmaking.v1.BotUsersNullRequest
|
|||
} |
|||
var file_matchmaking_v1_backend_backend_proto_depIdxs = []int32{ |
|||
1, // 0: matchmaking.v1.Backend.UpdateBotUsersByIsReal:input_type -> matchmaking.v1.BotUsersNullRequest
|
|||
0, // 1: matchmaking.v1.Backend.UpdateBotUsersByIsReal:output_type -> matchmaking.v1.BotUsersReply
|
|||
1, // [1:2] is the sub-list for method output_type
|
|||
0, // [0:1] is the sub-list for method input_type
|
|||
0, // [0:0] is the sub-list for extension type_name
|
|||
0, // [0:0] is the sub-list for extension extendee
|
|||
0, // [0:0] is the sub-list for field type_name
|
|||
} |
|||
|
|||
func init() { file_matchmaking_v1_backend_backend_proto_init() } |
|||
func file_matchmaking_v1_backend_backend_proto_init() { |
|||
if File_matchmaking_v1_backend_backend_proto != nil { |
|||
return |
|||
} |
|||
if !protoimpl.UnsafeEnabled { |
|||
file_matchmaking_v1_backend_backend_proto_msgTypes[0].Exporter = func(v any, i int) any { |
|||
switch v := v.(*BotUsersReply); i { |
|||
case 0: |
|||
return &v.state |
|||
case 1: |
|||
return &v.sizeCache |
|||
case 2: |
|||
return &v.unknownFields |
|||
default: |
|||
return nil |
|||
} |
|||
} |
|||
file_matchmaking_v1_backend_backend_proto_msgTypes[1].Exporter = func(v any, i int) any { |
|||
switch v := v.(*BotUsersNullRequest); 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_matchmaking_v1_backend_backend_proto_rawDesc, |
|||
NumEnums: 0, |
|||
NumMessages: 2, |
|||
NumExtensions: 0, |
|||
NumServices: 1, |
|||
}, |
|||
GoTypes: file_matchmaking_v1_backend_backend_proto_goTypes, |
|||
DependencyIndexes: file_matchmaking_v1_backend_backend_proto_depIdxs, |
|||
MessageInfos: file_matchmaking_v1_backend_backend_proto_msgTypes, |
|||
}.Build() |
|||
File_matchmaking_v1_backend_backend_proto = out.File |
|||
file_matchmaking_v1_backend_backend_proto_rawDesc = nil |
|||
file_matchmaking_v1_backend_backend_proto_goTypes = nil |
|||
file_matchmaking_v1_backend_backend_proto_depIdxs = nil |
|||
} |
@ -0,0 +1,27 @@ |
|||
syntax = "proto3"; |
|||
|
|||
package matchmaking.v1; |
|||
|
|||
import "google/api/annotations.proto"; |
|||
|
|||
option go_package = "matchmaking-system/api/matchmaking/v1;v1"; |
|||
|
|||
service Backend { |
|||
// UpdateBotUsersByIsReal 更新用户KYC认证 |
|||
rpc UpdateBotUsersByIsReal(BotUsersNullRequest)returns(BotUsersReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_backend/update_is_real", |
|||
body:"*", |
|||
}; |
|||
} |
|||
} |
|||
|
|||
message BotUsersReply{ |
|||
int64 code =1;// 状态码 |
|||
string data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message BotUsersNullRequest{ |
|||
|
|||
} |
@ -0,0 +1,112 @@ |
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-grpc v1.4.0
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/backend/backend.proto
|
|||
|
|||
package v1 |
|||
|
|||
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.62.0 or later.
|
|||
const _ = grpc.SupportPackageIsVersion8 |
|||
|
|||
const ( |
|||
Backend_UpdateBotUsersByIsReal_FullMethodName = "/matchmaking.v1.Backend/UpdateBotUsersByIsReal" |
|||
) |
|||
|
|||
// BackendClient is the client API for Backend 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 BackendClient interface { |
|||
// UpdateBotUsersByIsReal 更新用户KYC认证
|
|||
UpdateBotUsersByIsReal(ctx context.Context, in *BotUsersNullRequest, opts ...grpc.CallOption) (*BotUsersReply, error) |
|||
} |
|||
|
|||
type backendClient struct { |
|||
cc grpc.ClientConnInterface |
|||
} |
|||
|
|||
func NewBackendClient(cc grpc.ClientConnInterface) BackendClient { |
|||
return &backendClient{cc} |
|||
} |
|||
|
|||
func (c *backendClient) UpdateBotUsersByIsReal(ctx context.Context, in *BotUsersNullRequest, opts ...grpc.CallOption) (*BotUsersReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(BotUsersReply) |
|||
err := c.cc.Invoke(ctx, Backend_UpdateBotUsersByIsReal_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
// BackendServer is the server API for Backend service.
|
|||
// All implementations must embed UnimplementedBackendServer
|
|||
// for forward compatibility
|
|||
type BackendServer interface { |
|||
// UpdateBotUsersByIsReal 更新用户KYC认证
|
|||
UpdateBotUsersByIsReal(context.Context, *BotUsersNullRequest) (*BotUsersReply, error) |
|||
mustEmbedUnimplementedBackendServer() |
|||
} |
|||
|
|||
// UnimplementedBackendServer must be embedded to have forward compatible implementations.
|
|||
type UnimplementedBackendServer struct { |
|||
} |
|||
|
|||
func (UnimplementedBackendServer) UpdateBotUsersByIsReal(context.Context, *BotUsersNullRequest) (*BotUsersReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method UpdateBotUsersByIsReal not implemented") |
|||
} |
|||
func (UnimplementedBackendServer) mustEmbedUnimplementedBackendServer() {} |
|||
|
|||
// UnsafeBackendServer may be embedded to opt out of forward compatibility for this service.
|
|||
// Use of this interface is not recommended, as added methods to BackendServer will
|
|||
// result in compilation errors.
|
|||
type UnsafeBackendServer interface { |
|||
mustEmbedUnimplementedBackendServer() |
|||
} |
|||
|
|||
func RegisterBackendServer(s grpc.ServiceRegistrar, srv BackendServer) { |
|||
s.RegisterService(&Backend_ServiceDesc, srv) |
|||
} |
|||
|
|||
func _Backend_UpdateBotUsersByIsReal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(BotUsersNullRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(BackendServer).UpdateBotUsersByIsReal(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Backend_UpdateBotUsersByIsReal_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(BackendServer).UpdateBotUsersByIsReal(ctx, req.(*BotUsersNullRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
// Backend_ServiceDesc is the grpc.ServiceDesc for Backend service.
|
|||
// It's only intended for direct use with grpc.RegisterService,
|
|||
// and not to be introspected or modified (even as a copy)
|
|||
var Backend_ServiceDesc = grpc.ServiceDesc{ |
|||
ServiceName: "matchmaking.v1.Backend", |
|||
HandlerType: (*BackendServer)(nil), |
|||
Methods: []grpc.MethodDesc{ |
|||
{ |
|||
MethodName: "UpdateBotUsersByIsReal", |
|||
Handler: _Backend_UpdateBotUsersByIsReal_Handler, |
|||
}, |
|||
}, |
|||
Streams: []grpc.StreamDesc{}, |
|||
Metadata: "matchmaking/v1/backend/backend.proto", |
|||
} |
@ -0,0 +1,79 @@ |
|||
// Code generated by protoc-gen-go-http. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-http v2.7.3
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/backend/backend.proto
|
|||
|
|||
package v1 |
|||
|
|||
import ( |
|||
context "context" |
|||
http "github.com/go-kratos/kratos/v2/transport/http" |
|||
binding "github.com/go-kratos/kratos/v2/transport/http/binding" |
|||
) |
|||
|
|||
// This is a compile-time assertion to ensure that this generated file
|
|||
// is compatible with the kratos package it is being compiled against.
|
|||
var _ = new(context.Context) |
|||
var _ = binding.EncodeURL |
|||
|
|||
const _ = http.SupportPackageIsVersion1 |
|||
|
|||
const OperationBackendUpdateBotUsersByIsReal = "/matchmaking.v1.Backend/UpdateBotUsersByIsReal" |
|||
|
|||
type BackendHTTPServer interface { |
|||
// UpdateBotUsersByIsReal UpdateBotUsersByIsReal 更新用户KYC认证
|
|||
UpdateBotUsersByIsReal(context.Context, *BotUsersNullRequest) (*BotUsersReply, error) |
|||
} |
|||
|
|||
func RegisterBackendHTTPServer(s *http.Server, srv BackendHTTPServer) { |
|||
r := s.Route("/") |
|||
r.POST("/order_backend/update_is_real", _Backend_UpdateBotUsersByIsReal0_HTTP_Handler(srv)) |
|||
} |
|||
|
|||
func _Backend_UpdateBotUsersByIsReal0_HTTP_Handler(srv BackendHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in BotUsersNullRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationBackendUpdateBotUsersByIsReal) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.UpdateBotUsersByIsReal(ctx, req.(*BotUsersNullRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*BotUsersReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
type BackendHTTPClient interface { |
|||
UpdateBotUsersByIsReal(ctx context.Context, req *BotUsersNullRequest, opts ...http.CallOption) (rsp *BotUsersReply, err error) |
|||
} |
|||
|
|||
type BackendHTTPClientImpl struct { |
|||
cc *http.Client |
|||
} |
|||
|
|||
func NewBackendHTTPClient(client *http.Client) BackendHTTPClient { |
|||
return &BackendHTTPClientImpl{client} |
|||
} |
|||
|
|||
func (c *BackendHTTPClientImpl) UpdateBotUsersByIsReal(ctx context.Context, in *BotUsersNullRequest, opts ...http.CallOption) (*BotUsersReply, error) { |
|||
var out BotUsersReply |
|||
pattern := "/order_backend/update_is_real" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationBackendUpdateBotUsersByIsReal)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,134 @@ |
|||
syntax = "proto3"; |
|||
|
|||
package matchmaking.v1; |
|||
|
|||
import "google/api/annotations.proto"; |
|||
import "google/protobuf/timestamp.proto"; |
|||
|
|||
option go_package = "matchmaking-system/api/matchmaking/v1;v1"; |
|||
|
|||
service BlockTrade { |
|||
// GetBotStockBlockTrade 大宗交易股列表查询 |
|||
rpc GetBotStockBlockTrade(GetBotStockBlockTradeRequest)returns(GetBotStockBlockTradeReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareblock/share_list", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareBlockPlaceOrder 大宗交易股下单 |
|||
rpc ShareBlockPlaceOrder(OrderBlockRequest)returns(OrderBlockReply) { |
|||
option (google.api.http) = { |
|||
post: "/order_shareblock/share_place_order", |
|||
body: "*", |
|||
}; |
|||
} |
|||
// ShareBlockUpdateOrder 大宗交易股设置止盈止损 |
|||
rpc ShareBlockUpdateOrder(UpdateBlockOrderRequest)returns(OrderBlockReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareblock/share_update_order", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareBlockPosition 大宗交易股平仓 |
|||
rpc ShareBlockPosition(CancelBlockOrderRequest)returns(OrderBlockReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareblock/share_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareBlockCancel 大宗交易股撤单 |
|||
rpc ShareBlockCancel(CancelBlockOrderRequest)returns(OrderBlockReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareblock/share_cancel", |
|||
body:"*", |
|||
}; |
|||
} |
|||
} |
|||
|
|||
message GetBotStockBlockTradeRequest{ |
|||
int64 status =1;// 状态码 |
|||
int64 pageSize =2; // 每页显示条数 |
|||
int64 pageCount =3;// 开始的位置 |
|||
int64 type =4;// 市场类型 |
|||
} |
|||
|
|||
message GetBotStockBlockTradeReply{ |
|||
int64 code =1;// 状态码 |
|||
BotStockBlockTradeData data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message BotStockBlockTradeData{ |
|||
int64 pageSize =1; // 每页显示条数 |
|||
int64 pageCount =2;// 开始的位置 |
|||
repeated BotOrderBlockTrade data =3;// 返回结果 |
|||
int64 totalCount =4;// 总数据 |
|||
} |
|||
|
|||
message BotOrderBlockTrade{ |
|||
string orderId =1;// 订单ID |
|||
string stockId =2;// 股票代码 |
|||
int64 tradeType =3;// 交易类型 |
|||
int64 dealType =4;// 交易方式 |
|||
string limitPrice =5;// 限价 |
|||
string marketPrice =6;// 市价 |
|||
string dealPrice =7;// 开仓价 |
|||
string closingPrice =8;// 平仓价 |
|||
string orderNumber =9;// 订单数量 |
|||
int64 stopType =10;// 止盈止损状态 |
|||
string stopLossPrice =11;// 止损 |
|||
string stopWinPrice =12;// 止盈 |
|||
string serviceCost =13;// 开仓手续费 |
|||
string marketMoney =14;// 订单金额 |
|||
string orderMoney =15;// 订单总金额 |
|||
int64 status =16;// 订单状态 |
|||
google.protobuf.Timestamp createTime =17;// 订单创建时间 |
|||
google.protobuf.Timestamp updateTime =18;// 订单更新时间 |
|||
google.protobuf.Timestamp openTime =19;// 订单开仓时间 |
|||
google.protobuf.Timestamp closingTime =20;// 订单平仓时间 |
|||
string closingCost =21;// 平仓手续费 |
|||
string faceValue =22;// 面值 |
|||
string pryNum =23;// 杠杆 |
|||
string keepDecimal =24;// 保留小数位 |
|||
string stockName =25;// 股票名称 |
|||
int64 type =26;// 市场类型 |
|||
} |
|||
|
|||
message OrderBlockRequest{ |
|||
string stockId =1;// 股票Code |
|||
int64 tradeType =2;// 交易类型:1买入,2卖出 |
|||
int64 dealType =3;// 委托方式:1限价,2市价 |
|||
string limitPrice =4;// 限价 |
|||
string marketPrice =5;// 市价 |
|||
string marketMoney =6;// 订单金额 |
|||
string orderNumber =7;// 订单数量 |
|||
string serviceCost =8;// 手续费 |
|||
int64 stopType =9;// 止损止盈设置:1无设置,2止损止盈 |
|||
string stopLossPrice =10;// 止损 |
|||
string stopWinPrice =11;// 止损 |
|||
string pryNum =12;// 杠杆 |
|||
int64 type =13;// 市场类型 |
|||
} |
|||
|
|||
message UpdateBlockOrderRequest{ |
|||
string orderId =1;// 订单Id |
|||
int64 stopType =2;// 止盈止损 |
|||
string stopLossPrice =3;// 止损 |
|||
string stopWinPrice =4;// 止盈 |
|||
int64 type =5;// 市场类型 |
|||
} |
|||
|
|||
message OrderBlockReply{ |
|||
int64 code =1;// 状态码 |
|||
OrderBlockResult data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message CancelBlockOrderRequest{ |
|||
string orderId =1;// 订单ID |
|||
int64 type =2;// 市场类型 |
|||
} |
|||
|
|||
message OrderBlockResult { |
|||
string orderId =1;// 订单Id |
|||
} |
@ -0,0 +1,272 @@ |
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-grpc v1.4.0
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/block/blockOrder.proto
|
|||
|
|||
package v1 |
|||
|
|||
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.62.0 or later.
|
|||
const _ = grpc.SupportPackageIsVersion8 |
|||
|
|||
const ( |
|||
BlockTrade_GetBotStockBlockTrade_FullMethodName = "/matchmaking.v1.BlockTrade/GetBotStockBlockTrade" |
|||
BlockTrade_ShareBlockPlaceOrder_FullMethodName = "/matchmaking.v1.BlockTrade/ShareBlockPlaceOrder" |
|||
BlockTrade_ShareBlockUpdateOrder_FullMethodName = "/matchmaking.v1.BlockTrade/ShareBlockUpdateOrder" |
|||
BlockTrade_ShareBlockPosition_FullMethodName = "/matchmaking.v1.BlockTrade/ShareBlockPosition" |
|||
BlockTrade_ShareBlockCancel_FullMethodName = "/matchmaking.v1.BlockTrade/ShareBlockCancel" |
|||
) |
|||
|
|||
// BlockTradeClient is the client API for BlockTrade 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 BlockTradeClient interface { |
|||
// GetBotStockBlockTrade 大宗交易股列表查询
|
|||
GetBotStockBlockTrade(ctx context.Context, in *GetBotStockBlockTradeRequest, opts ...grpc.CallOption) (*GetBotStockBlockTradeReply, error) |
|||
// ShareBlockPlaceOrder 大宗交易股下单
|
|||
ShareBlockPlaceOrder(ctx context.Context, in *OrderBlockRequest, opts ...grpc.CallOption) (*OrderBlockReply, error) |
|||
// ShareBlockUpdateOrder 大宗交易股设置止盈止损
|
|||
ShareBlockUpdateOrder(ctx context.Context, in *UpdateBlockOrderRequest, opts ...grpc.CallOption) (*OrderBlockReply, error) |
|||
// ShareBlockPosition 大宗交易股平仓
|
|||
ShareBlockPosition(ctx context.Context, in *CancelBlockOrderRequest, opts ...grpc.CallOption) (*OrderBlockReply, error) |
|||
// ShareBlockCancel 大宗交易股撤单
|
|||
ShareBlockCancel(ctx context.Context, in *CancelBlockOrderRequest, opts ...grpc.CallOption) (*OrderBlockReply, error) |
|||
} |
|||
|
|||
type blockTradeClient struct { |
|||
cc grpc.ClientConnInterface |
|||
} |
|||
|
|||
func NewBlockTradeClient(cc grpc.ClientConnInterface) BlockTradeClient { |
|||
return &blockTradeClient{cc} |
|||
} |
|||
|
|||
func (c *blockTradeClient) GetBotStockBlockTrade(ctx context.Context, in *GetBotStockBlockTradeRequest, opts ...grpc.CallOption) (*GetBotStockBlockTradeReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(GetBotStockBlockTradeReply) |
|||
err := c.cc.Invoke(ctx, BlockTrade_GetBotStockBlockTrade_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *blockTradeClient) ShareBlockPlaceOrder(ctx context.Context, in *OrderBlockRequest, opts ...grpc.CallOption) (*OrderBlockReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(OrderBlockReply) |
|||
err := c.cc.Invoke(ctx, BlockTrade_ShareBlockPlaceOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *blockTradeClient) ShareBlockUpdateOrder(ctx context.Context, in *UpdateBlockOrderRequest, opts ...grpc.CallOption) (*OrderBlockReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(OrderBlockReply) |
|||
err := c.cc.Invoke(ctx, BlockTrade_ShareBlockUpdateOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *blockTradeClient) ShareBlockPosition(ctx context.Context, in *CancelBlockOrderRequest, opts ...grpc.CallOption) (*OrderBlockReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(OrderBlockReply) |
|||
err := c.cc.Invoke(ctx, BlockTrade_ShareBlockPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *blockTradeClient) ShareBlockCancel(ctx context.Context, in *CancelBlockOrderRequest, opts ...grpc.CallOption) (*OrderBlockReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(OrderBlockReply) |
|||
err := c.cc.Invoke(ctx, BlockTrade_ShareBlockCancel_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
// BlockTradeServer is the server API for BlockTrade service.
|
|||
// All implementations must embed UnimplementedBlockTradeServer
|
|||
// for forward compatibility
|
|||
type BlockTradeServer interface { |
|||
// GetBotStockBlockTrade 大宗交易股列表查询
|
|||
GetBotStockBlockTrade(context.Context, *GetBotStockBlockTradeRequest) (*GetBotStockBlockTradeReply, error) |
|||
// ShareBlockPlaceOrder 大宗交易股下单
|
|||
ShareBlockPlaceOrder(context.Context, *OrderBlockRequest) (*OrderBlockReply, error) |
|||
// ShareBlockUpdateOrder 大宗交易股设置止盈止损
|
|||
ShareBlockUpdateOrder(context.Context, *UpdateBlockOrderRequest) (*OrderBlockReply, error) |
|||
// ShareBlockPosition 大宗交易股平仓
|
|||
ShareBlockPosition(context.Context, *CancelBlockOrderRequest) (*OrderBlockReply, error) |
|||
// ShareBlockCancel 大宗交易股撤单
|
|||
ShareBlockCancel(context.Context, *CancelBlockOrderRequest) (*OrderBlockReply, error) |
|||
mustEmbedUnimplementedBlockTradeServer() |
|||
} |
|||
|
|||
// UnimplementedBlockTradeServer must be embedded to have forward compatible implementations.
|
|||
type UnimplementedBlockTradeServer struct { |
|||
} |
|||
|
|||
func (UnimplementedBlockTradeServer) GetBotStockBlockTrade(context.Context, *GetBotStockBlockTradeRequest) (*GetBotStockBlockTradeReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method GetBotStockBlockTrade not implemented") |
|||
} |
|||
func (UnimplementedBlockTradeServer) ShareBlockPlaceOrder(context.Context, *OrderBlockRequest) (*OrderBlockReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareBlockPlaceOrder not implemented") |
|||
} |
|||
func (UnimplementedBlockTradeServer) ShareBlockUpdateOrder(context.Context, *UpdateBlockOrderRequest) (*OrderBlockReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareBlockUpdateOrder not implemented") |
|||
} |
|||
func (UnimplementedBlockTradeServer) ShareBlockPosition(context.Context, *CancelBlockOrderRequest) (*OrderBlockReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareBlockPosition not implemented") |
|||
} |
|||
func (UnimplementedBlockTradeServer) ShareBlockCancel(context.Context, *CancelBlockOrderRequest) (*OrderBlockReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareBlockCancel not implemented") |
|||
} |
|||
func (UnimplementedBlockTradeServer) mustEmbedUnimplementedBlockTradeServer() {} |
|||
|
|||
// UnsafeBlockTradeServer may be embedded to opt out of forward compatibility for this service.
|
|||
// Use of this interface is not recommended, as added methods to BlockTradeServer will
|
|||
// result in compilation errors.
|
|||
type UnsafeBlockTradeServer interface { |
|||
mustEmbedUnimplementedBlockTradeServer() |
|||
} |
|||
|
|||
func RegisterBlockTradeServer(s grpc.ServiceRegistrar, srv BlockTradeServer) { |
|||
s.RegisterService(&BlockTrade_ServiceDesc, srv) |
|||
} |
|||
|
|||
func _BlockTrade_GetBotStockBlockTrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(GetBotStockBlockTradeRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(BlockTradeServer).GetBotStockBlockTrade(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: BlockTrade_GetBotStockBlockTrade_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(BlockTradeServer).GetBotStockBlockTrade(ctx, req.(*GetBotStockBlockTradeRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _BlockTrade_ShareBlockPlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(OrderBlockRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(BlockTradeServer).ShareBlockPlaceOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: BlockTrade_ShareBlockPlaceOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(BlockTradeServer).ShareBlockPlaceOrder(ctx, req.(*OrderBlockRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _BlockTrade_ShareBlockUpdateOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(UpdateBlockOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(BlockTradeServer).ShareBlockUpdateOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: BlockTrade_ShareBlockUpdateOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(BlockTradeServer).ShareBlockUpdateOrder(ctx, req.(*UpdateBlockOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _BlockTrade_ShareBlockPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelBlockOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(BlockTradeServer).ShareBlockPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: BlockTrade_ShareBlockPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(BlockTradeServer).ShareBlockPosition(ctx, req.(*CancelBlockOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _BlockTrade_ShareBlockCancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelBlockOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(BlockTradeServer).ShareBlockCancel(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: BlockTrade_ShareBlockCancel_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(BlockTradeServer).ShareBlockCancel(ctx, req.(*CancelBlockOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
// BlockTrade_ServiceDesc is the grpc.ServiceDesc for BlockTrade service.
|
|||
// It's only intended for direct use with grpc.RegisterService,
|
|||
// and not to be introspected or modified (even as a copy)
|
|||
var BlockTrade_ServiceDesc = grpc.ServiceDesc{ |
|||
ServiceName: "matchmaking.v1.BlockTrade", |
|||
HandlerType: (*BlockTradeServer)(nil), |
|||
Methods: []grpc.MethodDesc{ |
|||
{ |
|||
MethodName: "GetBotStockBlockTrade", |
|||
Handler: _BlockTrade_GetBotStockBlockTrade_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareBlockPlaceOrder", |
|||
Handler: _BlockTrade_ShareBlockPlaceOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareBlockUpdateOrder", |
|||
Handler: _BlockTrade_ShareBlockUpdateOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareBlockPosition", |
|||
Handler: _BlockTrade_ShareBlockPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareBlockCancel", |
|||
Handler: _BlockTrade_ShareBlockCancel_Handler, |
|||
}, |
|||
}, |
|||
Streams: []grpc.StreamDesc{}, |
|||
Metadata: "matchmaking/v1/block/blockOrder.proto", |
|||
} |
@ -0,0 +1,239 @@ |
|||
// Code generated by protoc-gen-go-http. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-http v2.7.3
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/block/blockOrder.proto
|
|||
|
|||
package v1 |
|||
|
|||
import ( |
|||
context "context" |
|||
http "github.com/go-kratos/kratos/v2/transport/http" |
|||
binding "github.com/go-kratos/kratos/v2/transport/http/binding" |
|||
) |
|||
|
|||
// This is a compile-time assertion to ensure that this generated file
|
|||
// is compatible with the kratos package it is being compiled against.
|
|||
var _ = new(context.Context) |
|||
var _ = binding.EncodeURL |
|||
|
|||
const _ = http.SupportPackageIsVersion1 |
|||
|
|||
const OperationBlockTradeGetBotStockBlockTrade = "/matchmaking.v1.BlockTrade/GetBotStockBlockTrade" |
|||
const OperationBlockTradeShareBlockCancel = "/matchmaking.v1.BlockTrade/ShareBlockCancel" |
|||
const OperationBlockTradeShareBlockPlaceOrder = "/matchmaking.v1.BlockTrade/ShareBlockPlaceOrder" |
|||
const OperationBlockTradeShareBlockPosition = "/matchmaking.v1.BlockTrade/ShareBlockPosition" |
|||
const OperationBlockTradeShareBlockUpdateOrder = "/matchmaking.v1.BlockTrade/ShareBlockUpdateOrder" |
|||
|
|||
type BlockTradeHTTPServer interface { |
|||
// GetBotStockBlockTrade GetBotStockBlockTrade 大宗交易股列表查询
|
|||
GetBotStockBlockTrade(context.Context, *GetBotStockBlockTradeRequest) (*GetBotStockBlockTradeReply, error) |
|||
// ShareBlockCancel ShareBlockCancel 大宗交易股撤单
|
|||
ShareBlockCancel(context.Context, *CancelBlockOrderRequest) (*OrderBlockReply, error) |
|||
// ShareBlockPlaceOrder ShareBlockPlaceOrder 大宗交易股下单
|
|||
ShareBlockPlaceOrder(context.Context, *OrderBlockRequest) (*OrderBlockReply, error) |
|||
// ShareBlockPosition ShareBlockPosition 大宗交易股平仓
|
|||
ShareBlockPosition(context.Context, *CancelBlockOrderRequest) (*OrderBlockReply, error) |
|||
// ShareBlockUpdateOrder ShareBlockUpdateOrder 大宗交易股设置止盈止损
|
|||
ShareBlockUpdateOrder(context.Context, *UpdateBlockOrderRequest) (*OrderBlockReply, error) |
|||
} |
|||
|
|||
func RegisterBlockTradeHTTPServer(s *http.Server, srv BlockTradeHTTPServer) { |
|||
r := s.Route("/") |
|||
r.POST("/order_shareblock/share_list", _BlockTrade_GetBotStockBlockTrade0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareblock/share_place_order", _BlockTrade_ShareBlockPlaceOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareblock/share_update_order", _BlockTrade_ShareBlockUpdateOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareblock/share_position", _BlockTrade_ShareBlockPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareblock/share_cancel", _BlockTrade_ShareBlockCancel0_HTTP_Handler(srv)) |
|||
} |
|||
|
|||
func _BlockTrade_GetBotStockBlockTrade0_HTTP_Handler(srv BlockTradeHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in GetBotStockBlockTradeRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationBlockTradeGetBotStockBlockTrade) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.GetBotStockBlockTrade(ctx, req.(*GetBotStockBlockTradeRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*GetBotStockBlockTradeReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _BlockTrade_ShareBlockPlaceOrder0_HTTP_Handler(srv BlockTradeHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in OrderBlockRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationBlockTradeShareBlockPlaceOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareBlockPlaceOrder(ctx, req.(*OrderBlockRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*OrderBlockReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _BlockTrade_ShareBlockUpdateOrder0_HTTP_Handler(srv BlockTradeHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in UpdateBlockOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationBlockTradeShareBlockUpdateOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareBlockUpdateOrder(ctx, req.(*UpdateBlockOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*OrderBlockReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _BlockTrade_ShareBlockPosition0_HTTP_Handler(srv BlockTradeHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelBlockOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationBlockTradeShareBlockPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareBlockPosition(ctx, req.(*CancelBlockOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*OrderBlockReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _BlockTrade_ShareBlockCancel0_HTTP_Handler(srv BlockTradeHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelBlockOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationBlockTradeShareBlockCancel) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareBlockCancel(ctx, req.(*CancelBlockOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*OrderBlockReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
type BlockTradeHTTPClient interface { |
|||
GetBotStockBlockTrade(ctx context.Context, req *GetBotStockBlockTradeRequest, opts ...http.CallOption) (rsp *GetBotStockBlockTradeReply, err error) |
|||
ShareBlockCancel(ctx context.Context, req *CancelBlockOrderRequest, opts ...http.CallOption) (rsp *OrderBlockReply, err error) |
|||
ShareBlockPlaceOrder(ctx context.Context, req *OrderBlockRequest, opts ...http.CallOption) (rsp *OrderBlockReply, err error) |
|||
ShareBlockPosition(ctx context.Context, req *CancelBlockOrderRequest, opts ...http.CallOption) (rsp *OrderBlockReply, err error) |
|||
ShareBlockUpdateOrder(ctx context.Context, req *UpdateBlockOrderRequest, opts ...http.CallOption) (rsp *OrderBlockReply, err error) |
|||
} |
|||
|
|||
type BlockTradeHTTPClientImpl struct { |
|||
cc *http.Client |
|||
} |
|||
|
|||
func NewBlockTradeHTTPClient(client *http.Client) BlockTradeHTTPClient { |
|||
return &BlockTradeHTTPClientImpl{client} |
|||
} |
|||
|
|||
func (c *BlockTradeHTTPClientImpl) GetBotStockBlockTrade(ctx context.Context, in *GetBotStockBlockTradeRequest, opts ...http.CallOption) (*GetBotStockBlockTradeReply, error) { |
|||
var out GetBotStockBlockTradeReply |
|||
pattern := "/order_shareblock/share_list" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationBlockTradeGetBotStockBlockTrade)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *BlockTradeHTTPClientImpl) ShareBlockCancel(ctx context.Context, in *CancelBlockOrderRequest, opts ...http.CallOption) (*OrderBlockReply, error) { |
|||
var out OrderBlockReply |
|||
pattern := "/order_shareblock/share_cancel" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationBlockTradeShareBlockCancel)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *BlockTradeHTTPClientImpl) ShareBlockPlaceOrder(ctx context.Context, in *OrderBlockRequest, opts ...http.CallOption) (*OrderBlockReply, error) { |
|||
var out OrderBlockReply |
|||
pattern := "/order_shareblock/share_place_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationBlockTradeShareBlockPlaceOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *BlockTradeHTTPClientImpl) ShareBlockPosition(ctx context.Context, in *CancelBlockOrderRequest, opts ...http.CallOption) (*OrderBlockReply, error) { |
|||
var out OrderBlockReply |
|||
pattern := "/order_shareblock/share_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationBlockTradeShareBlockPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *BlockTradeHTTPClientImpl) ShareBlockUpdateOrder(ctx context.Context, in *UpdateBlockOrderRequest, opts ...http.CallOption) (*OrderBlockReply, error) { |
|||
var out OrderBlockReply |
|||
pattern := "/order_shareblock/share_update_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationBlockTradeShareBlockUpdateOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
@ -0,0 +1,132 @@ |
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|||
// versions:
|
|||
// protoc-gen-go v1.34.2
|
|||
// protoc v5.27.1
|
|||
// source: matchmaking/v1/error/error_reason.proto
|
|||
|
|||
package v1 |
|||
|
|||
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 ErrorReason int32 |
|||
|
|||
const ( |
|||
ErrorReason_GREETER_UNSPECIFIED ErrorReason = 0 |
|||
ErrorReason_USER_NOT_FOUND ErrorReason = 1 |
|||
) |
|||
|
|||
// Enum value maps for ErrorReason.
|
|||
var ( |
|||
ErrorReason_name = map[int32]string{ |
|||
0: "GREETER_UNSPECIFIED", |
|||
1: "USER_NOT_FOUND", |
|||
} |
|||
ErrorReason_value = map[string]int32{ |
|||
"GREETER_UNSPECIFIED": 0, |
|||
"USER_NOT_FOUND": 1, |
|||
} |
|||
) |
|||
|
|||
func (x ErrorReason) Enum() *ErrorReason { |
|||
p := new(ErrorReason) |
|||
*p = x |
|||
return p |
|||
} |
|||
|
|||
func (x ErrorReason) String() string { |
|||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) |
|||
} |
|||
|
|||
func (ErrorReason) Descriptor() protoreflect.EnumDescriptor { |
|||
return file_matchmaking_v1_error_error_reason_proto_enumTypes[0].Descriptor() |
|||
} |
|||
|
|||
func (ErrorReason) Type() protoreflect.EnumType { |
|||
return &file_matchmaking_v1_error_error_reason_proto_enumTypes[0] |
|||
} |
|||
|
|||
func (x ErrorReason) Number() protoreflect.EnumNumber { |
|||
return protoreflect.EnumNumber(x) |
|||
} |
|||
|
|||
// Deprecated: Use ErrorReason.Descriptor instead.
|
|||
func (ErrorReason) EnumDescriptor() ([]byte, []int) { |
|||
return file_matchmaking_v1_error_error_reason_proto_rawDescGZIP(), []int{0} |
|||
} |
|||
|
|||
var File_matchmaking_v1_error_error_reason_proto protoreflect.FileDescriptor |
|||
|
|||
var file_matchmaking_v1_error_error_reason_proto_rawDesc = []byte{ |
|||
0x0a, 0x27, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x6d, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, |
|||
0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x61, |
|||
0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x6d, 0x61, 0x74, 0x63, 0x68, |
|||
0x6d, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2a, 0x3a, 0x0a, 0x0b, 0x45, 0x72, 0x72, |
|||
0x6f, 0x72, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x13, 0x47, 0x52, 0x45, 0x45, |
|||
0x54, 0x45, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, |
|||
0x00, 0x12, 0x12, 0x0a, 0x0e, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, |
|||
0x55, 0x4e, 0x44, 0x10, 0x01, 0x42, 0x2a, 0x5a, 0x28, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x6d, 0x61, |
|||
0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, |
|||
0x6d, 0x61, 0x74, 0x63, 0x68, 0x6d, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x76, |
|||
0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, |
|||
} |
|||
|
|||
var ( |
|||
file_matchmaking_v1_error_error_reason_proto_rawDescOnce sync.Once |
|||
file_matchmaking_v1_error_error_reason_proto_rawDescData = file_matchmaking_v1_error_error_reason_proto_rawDesc |
|||
) |
|||
|
|||
func file_matchmaking_v1_error_error_reason_proto_rawDescGZIP() []byte { |
|||
file_matchmaking_v1_error_error_reason_proto_rawDescOnce.Do(func() { |
|||
file_matchmaking_v1_error_error_reason_proto_rawDescData = protoimpl.X.CompressGZIP(file_matchmaking_v1_error_error_reason_proto_rawDescData) |
|||
}) |
|||
return file_matchmaking_v1_error_error_reason_proto_rawDescData |
|||
} |
|||
|
|||
var file_matchmaking_v1_error_error_reason_proto_enumTypes = make([]protoimpl.EnumInfo, 1) |
|||
var file_matchmaking_v1_error_error_reason_proto_goTypes = []any{ |
|||
(ErrorReason)(0), // 0: matchmaking.v1.ErrorReason
|
|||
} |
|||
var file_matchmaking_v1_error_error_reason_proto_depIdxs = []int32{ |
|||
0, // [0:0] is the sub-list for method output_type
|
|||
0, // [0:0] is the sub-list for method input_type
|
|||
0, // [0:0] is the sub-list for extension type_name
|
|||
0, // [0:0] is the sub-list for extension extendee
|
|||
0, // [0:0] is the sub-list for field type_name
|
|||
} |
|||
|
|||
func init() { file_matchmaking_v1_error_error_reason_proto_init() } |
|||
func file_matchmaking_v1_error_error_reason_proto_init() { |
|||
if File_matchmaking_v1_error_error_reason_proto != nil { |
|||
return |
|||
} |
|||
type x struct{} |
|||
out := protoimpl.TypeBuilder{ |
|||
File: protoimpl.DescBuilder{ |
|||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), |
|||
RawDescriptor: file_matchmaking_v1_error_error_reason_proto_rawDesc, |
|||
NumEnums: 1, |
|||
NumMessages: 0, |
|||
NumExtensions: 0, |
|||
NumServices: 0, |
|||
}, |
|||
GoTypes: file_matchmaking_v1_error_error_reason_proto_goTypes, |
|||
DependencyIndexes: file_matchmaking_v1_error_error_reason_proto_depIdxs, |
|||
EnumInfos: file_matchmaking_v1_error_error_reason_proto_enumTypes, |
|||
}.Build() |
|||
File_matchmaking_v1_error_error_reason_proto = out.File |
|||
file_matchmaking_v1_error_error_reason_proto_rawDesc = nil |
|||
file_matchmaking_v1_error_error_reason_proto_goTypes = nil |
|||
file_matchmaking_v1_error_error_reason_proto_depIdxs = nil |
|||
} |
@ -0,0 +1,10 @@ |
|||
syntax = "proto3"; |
|||
|
|||
package matchmaking.v1; |
|||
|
|||
option go_package = "matchmaking-system/api/matchmaking/v1;v1"; |
|||
|
|||
enum ErrorReason { |
|||
GREETER_UNSPECIFIED = 0; |
|||
USER_NOT_FOUND = 1; |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,151 @@ |
|||
syntax = "proto3"; |
|||
|
|||
package matchmaking.v1; |
|||
|
|||
import "google/api/annotations.proto"; |
|||
import "google/protobuf/timestamp.proto"; |
|||
|
|||
option go_package = "matchmaking-system/api/matchmaking/v1;v1"; |
|||
|
|||
service Forex { |
|||
// GetBotForexTrade 外汇列表查询 |
|||
rpc GetBotForexTrade(GetBotForexTradeRequest)returns(GetBotForexTradeReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_forex/forex_list", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ForexPlaceOrder 外汇下单 |
|||
rpc ForexPlaceOrder(ForexRequest)returns(ForexReply){ |
|||
option (google.api.http) = { |
|||
post: "/order_forex/forex_place_order", |
|||
body: "*", |
|||
}; |
|||
} |
|||
// ForexUpdatePlaceOrder 外汇设置止盈止损 |
|||
rpc ForexUpdatePlaceOrder(UpdateForexRequest)returns(ForexReply){ |
|||
option (google.api.http) = { |
|||
post: "/order_forex/forex_update_order", |
|||
body: "*", |
|||
}; |
|||
} |
|||
// ForexPosition 外汇平仓 |
|||
rpc ForexPosition(CancelForexRequest)returns(ForexReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_forex/forex_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ForexAllPosition 外汇一键平仓 |
|||
rpc ForexAllPosition(AllForexRequest)returns(AllForexReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_forex/forex_all_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ForexCancel 外汇撤单 |
|||
rpc ForexCancel(CancelForexRequest)returns(ForexReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_forex/forex_cancel", |
|||
body:"*", |
|||
}; |
|||
} |
|||
} |
|||
|
|||
message GetBotForexTradeRequest{ |
|||
int64 status =1;// 状态码 |
|||
int64 pageSize =2; // 每页显示条数 |
|||
int64 pageCount =3;// 开始的位置 |
|||
int64 state = 4;// 订单类型 |
|||
} |
|||
|
|||
message GetBotForexTradeReply{ |
|||
int64 code =1;// 状态码 |
|||
BotForexTradeData data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message BotForexTradeData{ |
|||
int64 pageSize =1; // 每页显示条数 |
|||
int64 pageCount =2;// 开始的位置 |
|||
repeated BotForexTrade data =3;// 返回结果 |
|||
int64 totalCount =4;// 总数据 |
|||
} |
|||
|
|||
message BotForexTrade{ |
|||
string orderId =1;// 订单ID |
|||
string forexId =2;// 外汇ID |
|||
int64 tradeType =3;// 交易类型 |
|||
int64 dealType =4;// 交易方式 |
|||
string limitPrice =5;// 限价 |
|||
string marketPrice =6;// 市价 |
|||
string dealPrice =7;// 开仓价 |
|||
string closingPrice =8;// 平仓价 |
|||
string orderNumber =9;// 订单数量 |
|||
int64 stopType =10;// 止盈止损状态 |
|||
string stopLossPrice =11;// 止损 |
|||
string stopWinPrice =12;// 止盈 |
|||
string serviceCost =13;// 开仓手续费 |
|||
string earnestMoney =14;// 保证金 |
|||
string orderMoney =15;// 订单总额 |
|||
int64 status =16;// 订单状态 |
|||
google.protobuf.Timestamp createTime =17;// 订单创建时间 |
|||
google.protobuf.Timestamp updateTime =18;// 订单更新时间 |
|||
google.protobuf.Timestamp openTime =19;// 订单开仓时间 |
|||
google.protobuf.Timestamp closingTime =20;// 订单平仓时间 |
|||
string closingCost =21;// 平仓手续费 |
|||
string faceValue =22;// 面值 |
|||
string overnightCost =23;// 过夜手续费 |
|||
string pryNum =24;// 杠杆值 |
|||
string keepDecimal =25;// 保留小数位 |
|||
string secondTime = 26;// 秒外汇时间 |
|||
int64 state = 27;// 订单类型 |
|||
} |
|||
|
|||
message ForexRequest{ |
|||
string forexId =1;// 交易对 |
|||
int64 tradeType =2;// 交易类型:1买入,2卖出 |
|||
int64 dealType =3;// 委托方式:1限价,2市价 |
|||
string limitPrice =4;// 限价 |
|||
string marketPrice =5;// 市价 |
|||
string orderAmount =6;// 订单金额 |
|||
string orderNumber =7;// 订单数量 |
|||
string earnestMoney =8;// 保证金 |
|||
string serviceCost =9;// 手续费 |
|||
int64 stopType =10;// 止损止盈设置:0无设置,1止损止盈 |
|||
string stopLossPrice =11;// 止损 |
|||
string stopWinPrice =12;// 止盈 |
|||
string pryNum =13;//杠杆 |
|||
int64 time = 14;// 秒外汇时间 |
|||
} |
|||
|
|||
message ForexReply{ |
|||
int64 code =1;// 状态码 |
|||
ForexResult data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message ForexResult { |
|||
string orderId =1;// 订单Id |
|||
} |
|||
|
|||
message UpdateForexRequest{ |
|||
string orderId =1;// 订单Id |
|||
int64 stopType =2;// 止盈止损 |
|||
string stopLossPrice =3;// 止损 |
|||
string stopWinPrice =4;// 止盈 |
|||
} |
|||
|
|||
message CancelForexRequest{ |
|||
string orderId =1;// 订单ID |
|||
} |
|||
|
|||
message AllForexRequest{ |
|||
|
|||
} |
|||
|
|||
message AllForexReply{ |
|||
int64 code =1;// 状态码 |
|||
string data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
@ -0,0 +1,312 @@ |
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-grpc v1.4.0
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/forex/forex.proto
|
|||
|
|||
package v1 |
|||
|
|||
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.62.0 or later.
|
|||
const _ = grpc.SupportPackageIsVersion8 |
|||
|
|||
const ( |
|||
Forex_GetBotForexTrade_FullMethodName = "/matchmaking.v1.Forex/GetBotForexTrade" |
|||
Forex_ForexPlaceOrder_FullMethodName = "/matchmaking.v1.Forex/ForexPlaceOrder" |
|||
Forex_ForexUpdatePlaceOrder_FullMethodName = "/matchmaking.v1.Forex/ForexUpdatePlaceOrder" |
|||
Forex_ForexPosition_FullMethodName = "/matchmaking.v1.Forex/ForexPosition" |
|||
Forex_ForexAllPosition_FullMethodName = "/matchmaking.v1.Forex/ForexAllPosition" |
|||
Forex_ForexCancel_FullMethodName = "/matchmaking.v1.Forex/ForexCancel" |
|||
) |
|||
|
|||
// ForexClient is the client API for Forex 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 ForexClient interface { |
|||
// GetBotForexTrade 外汇列表查询
|
|||
GetBotForexTrade(ctx context.Context, in *GetBotForexTradeRequest, opts ...grpc.CallOption) (*GetBotForexTradeReply, error) |
|||
// ForexPlaceOrder 外汇下单
|
|||
ForexPlaceOrder(ctx context.Context, in *ForexRequest, opts ...grpc.CallOption) (*ForexReply, error) |
|||
// ForexUpdatePlaceOrder 外汇设置止盈止损
|
|||
ForexUpdatePlaceOrder(ctx context.Context, in *UpdateForexRequest, opts ...grpc.CallOption) (*ForexReply, error) |
|||
// ForexPosition 外汇平仓
|
|||
ForexPosition(ctx context.Context, in *CancelForexRequest, opts ...grpc.CallOption) (*ForexReply, error) |
|||
// ForexAllPosition 外汇一键平仓
|
|||
ForexAllPosition(ctx context.Context, in *AllForexRequest, opts ...grpc.CallOption) (*AllForexReply, error) |
|||
// ForexCancel 外汇撤单
|
|||
ForexCancel(ctx context.Context, in *CancelForexRequest, opts ...grpc.CallOption) (*ForexReply, error) |
|||
} |
|||
|
|||
type forexClient struct { |
|||
cc grpc.ClientConnInterface |
|||
} |
|||
|
|||
func NewForexClient(cc grpc.ClientConnInterface) ForexClient { |
|||
return &forexClient{cc} |
|||
} |
|||
|
|||
func (c *forexClient) GetBotForexTrade(ctx context.Context, in *GetBotForexTradeRequest, opts ...grpc.CallOption) (*GetBotForexTradeReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(GetBotForexTradeReply) |
|||
err := c.cc.Invoke(ctx, Forex_GetBotForexTrade_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *forexClient) ForexPlaceOrder(ctx context.Context, in *ForexRequest, opts ...grpc.CallOption) (*ForexReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(ForexReply) |
|||
err := c.cc.Invoke(ctx, Forex_ForexPlaceOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *forexClient) ForexUpdatePlaceOrder(ctx context.Context, in *UpdateForexRequest, opts ...grpc.CallOption) (*ForexReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(ForexReply) |
|||
err := c.cc.Invoke(ctx, Forex_ForexUpdatePlaceOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *forexClient) ForexPosition(ctx context.Context, in *CancelForexRequest, opts ...grpc.CallOption) (*ForexReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(ForexReply) |
|||
err := c.cc.Invoke(ctx, Forex_ForexPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *forexClient) ForexAllPosition(ctx context.Context, in *AllForexRequest, opts ...grpc.CallOption) (*AllForexReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(AllForexReply) |
|||
err := c.cc.Invoke(ctx, Forex_ForexAllPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *forexClient) ForexCancel(ctx context.Context, in *CancelForexRequest, opts ...grpc.CallOption) (*ForexReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(ForexReply) |
|||
err := c.cc.Invoke(ctx, Forex_ForexCancel_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
// ForexServer is the server API for Forex service.
|
|||
// All implementations must embed UnimplementedForexServer
|
|||
// for forward compatibility
|
|||
type ForexServer interface { |
|||
// GetBotForexTrade 外汇列表查询
|
|||
GetBotForexTrade(context.Context, *GetBotForexTradeRequest) (*GetBotForexTradeReply, error) |
|||
// ForexPlaceOrder 外汇下单
|
|||
ForexPlaceOrder(context.Context, *ForexRequest) (*ForexReply, error) |
|||
// ForexUpdatePlaceOrder 外汇设置止盈止损
|
|||
ForexUpdatePlaceOrder(context.Context, *UpdateForexRequest) (*ForexReply, error) |
|||
// ForexPosition 外汇平仓
|
|||
ForexPosition(context.Context, *CancelForexRequest) (*ForexReply, error) |
|||
// ForexAllPosition 外汇一键平仓
|
|||
ForexAllPosition(context.Context, *AllForexRequest) (*AllForexReply, error) |
|||
// ForexCancel 外汇撤单
|
|||
ForexCancel(context.Context, *CancelForexRequest) (*ForexReply, error) |
|||
mustEmbedUnimplementedForexServer() |
|||
} |
|||
|
|||
// UnimplementedForexServer must be embedded to have forward compatible implementations.
|
|||
type UnimplementedForexServer struct { |
|||
} |
|||
|
|||
func (UnimplementedForexServer) GetBotForexTrade(context.Context, *GetBotForexTradeRequest) (*GetBotForexTradeReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method GetBotForexTrade not implemented") |
|||
} |
|||
func (UnimplementedForexServer) ForexPlaceOrder(context.Context, *ForexRequest) (*ForexReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ForexPlaceOrder not implemented") |
|||
} |
|||
func (UnimplementedForexServer) ForexUpdatePlaceOrder(context.Context, *UpdateForexRequest) (*ForexReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ForexUpdatePlaceOrder not implemented") |
|||
} |
|||
func (UnimplementedForexServer) ForexPosition(context.Context, *CancelForexRequest) (*ForexReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ForexPosition not implemented") |
|||
} |
|||
func (UnimplementedForexServer) ForexAllPosition(context.Context, *AllForexRequest) (*AllForexReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ForexAllPosition not implemented") |
|||
} |
|||
func (UnimplementedForexServer) ForexCancel(context.Context, *CancelForexRequest) (*ForexReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ForexCancel not implemented") |
|||
} |
|||
func (UnimplementedForexServer) mustEmbedUnimplementedForexServer() {} |
|||
|
|||
// UnsafeForexServer may be embedded to opt out of forward compatibility for this service.
|
|||
// Use of this interface is not recommended, as added methods to ForexServer will
|
|||
// result in compilation errors.
|
|||
type UnsafeForexServer interface { |
|||
mustEmbedUnimplementedForexServer() |
|||
} |
|||
|
|||
func RegisterForexServer(s grpc.ServiceRegistrar, srv ForexServer) { |
|||
s.RegisterService(&Forex_ServiceDesc, srv) |
|||
} |
|||
|
|||
func _Forex_GetBotForexTrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(GetBotForexTradeRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ForexServer).GetBotForexTrade(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Forex_GetBotForexTrade_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ForexServer).GetBotForexTrade(ctx, req.(*GetBotForexTradeRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Forex_ForexPlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(ForexRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ForexServer).ForexPlaceOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Forex_ForexPlaceOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ForexServer).ForexPlaceOrder(ctx, req.(*ForexRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Forex_ForexUpdatePlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(UpdateForexRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ForexServer).ForexUpdatePlaceOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Forex_ForexUpdatePlaceOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ForexServer).ForexUpdatePlaceOrder(ctx, req.(*UpdateForexRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Forex_ForexPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelForexRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ForexServer).ForexPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Forex_ForexPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ForexServer).ForexPosition(ctx, req.(*CancelForexRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Forex_ForexAllPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(AllForexRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ForexServer).ForexAllPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Forex_ForexAllPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ForexServer).ForexAllPosition(ctx, req.(*AllForexRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Forex_ForexCancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelForexRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ForexServer).ForexCancel(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Forex_ForexCancel_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ForexServer).ForexCancel(ctx, req.(*CancelForexRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
// Forex_ServiceDesc is the grpc.ServiceDesc for Forex service.
|
|||
// It's only intended for direct use with grpc.RegisterService,
|
|||
// and not to be introspected or modified (even as a copy)
|
|||
var Forex_ServiceDesc = grpc.ServiceDesc{ |
|||
ServiceName: "matchmaking.v1.Forex", |
|||
HandlerType: (*ForexServer)(nil), |
|||
Methods: []grpc.MethodDesc{ |
|||
{ |
|||
MethodName: "GetBotForexTrade", |
|||
Handler: _Forex_GetBotForexTrade_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ForexPlaceOrder", |
|||
Handler: _Forex_ForexPlaceOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ForexUpdatePlaceOrder", |
|||
Handler: _Forex_ForexUpdatePlaceOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ForexPosition", |
|||
Handler: _Forex_ForexPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ForexAllPosition", |
|||
Handler: _Forex_ForexAllPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ForexCancel", |
|||
Handler: _Forex_ForexCancel_Handler, |
|||
}, |
|||
}, |
|||
Streams: []grpc.StreamDesc{}, |
|||
Metadata: "matchmaking/v1/forex/forex.proto", |
|||
} |
@ -0,0 +1,279 @@ |
|||
// Code generated by protoc-gen-go-http. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-http v2.7.3
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/forex/forex.proto
|
|||
|
|||
package v1 |
|||
|
|||
import ( |
|||
context "context" |
|||
http "github.com/go-kratos/kratos/v2/transport/http" |
|||
binding "github.com/go-kratos/kratos/v2/transport/http/binding" |
|||
) |
|||
|
|||
// This is a compile-time assertion to ensure that this generated file
|
|||
// is compatible with the kratos package it is being compiled against.
|
|||
var _ = new(context.Context) |
|||
var _ = binding.EncodeURL |
|||
|
|||
const _ = http.SupportPackageIsVersion1 |
|||
|
|||
const OperationForexForexAllPosition = "/matchmaking.v1.Forex/ForexAllPosition" |
|||
const OperationForexForexCancel = "/matchmaking.v1.Forex/ForexCancel" |
|||
const OperationForexForexPlaceOrder = "/matchmaking.v1.Forex/ForexPlaceOrder" |
|||
const OperationForexForexPosition = "/matchmaking.v1.Forex/ForexPosition" |
|||
const OperationForexForexUpdatePlaceOrder = "/matchmaking.v1.Forex/ForexUpdatePlaceOrder" |
|||
const OperationForexGetBotForexTrade = "/matchmaking.v1.Forex/GetBotForexTrade" |
|||
|
|||
type ForexHTTPServer interface { |
|||
// ForexAllPosition ForexAllPosition 外汇一键平仓
|
|||
ForexAllPosition(context.Context, *AllForexRequest) (*AllForexReply, error) |
|||
// ForexCancel ForexCancel 外汇撤单
|
|||
ForexCancel(context.Context, *CancelForexRequest) (*ForexReply, error) |
|||
// ForexPlaceOrder ForexPlaceOrder 外汇下单
|
|||
ForexPlaceOrder(context.Context, *ForexRequest) (*ForexReply, error) |
|||
// ForexPosition ForexPosition 外汇平仓
|
|||
ForexPosition(context.Context, *CancelForexRequest) (*ForexReply, error) |
|||
// ForexUpdatePlaceOrder ForexUpdatePlaceOrder 外汇设置止盈止损
|
|||
ForexUpdatePlaceOrder(context.Context, *UpdateForexRequest) (*ForexReply, error) |
|||
// GetBotForexTrade GetBotForexTrade 外汇列表查询
|
|||
GetBotForexTrade(context.Context, *GetBotForexTradeRequest) (*GetBotForexTradeReply, error) |
|||
} |
|||
|
|||
func RegisterForexHTTPServer(s *http.Server, srv ForexHTTPServer) { |
|||
r := s.Route("/") |
|||
r.POST("/order_forex/forex_list", _Forex_GetBotForexTrade0_HTTP_Handler(srv)) |
|||
r.POST("/order_forex/forex_place_order", _Forex_ForexPlaceOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_forex/forex_update_order", _Forex_ForexUpdatePlaceOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_forex/forex_position", _Forex_ForexPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_forex/forex_all_position", _Forex_ForexAllPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_forex/forex_cancel", _Forex_ForexCancel0_HTTP_Handler(srv)) |
|||
} |
|||
|
|||
func _Forex_GetBotForexTrade0_HTTP_Handler(srv ForexHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in GetBotForexTradeRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationForexGetBotForexTrade) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.GetBotForexTrade(ctx, req.(*GetBotForexTradeRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*GetBotForexTradeReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Forex_ForexPlaceOrder0_HTTP_Handler(srv ForexHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in ForexRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationForexForexPlaceOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ForexPlaceOrder(ctx, req.(*ForexRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*ForexReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Forex_ForexUpdatePlaceOrder0_HTTP_Handler(srv ForexHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in UpdateForexRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationForexForexUpdatePlaceOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ForexUpdatePlaceOrder(ctx, req.(*UpdateForexRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*ForexReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Forex_ForexPosition0_HTTP_Handler(srv ForexHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelForexRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationForexForexPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ForexPosition(ctx, req.(*CancelForexRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*ForexReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Forex_ForexAllPosition0_HTTP_Handler(srv ForexHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in AllForexRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationForexForexAllPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ForexAllPosition(ctx, req.(*AllForexRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*AllForexReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Forex_ForexCancel0_HTTP_Handler(srv ForexHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelForexRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationForexForexCancel) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ForexCancel(ctx, req.(*CancelForexRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*ForexReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
type ForexHTTPClient interface { |
|||
ForexAllPosition(ctx context.Context, req *AllForexRequest, opts ...http.CallOption) (rsp *AllForexReply, err error) |
|||
ForexCancel(ctx context.Context, req *CancelForexRequest, opts ...http.CallOption) (rsp *ForexReply, err error) |
|||
ForexPlaceOrder(ctx context.Context, req *ForexRequest, opts ...http.CallOption) (rsp *ForexReply, err error) |
|||
ForexPosition(ctx context.Context, req *CancelForexRequest, opts ...http.CallOption) (rsp *ForexReply, err error) |
|||
ForexUpdatePlaceOrder(ctx context.Context, req *UpdateForexRequest, opts ...http.CallOption) (rsp *ForexReply, err error) |
|||
GetBotForexTrade(ctx context.Context, req *GetBotForexTradeRequest, opts ...http.CallOption) (rsp *GetBotForexTradeReply, err error) |
|||
} |
|||
|
|||
type ForexHTTPClientImpl struct { |
|||
cc *http.Client |
|||
} |
|||
|
|||
func NewForexHTTPClient(client *http.Client) ForexHTTPClient { |
|||
return &ForexHTTPClientImpl{client} |
|||
} |
|||
|
|||
func (c *ForexHTTPClientImpl) ForexAllPosition(ctx context.Context, in *AllForexRequest, opts ...http.CallOption) (*AllForexReply, error) { |
|||
var out AllForexReply |
|||
pattern := "/order_forex/forex_all_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationForexForexAllPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ForexHTTPClientImpl) ForexCancel(ctx context.Context, in *CancelForexRequest, opts ...http.CallOption) (*ForexReply, error) { |
|||
var out ForexReply |
|||
pattern := "/order_forex/forex_cancel" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationForexForexCancel)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ForexHTTPClientImpl) ForexPlaceOrder(ctx context.Context, in *ForexRequest, opts ...http.CallOption) (*ForexReply, error) { |
|||
var out ForexReply |
|||
pattern := "/order_forex/forex_place_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationForexForexPlaceOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ForexHTTPClientImpl) ForexPosition(ctx context.Context, in *CancelForexRequest, opts ...http.CallOption) (*ForexReply, error) { |
|||
var out ForexReply |
|||
pattern := "/order_forex/forex_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationForexForexPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ForexHTTPClientImpl) ForexUpdatePlaceOrder(ctx context.Context, in *UpdateForexRequest, opts ...http.CallOption) (*ForexReply, error) { |
|||
var out ForexReply |
|||
pattern := "/order_forex/forex_update_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationForexForexUpdatePlaceOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ForexHTTPClientImpl) GetBotForexTrade(ctx context.Context, in *GetBotForexTradeRequest, opts ...http.CallOption) (*GetBotForexTradeReply, error) { |
|||
var out GetBotForexTradeReply |
|||
pattern := "/order_forex/forex_list" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationForexGetBotForexTrade)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,160 @@ |
|||
syntax = "proto3"; |
|||
|
|||
package matchmaking.v1; |
|||
|
|||
import "google/api/annotations.proto"; |
|||
import "google/protobuf/timestamp.proto"; |
|||
|
|||
option go_package = "matchmaking-system/api/matchmaking/v1;v1"; |
|||
|
|||
service Money { |
|||
// GetBotMoneyTrade 综合列表查询 |
|||
rpc GetBotMoneyTrade(GetBotMoneyTradeRequest)returns(GetBotMoneyTradeReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_money/money_list", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// MoneyPlaceOrder 综合下单 |
|||
rpc MoneyPlaceOrder(MoneyRequest)returns(MoneyReply){ |
|||
option (google.api.http) = { |
|||
post: "/order_money/money_place_order", |
|||
body: "*", |
|||
}; |
|||
} |
|||
// MoneyUpdatePlaceOrder 综合设置止盈止损 |
|||
rpc MoneyUpdatePlaceOrder(UpdateMoneyRequest)returns(MoneyReply){ |
|||
option (google.api.http) = { |
|||
post: "/order_money/money_update_order", |
|||
body: "*", |
|||
}; |
|||
} |
|||
// MoneyPosition 综合平仓 |
|||
rpc MoneyPosition(CancelMoneyRequest)returns(MoneyReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_money/money_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// MoneyAllPosition 综合一键平仓 |
|||
rpc MoneyAllPosition(AllMoneyRequest)returns(AllMoneyReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_money/money_all_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// MoneyCancel 综合撤单 |
|||
rpc MoneyCancel(CancelMoneyRequest)returns(MoneyReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_money/money_cancel", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// MoneyOneClickRedemption 现货一键兑换 |
|||
rpc MoneyOneClickRedemption(MoneyRequest)returns(MoneyReply){ |
|||
option (google.api.http) = { |
|||
post: "/order_money/money_one_click_redemption", |
|||
body: "*", |
|||
}; |
|||
} |
|||
} |
|||
|
|||
message GetBotMoneyTradeRequest{ |
|||
int64 status =1;// 状态码 |
|||
int64 pageSize =2; // 每页显示条数 |
|||
int64 pageCount =3;// 开始的位置 |
|||
int64 state = 4;// 订单类型 |
|||
int64 type = 5;// 订单市场 |
|||
} |
|||
|
|||
message GetBotMoneyTradeReply{ |
|||
int64 code =1;// 状态码 |
|||
BotMoneyTradeData data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message BotMoneyTradeData{ |
|||
int64 pageSize =1; // 每页显示条数 |
|||
int64 pageCount =2;// 开始的位置 |
|||
repeated BotMoneyTrade data =3;// 返回结果 |
|||
int64 totalCount =4;// 总数据 |
|||
} |
|||
|
|||
message BotMoneyTrade{ |
|||
string orderId =1;// 订单ID |
|||
string StockId =2;// 综合ID |
|||
int64 tradeType =3;// 交易类型 |
|||
int64 dealType =4;// 交易方式 |
|||
string limitPrice =5;// 限价 |
|||
string marketPrice =6;// 市价 |
|||
string dealPrice =7;// 开仓价 |
|||
string closingPrice =8;// 平仓价 |
|||
string orderNumber =9;// 订单数量 |
|||
int64 stopType =10;// 止盈止损状态 |
|||
string stopLossPrice =11;// 止损 |
|||
string stopWinPrice =12;// 止盈 |
|||
string serviceCost =13;// 开仓手续费 |
|||
string earnestMoney =14;// 保证金 |
|||
string orderMoney =15;// 订单总额 |
|||
int64 status =16;// 订单状态 |
|||
google.protobuf.Timestamp createTime =17;// 订单创建时间 |
|||
google.protobuf.Timestamp updateTime =18;// 订单更新时间 |
|||
google.protobuf.Timestamp openTime =19;// 订单开仓时间 |
|||
google.protobuf.Timestamp closingTime =20;// 订单平仓时间 |
|||
string closingCost =21;// 平仓手续费 |
|||
string faceValue =22;// 面值 |
|||
string overnightCost =23;// 过夜手续费 |
|||
string pryNum =24;// 杠杆值 |
|||
string keepDecimal =25;// 保留小数位 |
|||
string secondTime = 26;// 秒综合时间 |
|||
int64 state = 27;// 订单类型 |
|||
} |
|||
|
|||
message MoneyRequest{ |
|||
string stockId =1;// 交易对 |
|||
int64 tradeType =2;// 交易类型:1买入,2卖出 |
|||
int64 dealType =3;// 委托方式:1限价,2市价 |
|||
string limitPrice =4;// 限价 |
|||
string marketPrice =5;// 市价 |
|||
string orderAmount =6;// 订单金额 |
|||
string orderNumber =7;// 订单数量 |
|||
string earnestMoney =8;// 保证金 |
|||
string serviceCost =9;// 手续费 |
|||
int64 stopType =10;// 止损止盈设置:0无设置,1止损止盈 |
|||
string stopLossPrice =11;// 止损 |
|||
string stopWinPrice =12;// 止盈 |
|||
string pryNum =13;//杠杆 |
|||
int64 time = 14;// 秒综合时间 |
|||
int64 type = 15;// 交易市场 |
|||
} |
|||
|
|||
message MoneyReply{ |
|||
int64 code =1;// 状态码 |
|||
MoneyResult data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message MoneyResult { |
|||
string orderId =1;// 订单Id |
|||
} |
|||
|
|||
message UpdateMoneyRequest{ |
|||
string orderId =1;// 订单Id |
|||
int64 stopType =2;// 止盈止损 |
|||
string stopLossPrice =3;// 止损 |
|||
string stopWinPrice =4;// 止盈 |
|||
} |
|||
|
|||
message CancelMoneyRequest{ |
|||
string orderId =1;// 订单ID |
|||
} |
|||
|
|||
message AllMoneyRequest{ |
|||
|
|||
} |
|||
|
|||
message AllMoneyReply{ |
|||
int64 code =1;// 状态码 |
|||
string data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
@ -0,0 +1,352 @@ |
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-grpc v1.4.0
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/money/money.proto
|
|||
|
|||
package v1 |
|||
|
|||
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.62.0 or later.
|
|||
const _ = grpc.SupportPackageIsVersion8 |
|||
|
|||
const ( |
|||
Money_GetBotMoneyTrade_FullMethodName = "/matchmaking.v1.Money/GetBotMoneyTrade" |
|||
Money_MoneyPlaceOrder_FullMethodName = "/matchmaking.v1.Money/MoneyPlaceOrder" |
|||
Money_MoneyUpdatePlaceOrder_FullMethodName = "/matchmaking.v1.Money/MoneyUpdatePlaceOrder" |
|||
Money_MoneyPosition_FullMethodName = "/matchmaking.v1.Money/MoneyPosition" |
|||
Money_MoneyAllPosition_FullMethodName = "/matchmaking.v1.Money/MoneyAllPosition" |
|||
Money_MoneyCancel_FullMethodName = "/matchmaking.v1.Money/MoneyCancel" |
|||
Money_MoneyOneClickRedemption_FullMethodName = "/matchmaking.v1.Money/MoneyOneClickRedemption" |
|||
) |
|||
|
|||
// MoneyClient is the client API for Money 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 MoneyClient interface { |
|||
// GetBotMoneyTrade 综合列表查询
|
|||
GetBotMoneyTrade(ctx context.Context, in *GetBotMoneyTradeRequest, opts ...grpc.CallOption) (*GetBotMoneyTradeReply, error) |
|||
// MoneyPlaceOrder 综合下单
|
|||
MoneyPlaceOrder(ctx context.Context, in *MoneyRequest, opts ...grpc.CallOption) (*MoneyReply, error) |
|||
// MoneyUpdatePlaceOrder 综合设置止盈止损
|
|||
MoneyUpdatePlaceOrder(ctx context.Context, in *UpdateMoneyRequest, opts ...grpc.CallOption) (*MoneyReply, error) |
|||
// MoneyPosition 综合平仓
|
|||
MoneyPosition(ctx context.Context, in *CancelMoneyRequest, opts ...grpc.CallOption) (*MoneyReply, error) |
|||
// MoneyAllPosition 综合一键平仓
|
|||
MoneyAllPosition(ctx context.Context, in *AllMoneyRequest, opts ...grpc.CallOption) (*AllMoneyReply, error) |
|||
// MoneyCancel 综合撤单
|
|||
MoneyCancel(ctx context.Context, in *CancelMoneyRequest, opts ...grpc.CallOption) (*MoneyReply, error) |
|||
// MoneyOneClickRedemption 现货一键兑换
|
|||
MoneyOneClickRedemption(ctx context.Context, in *MoneyRequest, opts ...grpc.CallOption) (*MoneyReply, error) |
|||
} |
|||
|
|||
type moneyClient struct { |
|||
cc grpc.ClientConnInterface |
|||
} |
|||
|
|||
func NewMoneyClient(cc grpc.ClientConnInterface) MoneyClient { |
|||
return &moneyClient{cc} |
|||
} |
|||
|
|||
func (c *moneyClient) GetBotMoneyTrade(ctx context.Context, in *GetBotMoneyTradeRequest, opts ...grpc.CallOption) (*GetBotMoneyTradeReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(GetBotMoneyTradeReply) |
|||
err := c.cc.Invoke(ctx, Money_GetBotMoneyTrade_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *moneyClient) MoneyPlaceOrder(ctx context.Context, in *MoneyRequest, opts ...grpc.CallOption) (*MoneyReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(MoneyReply) |
|||
err := c.cc.Invoke(ctx, Money_MoneyPlaceOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *moneyClient) MoneyUpdatePlaceOrder(ctx context.Context, in *UpdateMoneyRequest, opts ...grpc.CallOption) (*MoneyReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(MoneyReply) |
|||
err := c.cc.Invoke(ctx, Money_MoneyUpdatePlaceOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *moneyClient) MoneyPosition(ctx context.Context, in *CancelMoneyRequest, opts ...grpc.CallOption) (*MoneyReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(MoneyReply) |
|||
err := c.cc.Invoke(ctx, Money_MoneyPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *moneyClient) MoneyAllPosition(ctx context.Context, in *AllMoneyRequest, opts ...grpc.CallOption) (*AllMoneyReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(AllMoneyReply) |
|||
err := c.cc.Invoke(ctx, Money_MoneyAllPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *moneyClient) MoneyCancel(ctx context.Context, in *CancelMoneyRequest, opts ...grpc.CallOption) (*MoneyReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(MoneyReply) |
|||
err := c.cc.Invoke(ctx, Money_MoneyCancel_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *moneyClient) MoneyOneClickRedemption(ctx context.Context, in *MoneyRequest, opts ...grpc.CallOption) (*MoneyReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(MoneyReply) |
|||
err := c.cc.Invoke(ctx, Money_MoneyOneClickRedemption_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
// MoneyServer is the server API for Money service.
|
|||
// All implementations must embed UnimplementedMoneyServer
|
|||
// for forward compatibility
|
|||
type MoneyServer interface { |
|||
// GetBotMoneyTrade 综合列表查询
|
|||
GetBotMoneyTrade(context.Context, *GetBotMoneyTradeRequest) (*GetBotMoneyTradeReply, error) |
|||
// MoneyPlaceOrder 综合下单
|
|||
MoneyPlaceOrder(context.Context, *MoneyRequest) (*MoneyReply, error) |
|||
// MoneyUpdatePlaceOrder 综合设置止盈止损
|
|||
MoneyUpdatePlaceOrder(context.Context, *UpdateMoneyRequest) (*MoneyReply, error) |
|||
// MoneyPosition 综合平仓
|
|||
MoneyPosition(context.Context, *CancelMoneyRequest) (*MoneyReply, error) |
|||
// MoneyAllPosition 综合一键平仓
|
|||
MoneyAllPosition(context.Context, *AllMoneyRequest) (*AllMoneyReply, error) |
|||
// MoneyCancel 综合撤单
|
|||
MoneyCancel(context.Context, *CancelMoneyRequest) (*MoneyReply, error) |
|||
// MoneyOneClickRedemption 现货一键兑换
|
|||
MoneyOneClickRedemption(context.Context, *MoneyRequest) (*MoneyReply, error) |
|||
mustEmbedUnimplementedMoneyServer() |
|||
} |
|||
|
|||
// UnimplementedMoneyServer must be embedded to have forward compatible implementations.
|
|||
type UnimplementedMoneyServer struct { |
|||
} |
|||
|
|||
func (UnimplementedMoneyServer) GetBotMoneyTrade(context.Context, *GetBotMoneyTradeRequest) (*GetBotMoneyTradeReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method GetBotMoneyTrade not implemented") |
|||
} |
|||
func (UnimplementedMoneyServer) MoneyPlaceOrder(context.Context, *MoneyRequest) (*MoneyReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method MoneyPlaceOrder not implemented") |
|||
} |
|||
func (UnimplementedMoneyServer) MoneyUpdatePlaceOrder(context.Context, *UpdateMoneyRequest) (*MoneyReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method MoneyUpdatePlaceOrder not implemented") |
|||
} |
|||
func (UnimplementedMoneyServer) MoneyPosition(context.Context, *CancelMoneyRequest) (*MoneyReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method MoneyPosition not implemented") |
|||
} |
|||
func (UnimplementedMoneyServer) MoneyAllPosition(context.Context, *AllMoneyRequest) (*AllMoneyReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method MoneyAllPosition not implemented") |
|||
} |
|||
func (UnimplementedMoneyServer) MoneyCancel(context.Context, *CancelMoneyRequest) (*MoneyReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method MoneyCancel not implemented") |
|||
} |
|||
func (UnimplementedMoneyServer) MoneyOneClickRedemption(context.Context, *MoneyRequest) (*MoneyReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method MoneyOneClickRedemption not implemented") |
|||
} |
|||
func (UnimplementedMoneyServer) mustEmbedUnimplementedMoneyServer() {} |
|||
|
|||
// UnsafeMoneyServer may be embedded to opt out of forward compatibility for this service.
|
|||
// Use of this interface is not recommended, as added methods to MoneyServer will
|
|||
// result in compilation errors.
|
|||
type UnsafeMoneyServer interface { |
|||
mustEmbedUnimplementedMoneyServer() |
|||
} |
|||
|
|||
func RegisterMoneyServer(s grpc.ServiceRegistrar, srv MoneyServer) { |
|||
s.RegisterService(&Money_ServiceDesc, srv) |
|||
} |
|||
|
|||
func _Money_GetBotMoneyTrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(GetBotMoneyTradeRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(MoneyServer).GetBotMoneyTrade(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Money_GetBotMoneyTrade_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(MoneyServer).GetBotMoneyTrade(ctx, req.(*GetBotMoneyTradeRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Money_MoneyPlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(MoneyRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(MoneyServer).MoneyPlaceOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Money_MoneyPlaceOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(MoneyServer).MoneyPlaceOrder(ctx, req.(*MoneyRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Money_MoneyUpdatePlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(UpdateMoneyRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(MoneyServer).MoneyUpdatePlaceOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Money_MoneyUpdatePlaceOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(MoneyServer).MoneyUpdatePlaceOrder(ctx, req.(*UpdateMoneyRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Money_MoneyPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelMoneyRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(MoneyServer).MoneyPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Money_MoneyPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(MoneyServer).MoneyPosition(ctx, req.(*CancelMoneyRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Money_MoneyAllPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(AllMoneyRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(MoneyServer).MoneyAllPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Money_MoneyAllPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(MoneyServer).MoneyAllPosition(ctx, req.(*AllMoneyRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Money_MoneyCancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelMoneyRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(MoneyServer).MoneyCancel(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Money_MoneyCancel_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(MoneyServer).MoneyCancel(ctx, req.(*CancelMoneyRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Money_MoneyOneClickRedemption_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(MoneyRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(MoneyServer).MoneyOneClickRedemption(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Money_MoneyOneClickRedemption_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(MoneyServer).MoneyOneClickRedemption(ctx, req.(*MoneyRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
// Money_ServiceDesc is the grpc.ServiceDesc for Money service.
|
|||
// It's only intended for direct use with grpc.RegisterService,
|
|||
// and not to be introspected or modified (even as a copy)
|
|||
var Money_ServiceDesc = grpc.ServiceDesc{ |
|||
ServiceName: "matchmaking.v1.Money", |
|||
HandlerType: (*MoneyServer)(nil), |
|||
Methods: []grpc.MethodDesc{ |
|||
{ |
|||
MethodName: "GetBotMoneyTrade", |
|||
Handler: _Money_GetBotMoneyTrade_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "MoneyPlaceOrder", |
|||
Handler: _Money_MoneyPlaceOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "MoneyUpdatePlaceOrder", |
|||
Handler: _Money_MoneyUpdatePlaceOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "MoneyPosition", |
|||
Handler: _Money_MoneyPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "MoneyAllPosition", |
|||
Handler: _Money_MoneyAllPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "MoneyCancel", |
|||
Handler: _Money_MoneyCancel_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "MoneyOneClickRedemption", |
|||
Handler: _Money_MoneyOneClickRedemption_Handler, |
|||
}, |
|||
}, |
|||
Streams: []grpc.StreamDesc{}, |
|||
Metadata: "matchmaking/v1/money/money.proto", |
|||
} |
@ -0,0 +1,319 @@ |
|||
// Code generated by protoc-gen-go-http. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-http v2.7.3
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/money/money.proto
|
|||
|
|||
package v1 |
|||
|
|||
import ( |
|||
context "context" |
|||
http "github.com/go-kratos/kratos/v2/transport/http" |
|||
binding "github.com/go-kratos/kratos/v2/transport/http/binding" |
|||
) |
|||
|
|||
// This is a compile-time assertion to ensure that this generated file
|
|||
// is compatible with the kratos package it is being compiled against.
|
|||
var _ = new(context.Context) |
|||
var _ = binding.EncodeURL |
|||
|
|||
const _ = http.SupportPackageIsVersion1 |
|||
|
|||
const OperationMoneyGetBotMoneyTrade = "/matchmaking.v1.Money/GetBotMoneyTrade" |
|||
const OperationMoneyMoneyAllPosition = "/matchmaking.v1.Money/MoneyAllPosition" |
|||
const OperationMoneyMoneyCancel = "/matchmaking.v1.Money/MoneyCancel" |
|||
const OperationMoneyMoneyOneClickRedemption = "/matchmaking.v1.Money/MoneyOneClickRedemption" |
|||
const OperationMoneyMoneyPlaceOrder = "/matchmaking.v1.Money/MoneyPlaceOrder" |
|||
const OperationMoneyMoneyPosition = "/matchmaking.v1.Money/MoneyPosition" |
|||
const OperationMoneyMoneyUpdatePlaceOrder = "/matchmaking.v1.Money/MoneyUpdatePlaceOrder" |
|||
|
|||
type MoneyHTTPServer interface { |
|||
// GetBotMoneyTrade GetBotMoneyTrade 综合列表查询
|
|||
GetBotMoneyTrade(context.Context, *GetBotMoneyTradeRequest) (*GetBotMoneyTradeReply, error) |
|||
// MoneyAllPosition MoneyAllPosition 综合一键平仓
|
|||
MoneyAllPosition(context.Context, *AllMoneyRequest) (*AllMoneyReply, error) |
|||
// MoneyCancel MoneyCancel 综合撤单
|
|||
MoneyCancel(context.Context, *CancelMoneyRequest) (*MoneyReply, error) |
|||
// MoneyOneClickRedemption MoneyOneClickRedemption 现货一键兑换
|
|||
MoneyOneClickRedemption(context.Context, *MoneyRequest) (*MoneyReply, error) |
|||
// MoneyPlaceOrder MoneyPlaceOrder 综合下单
|
|||
MoneyPlaceOrder(context.Context, *MoneyRequest) (*MoneyReply, error) |
|||
// MoneyPosition MoneyPosition 综合平仓
|
|||
MoneyPosition(context.Context, *CancelMoneyRequest) (*MoneyReply, error) |
|||
// MoneyUpdatePlaceOrder MoneyUpdatePlaceOrder 综合设置止盈止损
|
|||
MoneyUpdatePlaceOrder(context.Context, *UpdateMoneyRequest) (*MoneyReply, error) |
|||
} |
|||
|
|||
func RegisterMoneyHTTPServer(s *http.Server, srv MoneyHTTPServer) { |
|||
r := s.Route("/") |
|||
r.POST("/order_money/money_list", _Money_GetBotMoneyTrade0_HTTP_Handler(srv)) |
|||
r.POST("/order_money/money_place_order", _Money_MoneyPlaceOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_money/money_update_order", _Money_MoneyUpdatePlaceOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_money/money_position", _Money_MoneyPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_money/money_all_position", _Money_MoneyAllPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_money/money_cancel", _Money_MoneyCancel0_HTTP_Handler(srv)) |
|||
r.POST("/order_money/money_one_click_redemption", _Money_MoneyOneClickRedemption0_HTTP_Handler(srv)) |
|||
} |
|||
|
|||
func _Money_GetBotMoneyTrade0_HTTP_Handler(srv MoneyHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in GetBotMoneyTradeRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationMoneyGetBotMoneyTrade) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.GetBotMoneyTrade(ctx, req.(*GetBotMoneyTradeRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*GetBotMoneyTradeReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Money_MoneyPlaceOrder0_HTTP_Handler(srv MoneyHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in MoneyRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationMoneyMoneyPlaceOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.MoneyPlaceOrder(ctx, req.(*MoneyRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*MoneyReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Money_MoneyUpdatePlaceOrder0_HTTP_Handler(srv MoneyHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in UpdateMoneyRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationMoneyMoneyUpdatePlaceOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.MoneyUpdatePlaceOrder(ctx, req.(*UpdateMoneyRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*MoneyReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Money_MoneyPosition0_HTTP_Handler(srv MoneyHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelMoneyRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationMoneyMoneyPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.MoneyPosition(ctx, req.(*CancelMoneyRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*MoneyReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Money_MoneyAllPosition0_HTTP_Handler(srv MoneyHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in AllMoneyRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationMoneyMoneyAllPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.MoneyAllPosition(ctx, req.(*AllMoneyRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*AllMoneyReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Money_MoneyCancel0_HTTP_Handler(srv MoneyHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelMoneyRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationMoneyMoneyCancel) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.MoneyCancel(ctx, req.(*CancelMoneyRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*MoneyReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Money_MoneyOneClickRedemption0_HTTP_Handler(srv MoneyHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in MoneyRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationMoneyMoneyOneClickRedemption) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.MoneyOneClickRedemption(ctx, req.(*MoneyRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*MoneyReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
type MoneyHTTPClient interface { |
|||
GetBotMoneyTrade(ctx context.Context, req *GetBotMoneyTradeRequest, opts ...http.CallOption) (rsp *GetBotMoneyTradeReply, err error) |
|||
MoneyAllPosition(ctx context.Context, req *AllMoneyRequest, opts ...http.CallOption) (rsp *AllMoneyReply, err error) |
|||
MoneyCancel(ctx context.Context, req *CancelMoneyRequest, opts ...http.CallOption) (rsp *MoneyReply, err error) |
|||
MoneyOneClickRedemption(ctx context.Context, req *MoneyRequest, opts ...http.CallOption) (rsp *MoneyReply, err error) |
|||
MoneyPlaceOrder(ctx context.Context, req *MoneyRequest, opts ...http.CallOption) (rsp *MoneyReply, err error) |
|||
MoneyPosition(ctx context.Context, req *CancelMoneyRequest, opts ...http.CallOption) (rsp *MoneyReply, err error) |
|||
MoneyUpdatePlaceOrder(ctx context.Context, req *UpdateMoneyRequest, opts ...http.CallOption) (rsp *MoneyReply, err error) |
|||
} |
|||
|
|||
type MoneyHTTPClientImpl struct { |
|||
cc *http.Client |
|||
} |
|||
|
|||
func NewMoneyHTTPClient(client *http.Client) MoneyHTTPClient { |
|||
return &MoneyHTTPClientImpl{client} |
|||
} |
|||
|
|||
func (c *MoneyHTTPClientImpl) GetBotMoneyTrade(ctx context.Context, in *GetBotMoneyTradeRequest, opts ...http.CallOption) (*GetBotMoneyTradeReply, error) { |
|||
var out GetBotMoneyTradeReply |
|||
pattern := "/order_money/money_list" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationMoneyGetBotMoneyTrade)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *MoneyHTTPClientImpl) MoneyAllPosition(ctx context.Context, in *AllMoneyRequest, opts ...http.CallOption) (*AllMoneyReply, error) { |
|||
var out AllMoneyReply |
|||
pattern := "/order_money/money_all_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationMoneyMoneyAllPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *MoneyHTTPClientImpl) MoneyCancel(ctx context.Context, in *CancelMoneyRequest, opts ...http.CallOption) (*MoneyReply, error) { |
|||
var out MoneyReply |
|||
pattern := "/order_money/money_cancel" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationMoneyMoneyCancel)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *MoneyHTTPClientImpl) MoneyOneClickRedemption(ctx context.Context, in *MoneyRequest, opts ...http.CallOption) (*MoneyReply, error) { |
|||
var out MoneyReply |
|||
pattern := "/order_money/money_one_click_redemption" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationMoneyMoneyOneClickRedemption)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *MoneyHTTPClientImpl) MoneyPlaceOrder(ctx context.Context, in *MoneyRequest, opts ...http.CallOption) (*MoneyReply, error) { |
|||
var out MoneyReply |
|||
pattern := "/order_money/money_place_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationMoneyMoneyPlaceOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *MoneyHTTPClientImpl) MoneyPosition(ctx context.Context, in *CancelMoneyRequest, opts ...http.CallOption) (*MoneyReply, error) { |
|||
var out MoneyReply |
|||
pattern := "/order_money/money_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationMoneyMoneyPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *MoneyHTTPClientImpl) MoneyUpdatePlaceOrder(ctx context.Context, in *UpdateMoneyRequest, opts ...http.CallOption) (*MoneyReply, error) { |
|||
var out MoneyReply |
|||
pattern := "/order_money/money_update_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationMoneyMoneyUpdatePlaceOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,162 @@ |
|||
syntax = "proto3"; |
|||
|
|||
package matchmaking.v1; |
|||
|
|||
import "google/api/annotations.proto"; |
|||
import "google/protobuf/timestamp.proto"; |
|||
|
|||
option go_package = "matchmaking-system/api/matchmaking/v1;v1"; |
|||
|
|||
service OptionInr { |
|||
// GetBotStockOptionInrTrade 期权-印度股列表查询 |
|||
rpc GetBotStockOptionInrTrade(GetBotStockOptionInrTradeRequest)returns(GetBotStockOptionInrTradeReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_optioninr/share_list", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// OptionInrPlaceOrder 期权-印度股下单 |
|||
rpc OptionInrPlaceOrder(OptionInrOrderRequest)returns(OptionInrOrderReply) { |
|||
option (google.api.http) = { |
|||
post: "/order_optioninr/share_place_order", |
|||
body: "*", |
|||
}; |
|||
} |
|||
// OptionInrUpdateOrder 期权-印度股设置止盈止损 |
|||
rpc OptionInrUpdateOrder(UpdateOptionInrOrderRequest)returns(OptionInrOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_optioninr/share_update_order", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// OptionInrCancel 期权-印度股撤单 |
|||
rpc OptionInrCancel(CancelOptionInrOrderRequest)returns(OptionInrOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_optioninr/share_cancel", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// OptionInrPosition 期权-印度股平仓 |
|||
rpc OptionInrPosition(CancelOptionInrOrderRequest)returns(OptionInrOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_optioninr/share_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// OptionInrAllPosition 期权-印度股一键平仓 |
|||
rpc OptionInrAllPosition(AllOptionInrOrderRequest)returns(AllOptionInrOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_optioninr/share_all_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
} |
|||
|
|||
message CancelOptionInrOrderRequest{ |
|||
string orderId =1;// 订单ID |
|||
} |
|||
|
|||
message UpdateOptionInrOrderRequest{ |
|||
string orderId =1;// 订单Id |
|||
int64 stopType =2;// 止盈止损 |
|||
string stopLossPrice =3;// 止损 |
|||
string stopWinPrice =4;// 止盈 |
|||
} |
|||
|
|||
message OptionInrOrderRequest{ |
|||
string stockId =1;// 股票类型 |
|||
int64 tradeType =2;// 交易类型:1看涨(calls-CE),2看跌(puts-PE) |
|||
int64 dealType =3;// 委托方式:1限价,2市价 |
|||
string limitPrice =4;// 限价 |
|||
string marketPrice =5;// 市价 |
|||
string marketMoney =6;// 订单金额 |
|||
string orderNumber =7;// 订单数量 |
|||
string serviceCost =8;// 手续费 |
|||
int64 stopType =9;// 止损止盈设置:1无设置,2止损止盈 |
|||
string stopLossPrice =10;// 止损 |
|||
string stopWinPrice =11;// 止损 |
|||
string pryNum =12;// 杠杆 |
|||
string stopTime =13;// 到期时间 |
|||
string strikePrice =14;// 行权价 |
|||
int64 tradingType =15;// 交易方式:1买入(buy),2卖出(sell) |
|||
string stockCode =16;// 期权订单标识(stockId+到期时间+行权价+(CE|PE)) |
|||
string multiplier =17;// 期权乘数 |
|||
string ask =18;// 卖一价(ask) |
|||
string bid =19;// 买一价(bid) |
|||
} |
|||
|
|||
message GetBotStockOptionInrTradeRequest{ |
|||
int64 status =1;// 状态码 |
|||
int64 pageSize =2; // 每页显示条数 |
|||
int64 pageCount =3;// 开始的位置 |
|||
} |
|||
|
|||
message GetBotStockOptionInrTradeReply{ |
|||
int64 code =1;// 状态码 |
|||
BotStockOptionInrTradeData data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message BotStockOptionInrTradeData{ |
|||
int64 pageSize =1; // 每页显示条数 |
|||
int64 pageCount =2;// 开始的位置 |
|||
repeated BotStockOptionInrTrade data =3;// 返回结果 |
|||
int64 totalCount =4;// 总数据 |
|||
} |
|||
|
|||
message BotStockOptionInrTrade{ |
|||
string orderId =1;// 订单ID |
|||
string stockId =2;// 股票代码 |
|||
int64 tradeType =3;// 交易类型 |
|||
int64 dealType =4;// 交易方式 |
|||
string limitPrice =5;// 限价 |
|||
string marketPrice =6;// 市价 |
|||
string dealPrice =7;// 开仓价 |
|||
string closingPrice =8;// 平仓价 |
|||
string orderNumber =9;// 订单数量 |
|||
int64 stopType =10;// 止盈止损 |
|||
string stopLossPrice =11;// 止损 |
|||
string stopWinPrice =12;// 止盈 |
|||
string serviceCost =13;// 开仓手续费 |
|||
string marketMoney =14;// 订单金额 |
|||
string orderMoney =15;// 订单总金额 |
|||
int64 status =16;// 订单状态 |
|||
google.protobuf.Timestamp createTime =17;// 订单创建时间 |
|||
google.protobuf.Timestamp updateTime =18;// 订单更新时间 |
|||
google.protobuf.Timestamp openTime =19;// 订单开仓时间 |
|||
google.protobuf.Timestamp closingTime =20;// 订单平仓时间 |
|||
string closingCost =21;// 平仓手续费 |
|||
string faceValue =22;// 面值 |
|||
string pryNum =23;// 杠杆 |
|||
string keepDecimal =24;// 保留小数位 |
|||
string stockName =25;// 股票名称 |
|||
string stopTime = 26;// 期权时间 |
|||
string strikePrice =27;// 权利金 |
|||
int64 tradingType =28;// 交易方式 |
|||
string stockCode =29;// 期权订单标识(stockId+到期时间+行权价+(CE|PE)) |
|||
int64 multiplier =30;// 期权乘数 |
|||
string costPrice = 31;// 成本价格 |
|||
int64 ratio =32;// 保证金比例 |
|||
string bid =33;// 买一价 |
|||
string ask =34;// 卖一价 |
|||
} |
|||
|
|||
message OptionInrOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
OptionInrOrderResult data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message OptionInrOrderResult { |
|||
string orderId =1;// 订单Id |
|||
} |
|||
|
|||
message AllOptionInrOrderRequest{ |
|||
|
|||
} |
|||
|
|||
message AllOptionInrOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
string data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
@ -0,0 +1,312 @@ |
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-grpc v1.4.0
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/option/optionInr.proto
|
|||
|
|||
package v1 |
|||
|
|||
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.62.0 or later.
|
|||
const _ = grpc.SupportPackageIsVersion8 |
|||
|
|||
const ( |
|||
OptionInr_GetBotStockOptionInrTrade_FullMethodName = "/matchmaking.v1.OptionInr/GetBotStockOptionInrTrade" |
|||
OptionInr_OptionInrPlaceOrder_FullMethodName = "/matchmaking.v1.OptionInr/OptionInrPlaceOrder" |
|||
OptionInr_OptionInrUpdateOrder_FullMethodName = "/matchmaking.v1.OptionInr/OptionInrUpdateOrder" |
|||
OptionInr_OptionInrCancel_FullMethodName = "/matchmaking.v1.OptionInr/OptionInrCancel" |
|||
OptionInr_OptionInrPosition_FullMethodName = "/matchmaking.v1.OptionInr/OptionInrPosition" |
|||
OptionInr_OptionInrAllPosition_FullMethodName = "/matchmaking.v1.OptionInr/OptionInrAllPosition" |
|||
) |
|||
|
|||
// OptionInrClient is the client API for OptionInr 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 OptionInrClient interface { |
|||
// GetBotStockOptionInrTrade 期权-印度股列表查询
|
|||
GetBotStockOptionInrTrade(ctx context.Context, in *GetBotStockOptionInrTradeRequest, opts ...grpc.CallOption) (*GetBotStockOptionInrTradeReply, error) |
|||
// OptionInrPlaceOrder 期权-印度股下单
|
|||
OptionInrPlaceOrder(ctx context.Context, in *OptionInrOrderRequest, opts ...grpc.CallOption) (*OptionInrOrderReply, error) |
|||
// OptionInrUpdateOrder 期权-印度股设置止盈止损
|
|||
OptionInrUpdateOrder(ctx context.Context, in *UpdateOptionInrOrderRequest, opts ...grpc.CallOption) (*OptionInrOrderReply, error) |
|||
// OptionInrCancel 期权-印度股撤单
|
|||
OptionInrCancel(ctx context.Context, in *CancelOptionInrOrderRequest, opts ...grpc.CallOption) (*OptionInrOrderReply, error) |
|||
// OptionInrPosition 期权-印度股平仓
|
|||
OptionInrPosition(ctx context.Context, in *CancelOptionInrOrderRequest, opts ...grpc.CallOption) (*OptionInrOrderReply, error) |
|||
// OptionInrAllPosition 期权-印度股一键平仓
|
|||
OptionInrAllPosition(ctx context.Context, in *AllOptionInrOrderRequest, opts ...grpc.CallOption) (*AllOptionInrOrderReply, error) |
|||
} |
|||
|
|||
type optionInrClient struct { |
|||
cc grpc.ClientConnInterface |
|||
} |
|||
|
|||
func NewOptionInrClient(cc grpc.ClientConnInterface) OptionInrClient { |
|||
return &optionInrClient{cc} |
|||
} |
|||
|
|||
func (c *optionInrClient) GetBotStockOptionInrTrade(ctx context.Context, in *GetBotStockOptionInrTradeRequest, opts ...grpc.CallOption) (*GetBotStockOptionInrTradeReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(GetBotStockOptionInrTradeReply) |
|||
err := c.cc.Invoke(ctx, OptionInr_GetBotStockOptionInrTrade_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *optionInrClient) OptionInrPlaceOrder(ctx context.Context, in *OptionInrOrderRequest, opts ...grpc.CallOption) (*OptionInrOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(OptionInrOrderReply) |
|||
err := c.cc.Invoke(ctx, OptionInr_OptionInrPlaceOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *optionInrClient) OptionInrUpdateOrder(ctx context.Context, in *UpdateOptionInrOrderRequest, opts ...grpc.CallOption) (*OptionInrOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(OptionInrOrderReply) |
|||
err := c.cc.Invoke(ctx, OptionInr_OptionInrUpdateOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *optionInrClient) OptionInrCancel(ctx context.Context, in *CancelOptionInrOrderRequest, opts ...grpc.CallOption) (*OptionInrOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(OptionInrOrderReply) |
|||
err := c.cc.Invoke(ctx, OptionInr_OptionInrCancel_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *optionInrClient) OptionInrPosition(ctx context.Context, in *CancelOptionInrOrderRequest, opts ...grpc.CallOption) (*OptionInrOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(OptionInrOrderReply) |
|||
err := c.cc.Invoke(ctx, OptionInr_OptionInrPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *optionInrClient) OptionInrAllPosition(ctx context.Context, in *AllOptionInrOrderRequest, opts ...grpc.CallOption) (*AllOptionInrOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(AllOptionInrOrderReply) |
|||
err := c.cc.Invoke(ctx, OptionInr_OptionInrAllPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
// OptionInrServer is the server API for OptionInr service.
|
|||
// All implementations must embed UnimplementedOptionInrServer
|
|||
// for forward compatibility
|
|||
type OptionInrServer interface { |
|||
// GetBotStockOptionInrTrade 期权-印度股列表查询
|
|||
GetBotStockOptionInrTrade(context.Context, *GetBotStockOptionInrTradeRequest) (*GetBotStockOptionInrTradeReply, error) |
|||
// OptionInrPlaceOrder 期权-印度股下单
|
|||
OptionInrPlaceOrder(context.Context, *OptionInrOrderRequest) (*OptionInrOrderReply, error) |
|||
// OptionInrUpdateOrder 期权-印度股设置止盈止损
|
|||
OptionInrUpdateOrder(context.Context, *UpdateOptionInrOrderRequest) (*OptionInrOrderReply, error) |
|||
// OptionInrCancel 期权-印度股撤单
|
|||
OptionInrCancel(context.Context, *CancelOptionInrOrderRequest) (*OptionInrOrderReply, error) |
|||
// OptionInrPosition 期权-印度股平仓
|
|||
OptionInrPosition(context.Context, *CancelOptionInrOrderRequest) (*OptionInrOrderReply, error) |
|||
// OptionInrAllPosition 期权-印度股一键平仓
|
|||
OptionInrAllPosition(context.Context, *AllOptionInrOrderRequest) (*AllOptionInrOrderReply, error) |
|||
mustEmbedUnimplementedOptionInrServer() |
|||
} |
|||
|
|||
// UnimplementedOptionInrServer must be embedded to have forward compatible implementations.
|
|||
type UnimplementedOptionInrServer struct { |
|||
} |
|||
|
|||
func (UnimplementedOptionInrServer) GetBotStockOptionInrTrade(context.Context, *GetBotStockOptionInrTradeRequest) (*GetBotStockOptionInrTradeReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method GetBotStockOptionInrTrade not implemented") |
|||
} |
|||
func (UnimplementedOptionInrServer) OptionInrPlaceOrder(context.Context, *OptionInrOrderRequest) (*OptionInrOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method OptionInrPlaceOrder not implemented") |
|||
} |
|||
func (UnimplementedOptionInrServer) OptionInrUpdateOrder(context.Context, *UpdateOptionInrOrderRequest) (*OptionInrOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method OptionInrUpdateOrder not implemented") |
|||
} |
|||
func (UnimplementedOptionInrServer) OptionInrCancel(context.Context, *CancelOptionInrOrderRequest) (*OptionInrOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method OptionInrCancel not implemented") |
|||
} |
|||
func (UnimplementedOptionInrServer) OptionInrPosition(context.Context, *CancelOptionInrOrderRequest) (*OptionInrOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method OptionInrPosition not implemented") |
|||
} |
|||
func (UnimplementedOptionInrServer) OptionInrAllPosition(context.Context, *AllOptionInrOrderRequest) (*AllOptionInrOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method OptionInrAllPosition not implemented") |
|||
} |
|||
func (UnimplementedOptionInrServer) mustEmbedUnimplementedOptionInrServer() {} |
|||
|
|||
// UnsafeOptionInrServer may be embedded to opt out of forward compatibility for this service.
|
|||
// Use of this interface is not recommended, as added methods to OptionInrServer will
|
|||
// result in compilation errors.
|
|||
type UnsafeOptionInrServer interface { |
|||
mustEmbedUnimplementedOptionInrServer() |
|||
} |
|||
|
|||
func RegisterOptionInrServer(s grpc.ServiceRegistrar, srv OptionInrServer) { |
|||
s.RegisterService(&OptionInr_ServiceDesc, srv) |
|||
} |
|||
|
|||
func _OptionInr_GetBotStockOptionInrTrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(GetBotStockOptionInrTradeRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(OptionInrServer).GetBotStockOptionInrTrade(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: OptionInr_GetBotStockOptionInrTrade_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(OptionInrServer).GetBotStockOptionInrTrade(ctx, req.(*GetBotStockOptionInrTradeRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _OptionInr_OptionInrPlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(OptionInrOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(OptionInrServer).OptionInrPlaceOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: OptionInr_OptionInrPlaceOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(OptionInrServer).OptionInrPlaceOrder(ctx, req.(*OptionInrOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _OptionInr_OptionInrUpdateOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(UpdateOptionInrOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(OptionInrServer).OptionInrUpdateOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: OptionInr_OptionInrUpdateOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(OptionInrServer).OptionInrUpdateOrder(ctx, req.(*UpdateOptionInrOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _OptionInr_OptionInrCancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelOptionInrOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(OptionInrServer).OptionInrCancel(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: OptionInr_OptionInrCancel_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(OptionInrServer).OptionInrCancel(ctx, req.(*CancelOptionInrOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _OptionInr_OptionInrPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelOptionInrOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(OptionInrServer).OptionInrPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: OptionInr_OptionInrPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(OptionInrServer).OptionInrPosition(ctx, req.(*CancelOptionInrOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _OptionInr_OptionInrAllPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(AllOptionInrOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(OptionInrServer).OptionInrAllPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: OptionInr_OptionInrAllPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(OptionInrServer).OptionInrAllPosition(ctx, req.(*AllOptionInrOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
// OptionInr_ServiceDesc is the grpc.ServiceDesc for OptionInr service.
|
|||
// It's only intended for direct use with grpc.RegisterService,
|
|||
// and not to be introspected or modified (even as a copy)
|
|||
var OptionInr_ServiceDesc = grpc.ServiceDesc{ |
|||
ServiceName: "matchmaking.v1.OptionInr", |
|||
HandlerType: (*OptionInrServer)(nil), |
|||
Methods: []grpc.MethodDesc{ |
|||
{ |
|||
MethodName: "GetBotStockOptionInrTrade", |
|||
Handler: _OptionInr_GetBotStockOptionInrTrade_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "OptionInrPlaceOrder", |
|||
Handler: _OptionInr_OptionInrPlaceOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "OptionInrUpdateOrder", |
|||
Handler: _OptionInr_OptionInrUpdateOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "OptionInrCancel", |
|||
Handler: _OptionInr_OptionInrCancel_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "OptionInrPosition", |
|||
Handler: _OptionInr_OptionInrPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "OptionInrAllPosition", |
|||
Handler: _OptionInr_OptionInrAllPosition_Handler, |
|||
}, |
|||
}, |
|||
Streams: []grpc.StreamDesc{}, |
|||
Metadata: "matchmaking/v1/option/optionInr.proto", |
|||
} |
@ -0,0 +1,279 @@ |
|||
// Code generated by protoc-gen-go-http. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-http v2.7.3
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/option/optionInr.proto
|
|||
|
|||
package v1 |
|||
|
|||
import ( |
|||
context "context" |
|||
http "github.com/go-kratos/kratos/v2/transport/http" |
|||
binding "github.com/go-kratos/kratos/v2/transport/http/binding" |
|||
) |
|||
|
|||
// This is a compile-time assertion to ensure that this generated file
|
|||
// is compatible with the kratos package it is being compiled against.
|
|||
var _ = new(context.Context) |
|||
var _ = binding.EncodeURL |
|||
|
|||
const _ = http.SupportPackageIsVersion1 |
|||
|
|||
const OperationOptionInrGetBotStockOptionInrTrade = "/matchmaking.v1.OptionInr/GetBotStockOptionInrTrade" |
|||
const OperationOptionInrOptionInrAllPosition = "/matchmaking.v1.OptionInr/OptionInrAllPosition" |
|||
const OperationOptionInrOptionInrCancel = "/matchmaking.v1.OptionInr/OptionInrCancel" |
|||
const OperationOptionInrOptionInrPlaceOrder = "/matchmaking.v1.OptionInr/OptionInrPlaceOrder" |
|||
const OperationOptionInrOptionInrPosition = "/matchmaking.v1.OptionInr/OptionInrPosition" |
|||
const OperationOptionInrOptionInrUpdateOrder = "/matchmaking.v1.OptionInr/OptionInrUpdateOrder" |
|||
|
|||
type OptionInrHTTPServer interface { |
|||
// GetBotStockOptionInrTrade GetBotStockOptionInrTrade 期权-印度股列表查询
|
|||
GetBotStockOptionInrTrade(context.Context, *GetBotStockOptionInrTradeRequest) (*GetBotStockOptionInrTradeReply, error) |
|||
// OptionInrAllPosition OptionInrAllPosition 期权-印度股一键平仓
|
|||
OptionInrAllPosition(context.Context, *AllOptionInrOrderRequest) (*AllOptionInrOrderReply, error) |
|||
// OptionInrCancel OptionInrCancel 期权-印度股撤单
|
|||
OptionInrCancel(context.Context, *CancelOptionInrOrderRequest) (*OptionInrOrderReply, error) |
|||
// OptionInrPlaceOrder OptionInrPlaceOrder 期权-印度股下单
|
|||
OptionInrPlaceOrder(context.Context, *OptionInrOrderRequest) (*OptionInrOrderReply, error) |
|||
// OptionInrPosition OptionInrPosition 期权-印度股平仓
|
|||
OptionInrPosition(context.Context, *CancelOptionInrOrderRequest) (*OptionInrOrderReply, error) |
|||
// OptionInrUpdateOrder OptionInrUpdateOrder 期权-印度股设置止盈止损
|
|||
OptionInrUpdateOrder(context.Context, *UpdateOptionInrOrderRequest) (*OptionInrOrderReply, error) |
|||
} |
|||
|
|||
func RegisterOptionInrHTTPServer(s *http.Server, srv OptionInrHTTPServer) { |
|||
r := s.Route("/") |
|||
r.POST("/order_optioninr/share_list", _OptionInr_GetBotStockOptionInrTrade0_HTTP_Handler(srv)) |
|||
r.POST("/order_optioninr/share_place_order", _OptionInr_OptionInrPlaceOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_optioninr/share_update_order", _OptionInr_OptionInrUpdateOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_optioninr/share_cancel", _OptionInr_OptionInrCancel0_HTTP_Handler(srv)) |
|||
r.POST("/order_optioninr/share_position", _OptionInr_OptionInrPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_optioninr/share_all_position", _OptionInr_OptionInrAllPosition0_HTTP_Handler(srv)) |
|||
} |
|||
|
|||
func _OptionInr_GetBotStockOptionInrTrade0_HTTP_Handler(srv OptionInrHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in GetBotStockOptionInrTradeRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationOptionInrGetBotStockOptionInrTrade) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.GetBotStockOptionInrTrade(ctx, req.(*GetBotStockOptionInrTradeRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*GetBotStockOptionInrTradeReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _OptionInr_OptionInrPlaceOrder0_HTTP_Handler(srv OptionInrHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in OptionInrOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationOptionInrOptionInrPlaceOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.OptionInrPlaceOrder(ctx, req.(*OptionInrOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*OptionInrOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _OptionInr_OptionInrUpdateOrder0_HTTP_Handler(srv OptionInrHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in UpdateOptionInrOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationOptionInrOptionInrUpdateOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.OptionInrUpdateOrder(ctx, req.(*UpdateOptionInrOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*OptionInrOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _OptionInr_OptionInrCancel0_HTTP_Handler(srv OptionInrHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelOptionInrOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationOptionInrOptionInrCancel) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.OptionInrCancel(ctx, req.(*CancelOptionInrOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*OptionInrOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _OptionInr_OptionInrPosition0_HTTP_Handler(srv OptionInrHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelOptionInrOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationOptionInrOptionInrPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.OptionInrPosition(ctx, req.(*CancelOptionInrOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*OptionInrOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _OptionInr_OptionInrAllPosition0_HTTP_Handler(srv OptionInrHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in AllOptionInrOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationOptionInrOptionInrAllPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.OptionInrAllPosition(ctx, req.(*AllOptionInrOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*AllOptionInrOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
type OptionInrHTTPClient interface { |
|||
GetBotStockOptionInrTrade(ctx context.Context, req *GetBotStockOptionInrTradeRequest, opts ...http.CallOption) (rsp *GetBotStockOptionInrTradeReply, err error) |
|||
OptionInrAllPosition(ctx context.Context, req *AllOptionInrOrderRequest, opts ...http.CallOption) (rsp *AllOptionInrOrderReply, err error) |
|||
OptionInrCancel(ctx context.Context, req *CancelOptionInrOrderRequest, opts ...http.CallOption) (rsp *OptionInrOrderReply, err error) |
|||
OptionInrPlaceOrder(ctx context.Context, req *OptionInrOrderRequest, opts ...http.CallOption) (rsp *OptionInrOrderReply, err error) |
|||
OptionInrPosition(ctx context.Context, req *CancelOptionInrOrderRequest, opts ...http.CallOption) (rsp *OptionInrOrderReply, err error) |
|||
OptionInrUpdateOrder(ctx context.Context, req *UpdateOptionInrOrderRequest, opts ...http.CallOption) (rsp *OptionInrOrderReply, err error) |
|||
} |
|||
|
|||
type OptionInrHTTPClientImpl struct { |
|||
cc *http.Client |
|||
} |
|||
|
|||
func NewOptionInrHTTPClient(client *http.Client) OptionInrHTTPClient { |
|||
return &OptionInrHTTPClientImpl{client} |
|||
} |
|||
|
|||
func (c *OptionInrHTTPClientImpl) GetBotStockOptionInrTrade(ctx context.Context, in *GetBotStockOptionInrTradeRequest, opts ...http.CallOption) (*GetBotStockOptionInrTradeReply, error) { |
|||
var out GetBotStockOptionInrTradeReply |
|||
pattern := "/order_optioninr/share_list" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationOptionInrGetBotStockOptionInrTrade)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *OptionInrHTTPClientImpl) OptionInrAllPosition(ctx context.Context, in *AllOptionInrOrderRequest, opts ...http.CallOption) (*AllOptionInrOrderReply, error) { |
|||
var out AllOptionInrOrderReply |
|||
pattern := "/order_optioninr/share_all_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationOptionInrOptionInrAllPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *OptionInrHTTPClientImpl) OptionInrCancel(ctx context.Context, in *CancelOptionInrOrderRequest, opts ...http.CallOption) (*OptionInrOrderReply, error) { |
|||
var out OptionInrOrderReply |
|||
pattern := "/order_optioninr/share_cancel" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationOptionInrOptionInrCancel)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *OptionInrHTTPClientImpl) OptionInrPlaceOrder(ctx context.Context, in *OptionInrOrderRequest, opts ...http.CallOption) (*OptionInrOrderReply, error) { |
|||
var out OptionInrOrderReply |
|||
pattern := "/order_optioninr/share_place_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationOptionInrOptionInrPlaceOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *OptionInrHTTPClientImpl) OptionInrPosition(ctx context.Context, in *CancelOptionInrOrderRequest, opts ...http.CallOption) (*OptionInrOrderReply, error) { |
|||
var out OptionInrOrderReply |
|||
pattern := "/order_optioninr/share_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationOptionInrOptionInrPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *OptionInrHTTPClientImpl) OptionInrUpdateOrder(ctx context.Context, in *UpdateOptionInrOrderRequest, opts ...http.CallOption) (*OptionInrOrderReply, error) { |
|||
var out OptionInrOrderReply |
|||
pattern := "/order_optioninr/share_update_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationOptionInrOptionInrUpdateOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
@ -0,0 +1,435 @@ |
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|||
// versions:
|
|||
// protoc-gen-go v1.34.2
|
|||
// protoc v5.27.1
|
|||
// source: matchmaking/v1/order/order.proto
|
|||
|
|||
package v1 |
|||
|
|||
import ( |
|||
_ "google.golang.org/genproto/googleapis/api/annotations" |
|||
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 ShareTradeStockIdRequest struct { |
|||
state protoimpl.MessageState |
|||
sizeCache protoimpl.SizeCache |
|||
unknownFields protoimpl.UnknownFields |
|||
|
|||
Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` // 股票代码
|
|||
CodeOld string `protobuf:"bytes,2,opt,name=codeOld,proto3" json:"codeOld,omitempty"` // 旧股票代码
|
|||
Stock int64 `protobuf:"varint,3,opt,name=stock,proto3" json:"stock,omitempty"` // 股票市场
|
|||
} |
|||
|
|||
func (x *ShareTradeStockIdRequest) Reset() { |
|||
*x = ShareTradeStockIdRequest{} |
|||
if protoimpl.UnsafeEnabled { |
|||
mi := &file_matchmaking_v1_order_order_proto_msgTypes[0] |
|||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
|||
ms.StoreMessageInfo(mi) |
|||
} |
|||
} |
|||
|
|||
func (x *ShareTradeStockIdRequest) String() string { |
|||
return protoimpl.X.MessageStringOf(x) |
|||
} |
|||
|
|||
func (*ShareTradeStockIdRequest) ProtoMessage() {} |
|||
|
|||
func (x *ShareTradeStockIdRequest) ProtoReflect() protoreflect.Message { |
|||
mi := &file_matchmaking_v1_order_order_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 ShareTradeStockIdRequest.ProtoReflect.Descriptor instead.
|
|||
func (*ShareTradeStockIdRequest) Descriptor() ([]byte, []int) { |
|||
return file_matchmaking_v1_order_order_proto_rawDescGZIP(), []int{0} |
|||
} |
|||
|
|||
func (x *ShareTradeStockIdRequest) GetCode() string { |
|||
if x != nil { |
|||
return x.Code |
|||
} |
|||
return "" |
|||
} |
|||
|
|||
func (x *ShareTradeStockIdRequest) GetCodeOld() string { |
|||
if x != nil { |
|||
return x.CodeOld |
|||
} |
|||
return "" |
|||
} |
|||
|
|||
func (x *ShareTradeStockIdRequest) GetStock() int64 { |
|||
if x != nil { |
|||
return x.Stock |
|||
} |
|||
return 0 |
|||
} |
|||
|
|||
type SharePreRequest struct { |
|||
state protoimpl.MessageState |
|||
sizeCache protoimpl.SizeCache |
|||
unknownFields protoimpl.UnknownFields |
|||
|
|||
Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` // 股票代码
|
|||
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` // 新股申购-订单Id
|
|||
Stock int32 `protobuf:"varint,3,opt,name=stock,proto3" json:"stock,omitempty"` // 股票市场
|
|||
} |
|||
|
|||
func (x *SharePreRequest) Reset() { |
|||
*x = SharePreRequest{} |
|||
if protoimpl.UnsafeEnabled { |
|||
mi := &file_matchmaking_v1_order_order_proto_msgTypes[1] |
|||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
|||
ms.StoreMessageInfo(mi) |
|||
} |
|||
} |
|||
|
|||
func (x *SharePreRequest) String() string { |
|||
return protoimpl.X.MessageStringOf(x) |
|||
} |
|||
|
|||
func (*SharePreRequest) ProtoMessage() {} |
|||
|
|||
func (x *SharePreRequest) ProtoReflect() protoreflect.Message { |
|||
mi := &file_matchmaking_v1_order_order_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 SharePreRequest.ProtoReflect.Descriptor instead.
|
|||
func (*SharePreRequest) Descriptor() ([]byte, []int) { |
|||
return file_matchmaking_v1_order_order_proto_rawDescGZIP(), []int{1} |
|||
} |
|||
|
|||
func (x *SharePreRequest) GetCode() string { |
|||
if x != nil { |
|||
return x.Code |
|||
} |
|||
return "" |
|||
} |
|||
|
|||
func (x *SharePreRequest) GetId() string { |
|||
if x != nil { |
|||
return x.Id |
|||
} |
|||
return "" |
|||
} |
|||
|
|||
func (x *SharePreRequest) GetStock() int32 { |
|||
if x != nil { |
|||
return x.Stock |
|||
} |
|||
return 0 |
|||
} |
|||
|
|||
type SharePreReply struct { |
|||
state protoimpl.MessageState |
|||
sizeCache protoimpl.SizeCache |
|||
unknownFields protoimpl.UnknownFields |
|||
|
|||
Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // 状态码
|
|||
Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // 返回结果
|
|||
Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` // 返回消息提示
|
|||
} |
|||
|
|||
func (x *SharePreReply) Reset() { |
|||
*x = SharePreReply{} |
|||
if protoimpl.UnsafeEnabled { |
|||
mi := &file_matchmaking_v1_order_order_proto_msgTypes[2] |
|||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
|||
ms.StoreMessageInfo(mi) |
|||
} |
|||
} |
|||
|
|||
func (x *SharePreReply) String() string { |
|||
return protoimpl.X.MessageStringOf(x) |
|||
} |
|||
|
|||
func (*SharePreReply) ProtoMessage() {} |
|||
|
|||
func (x *SharePreReply) ProtoReflect() protoreflect.Message { |
|||
mi := &file_matchmaking_v1_order_order_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 SharePreReply.ProtoReflect.Descriptor instead.
|
|||
func (*SharePreReply) Descriptor() ([]byte, []int) { |
|||
return file_matchmaking_v1_order_order_proto_rawDescGZIP(), []int{2} |
|||
} |
|||
|
|||
func (x *SharePreReply) GetCode() int64 { |
|||
if x != nil { |
|||
return x.Code |
|||
} |
|||
return 0 |
|||
} |
|||
|
|||
func (x *SharePreReply) GetData() string { |
|||
if x != nil { |
|||
return x.Data |
|||
} |
|||
return "" |
|||
} |
|||
|
|||
func (x *SharePreReply) GetMessage() string { |
|||
if x != nil { |
|||
return x.Message |
|||
} |
|||
return "" |
|||
} |
|||
|
|||
type ShareNullRequest struct { |
|||
state protoimpl.MessageState |
|||
sizeCache protoimpl.SizeCache |
|||
unknownFields protoimpl.UnknownFields |
|||
} |
|||
|
|||
func (x *ShareNullRequest) Reset() { |
|||
*x = ShareNullRequest{} |
|||
if protoimpl.UnsafeEnabled { |
|||
mi := &file_matchmaking_v1_order_order_proto_msgTypes[3] |
|||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
|||
ms.StoreMessageInfo(mi) |
|||
} |
|||
} |
|||
|
|||
func (x *ShareNullRequest) String() string { |
|||
return protoimpl.X.MessageStringOf(x) |
|||
} |
|||
|
|||
func (*ShareNullRequest) ProtoMessage() {} |
|||
|
|||
func (x *ShareNullRequest) ProtoReflect() protoreflect.Message { |
|||
mi := &file_matchmaking_v1_order_order_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 ShareNullRequest.ProtoReflect.Descriptor instead.
|
|||
func (*ShareNullRequest) Descriptor() ([]byte, []int) { |
|||
return file_matchmaking_v1_order_order_proto_rawDescGZIP(), []int{3} |
|||
} |
|||
|
|||
var File_matchmaking_v1_order_order_proto protoreflect.FileDescriptor |
|||
|
|||
var file_matchmaking_v1_order_order_proto_rawDesc = []byte{ |
|||
0x0a, 0x20, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x6d, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, |
|||
0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, |
|||
0x74, 0x6f, 0x12, 0x0e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x6d, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, |
|||
0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, |
|||
0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, |
|||
0x22, 0x5e, 0x0a, 0x18, 0x53, 0x68, 0x61, 0x72, 0x65, 0x54, 0x72, 0x61, 0x64, 0x65, 0x53, 0x74, |
|||
0x6f, 0x63, 0x6b, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, |
|||
0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, |
|||
0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x64, 0x65, 0x4f, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, |
|||
0x09, 0x52, 0x07, 0x63, 0x6f, 0x64, 0x65, 0x4f, 0x6c, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, |
|||
0x6f, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, |
|||
0x22, 0x4b, 0x0a, 0x0f, 0x53, 0x68, 0x61, 0x72, 0x65, 0x50, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, |
|||
0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, |
|||
0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, |
|||
0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, |
|||
0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x22, 0x51, 0x0a, |
|||
0x0d, 0x53, 0x68, 0x61, 0x72, 0x65, 0x50, 0x72, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x12, |
|||
0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, |
|||
0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, |
|||
0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, |
|||
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, |
|||
0x22, 0x12, 0x0a, 0x10, 0x53, 0x68, 0x61, 0x72, 0x65, 0x4e, 0x75, 0x6c, 0x6c, 0x52, 0x65, 0x71, |
|||
0x75, 0x65, 0x73, 0x74, 0x32, 0xb1, 0x05, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x7b, |
|||
0x0a, 0x0d, 0x53, 0x68, 0x61, 0x72, 0x65, 0x50, 0x72, 0x65, 0x54, 0x72, 0x61, 0x64, 0x65, 0x12, |
|||
0x1f, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x6d, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, |
|||
0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x50, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, |
|||
0x1a, 0x1d, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x6d, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, |
|||
0x31, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x50, 0x72, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, |
|||
0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x3a, 0x01, 0x2a, 0x22, 0x1f, 0x2f, 0x6f, 0x72, 0x64, |
|||
0x65, 0x72, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x70, 0x72, 0x65, 0x2f, 0x73, 0x68, 0x61, 0x72, |
|||
0x65, 0x5f, 0x70, 0x72, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x64, 0x65, 0x12, 0x90, 0x01, 0x0a, 0x16, |
|||
0x53, 0x68, 0x61, 0x72, 0x65, 0x50, 0x72, 0x65, 0x54, 0x72, 0x61, 0x64, 0x65, 0x42, 0x79, 0x4f, |
|||
0x72, 0x64, 0x65, 0x72, 0x4e, 0x6f, 0x12, 0x1f, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x6d, 0x61, |
|||
0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x50, 0x72, 0x65, |
|||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x6d, |
|||
0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x50, 0x72, |
|||
0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x3a, 0x01, |
|||
0x2a, 0x22, 0x2b, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x70, |
|||
0x72, 0x65, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x5f, 0x74, 0x72, 0x61, |
|||
0x64, 0x65, 0x5f, 0x62, 0x79, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x6e, 0x6f, 0x12, 0x8e, |
|||
0x01, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x54, 0x72, |
|||
0x61, 0x64, 0x65, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x49, 0x64, 0x12, 0x28, 0x2e, 0x6d, 0x61, 0x74, |
|||
0x63, 0x68, 0x6d, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x61, 0x72, |
|||
0x65, 0x54, 0x72, 0x61, 0x64, 0x65, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x49, 0x64, 0x52, 0x65, 0x71, |
|||
0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x6d, 0x61, 0x6b, 0x69, |
|||
0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x50, 0x72, 0x65, 0x52, 0x65, |
|||
0x70, 0x6c, 0x79, 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x3a, 0x01, 0x2a, 0x22, 0x1f, |
|||
0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x70, 0x72, 0x65, 0x2f, |
|||
0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x5f, 0x69, 0x64, 0x12, |
|||
0x7c, 0x0a, 0x0e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x47, 0x69, 0x76, 0x65, 0x61, 0x77, 0x61, 0x79, |
|||
0x73, 0x12, 0x1f, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x6d, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, |
|||
0x76, 0x31, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x50, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, |
|||
0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x6d, 0x61, 0x6b, 0x69, 0x6e, 0x67, |
|||
0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x50, 0x72, 0x65, 0x52, 0x65, 0x70, 0x6c, |
|||
0x79, 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x3a, 0x01, 0x2a, 0x22, 0x1f, 0x2f, 0x6f, |
|||
0x72, 0x64, 0x65, 0x72, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x70, 0x72, 0x65, 0x2f, 0x73, 0x68, |
|||
0x61, 0x72, 0x65, 0x5f, 0x67, 0x69, 0x76, 0x65, 0x61, 0x77, 0x61, 0x79, 0x73, 0x12, 0x88, 0x01, |
|||
0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x41, 0x6c, 0x6c, |
|||
0x53, 0x74, 0x6f, 0x63, 0x6b, 0x49, 0x64, 0x12, 0x20, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x6d, |
|||
0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x4e, 0x75, |
|||
0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x61, 0x74, 0x63, |
|||
0x68, 0x6d, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, |
|||
0x50, 0x72, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, |
|||
0x3a, 0x01, 0x2a, 0x22, 0x23, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x73, 0x68, 0x61, 0x72, |
|||
0x65, 0x70, 0x72, 0x65, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, |
|||
0x73, 0x74, 0x6f, 0x63, 0x6b, 0x5f, 0x69, 0x64, 0x42, 0x2a, 0x5a, 0x28, 0x6d, 0x61, 0x74, 0x63, |
|||
0x68, 0x6d, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2d, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x61, |
|||
0x70, 0x69, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x6d, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, |
|||
0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, |
|||
} |
|||
|
|||
var ( |
|||
file_matchmaking_v1_order_order_proto_rawDescOnce sync.Once |
|||
file_matchmaking_v1_order_order_proto_rawDescData = file_matchmaking_v1_order_order_proto_rawDesc |
|||
) |
|||
|
|||
func file_matchmaking_v1_order_order_proto_rawDescGZIP() []byte { |
|||
file_matchmaking_v1_order_order_proto_rawDescOnce.Do(func() { |
|||
file_matchmaking_v1_order_order_proto_rawDescData = protoimpl.X.CompressGZIP(file_matchmaking_v1_order_order_proto_rawDescData) |
|||
}) |
|||
return file_matchmaking_v1_order_order_proto_rawDescData |
|||
} |
|||
|
|||
var file_matchmaking_v1_order_order_proto_msgTypes = make([]protoimpl.MessageInfo, 4) |
|||
var file_matchmaking_v1_order_order_proto_goTypes = []any{ |
|||
(*ShareTradeStockIdRequest)(nil), // 0: matchmaking.v1.ShareTradeStockIdRequest
|
|||
(*SharePreRequest)(nil), // 1: matchmaking.v1.SharePreRequest
|
|||
(*SharePreReply)(nil), // 2: matchmaking.v1.SharePreReply
|
|||
(*ShareNullRequest)(nil), // 3: matchmaking.v1.ShareNullRequest
|
|||
} |
|||
var file_matchmaking_v1_order_order_proto_depIdxs = []int32{ |
|||
1, // 0: matchmaking.v1.Order.SharePreTrade:input_type -> matchmaking.v1.SharePreRequest
|
|||
1, // 1: matchmaking.v1.Order.SharePreTradeByOrderNo:input_type -> matchmaking.v1.SharePreRequest
|
|||
0, // 2: matchmaking.v1.Order.UpdateShareTradeStockId:input_type -> matchmaking.v1.ShareTradeStockIdRequest
|
|||
1, // 3: matchmaking.v1.Order.ShareGiveaways:input_type -> matchmaking.v1.SharePreRequest
|
|||
3, // 4: matchmaking.v1.Order.UpdateShareAllStockId:input_type -> matchmaking.v1.ShareNullRequest
|
|||
2, // 5: matchmaking.v1.Order.SharePreTrade:output_type -> matchmaking.v1.SharePreReply
|
|||
2, // 6: matchmaking.v1.Order.SharePreTradeByOrderNo:output_type -> matchmaking.v1.SharePreReply
|
|||
2, // 7: matchmaking.v1.Order.UpdateShareTradeStockId:output_type -> matchmaking.v1.SharePreReply
|
|||
2, // 8: matchmaking.v1.Order.ShareGiveaways:output_type -> matchmaking.v1.SharePreReply
|
|||
2, // 9: matchmaking.v1.Order.UpdateShareAllStockId:output_type -> matchmaking.v1.SharePreReply
|
|||
5, // [5:10] is the sub-list for method output_type
|
|||
0, // [0:5] is the sub-list for method input_type
|
|||
0, // [0:0] is the sub-list for extension type_name
|
|||
0, // [0:0] is the sub-list for extension extendee
|
|||
0, // [0:0] is the sub-list for field type_name
|
|||
} |
|||
|
|||
func init() { file_matchmaking_v1_order_order_proto_init() } |
|||
func file_matchmaking_v1_order_order_proto_init() { |
|||
if File_matchmaking_v1_order_order_proto != nil { |
|||
return |
|||
} |
|||
if !protoimpl.UnsafeEnabled { |
|||
file_matchmaking_v1_order_order_proto_msgTypes[0].Exporter = func(v any, i int) any { |
|||
switch v := v.(*ShareTradeStockIdRequest); i { |
|||
case 0: |
|||
return &v.state |
|||
case 1: |
|||
return &v.sizeCache |
|||
case 2: |
|||
return &v.unknownFields |
|||
default: |
|||
return nil |
|||
} |
|||
} |
|||
file_matchmaking_v1_order_order_proto_msgTypes[1].Exporter = func(v any, i int) any { |
|||
switch v := v.(*SharePreRequest); i { |
|||
case 0: |
|||
return &v.state |
|||
case 1: |
|||
return &v.sizeCache |
|||
case 2: |
|||
return &v.unknownFields |
|||
default: |
|||
return nil |
|||
} |
|||
} |
|||
file_matchmaking_v1_order_order_proto_msgTypes[2].Exporter = func(v any, i int) any { |
|||
switch v := v.(*SharePreReply); i { |
|||
case 0: |
|||
return &v.state |
|||
case 1: |
|||
return &v.sizeCache |
|||
case 2: |
|||
return &v.unknownFields |
|||
default: |
|||
return nil |
|||
} |
|||
} |
|||
file_matchmaking_v1_order_order_proto_msgTypes[3].Exporter = func(v any, i int) any { |
|||
switch v := v.(*ShareNullRequest); 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_matchmaking_v1_order_order_proto_rawDesc, |
|||
NumEnums: 0, |
|||
NumMessages: 4, |
|||
NumExtensions: 0, |
|||
NumServices: 1, |
|||
}, |
|||
GoTypes: file_matchmaking_v1_order_order_proto_goTypes, |
|||
DependencyIndexes: file_matchmaking_v1_order_order_proto_depIdxs, |
|||
MessageInfos: file_matchmaking_v1_order_order_proto_msgTypes, |
|||
}.Build() |
|||
File_matchmaking_v1_order_order_proto = out.File |
|||
file_matchmaking_v1_order_order_proto_rawDesc = nil |
|||
file_matchmaking_v1_order_order_proto_goTypes = nil |
|||
file_matchmaking_v1_order_order_proto_depIdxs = nil |
|||
} |
@ -0,0 +1,67 @@ |
|||
syntax = "proto3"; |
|||
|
|||
package matchmaking.v1; |
|||
|
|||
import "google/api/annotations.proto"; |
|||
|
|||
option go_package = "matchmaking-system/api/matchmaking/v1;v1"; |
|||
|
|||
service Order { |
|||
// SharePreTrade 新股申购 |
|||
rpc SharePreTrade(SharePreRequest)returns(SharePreReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharepre/share_pre_trade", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// SharePreTradeByOrderNo 新股申购-订单号 |
|||
rpc SharePreTradeByOrderNo(SharePreRequest)returns(SharePreReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharepre/share_pre_trade_by_order_no", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// UpdateShareTradeStockId 更新股票代码stock_id |
|||
rpc UpdateShareTradeStockId(ShareTradeStockIdRequest)returns(SharePreReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharepre/update_stock_id", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareGiveaways 股票赠送 |
|||
rpc ShareGiveaways(SharePreRequest)returns(SharePreReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharepre/share_giveaways", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// UpdateShareAllStockId 更新全局的股票StockId |
|||
rpc UpdateShareAllStockId(ShareNullRequest)returns(SharePreReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharepre/update_all_stock_id", |
|||
body:"*", |
|||
}; |
|||
} |
|||
} |
|||
|
|||
message ShareTradeStockIdRequest{ |
|||
string code =1;// 股票代码 |
|||
string codeOld =2;// 旧股票代码 |
|||
int64 stock =3;// 股票市场 |
|||
} |
|||
|
|||
message SharePreRequest{ |
|||
string code =1;// 股票代码 |
|||
string id =2;// 新股申购-订单Id |
|||
int32 stock =3;// 股票市场 |
|||
} |
|||
|
|||
message SharePreReply{ |
|||
int64 code =1;// 状态码 |
|||
string data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message ShareNullRequest{ |
|||
|
|||
} |
@ -0,0 +1,272 @@ |
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-grpc v1.4.0
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/order/order.proto
|
|||
|
|||
package v1 |
|||
|
|||
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.62.0 or later.
|
|||
const _ = grpc.SupportPackageIsVersion8 |
|||
|
|||
const ( |
|||
Order_SharePreTrade_FullMethodName = "/matchmaking.v1.Order/SharePreTrade" |
|||
Order_SharePreTradeByOrderNo_FullMethodName = "/matchmaking.v1.Order/SharePreTradeByOrderNo" |
|||
Order_UpdateShareTradeStockId_FullMethodName = "/matchmaking.v1.Order/UpdateShareTradeStockId" |
|||
Order_ShareGiveaways_FullMethodName = "/matchmaking.v1.Order/ShareGiveaways" |
|||
Order_UpdateShareAllStockId_FullMethodName = "/matchmaking.v1.Order/UpdateShareAllStockId" |
|||
) |
|||
|
|||
// OrderClient is the client API for Order 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 OrderClient interface { |
|||
// SharePreTrade 新股申购
|
|||
SharePreTrade(ctx context.Context, in *SharePreRequest, opts ...grpc.CallOption) (*SharePreReply, error) |
|||
// SharePreTradeByOrderNo 新股申购-订单号
|
|||
SharePreTradeByOrderNo(ctx context.Context, in *SharePreRequest, opts ...grpc.CallOption) (*SharePreReply, error) |
|||
// UpdateShareTradeStockId 更新股票代码stock_id
|
|||
UpdateShareTradeStockId(ctx context.Context, in *ShareTradeStockIdRequest, opts ...grpc.CallOption) (*SharePreReply, error) |
|||
// ShareGiveaways 股票赠送
|
|||
ShareGiveaways(ctx context.Context, in *SharePreRequest, opts ...grpc.CallOption) (*SharePreReply, error) |
|||
// UpdateShareAllStockId 更新全局的股票StockId
|
|||
UpdateShareAllStockId(ctx context.Context, in *ShareNullRequest, opts ...grpc.CallOption) (*SharePreReply, error) |
|||
} |
|||
|
|||
type orderClient struct { |
|||
cc grpc.ClientConnInterface |
|||
} |
|||
|
|||
func NewOrderClient(cc grpc.ClientConnInterface) OrderClient { |
|||
return &orderClient{cc} |
|||
} |
|||
|
|||
func (c *orderClient) SharePreTrade(ctx context.Context, in *SharePreRequest, opts ...grpc.CallOption) (*SharePreReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(SharePreReply) |
|||
err := c.cc.Invoke(ctx, Order_SharePreTrade_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *orderClient) SharePreTradeByOrderNo(ctx context.Context, in *SharePreRequest, opts ...grpc.CallOption) (*SharePreReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(SharePreReply) |
|||
err := c.cc.Invoke(ctx, Order_SharePreTradeByOrderNo_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *orderClient) UpdateShareTradeStockId(ctx context.Context, in *ShareTradeStockIdRequest, opts ...grpc.CallOption) (*SharePreReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(SharePreReply) |
|||
err := c.cc.Invoke(ctx, Order_UpdateShareTradeStockId_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *orderClient) ShareGiveaways(ctx context.Context, in *SharePreRequest, opts ...grpc.CallOption) (*SharePreReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(SharePreReply) |
|||
err := c.cc.Invoke(ctx, Order_ShareGiveaways_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *orderClient) UpdateShareAllStockId(ctx context.Context, in *ShareNullRequest, opts ...grpc.CallOption) (*SharePreReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(SharePreReply) |
|||
err := c.cc.Invoke(ctx, Order_UpdateShareAllStockId_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
// OrderServer is the server API for Order service.
|
|||
// All implementations must embed UnimplementedOrderServer
|
|||
// for forward compatibility
|
|||
type OrderServer interface { |
|||
// SharePreTrade 新股申购
|
|||
SharePreTrade(context.Context, *SharePreRequest) (*SharePreReply, error) |
|||
// SharePreTradeByOrderNo 新股申购-订单号
|
|||
SharePreTradeByOrderNo(context.Context, *SharePreRequest) (*SharePreReply, error) |
|||
// UpdateShareTradeStockId 更新股票代码stock_id
|
|||
UpdateShareTradeStockId(context.Context, *ShareTradeStockIdRequest) (*SharePreReply, error) |
|||
// ShareGiveaways 股票赠送
|
|||
ShareGiveaways(context.Context, *SharePreRequest) (*SharePreReply, error) |
|||
// UpdateShareAllStockId 更新全局的股票StockId
|
|||
UpdateShareAllStockId(context.Context, *ShareNullRequest) (*SharePreReply, error) |
|||
mustEmbedUnimplementedOrderServer() |
|||
} |
|||
|
|||
// UnimplementedOrderServer must be embedded to have forward compatible implementations.
|
|||
type UnimplementedOrderServer struct { |
|||
} |
|||
|
|||
func (UnimplementedOrderServer) SharePreTrade(context.Context, *SharePreRequest) (*SharePreReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method SharePreTrade not implemented") |
|||
} |
|||
func (UnimplementedOrderServer) SharePreTradeByOrderNo(context.Context, *SharePreRequest) (*SharePreReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method SharePreTradeByOrderNo not implemented") |
|||
} |
|||
func (UnimplementedOrderServer) UpdateShareTradeStockId(context.Context, *ShareTradeStockIdRequest) (*SharePreReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method UpdateShareTradeStockId not implemented") |
|||
} |
|||
func (UnimplementedOrderServer) ShareGiveaways(context.Context, *SharePreRequest) (*SharePreReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareGiveaways not implemented") |
|||
} |
|||
func (UnimplementedOrderServer) UpdateShareAllStockId(context.Context, *ShareNullRequest) (*SharePreReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method UpdateShareAllStockId not implemented") |
|||
} |
|||
func (UnimplementedOrderServer) mustEmbedUnimplementedOrderServer() {} |
|||
|
|||
// UnsafeOrderServer may be embedded to opt out of forward compatibility for this service.
|
|||
// Use of this interface is not recommended, as added methods to OrderServer will
|
|||
// result in compilation errors.
|
|||
type UnsafeOrderServer interface { |
|||
mustEmbedUnimplementedOrderServer() |
|||
} |
|||
|
|||
func RegisterOrderServer(s grpc.ServiceRegistrar, srv OrderServer) { |
|||
s.RegisterService(&Order_ServiceDesc, srv) |
|||
} |
|||
|
|||
func _Order_SharePreTrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(SharePreRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(OrderServer).SharePreTrade(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Order_SharePreTrade_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(OrderServer).SharePreTrade(ctx, req.(*SharePreRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Order_SharePreTradeByOrderNo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(SharePreRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(OrderServer).SharePreTradeByOrderNo(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Order_SharePreTradeByOrderNo_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(OrderServer).SharePreTradeByOrderNo(ctx, req.(*SharePreRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Order_UpdateShareTradeStockId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(ShareTradeStockIdRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(OrderServer).UpdateShareTradeStockId(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Order_UpdateShareTradeStockId_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(OrderServer).UpdateShareTradeStockId(ctx, req.(*ShareTradeStockIdRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Order_ShareGiveaways_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(SharePreRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(OrderServer).ShareGiveaways(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Order_ShareGiveaways_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(OrderServer).ShareGiveaways(ctx, req.(*SharePreRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Order_UpdateShareAllStockId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(ShareNullRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(OrderServer).UpdateShareAllStockId(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Order_UpdateShareAllStockId_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(OrderServer).UpdateShareAllStockId(ctx, req.(*ShareNullRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
// Order_ServiceDesc is the grpc.ServiceDesc for Order service.
|
|||
// It's only intended for direct use with grpc.RegisterService,
|
|||
// and not to be introspected or modified (even as a copy)
|
|||
var Order_ServiceDesc = grpc.ServiceDesc{ |
|||
ServiceName: "matchmaking.v1.Order", |
|||
HandlerType: (*OrderServer)(nil), |
|||
Methods: []grpc.MethodDesc{ |
|||
{ |
|||
MethodName: "SharePreTrade", |
|||
Handler: _Order_SharePreTrade_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "SharePreTradeByOrderNo", |
|||
Handler: _Order_SharePreTradeByOrderNo_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "UpdateShareTradeStockId", |
|||
Handler: _Order_UpdateShareTradeStockId_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareGiveaways", |
|||
Handler: _Order_ShareGiveaways_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "UpdateShareAllStockId", |
|||
Handler: _Order_UpdateShareAllStockId_Handler, |
|||
}, |
|||
}, |
|||
Streams: []grpc.StreamDesc{}, |
|||
Metadata: "matchmaking/v1/order/order.proto", |
|||
} |
@ -0,0 +1,239 @@ |
|||
// Code generated by protoc-gen-go-http. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-http v2.7.3
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/order/order.proto
|
|||
|
|||
package v1 |
|||
|
|||
import ( |
|||
context "context" |
|||
http "github.com/go-kratos/kratos/v2/transport/http" |
|||
binding "github.com/go-kratos/kratos/v2/transport/http/binding" |
|||
) |
|||
|
|||
// This is a compile-time assertion to ensure that this generated file
|
|||
// is compatible with the kratos package it is being compiled against.
|
|||
var _ = new(context.Context) |
|||
var _ = binding.EncodeURL |
|||
|
|||
const _ = http.SupportPackageIsVersion1 |
|||
|
|||
const OperationOrderShareGiveaways = "/matchmaking.v1.Order/ShareGiveaways" |
|||
const OperationOrderSharePreTrade = "/matchmaking.v1.Order/SharePreTrade" |
|||
const OperationOrderSharePreTradeByOrderNo = "/matchmaking.v1.Order/SharePreTradeByOrderNo" |
|||
const OperationOrderUpdateShareAllStockId = "/matchmaking.v1.Order/UpdateShareAllStockId" |
|||
const OperationOrderUpdateShareTradeStockId = "/matchmaking.v1.Order/UpdateShareTradeStockId" |
|||
|
|||
type OrderHTTPServer interface { |
|||
// ShareGiveaways ShareGiveaways 股票赠送
|
|||
ShareGiveaways(context.Context, *SharePreRequest) (*SharePreReply, error) |
|||
// SharePreTrade SharePreTrade 新股申购
|
|||
SharePreTrade(context.Context, *SharePreRequest) (*SharePreReply, error) |
|||
// SharePreTradeByOrderNo SharePreTradeByOrderNo 新股申购-订单号
|
|||
SharePreTradeByOrderNo(context.Context, *SharePreRequest) (*SharePreReply, error) |
|||
// UpdateShareAllStockId UpdateShareAllStockId 更新全局的股票StockId
|
|||
UpdateShareAllStockId(context.Context, *ShareNullRequest) (*SharePreReply, error) |
|||
// UpdateShareTradeStockId UpdateShareTradeStockId 更新股票代码stock_id
|
|||
UpdateShareTradeStockId(context.Context, *ShareTradeStockIdRequest) (*SharePreReply, error) |
|||
} |
|||
|
|||
func RegisterOrderHTTPServer(s *http.Server, srv OrderHTTPServer) { |
|||
r := s.Route("/") |
|||
r.POST("/order_sharepre/share_pre_trade", _Order_SharePreTrade0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharepre/share_pre_trade_by_order_no", _Order_SharePreTradeByOrderNo0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharepre/update_stock_id", _Order_UpdateShareTradeStockId0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharepre/share_giveaways", _Order_ShareGiveaways0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharepre/update_all_stock_id", _Order_UpdateShareAllStockId0_HTTP_Handler(srv)) |
|||
} |
|||
|
|||
func _Order_SharePreTrade0_HTTP_Handler(srv OrderHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in SharePreRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationOrderSharePreTrade) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.SharePreTrade(ctx, req.(*SharePreRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*SharePreReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Order_SharePreTradeByOrderNo0_HTTP_Handler(srv OrderHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in SharePreRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationOrderSharePreTradeByOrderNo) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.SharePreTradeByOrderNo(ctx, req.(*SharePreRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*SharePreReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Order_UpdateShareTradeStockId0_HTTP_Handler(srv OrderHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in ShareTradeStockIdRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationOrderUpdateShareTradeStockId) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.UpdateShareTradeStockId(ctx, req.(*ShareTradeStockIdRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*SharePreReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Order_ShareGiveaways0_HTTP_Handler(srv OrderHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in SharePreRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationOrderShareGiveaways) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareGiveaways(ctx, req.(*SharePreRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*SharePreReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Order_UpdateShareAllStockId0_HTTP_Handler(srv OrderHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in ShareNullRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationOrderUpdateShareAllStockId) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.UpdateShareAllStockId(ctx, req.(*ShareNullRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*SharePreReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
type OrderHTTPClient interface { |
|||
ShareGiveaways(ctx context.Context, req *SharePreRequest, opts ...http.CallOption) (rsp *SharePreReply, err error) |
|||
SharePreTrade(ctx context.Context, req *SharePreRequest, opts ...http.CallOption) (rsp *SharePreReply, err error) |
|||
SharePreTradeByOrderNo(ctx context.Context, req *SharePreRequest, opts ...http.CallOption) (rsp *SharePreReply, err error) |
|||
UpdateShareAllStockId(ctx context.Context, req *ShareNullRequest, opts ...http.CallOption) (rsp *SharePreReply, err error) |
|||
UpdateShareTradeStockId(ctx context.Context, req *ShareTradeStockIdRequest, opts ...http.CallOption) (rsp *SharePreReply, err error) |
|||
} |
|||
|
|||
type OrderHTTPClientImpl struct { |
|||
cc *http.Client |
|||
} |
|||
|
|||
func NewOrderHTTPClient(client *http.Client) OrderHTTPClient { |
|||
return &OrderHTTPClientImpl{client} |
|||
} |
|||
|
|||
func (c *OrderHTTPClientImpl) ShareGiveaways(ctx context.Context, in *SharePreRequest, opts ...http.CallOption) (*SharePreReply, error) { |
|||
var out SharePreReply |
|||
pattern := "/order_sharepre/share_giveaways" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationOrderShareGiveaways)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *OrderHTTPClientImpl) SharePreTrade(ctx context.Context, in *SharePreRequest, opts ...http.CallOption) (*SharePreReply, error) { |
|||
var out SharePreReply |
|||
pattern := "/order_sharepre/share_pre_trade" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationOrderSharePreTrade)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *OrderHTTPClientImpl) SharePreTradeByOrderNo(ctx context.Context, in *SharePreRequest, opts ...http.CallOption) (*SharePreReply, error) { |
|||
var out SharePreReply |
|||
pattern := "/order_sharepre/share_pre_trade_by_order_no" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationOrderSharePreTradeByOrderNo)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *OrderHTTPClientImpl) UpdateShareAllStockId(ctx context.Context, in *ShareNullRequest, opts ...http.CallOption) (*SharePreReply, error) { |
|||
var out SharePreReply |
|||
pattern := "/order_sharepre/update_all_stock_id" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationOrderUpdateShareAllStockId)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *OrderHTTPClientImpl) UpdateShareTradeStockId(ctx context.Context, in *ShareTradeStockIdRequest, opts ...http.CallOption) (*SharePreReply, error) { |
|||
var out SharePreReply |
|||
pattern := "/order_sharepre/update_stock_id" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationOrderUpdateShareTradeStockId)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,144 @@ |
|||
syntax = "proto3"; |
|||
|
|||
package matchmaking.v1; |
|||
|
|||
import "google/api/annotations.proto"; |
|||
|
|||
option go_package = "matchmaking-system/api/matchmaking/v1;v1"; |
|||
|
|||
service ShareBrl { |
|||
// GetBotStockBrlTrade 巴西国股列表查询 |
|||
rpc GetBotStockBrlTrade(GetBrlBotStockTradeRequest)returns(GetBotStockBrlTradeReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharebrl/share_list", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareBrlPlaceOrder 巴西国股下单 |
|||
rpc ShareBrlPlaceOrder(ShareBrlOrderRequest)returns(BrlOrderReply) { |
|||
option (google.api.http) = { |
|||
post: "/order_sharebrl/share_place_order", |
|||
body: "*", |
|||
}; |
|||
} |
|||
// ShareBrlUpdateOrder 巴西国股设置止盈止损 |
|||
rpc ShareBrlUpdateOrder(UpdateBrlOrderRequest)returns(BrlOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharebrl/share_update_order", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareBrlPosition 巴西国股平仓 |
|||
rpc ShareBrlPosition(CancelBrlOrderRequest)returns(BrlOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharebrl/share_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareBrlAllPosition 巴西国股一键平仓 |
|||
rpc ShareBrlAllPosition(AllBrlOrderRequest)returns(AllBrlOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharebrl/share_all_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareBrlCancel 巴西国股撤单 |
|||
rpc ShareBrlCancel(CancelBrlOrderRequest)returns(BrlOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharebrl/share_cancel", |
|||
body:"*", |
|||
}; |
|||
} |
|||
} |
|||
|
|||
message GetBrlBotStockTradeRequest{ |
|||
int64 status =1;// 状态码 |
|||
int64 pageSize =2; // 每页显示条数 |
|||
int64 pageCount =3;// 开始的位置 |
|||
} |
|||
|
|||
message GetBotStockBrlTradeReply{ |
|||
int64 code =1;// 状态码 |
|||
BotStockBrlTradeReply data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message BotStockBrlTradeReply{ |
|||
int64 pageSize =1; // 每页显示条数 |
|||
int64 pageCount =2;// 开始的位置 |
|||
repeated BotStockBrlTrade data =3;// 返回结果 |
|||
int64 totalCount =4;// 总数据 |
|||
} |
|||
|
|||
message BotStockBrlTrade{ |
|||
string orderId =1;// 订单ID |
|||
string stockId =2;// 股票代码 |
|||
int64 tradeType =3;// 交易类型 |
|||
int64 dealType =4;// 交易方式 |
|||
string limitPrice =5;// 限价 |
|||
string marketPrice =6;// 市价 |
|||
string dealPrice =7;// 开仓价 |
|||
string closingPrice =8;// 平仓价 |
|||
string orderNumber =9;// 订单数量 |
|||
int64 stopType =10;// 止盈止损 |
|||
string stopLossPrice =11;// 止损 |
|||
string stopWinPrice =12;// 止盈 |
|||
string serviceCost =13;// 开仓手续费 |
|||
string marketMoney =14;// 订单金额 |
|||
string orderMoney =15;// 订单总金额 |
|||
int64 status =16;// 订单状态 |
|||
string createTime =17;// 订单创建时间 |
|||
string updateTime =18;// 订单更新时间 |
|||
string openTime =19;// 订单开仓时间 |
|||
string closingTime =20;// 订单平仓时间 |
|||
string closingCost =21;// 平仓手续费 |
|||
string faceValue =22;// 面值 |
|||
string pryNum =23;// 杠杆 |
|||
string keepDecimal =24;// 保留小数位 |
|||
string stockName =25;// 股票名称 |
|||
} |
|||
|
|||
message ShareBrlOrderRequest{ |
|||
string stockId =1;// 股票Code |
|||
int64 tradeType =2;// 交易类型:1买入,2卖出 |
|||
int64 dealType =3;// 委托方式:1限价,2市价 |
|||
string limitPrice =4;// 限价 |
|||
string marketPrice =5;// 市价 |
|||
string marketMoney =6;// 订单金额 |
|||
string orderNumber =7;// 订单数量 |
|||
string serviceCost =8;// 手续费 |
|||
int64 stopType =9;// 止损止盈设置:1无设置,2止损止盈 |
|||
string stopLossPrice =10;// 止损 |
|||
string stopWinPrice =11;// 止损 |
|||
string pryNum =12;// 杠杆 |
|||
} |
|||
|
|||
message UpdateBrlOrderRequest{ |
|||
string orderId =1;// 订单Id |
|||
int64 stopType =2;// 止盈止损 |
|||
string stopLossPrice =3;// 止损 |
|||
string stopWinPrice =4;// 止盈 |
|||
} |
|||
|
|||
message BrlOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
BrlOrderResult data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message BrlOrderResult { |
|||
string orderId =1;// 订单Id |
|||
} |
|||
|
|||
message CancelBrlOrderRequest{ |
|||
string orderId =1;// 订单ID |
|||
} |
|||
|
|||
message AllBrlOrderRequest{ |
|||
|
|||
} |
|||
message AllBrlOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
string data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
@ -0,0 +1,312 @@ |
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-grpc v1.4.0
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareBrl.proto
|
|||
|
|||
package v1 |
|||
|
|||
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.62.0 or later.
|
|||
const _ = grpc.SupportPackageIsVersion8 |
|||
|
|||
const ( |
|||
ShareBrl_GetBotStockBrlTrade_FullMethodName = "/matchmaking.v1.ShareBrl/GetBotStockBrlTrade" |
|||
ShareBrl_ShareBrlPlaceOrder_FullMethodName = "/matchmaking.v1.ShareBrl/ShareBrlPlaceOrder" |
|||
ShareBrl_ShareBrlUpdateOrder_FullMethodName = "/matchmaking.v1.ShareBrl/ShareBrlUpdateOrder" |
|||
ShareBrl_ShareBrlPosition_FullMethodName = "/matchmaking.v1.ShareBrl/ShareBrlPosition" |
|||
ShareBrl_ShareBrlAllPosition_FullMethodName = "/matchmaking.v1.ShareBrl/ShareBrlAllPosition" |
|||
ShareBrl_ShareBrlCancel_FullMethodName = "/matchmaking.v1.ShareBrl/ShareBrlCancel" |
|||
) |
|||
|
|||
// ShareBrlClient is the client API for ShareBrl 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 ShareBrlClient interface { |
|||
// GetBotStockBrlTrade 巴西国股列表查询
|
|||
GetBotStockBrlTrade(ctx context.Context, in *GetBrlBotStockTradeRequest, opts ...grpc.CallOption) (*GetBotStockBrlTradeReply, error) |
|||
// ShareBrlPlaceOrder 巴西国股下单
|
|||
ShareBrlPlaceOrder(ctx context.Context, in *ShareBrlOrderRequest, opts ...grpc.CallOption) (*BrlOrderReply, error) |
|||
// ShareBrlUpdateOrder 巴西国股设置止盈止损
|
|||
ShareBrlUpdateOrder(ctx context.Context, in *UpdateBrlOrderRequest, opts ...grpc.CallOption) (*BrlOrderReply, error) |
|||
// ShareBrlPosition 巴西国股平仓
|
|||
ShareBrlPosition(ctx context.Context, in *CancelBrlOrderRequest, opts ...grpc.CallOption) (*BrlOrderReply, error) |
|||
// ShareBrlAllPosition 巴西国股一键平仓
|
|||
ShareBrlAllPosition(ctx context.Context, in *AllBrlOrderRequest, opts ...grpc.CallOption) (*AllBrlOrderReply, error) |
|||
// ShareBrlCancel 巴西国股撤单
|
|||
ShareBrlCancel(ctx context.Context, in *CancelBrlOrderRequest, opts ...grpc.CallOption) (*BrlOrderReply, error) |
|||
} |
|||
|
|||
type shareBrlClient struct { |
|||
cc grpc.ClientConnInterface |
|||
} |
|||
|
|||
func NewShareBrlClient(cc grpc.ClientConnInterface) ShareBrlClient { |
|||
return &shareBrlClient{cc} |
|||
} |
|||
|
|||
func (c *shareBrlClient) GetBotStockBrlTrade(ctx context.Context, in *GetBrlBotStockTradeRequest, opts ...grpc.CallOption) (*GetBotStockBrlTradeReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(GetBotStockBrlTradeReply) |
|||
err := c.cc.Invoke(ctx, ShareBrl_GetBotStockBrlTrade_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareBrlClient) ShareBrlPlaceOrder(ctx context.Context, in *ShareBrlOrderRequest, opts ...grpc.CallOption) (*BrlOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(BrlOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareBrl_ShareBrlPlaceOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareBrlClient) ShareBrlUpdateOrder(ctx context.Context, in *UpdateBrlOrderRequest, opts ...grpc.CallOption) (*BrlOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(BrlOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareBrl_ShareBrlUpdateOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareBrlClient) ShareBrlPosition(ctx context.Context, in *CancelBrlOrderRequest, opts ...grpc.CallOption) (*BrlOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(BrlOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareBrl_ShareBrlPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareBrlClient) ShareBrlAllPosition(ctx context.Context, in *AllBrlOrderRequest, opts ...grpc.CallOption) (*AllBrlOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(AllBrlOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareBrl_ShareBrlAllPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareBrlClient) ShareBrlCancel(ctx context.Context, in *CancelBrlOrderRequest, opts ...grpc.CallOption) (*BrlOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(BrlOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareBrl_ShareBrlCancel_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
// ShareBrlServer is the server API for ShareBrl service.
|
|||
// All implementations must embed UnimplementedShareBrlServer
|
|||
// for forward compatibility
|
|||
type ShareBrlServer interface { |
|||
// GetBotStockBrlTrade 巴西国股列表查询
|
|||
GetBotStockBrlTrade(context.Context, *GetBrlBotStockTradeRequest) (*GetBotStockBrlTradeReply, error) |
|||
// ShareBrlPlaceOrder 巴西国股下单
|
|||
ShareBrlPlaceOrder(context.Context, *ShareBrlOrderRequest) (*BrlOrderReply, error) |
|||
// ShareBrlUpdateOrder 巴西国股设置止盈止损
|
|||
ShareBrlUpdateOrder(context.Context, *UpdateBrlOrderRequest) (*BrlOrderReply, error) |
|||
// ShareBrlPosition 巴西国股平仓
|
|||
ShareBrlPosition(context.Context, *CancelBrlOrderRequest) (*BrlOrderReply, error) |
|||
// ShareBrlAllPosition 巴西国股一键平仓
|
|||
ShareBrlAllPosition(context.Context, *AllBrlOrderRequest) (*AllBrlOrderReply, error) |
|||
// ShareBrlCancel 巴西国股撤单
|
|||
ShareBrlCancel(context.Context, *CancelBrlOrderRequest) (*BrlOrderReply, error) |
|||
mustEmbedUnimplementedShareBrlServer() |
|||
} |
|||
|
|||
// UnimplementedShareBrlServer must be embedded to have forward compatible implementations.
|
|||
type UnimplementedShareBrlServer struct { |
|||
} |
|||
|
|||
func (UnimplementedShareBrlServer) GetBotStockBrlTrade(context.Context, *GetBrlBotStockTradeRequest) (*GetBotStockBrlTradeReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method GetBotStockBrlTrade not implemented") |
|||
} |
|||
func (UnimplementedShareBrlServer) ShareBrlPlaceOrder(context.Context, *ShareBrlOrderRequest) (*BrlOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareBrlPlaceOrder not implemented") |
|||
} |
|||
func (UnimplementedShareBrlServer) ShareBrlUpdateOrder(context.Context, *UpdateBrlOrderRequest) (*BrlOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareBrlUpdateOrder not implemented") |
|||
} |
|||
func (UnimplementedShareBrlServer) ShareBrlPosition(context.Context, *CancelBrlOrderRequest) (*BrlOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareBrlPosition not implemented") |
|||
} |
|||
func (UnimplementedShareBrlServer) ShareBrlAllPosition(context.Context, *AllBrlOrderRequest) (*AllBrlOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareBrlAllPosition not implemented") |
|||
} |
|||
func (UnimplementedShareBrlServer) ShareBrlCancel(context.Context, *CancelBrlOrderRequest) (*BrlOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareBrlCancel not implemented") |
|||
} |
|||
func (UnimplementedShareBrlServer) mustEmbedUnimplementedShareBrlServer() {} |
|||
|
|||
// UnsafeShareBrlServer may be embedded to opt out of forward compatibility for this service.
|
|||
// Use of this interface is not recommended, as added methods to ShareBrlServer will
|
|||
// result in compilation errors.
|
|||
type UnsafeShareBrlServer interface { |
|||
mustEmbedUnimplementedShareBrlServer() |
|||
} |
|||
|
|||
func RegisterShareBrlServer(s grpc.ServiceRegistrar, srv ShareBrlServer) { |
|||
s.RegisterService(&ShareBrl_ServiceDesc, srv) |
|||
} |
|||
|
|||
func _ShareBrl_GetBotStockBrlTrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(GetBrlBotStockTradeRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareBrlServer).GetBotStockBrlTrade(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareBrl_GetBotStockBrlTrade_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareBrlServer).GetBotStockBrlTrade(ctx, req.(*GetBrlBotStockTradeRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareBrl_ShareBrlPlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(ShareBrlOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareBrlServer).ShareBrlPlaceOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareBrl_ShareBrlPlaceOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareBrlServer).ShareBrlPlaceOrder(ctx, req.(*ShareBrlOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareBrl_ShareBrlUpdateOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(UpdateBrlOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareBrlServer).ShareBrlUpdateOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareBrl_ShareBrlUpdateOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareBrlServer).ShareBrlUpdateOrder(ctx, req.(*UpdateBrlOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareBrl_ShareBrlPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelBrlOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareBrlServer).ShareBrlPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareBrl_ShareBrlPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareBrlServer).ShareBrlPosition(ctx, req.(*CancelBrlOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareBrl_ShareBrlAllPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(AllBrlOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareBrlServer).ShareBrlAllPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareBrl_ShareBrlAllPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareBrlServer).ShareBrlAllPosition(ctx, req.(*AllBrlOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareBrl_ShareBrlCancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelBrlOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareBrlServer).ShareBrlCancel(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareBrl_ShareBrlCancel_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareBrlServer).ShareBrlCancel(ctx, req.(*CancelBrlOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
// ShareBrl_ServiceDesc is the grpc.ServiceDesc for ShareBrl service.
|
|||
// It's only intended for direct use with grpc.RegisterService,
|
|||
// and not to be introspected or modified (even as a copy)
|
|||
var ShareBrl_ServiceDesc = grpc.ServiceDesc{ |
|||
ServiceName: "matchmaking.v1.ShareBrl", |
|||
HandlerType: (*ShareBrlServer)(nil), |
|||
Methods: []grpc.MethodDesc{ |
|||
{ |
|||
MethodName: "GetBotStockBrlTrade", |
|||
Handler: _ShareBrl_GetBotStockBrlTrade_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareBrlPlaceOrder", |
|||
Handler: _ShareBrl_ShareBrlPlaceOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareBrlUpdateOrder", |
|||
Handler: _ShareBrl_ShareBrlUpdateOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareBrlPosition", |
|||
Handler: _ShareBrl_ShareBrlPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareBrlAllPosition", |
|||
Handler: _ShareBrl_ShareBrlAllPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareBrlCancel", |
|||
Handler: _ShareBrl_ShareBrlCancel_Handler, |
|||
}, |
|||
}, |
|||
Streams: []grpc.StreamDesc{}, |
|||
Metadata: "matchmaking/v1/share/shareBrl.proto", |
|||
} |
@ -0,0 +1,279 @@ |
|||
// Code generated by protoc-gen-go-http. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-http v2.7.3
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareBrl.proto
|
|||
|
|||
package v1 |
|||
|
|||
import ( |
|||
context "context" |
|||
http "github.com/go-kratos/kratos/v2/transport/http" |
|||
binding "github.com/go-kratos/kratos/v2/transport/http/binding" |
|||
) |
|||
|
|||
// This is a compile-time assertion to ensure that this generated file
|
|||
// is compatible with the kratos package it is being compiled against.
|
|||
var _ = new(context.Context) |
|||
var _ = binding.EncodeURL |
|||
|
|||
const _ = http.SupportPackageIsVersion1 |
|||
|
|||
const OperationShareBrlGetBotStockBrlTrade = "/matchmaking.v1.ShareBrl/GetBotStockBrlTrade" |
|||
const OperationShareBrlShareBrlAllPosition = "/matchmaking.v1.ShareBrl/ShareBrlAllPosition" |
|||
const OperationShareBrlShareBrlCancel = "/matchmaking.v1.ShareBrl/ShareBrlCancel" |
|||
const OperationShareBrlShareBrlPlaceOrder = "/matchmaking.v1.ShareBrl/ShareBrlPlaceOrder" |
|||
const OperationShareBrlShareBrlPosition = "/matchmaking.v1.ShareBrl/ShareBrlPosition" |
|||
const OperationShareBrlShareBrlUpdateOrder = "/matchmaking.v1.ShareBrl/ShareBrlUpdateOrder" |
|||
|
|||
type ShareBrlHTTPServer interface { |
|||
// GetBotStockBrlTrade GetBotStockBrlTrade 巴西国股列表查询
|
|||
GetBotStockBrlTrade(context.Context, *GetBrlBotStockTradeRequest) (*GetBotStockBrlTradeReply, error) |
|||
// ShareBrlAllPosition ShareBrlAllPosition 巴西国股一键平仓
|
|||
ShareBrlAllPosition(context.Context, *AllBrlOrderRequest) (*AllBrlOrderReply, error) |
|||
// ShareBrlCancel ShareBrlCancel 巴西国股撤单
|
|||
ShareBrlCancel(context.Context, *CancelBrlOrderRequest) (*BrlOrderReply, error) |
|||
// ShareBrlPlaceOrder ShareBrlPlaceOrder 巴西国股下单
|
|||
ShareBrlPlaceOrder(context.Context, *ShareBrlOrderRequest) (*BrlOrderReply, error) |
|||
// ShareBrlPosition ShareBrlPosition 巴西国股平仓
|
|||
ShareBrlPosition(context.Context, *CancelBrlOrderRequest) (*BrlOrderReply, error) |
|||
// ShareBrlUpdateOrder ShareBrlUpdateOrder 巴西国股设置止盈止损
|
|||
ShareBrlUpdateOrder(context.Context, *UpdateBrlOrderRequest) (*BrlOrderReply, error) |
|||
} |
|||
|
|||
func RegisterShareBrlHTTPServer(s *http.Server, srv ShareBrlHTTPServer) { |
|||
r := s.Route("/") |
|||
r.POST("/order_sharebrl/share_list", _ShareBrl_GetBotStockBrlTrade0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharebrl/share_place_order", _ShareBrl_ShareBrlPlaceOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharebrl/share_update_order", _ShareBrl_ShareBrlUpdateOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharebrl/share_position", _ShareBrl_ShareBrlPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharebrl/share_all_position", _ShareBrl_ShareBrlAllPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharebrl/share_cancel", _ShareBrl_ShareBrlCancel0_HTTP_Handler(srv)) |
|||
} |
|||
|
|||
func _ShareBrl_GetBotStockBrlTrade0_HTTP_Handler(srv ShareBrlHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in GetBrlBotStockTradeRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareBrlGetBotStockBrlTrade) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.GetBotStockBrlTrade(ctx, req.(*GetBrlBotStockTradeRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*GetBotStockBrlTradeReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareBrl_ShareBrlPlaceOrder0_HTTP_Handler(srv ShareBrlHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in ShareBrlOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareBrlShareBrlPlaceOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareBrlPlaceOrder(ctx, req.(*ShareBrlOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*BrlOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareBrl_ShareBrlUpdateOrder0_HTTP_Handler(srv ShareBrlHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in UpdateBrlOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareBrlShareBrlUpdateOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareBrlUpdateOrder(ctx, req.(*UpdateBrlOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*BrlOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareBrl_ShareBrlPosition0_HTTP_Handler(srv ShareBrlHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelBrlOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareBrlShareBrlPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareBrlPosition(ctx, req.(*CancelBrlOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*BrlOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareBrl_ShareBrlAllPosition0_HTTP_Handler(srv ShareBrlHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in AllBrlOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareBrlShareBrlAllPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareBrlAllPosition(ctx, req.(*AllBrlOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*AllBrlOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareBrl_ShareBrlCancel0_HTTP_Handler(srv ShareBrlHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelBrlOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareBrlShareBrlCancel) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareBrlCancel(ctx, req.(*CancelBrlOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*BrlOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
type ShareBrlHTTPClient interface { |
|||
GetBotStockBrlTrade(ctx context.Context, req *GetBrlBotStockTradeRequest, opts ...http.CallOption) (rsp *GetBotStockBrlTradeReply, err error) |
|||
ShareBrlAllPosition(ctx context.Context, req *AllBrlOrderRequest, opts ...http.CallOption) (rsp *AllBrlOrderReply, err error) |
|||
ShareBrlCancel(ctx context.Context, req *CancelBrlOrderRequest, opts ...http.CallOption) (rsp *BrlOrderReply, err error) |
|||
ShareBrlPlaceOrder(ctx context.Context, req *ShareBrlOrderRequest, opts ...http.CallOption) (rsp *BrlOrderReply, err error) |
|||
ShareBrlPosition(ctx context.Context, req *CancelBrlOrderRequest, opts ...http.CallOption) (rsp *BrlOrderReply, err error) |
|||
ShareBrlUpdateOrder(ctx context.Context, req *UpdateBrlOrderRequest, opts ...http.CallOption) (rsp *BrlOrderReply, err error) |
|||
} |
|||
|
|||
type ShareBrlHTTPClientImpl struct { |
|||
cc *http.Client |
|||
} |
|||
|
|||
func NewShareBrlHTTPClient(client *http.Client) ShareBrlHTTPClient { |
|||
return &ShareBrlHTTPClientImpl{client} |
|||
} |
|||
|
|||
func (c *ShareBrlHTTPClientImpl) GetBotStockBrlTrade(ctx context.Context, in *GetBrlBotStockTradeRequest, opts ...http.CallOption) (*GetBotStockBrlTradeReply, error) { |
|||
var out GetBotStockBrlTradeReply |
|||
pattern := "/order_sharebrl/share_list" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareBrlGetBotStockBrlTrade)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareBrlHTTPClientImpl) ShareBrlAllPosition(ctx context.Context, in *AllBrlOrderRequest, opts ...http.CallOption) (*AllBrlOrderReply, error) { |
|||
var out AllBrlOrderReply |
|||
pattern := "/order_sharebrl/share_all_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareBrlShareBrlAllPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareBrlHTTPClientImpl) ShareBrlCancel(ctx context.Context, in *CancelBrlOrderRequest, opts ...http.CallOption) (*BrlOrderReply, error) { |
|||
var out BrlOrderReply |
|||
pattern := "/order_sharebrl/share_cancel" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareBrlShareBrlCancel)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareBrlHTTPClientImpl) ShareBrlPlaceOrder(ctx context.Context, in *ShareBrlOrderRequest, opts ...http.CallOption) (*BrlOrderReply, error) { |
|||
var out BrlOrderReply |
|||
pattern := "/order_sharebrl/share_place_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareBrlShareBrlPlaceOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareBrlHTTPClientImpl) ShareBrlPosition(ctx context.Context, in *CancelBrlOrderRequest, opts ...http.CallOption) (*BrlOrderReply, error) { |
|||
var out BrlOrderReply |
|||
pattern := "/order_sharebrl/share_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareBrlShareBrlPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareBrlHTTPClientImpl) ShareBrlUpdateOrder(ctx context.Context, in *UpdateBrlOrderRequest, opts ...http.CallOption) (*BrlOrderReply, error) { |
|||
var out BrlOrderReply |
|||
pattern := "/order_sharebrl/share_update_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareBrlShareBrlUpdateOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,144 @@ |
|||
syntax = "proto3"; |
|||
|
|||
package matchmaking.v1; |
|||
|
|||
import "google/api/annotations.proto"; |
|||
|
|||
option go_package = "matchmaking-system/api/matchmaking/v1;v1"; |
|||
|
|||
service ShareEur { |
|||
// GetBotStockEurTrade 德国股列表查询 |
|||
rpc GetBotStockEurTrade(GetEurBotStockTradeRequest)returns(GetBotStockEurTradeReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareeur/share_list", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareEurPlaceOrder 德国股下单 |
|||
rpc ShareEurPlaceOrder(ShareEurOrderRequest)returns(EurOrderReply) { |
|||
option (google.api.http) = { |
|||
post: "/order_shareeur/share_place_order", |
|||
body: "*", |
|||
}; |
|||
} |
|||
// ShareEurUpdateOrder 德国股设置止盈止损 |
|||
rpc ShareEurUpdateOrder(UpdateEurOrderRequest)returns(EurOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareeur/share_update_order", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareEurPosition 德国股平仓 |
|||
rpc ShareEurPosition(CancelEurOrderRequest)returns(EurOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareeur/share_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareEurAllPosition 德国股一键平仓 |
|||
rpc ShareEurAllPosition(AllEurOrderRequest)returns(AllEurOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareeur/share_all_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareEurCancel 德国股撤单 |
|||
rpc ShareEurCancel(CancelEurOrderRequest)returns(EurOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareeur/share_cancel", |
|||
body:"*", |
|||
}; |
|||
} |
|||
} |
|||
|
|||
message GetEurBotStockTradeRequest{ |
|||
int64 status =1;// 状态码 |
|||
int64 pageSize =2; // 每页显示条数 |
|||
int64 pageCount =3;// 开始的位置 |
|||
} |
|||
|
|||
message GetBotStockEurTradeReply{ |
|||
int64 code =1;// 状态码 |
|||
BotStockEurTradeReply data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message BotStockEurTradeReply{ |
|||
int64 pageSize =1; // 每页显示条数 |
|||
int64 pageCount =2;// 开始的位置 |
|||
repeated BotStockEurTrade data =3;// 返回结果 |
|||
int64 totalCount =4;// 总数据 |
|||
} |
|||
|
|||
message BotStockEurTrade{ |
|||
string orderId =1;// 订单ID |
|||
string stockId =2;// 股票代码 |
|||
int64 tradeType =3;// 交易类型 |
|||
int64 dealType =4;// 交易方式 |
|||
string limitPrice =5;// 限价 |
|||
string marketPrice =6;// 市价 |
|||
string dealPrice =7;// 开仓价 |
|||
string closingPrice =8;// 平仓价 |
|||
string orderNumber =9;// 订单数量 |
|||
int64 stopType =10;// 止盈止损 |
|||
string stopLossPrice =11;// 止损 |
|||
string stopWinPrice =12;// 止盈 |
|||
string serviceCost =13;// 开仓手续费 |
|||
string marketMoney =14;// 订单金额 |
|||
string orderMoney =15;// 订单总金额 |
|||
int64 status =16;// 订单状态 |
|||
string createTime =17;// 订单创建时间 |
|||
string updateTime =18;// 订单更新时间 |
|||
string openTime =19;// 订单开仓时间 |
|||
string closingTime =20;// 订单平仓时间 |
|||
string closingCost =21;// 平仓手续费 |
|||
string faceValue =22;// 面值 |
|||
string pryNum =23;// 杠杆 |
|||
string keepDecimal =24;// 保留小数位 |
|||
string stockName =25;// 股票名称 |
|||
} |
|||
|
|||
message ShareEurOrderRequest{ |
|||
string stockId =1;// 股票Code |
|||
int64 tradeType =2;// 交易类型:1买入,2卖出 |
|||
int64 dealType =3;// 委托方式:1限价,2市价 |
|||
string limitPrice =4;// 限价 |
|||
string marketPrice =5;// 市价 |
|||
string marketMoney =6;// 订单金额 |
|||
string orderNumber =7;// 订单数量 |
|||
string serviceCost =8;// 手续费 |
|||
int64 stopType =9;// 止损止盈设置:1无设置,2止损止盈 |
|||
string stopLossPrice =10;// 止损 |
|||
string stopWinPrice =11;// 止损 |
|||
string pryNum =12;// 杠杆 |
|||
} |
|||
|
|||
message UpdateEurOrderRequest{ |
|||
string orderId =1;// 订单Id |
|||
int64 stopType =2;// 止盈止损 |
|||
string stopLossPrice =3;// 止损 |
|||
string stopWinPrice =4;// 止盈 |
|||
} |
|||
|
|||
message EurOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
EurOrderResult data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message EurOrderResult { |
|||
string orderId =1;// 订单Id |
|||
} |
|||
|
|||
message CancelEurOrderRequest{ |
|||
string orderId =1;// 订单ID |
|||
} |
|||
|
|||
message AllEurOrderRequest{ |
|||
|
|||
} |
|||
message AllEurOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
string data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
@ -0,0 +1,312 @@ |
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-grpc v1.4.0
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareEur.proto
|
|||
|
|||
package v1 |
|||
|
|||
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.62.0 or later.
|
|||
const _ = grpc.SupportPackageIsVersion8 |
|||
|
|||
const ( |
|||
ShareEur_GetBotStockEurTrade_FullMethodName = "/matchmaking.v1.ShareEur/GetBotStockEurTrade" |
|||
ShareEur_ShareEurPlaceOrder_FullMethodName = "/matchmaking.v1.ShareEur/ShareEurPlaceOrder" |
|||
ShareEur_ShareEurUpdateOrder_FullMethodName = "/matchmaking.v1.ShareEur/ShareEurUpdateOrder" |
|||
ShareEur_ShareEurPosition_FullMethodName = "/matchmaking.v1.ShareEur/ShareEurPosition" |
|||
ShareEur_ShareEurAllPosition_FullMethodName = "/matchmaking.v1.ShareEur/ShareEurAllPosition" |
|||
ShareEur_ShareEurCancel_FullMethodName = "/matchmaking.v1.ShareEur/ShareEurCancel" |
|||
) |
|||
|
|||
// ShareEurClient is the client API for ShareEur 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 ShareEurClient interface { |
|||
// GetBotStockEurTrade 德国股列表查询
|
|||
GetBotStockEurTrade(ctx context.Context, in *GetEurBotStockTradeRequest, opts ...grpc.CallOption) (*GetBotStockEurTradeReply, error) |
|||
// ShareEurPlaceOrder 德国股下单
|
|||
ShareEurPlaceOrder(ctx context.Context, in *ShareEurOrderRequest, opts ...grpc.CallOption) (*EurOrderReply, error) |
|||
// ShareEurUpdateOrder 德国股设置止盈止损
|
|||
ShareEurUpdateOrder(ctx context.Context, in *UpdateEurOrderRequest, opts ...grpc.CallOption) (*EurOrderReply, error) |
|||
// ShareEurPosition 德国股平仓
|
|||
ShareEurPosition(ctx context.Context, in *CancelEurOrderRequest, opts ...grpc.CallOption) (*EurOrderReply, error) |
|||
// ShareEurAllPosition 德国股一键平仓
|
|||
ShareEurAllPosition(ctx context.Context, in *AllEurOrderRequest, opts ...grpc.CallOption) (*AllEurOrderReply, error) |
|||
// ShareEurCancel 德国股撤单
|
|||
ShareEurCancel(ctx context.Context, in *CancelEurOrderRequest, opts ...grpc.CallOption) (*EurOrderReply, error) |
|||
} |
|||
|
|||
type shareEurClient struct { |
|||
cc grpc.ClientConnInterface |
|||
} |
|||
|
|||
func NewShareEurClient(cc grpc.ClientConnInterface) ShareEurClient { |
|||
return &shareEurClient{cc} |
|||
} |
|||
|
|||
func (c *shareEurClient) GetBotStockEurTrade(ctx context.Context, in *GetEurBotStockTradeRequest, opts ...grpc.CallOption) (*GetBotStockEurTradeReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(GetBotStockEurTradeReply) |
|||
err := c.cc.Invoke(ctx, ShareEur_GetBotStockEurTrade_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareEurClient) ShareEurPlaceOrder(ctx context.Context, in *ShareEurOrderRequest, opts ...grpc.CallOption) (*EurOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(EurOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareEur_ShareEurPlaceOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareEurClient) ShareEurUpdateOrder(ctx context.Context, in *UpdateEurOrderRequest, opts ...grpc.CallOption) (*EurOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(EurOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareEur_ShareEurUpdateOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareEurClient) ShareEurPosition(ctx context.Context, in *CancelEurOrderRequest, opts ...grpc.CallOption) (*EurOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(EurOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareEur_ShareEurPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareEurClient) ShareEurAllPosition(ctx context.Context, in *AllEurOrderRequest, opts ...grpc.CallOption) (*AllEurOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(AllEurOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareEur_ShareEurAllPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareEurClient) ShareEurCancel(ctx context.Context, in *CancelEurOrderRequest, opts ...grpc.CallOption) (*EurOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(EurOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareEur_ShareEurCancel_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
// ShareEurServer is the server API for ShareEur service.
|
|||
// All implementations must embed UnimplementedShareEurServer
|
|||
// for forward compatibility
|
|||
type ShareEurServer interface { |
|||
// GetBotStockEurTrade 德国股列表查询
|
|||
GetBotStockEurTrade(context.Context, *GetEurBotStockTradeRequest) (*GetBotStockEurTradeReply, error) |
|||
// ShareEurPlaceOrder 德国股下单
|
|||
ShareEurPlaceOrder(context.Context, *ShareEurOrderRequest) (*EurOrderReply, error) |
|||
// ShareEurUpdateOrder 德国股设置止盈止损
|
|||
ShareEurUpdateOrder(context.Context, *UpdateEurOrderRequest) (*EurOrderReply, error) |
|||
// ShareEurPosition 德国股平仓
|
|||
ShareEurPosition(context.Context, *CancelEurOrderRequest) (*EurOrderReply, error) |
|||
// ShareEurAllPosition 德国股一键平仓
|
|||
ShareEurAllPosition(context.Context, *AllEurOrderRequest) (*AllEurOrderReply, error) |
|||
// ShareEurCancel 德国股撤单
|
|||
ShareEurCancel(context.Context, *CancelEurOrderRequest) (*EurOrderReply, error) |
|||
mustEmbedUnimplementedShareEurServer() |
|||
} |
|||
|
|||
// UnimplementedShareEurServer must be embedded to have forward compatible implementations.
|
|||
type UnimplementedShareEurServer struct { |
|||
} |
|||
|
|||
func (UnimplementedShareEurServer) GetBotStockEurTrade(context.Context, *GetEurBotStockTradeRequest) (*GetBotStockEurTradeReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method GetBotStockEurTrade not implemented") |
|||
} |
|||
func (UnimplementedShareEurServer) ShareEurPlaceOrder(context.Context, *ShareEurOrderRequest) (*EurOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareEurPlaceOrder not implemented") |
|||
} |
|||
func (UnimplementedShareEurServer) ShareEurUpdateOrder(context.Context, *UpdateEurOrderRequest) (*EurOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareEurUpdateOrder not implemented") |
|||
} |
|||
func (UnimplementedShareEurServer) ShareEurPosition(context.Context, *CancelEurOrderRequest) (*EurOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareEurPosition not implemented") |
|||
} |
|||
func (UnimplementedShareEurServer) ShareEurAllPosition(context.Context, *AllEurOrderRequest) (*AllEurOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareEurAllPosition not implemented") |
|||
} |
|||
func (UnimplementedShareEurServer) ShareEurCancel(context.Context, *CancelEurOrderRequest) (*EurOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareEurCancel not implemented") |
|||
} |
|||
func (UnimplementedShareEurServer) mustEmbedUnimplementedShareEurServer() {} |
|||
|
|||
// UnsafeShareEurServer may be embedded to opt out of forward compatibility for this service.
|
|||
// Use of this interface is not recommended, as added methods to ShareEurServer will
|
|||
// result in compilation errors.
|
|||
type UnsafeShareEurServer interface { |
|||
mustEmbedUnimplementedShareEurServer() |
|||
} |
|||
|
|||
func RegisterShareEurServer(s grpc.ServiceRegistrar, srv ShareEurServer) { |
|||
s.RegisterService(&ShareEur_ServiceDesc, srv) |
|||
} |
|||
|
|||
func _ShareEur_GetBotStockEurTrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(GetEurBotStockTradeRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareEurServer).GetBotStockEurTrade(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareEur_GetBotStockEurTrade_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareEurServer).GetBotStockEurTrade(ctx, req.(*GetEurBotStockTradeRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareEur_ShareEurPlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(ShareEurOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareEurServer).ShareEurPlaceOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareEur_ShareEurPlaceOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareEurServer).ShareEurPlaceOrder(ctx, req.(*ShareEurOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareEur_ShareEurUpdateOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(UpdateEurOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareEurServer).ShareEurUpdateOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareEur_ShareEurUpdateOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareEurServer).ShareEurUpdateOrder(ctx, req.(*UpdateEurOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareEur_ShareEurPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelEurOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareEurServer).ShareEurPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareEur_ShareEurPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareEurServer).ShareEurPosition(ctx, req.(*CancelEurOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareEur_ShareEurAllPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(AllEurOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareEurServer).ShareEurAllPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareEur_ShareEurAllPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareEurServer).ShareEurAllPosition(ctx, req.(*AllEurOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareEur_ShareEurCancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelEurOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareEurServer).ShareEurCancel(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareEur_ShareEurCancel_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareEurServer).ShareEurCancel(ctx, req.(*CancelEurOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
// ShareEur_ServiceDesc is the grpc.ServiceDesc for ShareEur service.
|
|||
// It's only intended for direct use with grpc.RegisterService,
|
|||
// and not to be introspected or modified (even as a copy)
|
|||
var ShareEur_ServiceDesc = grpc.ServiceDesc{ |
|||
ServiceName: "matchmaking.v1.ShareEur", |
|||
HandlerType: (*ShareEurServer)(nil), |
|||
Methods: []grpc.MethodDesc{ |
|||
{ |
|||
MethodName: "GetBotStockEurTrade", |
|||
Handler: _ShareEur_GetBotStockEurTrade_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareEurPlaceOrder", |
|||
Handler: _ShareEur_ShareEurPlaceOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareEurUpdateOrder", |
|||
Handler: _ShareEur_ShareEurUpdateOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareEurPosition", |
|||
Handler: _ShareEur_ShareEurPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareEurAllPosition", |
|||
Handler: _ShareEur_ShareEurAllPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareEurCancel", |
|||
Handler: _ShareEur_ShareEurCancel_Handler, |
|||
}, |
|||
}, |
|||
Streams: []grpc.StreamDesc{}, |
|||
Metadata: "matchmaking/v1/share/shareEur.proto", |
|||
} |
@ -0,0 +1,279 @@ |
|||
// Code generated by protoc-gen-go-http. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-http v2.7.3
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareEur.proto
|
|||
|
|||
package v1 |
|||
|
|||
import ( |
|||
context "context" |
|||
http "github.com/go-kratos/kratos/v2/transport/http" |
|||
binding "github.com/go-kratos/kratos/v2/transport/http/binding" |
|||
) |
|||
|
|||
// This is a compile-time assertion to ensure that this generated file
|
|||
// is compatible with the kratos package it is being compiled against.
|
|||
var _ = new(context.Context) |
|||
var _ = binding.EncodeURL |
|||
|
|||
const _ = http.SupportPackageIsVersion1 |
|||
|
|||
const OperationShareEurGetBotStockEurTrade = "/matchmaking.v1.ShareEur/GetBotStockEurTrade" |
|||
const OperationShareEurShareEurAllPosition = "/matchmaking.v1.ShareEur/ShareEurAllPosition" |
|||
const OperationShareEurShareEurCancel = "/matchmaking.v1.ShareEur/ShareEurCancel" |
|||
const OperationShareEurShareEurPlaceOrder = "/matchmaking.v1.ShareEur/ShareEurPlaceOrder" |
|||
const OperationShareEurShareEurPosition = "/matchmaking.v1.ShareEur/ShareEurPosition" |
|||
const OperationShareEurShareEurUpdateOrder = "/matchmaking.v1.ShareEur/ShareEurUpdateOrder" |
|||
|
|||
type ShareEurHTTPServer interface { |
|||
// GetBotStockEurTrade GetBotStockEurTrade 德国股列表查询
|
|||
GetBotStockEurTrade(context.Context, *GetEurBotStockTradeRequest) (*GetBotStockEurTradeReply, error) |
|||
// ShareEurAllPosition ShareEurAllPosition 德国股一键平仓
|
|||
ShareEurAllPosition(context.Context, *AllEurOrderRequest) (*AllEurOrderReply, error) |
|||
// ShareEurCancel ShareEurCancel 德国股撤单
|
|||
ShareEurCancel(context.Context, *CancelEurOrderRequest) (*EurOrderReply, error) |
|||
// ShareEurPlaceOrder ShareEurPlaceOrder 德国股下单
|
|||
ShareEurPlaceOrder(context.Context, *ShareEurOrderRequest) (*EurOrderReply, error) |
|||
// ShareEurPosition ShareEurPosition 德国股平仓
|
|||
ShareEurPosition(context.Context, *CancelEurOrderRequest) (*EurOrderReply, error) |
|||
// ShareEurUpdateOrder ShareEurUpdateOrder 德国股设置止盈止损
|
|||
ShareEurUpdateOrder(context.Context, *UpdateEurOrderRequest) (*EurOrderReply, error) |
|||
} |
|||
|
|||
func RegisterShareEurHTTPServer(s *http.Server, srv ShareEurHTTPServer) { |
|||
r := s.Route("/") |
|||
r.POST("/order_shareeur/share_list", _ShareEur_GetBotStockEurTrade0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareeur/share_place_order", _ShareEur_ShareEurPlaceOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareeur/share_update_order", _ShareEur_ShareEurUpdateOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareeur/share_position", _ShareEur_ShareEurPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareeur/share_all_position", _ShareEur_ShareEurAllPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareeur/share_cancel", _ShareEur_ShareEurCancel0_HTTP_Handler(srv)) |
|||
} |
|||
|
|||
func _ShareEur_GetBotStockEurTrade0_HTTP_Handler(srv ShareEurHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in GetEurBotStockTradeRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareEurGetBotStockEurTrade) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.GetBotStockEurTrade(ctx, req.(*GetEurBotStockTradeRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*GetBotStockEurTradeReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareEur_ShareEurPlaceOrder0_HTTP_Handler(srv ShareEurHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in ShareEurOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareEurShareEurPlaceOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareEurPlaceOrder(ctx, req.(*ShareEurOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*EurOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareEur_ShareEurUpdateOrder0_HTTP_Handler(srv ShareEurHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in UpdateEurOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareEurShareEurUpdateOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareEurUpdateOrder(ctx, req.(*UpdateEurOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*EurOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareEur_ShareEurPosition0_HTTP_Handler(srv ShareEurHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelEurOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareEurShareEurPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareEurPosition(ctx, req.(*CancelEurOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*EurOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareEur_ShareEurAllPosition0_HTTP_Handler(srv ShareEurHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in AllEurOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareEurShareEurAllPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareEurAllPosition(ctx, req.(*AllEurOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*AllEurOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareEur_ShareEurCancel0_HTTP_Handler(srv ShareEurHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelEurOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareEurShareEurCancel) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareEurCancel(ctx, req.(*CancelEurOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*EurOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
type ShareEurHTTPClient interface { |
|||
GetBotStockEurTrade(ctx context.Context, req *GetEurBotStockTradeRequest, opts ...http.CallOption) (rsp *GetBotStockEurTradeReply, err error) |
|||
ShareEurAllPosition(ctx context.Context, req *AllEurOrderRequest, opts ...http.CallOption) (rsp *AllEurOrderReply, err error) |
|||
ShareEurCancel(ctx context.Context, req *CancelEurOrderRequest, opts ...http.CallOption) (rsp *EurOrderReply, err error) |
|||
ShareEurPlaceOrder(ctx context.Context, req *ShareEurOrderRequest, opts ...http.CallOption) (rsp *EurOrderReply, err error) |
|||
ShareEurPosition(ctx context.Context, req *CancelEurOrderRequest, opts ...http.CallOption) (rsp *EurOrderReply, err error) |
|||
ShareEurUpdateOrder(ctx context.Context, req *UpdateEurOrderRequest, opts ...http.CallOption) (rsp *EurOrderReply, err error) |
|||
} |
|||
|
|||
type ShareEurHTTPClientImpl struct { |
|||
cc *http.Client |
|||
} |
|||
|
|||
func NewShareEurHTTPClient(client *http.Client) ShareEurHTTPClient { |
|||
return &ShareEurHTTPClientImpl{client} |
|||
} |
|||
|
|||
func (c *ShareEurHTTPClientImpl) GetBotStockEurTrade(ctx context.Context, in *GetEurBotStockTradeRequest, opts ...http.CallOption) (*GetBotStockEurTradeReply, error) { |
|||
var out GetBotStockEurTradeReply |
|||
pattern := "/order_shareeur/share_list" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareEurGetBotStockEurTrade)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareEurHTTPClientImpl) ShareEurAllPosition(ctx context.Context, in *AllEurOrderRequest, opts ...http.CallOption) (*AllEurOrderReply, error) { |
|||
var out AllEurOrderReply |
|||
pattern := "/order_shareeur/share_all_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareEurShareEurAllPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareEurHTTPClientImpl) ShareEurCancel(ctx context.Context, in *CancelEurOrderRequest, opts ...http.CallOption) (*EurOrderReply, error) { |
|||
var out EurOrderReply |
|||
pattern := "/order_shareeur/share_cancel" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareEurShareEurCancel)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareEurHTTPClientImpl) ShareEurPlaceOrder(ctx context.Context, in *ShareEurOrderRequest, opts ...http.CallOption) (*EurOrderReply, error) { |
|||
var out EurOrderReply |
|||
pattern := "/order_shareeur/share_place_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareEurShareEurPlaceOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareEurHTTPClientImpl) ShareEurPosition(ctx context.Context, in *CancelEurOrderRequest, opts ...http.CallOption) (*EurOrderReply, error) { |
|||
var out EurOrderReply |
|||
pattern := "/order_shareeur/share_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareEurShareEurPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareEurHTTPClientImpl) ShareEurUpdateOrder(ctx context.Context, in *UpdateEurOrderRequest, opts ...http.CallOption) (*EurOrderReply, error) { |
|||
var out EurOrderReply |
|||
pattern := "/order_shareeur/share_update_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareEurShareEurUpdateOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,144 @@ |
|||
syntax = "proto3"; |
|||
|
|||
package matchmaking.v1; |
|||
|
|||
import "google/api/annotations.proto"; |
|||
|
|||
option go_package = "matchmaking-system/api/matchmaking/v1;v1"; |
|||
|
|||
service ShareFur { |
|||
// GetBotStockFurTrade 法国股列表查询 |
|||
rpc GetBotStockFurTrade(GetFurBotStockTradeRequest)returns(GetBotStockFurTradeReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharefur/share_list", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareFurPlaceOrder 法国股下单 |
|||
rpc ShareFurPlaceOrder(ShareFurOrderRequest)returns(FurOrderReply) { |
|||
option (google.api.http) = { |
|||
post: "/order_sharefur/share_place_order", |
|||
body: "*", |
|||
}; |
|||
} |
|||
// ShareFurUpdateOrder 法国股设置止盈止损 |
|||
rpc ShareFurUpdateOrder(UpdateFurOrderRequest)returns(FurOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharefur/share_update_order", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareFurPosition 法国股平仓 |
|||
rpc ShareFurPosition(CancelFurOrderRequest)returns(FurOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharefur/share_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareFurAllPosition 法国股一键平仓 |
|||
rpc ShareFurAllPosition(AllFurOrderRequest)returns(AllFurOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharefur/share_all_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareFurCancel 法国股撤单 |
|||
rpc ShareFurCancel(CancelFurOrderRequest)returns(FurOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharefur/share_cancel", |
|||
body:"*", |
|||
}; |
|||
} |
|||
} |
|||
|
|||
message GetFurBotStockTradeRequest{ |
|||
int64 status =1;// 状态码 |
|||
int64 pageSize =2; // 每页显示条数 |
|||
int64 pageCount =3;// 开始的位置 |
|||
} |
|||
|
|||
message GetBotStockFurTradeReply{ |
|||
int64 code =1;// 状态码 |
|||
BotStockFurTradeReply data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message BotStockFurTradeReply{ |
|||
int64 pageSize =1; // 每页显示条数 |
|||
int64 pageCount =2;// 开始的位置 |
|||
repeated BotStockFurTrade data =3;// 返回结果 |
|||
int64 totalCount =4;// 总数据 |
|||
} |
|||
|
|||
message BotStockFurTrade{ |
|||
string orderId =1;// 订单ID |
|||
string stockId =2;// 股票代码 |
|||
int64 tradeType =3;// 交易类型 |
|||
int64 dealType =4;// 交易方式 |
|||
string limitPrice =5;// 限价 |
|||
string marketPrice =6;// 市价 |
|||
string dealPrice =7;// 开仓价 |
|||
string closingPrice =8;// 平仓价 |
|||
string orderNumber =9;// 订单数量 |
|||
int64 stopType =10;// 止盈止损 |
|||
string stopLossPrice =11;// 止损 |
|||
string stopWinPrice =12;// 止盈 |
|||
string serviceCost =13;// 开仓手续费 |
|||
string marketMoney =14;// 订单金额 |
|||
string orderMoney =15;// 订单总金额 |
|||
int64 status =16;// 订单状态 |
|||
string createTime =17;// 订单创建时间 |
|||
string updateTime =18;// 订单更新时间 |
|||
string openTime =19;// 订单开仓时间 |
|||
string closingTime =20;// 订单平仓时间 |
|||
string closingCost =21;// 平仓手续费 |
|||
string faceValue =22;// 面值 |
|||
string pryNum =23;// 杠杆 |
|||
string keepDecimal =24;// 保留小数位 |
|||
string stockName =25;// 股票名称 |
|||
} |
|||
|
|||
message ShareFurOrderRequest{ |
|||
string stockId =1;// 股票Code |
|||
int64 tradeType =2;// 交易类型:1买入,2卖出 |
|||
int64 dealType =3;// 委托方式:1限价,2市价 |
|||
string limitPrice =4;// 限价 |
|||
string marketPrice =5;// 市价 |
|||
string marketMoney =6;// 订单金额 |
|||
string orderNumber =7;// 订单数量 |
|||
string serviceCost =8;// 手续费 |
|||
int64 stopType =9;// 止损止盈设置:1无设置,2止损止盈 |
|||
string stopLossPrice =10;// 止损 |
|||
string stopWinPrice =11;// 止损 |
|||
string pryNum =12;// 杠杆 |
|||
} |
|||
|
|||
message UpdateFurOrderRequest{ |
|||
string orderId =1;// 订单Id |
|||
int64 stopType =2;// 止盈止损 |
|||
string stopLossPrice =3;// 止损 |
|||
string stopWinPrice =4;// 止盈 |
|||
} |
|||
|
|||
message FurOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
FurOrderResult data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message FurOrderResult { |
|||
string orderId =1;// 订单Id |
|||
} |
|||
|
|||
message CancelFurOrderRequest{ |
|||
string orderId =1;// 订单ID |
|||
} |
|||
|
|||
message AllFurOrderRequest{ |
|||
|
|||
} |
|||
message AllFurOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
string data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
@ -0,0 +1,312 @@ |
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-grpc v1.4.0
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareFur.proto
|
|||
|
|||
package v1 |
|||
|
|||
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.62.0 or later.
|
|||
const _ = grpc.SupportPackageIsVersion8 |
|||
|
|||
const ( |
|||
ShareFur_GetBotStockFurTrade_FullMethodName = "/matchmaking.v1.ShareFur/GetBotStockFurTrade" |
|||
ShareFur_ShareFurPlaceOrder_FullMethodName = "/matchmaking.v1.ShareFur/ShareFurPlaceOrder" |
|||
ShareFur_ShareFurUpdateOrder_FullMethodName = "/matchmaking.v1.ShareFur/ShareFurUpdateOrder" |
|||
ShareFur_ShareFurPosition_FullMethodName = "/matchmaking.v1.ShareFur/ShareFurPosition" |
|||
ShareFur_ShareFurAllPosition_FullMethodName = "/matchmaking.v1.ShareFur/ShareFurAllPosition" |
|||
ShareFur_ShareFurCancel_FullMethodName = "/matchmaking.v1.ShareFur/ShareFurCancel" |
|||
) |
|||
|
|||
// ShareFurClient is the client API for ShareFur 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 ShareFurClient interface { |
|||
// GetBotStockFurTrade 法国股列表查询
|
|||
GetBotStockFurTrade(ctx context.Context, in *GetFurBotStockTradeRequest, opts ...grpc.CallOption) (*GetBotStockFurTradeReply, error) |
|||
// ShareFurPlaceOrder 法国股下单
|
|||
ShareFurPlaceOrder(ctx context.Context, in *ShareFurOrderRequest, opts ...grpc.CallOption) (*FurOrderReply, error) |
|||
// ShareFurUpdateOrder 法国股设置止盈止损
|
|||
ShareFurUpdateOrder(ctx context.Context, in *UpdateFurOrderRequest, opts ...grpc.CallOption) (*FurOrderReply, error) |
|||
// ShareFurPosition 法国股平仓
|
|||
ShareFurPosition(ctx context.Context, in *CancelFurOrderRequest, opts ...grpc.CallOption) (*FurOrderReply, error) |
|||
// ShareFurAllPosition 法国股一键平仓
|
|||
ShareFurAllPosition(ctx context.Context, in *AllFurOrderRequest, opts ...grpc.CallOption) (*AllFurOrderReply, error) |
|||
// ShareFurCancel 法国股撤单
|
|||
ShareFurCancel(ctx context.Context, in *CancelFurOrderRequest, opts ...grpc.CallOption) (*FurOrderReply, error) |
|||
} |
|||
|
|||
type shareFurClient struct { |
|||
cc grpc.ClientConnInterface |
|||
} |
|||
|
|||
func NewShareFurClient(cc grpc.ClientConnInterface) ShareFurClient { |
|||
return &shareFurClient{cc} |
|||
} |
|||
|
|||
func (c *shareFurClient) GetBotStockFurTrade(ctx context.Context, in *GetFurBotStockTradeRequest, opts ...grpc.CallOption) (*GetBotStockFurTradeReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(GetBotStockFurTradeReply) |
|||
err := c.cc.Invoke(ctx, ShareFur_GetBotStockFurTrade_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareFurClient) ShareFurPlaceOrder(ctx context.Context, in *ShareFurOrderRequest, opts ...grpc.CallOption) (*FurOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(FurOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareFur_ShareFurPlaceOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareFurClient) ShareFurUpdateOrder(ctx context.Context, in *UpdateFurOrderRequest, opts ...grpc.CallOption) (*FurOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(FurOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareFur_ShareFurUpdateOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareFurClient) ShareFurPosition(ctx context.Context, in *CancelFurOrderRequest, opts ...grpc.CallOption) (*FurOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(FurOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareFur_ShareFurPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareFurClient) ShareFurAllPosition(ctx context.Context, in *AllFurOrderRequest, opts ...grpc.CallOption) (*AllFurOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(AllFurOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareFur_ShareFurAllPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareFurClient) ShareFurCancel(ctx context.Context, in *CancelFurOrderRequest, opts ...grpc.CallOption) (*FurOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(FurOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareFur_ShareFurCancel_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
// ShareFurServer is the server API for ShareFur service.
|
|||
// All implementations must embed UnimplementedShareFurServer
|
|||
// for forward compatibility
|
|||
type ShareFurServer interface { |
|||
// GetBotStockFurTrade 法国股列表查询
|
|||
GetBotStockFurTrade(context.Context, *GetFurBotStockTradeRequest) (*GetBotStockFurTradeReply, error) |
|||
// ShareFurPlaceOrder 法国股下单
|
|||
ShareFurPlaceOrder(context.Context, *ShareFurOrderRequest) (*FurOrderReply, error) |
|||
// ShareFurUpdateOrder 法国股设置止盈止损
|
|||
ShareFurUpdateOrder(context.Context, *UpdateFurOrderRequest) (*FurOrderReply, error) |
|||
// ShareFurPosition 法国股平仓
|
|||
ShareFurPosition(context.Context, *CancelFurOrderRequest) (*FurOrderReply, error) |
|||
// ShareFurAllPosition 法国股一键平仓
|
|||
ShareFurAllPosition(context.Context, *AllFurOrderRequest) (*AllFurOrderReply, error) |
|||
// ShareFurCancel 法国股撤单
|
|||
ShareFurCancel(context.Context, *CancelFurOrderRequest) (*FurOrderReply, error) |
|||
mustEmbedUnimplementedShareFurServer() |
|||
} |
|||
|
|||
// UnimplementedShareFurServer must be embedded to have forward compatible implementations.
|
|||
type UnimplementedShareFurServer struct { |
|||
} |
|||
|
|||
func (UnimplementedShareFurServer) GetBotStockFurTrade(context.Context, *GetFurBotStockTradeRequest) (*GetBotStockFurTradeReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method GetBotStockFurTrade not implemented") |
|||
} |
|||
func (UnimplementedShareFurServer) ShareFurPlaceOrder(context.Context, *ShareFurOrderRequest) (*FurOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareFurPlaceOrder not implemented") |
|||
} |
|||
func (UnimplementedShareFurServer) ShareFurUpdateOrder(context.Context, *UpdateFurOrderRequest) (*FurOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareFurUpdateOrder not implemented") |
|||
} |
|||
func (UnimplementedShareFurServer) ShareFurPosition(context.Context, *CancelFurOrderRequest) (*FurOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareFurPosition not implemented") |
|||
} |
|||
func (UnimplementedShareFurServer) ShareFurAllPosition(context.Context, *AllFurOrderRequest) (*AllFurOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareFurAllPosition not implemented") |
|||
} |
|||
func (UnimplementedShareFurServer) ShareFurCancel(context.Context, *CancelFurOrderRequest) (*FurOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareFurCancel not implemented") |
|||
} |
|||
func (UnimplementedShareFurServer) mustEmbedUnimplementedShareFurServer() {} |
|||
|
|||
// UnsafeShareFurServer may be embedded to opt out of forward compatibility for this service.
|
|||
// Use of this interface is not recommended, as added methods to ShareFurServer will
|
|||
// result in compilation errors.
|
|||
type UnsafeShareFurServer interface { |
|||
mustEmbedUnimplementedShareFurServer() |
|||
} |
|||
|
|||
func RegisterShareFurServer(s grpc.ServiceRegistrar, srv ShareFurServer) { |
|||
s.RegisterService(&ShareFur_ServiceDesc, srv) |
|||
} |
|||
|
|||
func _ShareFur_GetBotStockFurTrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(GetFurBotStockTradeRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareFurServer).GetBotStockFurTrade(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareFur_GetBotStockFurTrade_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareFurServer).GetBotStockFurTrade(ctx, req.(*GetFurBotStockTradeRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareFur_ShareFurPlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(ShareFurOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareFurServer).ShareFurPlaceOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareFur_ShareFurPlaceOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareFurServer).ShareFurPlaceOrder(ctx, req.(*ShareFurOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareFur_ShareFurUpdateOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(UpdateFurOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareFurServer).ShareFurUpdateOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareFur_ShareFurUpdateOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareFurServer).ShareFurUpdateOrder(ctx, req.(*UpdateFurOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareFur_ShareFurPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelFurOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareFurServer).ShareFurPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareFur_ShareFurPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareFurServer).ShareFurPosition(ctx, req.(*CancelFurOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareFur_ShareFurAllPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(AllFurOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareFurServer).ShareFurAllPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareFur_ShareFurAllPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareFurServer).ShareFurAllPosition(ctx, req.(*AllFurOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareFur_ShareFurCancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelFurOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareFurServer).ShareFurCancel(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareFur_ShareFurCancel_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareFurServer).ShareFurCancel(ctx, req.(*CancelFurOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
// ShareFur_ServiceDesc is the grpc.ServiceDesc for ShareFur service.
|
|||
// It's only intended for direct use with grpc.RegisterService,
|
|||
// and not to be introspected or modified (even as a copy)
|
|||
var ShareFur_ServiceDesc = grpc.ServiceDesc{ |
|||
ServiceName: "matchmaking.v1.ShareFur", |
|||
HandlerType: (*ShareFurServer)(nil), |
|||
Methods: []grpc.MethodDesc{ |
|||
{ |
|||
MethodName: "GetBotStockFurTrade", |
|||
Handler: _ShareFur_GetBotStockFurTrade_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareFurPlaceOrder", |
|||
Handler: _ShareFur_ShareFurPlaceOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareFurUpdateOrder", |
|||
Handler: _ShareFur_ShareFurUpdateOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareFurPosition", |
|||
Handler: _ShareFur_ShareFurPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareFurAllPosition", |
|||
Handler: _ShareFur_ShareFurAllPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareFurCancel", |
|||
Handler: _ShareFur_ShareFurCancel_Handler, |
|||
}, |
|||
}, |
|||
Streams: []grpc.StreamDesc{}, |
|||
Metadata: "matchmaking/v1/share/shareFur.proto", |
|||
} |
@ -0,0 +1,279 @@ |
|||
// Code generated by protoc-gen-go-http. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-http v2.7.3
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareFur.proto
|
|||
|
|||
package v1 |
|||
|
|||
import ( |
|||
context "context" |
|||
http "github.com/go-kratos/kratos/v2/transport/http" |
|||
binding "github.com/go-kratos/kratos/v2/transport/http/binding" |
|||
) |
|||
|
|||
// This is a compile-time assertion to ensure that this generated file
|
|||
// is compatible with the kratos package it is being compiled against.
|
|||
var _ = new(context.Context) |
|||
var _ = binding.EncodeURL |
|||
|
|||
const _ = http.SupportPackageIsVersion1 |
|||
|
|||
const OperationShareFurGetBotStockFurTrade = "/matchmaking.v1.ShareFur/GetBotStockFurTrade" |
|||
const OperationShareFurShareFurAllPosition = "/matchmaking.v1.ShareFur/ShareFurAllPosition" |
|||
const OperationShareFurShareFurCancel = "/matchmaking.v1.ShareFur/ShareFurCancel" |
|||
const OperationShareFurShareFurPlaceOrder = "/matchmaking.v1.ShareFur/ShareFurPlaceOrder" |
|||
const OperationShareFurShareFurPosition = "/matchmaking.v1.ShareFur/ShareFurPosition" |
|||
const OperationShareFurShareFurUpdateOrder = "/matchmaking.v1.ShareFur/ShareFurUpdateOrder" |
|||
|
|||
type ShareFurHTTPServer interface { |
|||
// GetBotStockFurTrade GetBotStockFurTrade 法国股列表查询
|
|||
GetBotStockFurTrade(context.Context, *GetFurBotStockTradeRequest) (*GetBotStockFurTradeReply, error) |
|||
// ShareFurAllPosition ShareFurAllPosition 法国股一键平仓
|
|||
ShareFurAllPosition(context.Context, *AllFurOrderRequest) (*AllFurOrderReply, error) |
|||
// ShareFurCancel ShareFurCancel 法国股撤单
|
|||
ShareFurCancel(context.Context, *CancelFurOrderRequest) (*FurOrderReply, error) |
|||
// ShareFurPlaceOrder ShareFurPlaceOrder 法国股下单
|
|||
ShareFurPlaceOrder(context.Context, *ShareFurOrderRequest) (*FurOrderReply, error) |
|||
// ShareFurPosition ShareFurPosition 法国股平仓
|
|||
ShareFurPosition(context.Context, *CancelFurOrderRequest) (*FurOrderReply, error) |
|||
// ShareFurUpdateOrder ShareFurUpdateOrder 法国股设置止盈止损
|
|||
ShareFurUpdateOrder(context.Context, *UpdateFurOrderRequest) (*FurOrderReply, error) |
|||
} |
|||
|
|||
func RegisterShareFurHTTPServer(s *http.Server, srv ShareFurHTTPServer) { |
|||
r := s.Route("/") |
|||
r.POST("/order_sharefur/share_list", _ShareFur_GetBotStockFurTrade0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharefur/share_place_order", _ShareFur_ShareFurPlaceOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharefur/share_update_order", _ShareFur_ShareFurUpdateOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharefur/share_position", _ShareFur_ShareFurPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharefur/share_all_position", _ShareFur_ShareFurAllPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharefur/share_cancel", _ShareFur_ShareFurCancel0_HTTP_Handler(srv)) |
|||
} |
|||
|
|||
func _ShareFur_GetBotStockFurTrade0_HTTP_Handler(srv ShareFurHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in GetFurBotStockTradeRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareFurGetBotStockFurTrade) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.GetBotStockFurTrade(ctx, req.(*GetFurBotStockTradeRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*GetBotStockFurTradeReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareFur_ShareFurPlaceOrder0_HTTP_Handler(srv ShareFurHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in ShareFurOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareFurShareFurPlaceOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareFurPlaceOrder(ctx, req.(*ShareFurOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*FurOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareFur_ShareFurUpdateOrder0_HTTP_Handler(srv ShareFurHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in UpdateFurOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareFurShareFurUpdateOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareFurUpdateOrder(ctx, req.(*UpdateFurOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*FurOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareFur_ShareFurPosition0_HTTP_Handler(srv ShareFurHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelFurOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareFurShareFurPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareFurPosition(ctx, req.(*CancelFurOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*FurOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareFur_ShareFurAllPosition0_HTTP_Handler(srv ShareFurHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in AllFurOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareFurShareFurAllPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareFurAllPosition(ctx, req.(*AllFurOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*AllFurOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareFur_ShareFurCancel0_HTTP_Handler(srv ShareFurHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelFurOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareFurShareFurCancel) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareFurCancel(ctx, req.(*CancelFurOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*FurOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
type ShareFurHTTPClient interface { |
|||
GetBotStockFurTrade(ctx context.Context, req *GetFurBotStockTradeRequest, opts ...http.CallOption) (rsp *GetBotStockFurTradeReply, err error) |
|||
ShareFurAllPosition(ctx context.Context, req *AllFurOrderRequest, opts ...http.CallOption) (rsp *AllFurOrderReply, err error) |
|||
ShareFurCancel(ctx context.Context, req *CancelFurOrderRequest, opts ...http.CallOption) (rsp *FurOrderReply, err error) |
|||
ShareFurPlaceOrder(ctx context.Context, req *ShareFurOrderRequest, opts ...http.CallOption) (rsp *FurOrderReply, err error) |
|||
ShareFurPosition(ctx context.Context, req *CancelFurOrderRequest, opts ...http.CallOption) (rsp *FurOrderReply, err error) |
|||
ShareFurUpdateOrder(ctx context.Context, req *UpdateFurOrderRequest, opts ...http.CallOption) (rsp *FurOrderReply, err error) |
|||
} |
|||
|
|||
type ShareFurHTTPClientImpl struct { |
|||
cc *http.Client |
|||
} |
|||
|
|||
func NewShareFurHTTPClient(client *http.Client) ShareFurHTTPClient { |
|||
return &ShareFurHTTPClientImpl{client} |
|||
} |
|||
|
|||
func (c *ShareFurHTTPClientImpl) GetBotStockFurTrade(ctx context.Context, in *GetFurBotStockTradeRequest, opts ...http.CallOption) (*GetBotStockFurTradeReply, error) { |
|||
var out GetBotStockFurTradeReply |
|||
pattern := "/order_sharefur/share_list" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareFurGetBotStockFurTrade)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareFurHTTPClientImpl) ShareFurAllPosition(ctx context.Context, in *AllFurOrderRequest, opts ...http.CallOption) (*AllFurOrderReply, error) { |
|||
var out AllFurOrderReply |
|||
pattern := "/order_sharefur/share_all_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareFurShareFurAllPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareFurHTTPClientImpl) ShareFurCancel(ctx context.Context, in *CancelFurOrderRequest, opts ...http.CallOption) (*FurOrderReply, error) { |
|||
var out FurOrderReply |
|||
pattern := "/order_sharefur/share_cancel" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareFurShareFurCancel)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareFurHTTPClientImpl) ShareFurPlaceOrder(ctx context.Context, in *ShareFurOrderRequest, opts ...http.CallOption) (*FurOrderReply, error) { |
|||
var out FurOrderReply |
|||
pattern := "/order_sharefur/share_place_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareFurShareFurPlaceOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareFurHTTPClientImpl) ShareFurPosition(ctx context.Context, in *CancelFurOrderRequest, opts ...http.CallOption) (*FurOrderReply, error) { |
|||
var out FurOrderReply |
|||
pattern := "/order_sharefur/share_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareFurShareFurPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareFurHTTPClientImpl) ShareFurUpdateOrder(ctx context.Context, in *UpdateFurOrderRequest, opts ...http.CallOption) (*FurOrderReply, error) { |
|||
var out FurOrderReply |
|||
pattern := "/order_sharefur/share_update_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareFurShareFurUpdateOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,145 @@ |
|||
syntax = "proto3"; |
|||
|
|||
package matchmaking.v1; |
|||
|
|||
import "google/api/annotations.proto"; |
|||
|
|||
option go_package = "matchmaking-system/api/matchmaking/v1;v1"; |
|||
|
|||
service ShareGbx { |
|||
// GetBotStockGbxTrade 英股列表查询 |
|||
rpc GetBotStockGbxTrade(GetBotStockGbxTradeRequest)returns(GetBotStockGbxTradeReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharegbx/share_list", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareGbxPlaceOrder 英股下单 |
|||
rpc ShareGbxPlaceOrder(OrderGbxRequest)returns(OrderGbxReply) { |
|||
option (google.api.http) = { |
|||
post: "/order_sharegbx/share_place_order", |
|||
body: "*", |
|||
}; |
|||
} |
|||
// ShareGbxUpdateOrder 英股设置止盈止损 |
|||
rpc ShareGbxUpdateOrder(UpdateGbxOrderRequest)returns(OrderGbxReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharegbx/share_update_order", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareGbxPosition 英股平仓 |
|||
rpc ShareGbxPosition(CancelGbxOrderRequest)returns(OrderGbxReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharegbx/share_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareGbxAllPosition 英股一键平仓 |
|||
rpc ShareGbxAllPosition(AllGbxOrderRequest)returns(AllGbxOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharegbx/share_all_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareGbxCancel 英股撤单 |
|||
rpc ShareGbxCancel(CancelGbxOrderRequest)returns(OrderGbxReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharegbx/share_cancel", |
|||
body:"*", |
|||
}; |
|||
} |
|||
} |
|||
|
|||
message GetBotStockGbxTradeRequest{ |
|||
int64 status =1;// 状态码 |
|||
int64 pageSize =2; // 每页显示条数 |
|||
int64 pageCount =3;// 开始的位置 |
|||
} |
|||
|
|||
message GetBotStockGbxTradeReply{ |
|||
int64 code =1;// 状态码 |
|||
BotStockGbxTradeData data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message BotStockGbxTradeData{ |
|||
int64 pageSize =1; // 每页显示条数 |
|||
int64 pageCount =2;// 开始的位置 |
|||
repeated BotOrderGbxTrade data =3;// 返回结果 |
|||
int64 totalCount =4;// 总数据 |
|||
} |
|||
|
|||
message BotOrderGbxTrade{ |
|||
string orderId =1;// 订单ID |
|||
string stockId =2;// 股票代码 |
|||
int64 tradeType =3;// 交易类型 |
|||
int64 dealType =4;// 交易方式 |
|||
string limitPrice =5;// 限价 |
|||
string marketPrice =6;// 市价 |
|||
string dealPrice =7;// 开仓价 |
|||
string closingPrice =8;// 平仓价 |
|||
string orderNumber =9;// 订单数量 |
|||
int64 stopType =10;// 止盈止损状态 |
|||
string stopLossPrice =11;// 止损 |
|||
string stopWinPrice =12;// 止盈 |
|||
string serviceCost =13;// 开仓手续费 |
|||
string marketMoney =14;// 订单金额 |
|||
string orderMoney =15;// 订单总金额 |
|||
int64 status =16;// 订单状态 |
|||
string createTime =17;// 订单创建时间 |
|||
string updateTime =18;// 订单更新时间 |
|||
string openTime =19;// 订单开仓时间 |
|||
string closingTime =20;// 订单平仓时间 |
|||
string closingCost =21;// 平仓手续费 |
|||
string faceValue =22;// 面值 |
|||
string pryNum =23;// 杠杆 |
|||
string keepDecimal =24;// 保留小数位 |
|||
string stockName =25;// 股票名称 |
|||
} |
|||
|
|||
message OrderGbxRequest{ |
|||
string stockId =1;// 股票Code |
|||
int64 tradeType =2;// 交易类型:1买入,2卖出 |
|||
int64 dealType =3;// 委托方式:1限价,2市价 |
|||
string limitPrice =4;// 限价 |
|||
string marketPrice =5;// 市价 |
|||
string marketMoney =6;// 订单金额 |
|||
string orderNumber =7;// 订单数量 |
|||
string serviceCost =8;// 手续费 |
|||
int64 stopType =9;// 止损止盈设置:1无设置,2止损止盈 |
|||
string stopLossPrice =10;// 止损 |
|||
string stopWinPrice =11;// 止损 |
|||
string pryNum =12;// 杠杆 |
|||
} |
|||
|
|||
message UpdateGbxOrderRequest{ |
|||
string orderId =1;// 订单Id |
|||
int64 stopType =2;// 止盈止损 |
|||
string stopLossPrice =3;// 止损 |
|||
string stopWinPrice =4;// 止盈 |
|||
} |
|||
|
|||
message OrderGbxReply{ |
|||
int64 code =1;// 状态码 |
|||
OrderGbxResult data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message AllGbxOrderRequest{ |
|||
|
|||
} |
|||
|
|||
message CancelGbxOrderRequest{ |
|||
string orderId =1;// 订单ID |
|||
} |
|||
|
|||
message AllGbxOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
string data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message OrderGbxResult { |
|||
string orderId =1;// 订单Id |
|||
} |
@ -0,0 +1,312 @@ |
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-grpc v1.4.0
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareGbx.proto
|
|||
|
|||
package v1 |
|||
|
|||
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.62.0 or later.
|
|||
const _ = grpc.SupportPackageIsVersion8 |
|||
|
|||
const ( |
|||
ShareGbx_GetBotStockGbxTrade_FullMethodName = "/matchmaking.v1.ShareGbx/GetBotStockGbxTrade" |
|||
ShareGbx_ShareGbxPlaceOrder_FullMethodName = "/matchmaking.v1.ShareGbx/ShareGbxPlaceOrder" |
|||
ShareGbx_ShareGbxUpdateOrder_FullMethodName = "/matchmaking.v1.ShareGbx/ShareGbxUpdateOrder" |
|||
ShareGbx_ShareGbxPosition_FullMethodName = "/matchmaking.v1.ShareGbx/ShareGbxPosition" |
|||
ShareGbx_ShareGbxAllPosition_FullMethodName = "/matchmaking.v1.ShareGbx/ShareGbxAllPosition" |
|||
ShareGbx_ShareGbxCancel_FullMethodName = "/matchmaking.v1.ShareGbx/ShareGbxCancel" |
|||
) |
|||
|
|||
// ShareGbxClient is the client API for ShareGbx 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 ShareGbxClient interface { |
|||
// GetBotStockGbxTrade 英股列表查询
|
|||
GetBotStockGbxTrade(ctx context.Context, in *GetBotStockGbxTradeRequest, opts ...grpc.CallOption) (*GetBotStockGbxTradeReply, error) |
|||
// ShareGbxPlaceOrder 英股下单
|
|||
ShareGbxPlaceOrder(ctx context.Context, in *OrderGbxRequest, opts ...grpc.CallOption) (*OrderGbxReply, error) |
|||
// ShareGbxUpdateOrder 英股设置止盈止损
|
|||
ShareGbxUpdateOrder(ctx context.Context, in *UpdateGbxOrderRequest, opts ...grpc.CallOption) (*OrderGbxReply, error) |
|||
// ShareGbxPosition 英股平仓
|
|||
ShareGbxPosition(ctx context.Context, in *CancelGbxOrderRequest, opts ...grpc.CallOption) (*OrderGbxReply, error) |
|||
// ShareGbxAllPosition 英股一键平仓
|
|||
ShareGbxAllPosition(ctx context.Context, in *AllGbxOrderRequest, opts ...grpc.CallOption) (*AllGbxOrderReply, error) |
|||
// ShareGbxCancel 英股撤单
|
|||
ShareGbxCancel(ctx context.Context, in *CancelGbxOrderRequest, opts ...grpc.CallOption) (*OrderGbxReply, error) |
|||
} |
|||
|
|||
type shareGbxClient struct { |
|||
cc grpc.ClientConnInterface |
|||
} |
|||
|
|||
func NewShareGbxClient(cc grpc.ClientConnInterface) ShareGbxClient { |
|||
return &shareGbxClient{cc} |
|||
} |
|||
|
|||
func (c *shareGbxClient) GetBotStockGbxTrade(ctx context.Context, in *GetBotStockGbxTradeRequest, opts ...grpc.CallOption) (*GetBotStockGbxTradeReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(GetBotStockGbxTradeReply) |
|||
err := c.cc.Invoke(ctx, ShareGbx_GetBotStockGbxTrade_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareGbxClient) ShareGbxPlaceOrder(ctx context.Context, in *OrderGbxRequest, opts ...grpc.CallOption) (*OrderGbxReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(OrderGbxReply) |
|||
err := c.cc.Invoke(ctx, ShareGbx_ShareGbxPlaceOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareGbxClient) ShareGbxUpdateOrder(ctx context.Context, in *UpdateGbxOrderRequest, opts ...grpc.CallOption) (*OrderGbxReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(OrderGbxReply) |
|||
err := c.cc.Invoke(ctx, ShareGbx_ShareGbxUpdateOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareGbxClient) ShareGbxPosition(ctx context.Context, in *CancelGbxOrderRequest, opts ...grpc.CallOption) (*OrderGbxReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(OrderGbxReply) |
|||
err := c.cc.Invoke(ctx, ShareGbx_ShareGbxPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareGbxClient) ShareGbxAllPosition(ctx context.Context, in *AllGbxOrderRequest, opts ...grpc.CallOption) (*AllGbxOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(AllGbxOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareGbx_ShareGbxAllPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareGbxClient) ShareGbxCancel(ctx context.Context, in *CancelGbxOrderRequest, opts ...grpc.CallOption) (*OrderGbxReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(OrderGbxReply) |
|||
err := c.cc.Invoke(ctx, ShareGbx_ShareGbxCancel_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
// ShareGbxServer is the server API for ShareGbx service.
|
|||
// All implementations must embed UnimplementedShareGbxServer
|
|||
// for forward compatibility
|
|||
type ShareGbxServer interface { |
|||
// GetBotStockGbxTrade 英股列表查询
|
|||
GetBotStockGbxTrade(context.Context, *GetBotStockGbxTradeRequest) (*GetBotStockGbxTradeReply, error) |
|||
// ShareGbxPlaceOrder 英股下单
|
|||
ShareGbxPlaceOrder(context.Context, *OrderGbxRequest) (*OrderGbxReply, error) |
|||
// ShareGbxUpdateOrder 英股设置止盈止损
|
|||
ShareGbxUpdateOrder(context.Context, *UpdateGbxOrderRequest) (*OrderGbxReply, error) |
|||
// ShareGbxPosition 英股平仓
|
|||
ShareGbxPosition(context.Context, *CancelGbxOrderRequest) (*OrderGbxReply, error) |
|||
// ShareGbxAllPosition 英股一键平仓
|
|||
ShareGbxAllPosition(context.Context, *AllGbxOrderRequest) (*AllGbxOrderReply, error) |
|||
// ShareGbxCancel 英股撤单
|
|||
ShareGbxCancel(context.Context, *CancelGbxOrderRequest) (*OrderGbxReply, error) |
|||
mustEmbedUnimplementedShareGbxServer() |
|||
} |
|||
|
|||
// UnimplementedShareGbxServer must be embedded to have forward compatible implementations.
|
|||
type UnimplementedShareGbxServer struct { |
|||
} |
|||
|
|||
func (UnimplementedShareGbxServer) GetBotStockGbxTrade(context.Context, *GetBotStockGbxTradeRequest) (*GetBotStockGbxTradeReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method GetBotStockGbxTrade not implemented") |
|||
} |
|||
func (UnimplementedShareGbxServer) ShareGbxPlaceOrder(context.Context, *OrderGbxRequest) (*OrderGbxReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareGbxPlaceOrder not implemented") |
|||
} |
|||
func (UnimplementedShareGbxServer) ShareGbxUpdateOrder(context.Context, *UpdateGbxOrderRequest) (*OrderGbxReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareGbxUpdateOrder not implemented") |
|||
} |
|||
func (UnimplementedShareGbxServer) ShareGbxPosition(context.Context, *CancelGbxOrderRequest) (*OrderGbxReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareGbxPosition not implemented") |
|||
} |
|||
func (UnimplementedShareGbxServer) ShareGbxAllPosition(context.Context, *AllGbxOrderRequest) (*AllGbxOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareGbxAllPosition not implemented") |
|||
} |
|||
func (UnimplementedShareGbxServer) ShareGbxCancel(context.Context, *CancelGbxOrderRequest) (*OrderGbxReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareGbxCancel not implemented") |
|||
} |
|||
func (UnimplementedShareGbxServer) mustEmbedUnimplementedShareGbxServer() {} |
|||
|
|||
// UnsafeShareGbxServer may be embedded to opt out of forward compatibility for this service.
|
|||
// Use of this interface is not recommended, as added methods to ShareGbxServer will
|
|||
// result in compilation errors.
|
|||
type UnsafeShareGbxServer interface { |
|||
mustEmbedUnimplementedShareGbxServer() |
|||
} |
|||
|
|||
func RegisterShareGbxServer(s grpc.ServiceRegistrar, srv ShareGbxServer) { |
|||
s.RegisterService(&ShareGbx_ServiceDesc, srv) |
|||
} |
|||
|
|||
func _ShareGbx_GetBotStockGbxTrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(GetBotStockGbxTradeRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareGbxServer).GetBotStockGbxTrade(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareGbx_GetBotStockGbxTrade_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareGbxServer).GetBotStockGbxTrade(ctx, req.(*GetBotStockGbxTradeRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareGbx_ShareGbxPlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(OrderGbxRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareGbxServer).ShareGbxPlaceOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareGbx_ShareGbxPlaceOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareGbxServer).ShareGbxPlaceOrder(ctx, req.(*OrderGbxRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareGbx_ShareGbxUpdateOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(UpdateGbxOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareGbxServer).ShareGbxUpdateOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareGbx_ShareGbxUpdateOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareGbxServer).ShareGbxUpdateOrder(ctx, req.(*UpdateGbxOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareGbx_ShareGbxPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelGbxOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareGbxServer).ShareGbxPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareGbx_ShareGbxPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareGbxServer).ShareGbxPosition(ctx, req.(*CancelGbxOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareGbx_ShareGbxAllPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(AllGbxOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareGbxServer).ShareGbxAllPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareGbx_ShareGbxAllPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareGbxServer).ShareGbxAllPosition(ctx, req.(*AllGbxOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareGbx_ShareGbxCancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelGbxOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareGbxServer).ShareGbxCancel(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareGbx_ShareGbxCancel_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareGbxServer).ShareGbxCancel(ctx, req.(*CancelGbxOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
// ShareGbx_ServiceDesc is the grpc.ServiceDesc for ShareGbx service.
|
|||
// It's only intended for direct use with grpc.RegisterService,
|
|||
// and not to be introspected or modified (even as a copy)
|
|||
var ShareGbx_ServiceDesc = grpc.ServiceDesc{ |
|||
ServiceName: "matchmaking.v1.ShareGbx", |
|||
HandlerType: (*ShareGbxServer)(nil), |
|||
Methods: []grpc.MethodDesc{ |
|||
{ |
|||
MethodName: "GetBotStockGbxTrade", |
|||
Handler: _ShareGbx_GetBotStockGbxTrade_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareGbxPlaceOrder", |
|||
Handler: _ShareGbx_ShareGbxPlaceOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareGbxUpdateOrder", |
|||
Handler: _ShareGbx_ShareGbxUpdateOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareGbxPosition", |
|||
Handler: _ShareGbx_ShareGbxPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareGbxAllPosition", |
|||
Handler: _ShareGbx_ShareGbxAllPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareGbxCancel", |
|||
Handler: _ShareGbx_ShareGbxCancel_Handler, |
|||
}, |
|||
}, |
|||
Streams: []grpc.StreamDesc{}, |
|||
Metadata: "matchmaking/v1/share/shareGbx.proto", |
|||
} |
@ -0,0 +1,279 @@ |
|||
// Code generated by protoc-gen-go-http. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-http v2.7.3
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareGbx.proto
|
|||
|
|||
package v1 |
|||
|
|||
import ( |
|||
context "context" |
|||
http "github.com/go-kratos/kratos/v2/transport/http" |
|||
binding "github.com/go-kratos/kratos/v2/transport/http/binding" |
|||
) |
|||
|
|||
// This is a compile-time assertion to ensure that this generated file
|
|||
// is compatible with the kratos package it is being compiled against.
|
|||
var _ = new(context.Context) |
|||
var _ = binding.EncodeURL |
|||
|
|||
const _ = http.SupportPackageIsVersion1 |
|||
|
|||
const OperationShareGbxGetBotStockGbxTrade = "/matchmaking.v1.ShareGbx/GetBotStockGbxTrade" |
|||
const OperationShareGbxShareGbxAllPosition = "/matchmaking.v1.ShareGbx/ShareGbxAllPosition" |
|||
const OperationShareGbxShareGbxCancel = "/matchmaking.v1.ShareGbx/ShareGbxCancel" |
|||
const OperationShareGbxShareGbxPlaceOrder = "/matchmaking.v1.ShareGbx/ShareGbxPlaceOrder" |
|||
const OperationShareGbxShareGbxPosition = "/matchmaking.v1.ShareGbx/ShareGbxPosition" |
|||
const OperationShareGbxShareGbxUpdateOrder = "/matchmaking.v1.ShareGbx/ShareGbxUpdateOrder" |
|||
|
|||
type ShareGbxHTTPServer interface { |
|||
// GetBotStockGbxTrade GetBotStockGbxTrade 英股列表查询
|
|||
GetBotStockGbxTrade(context.Context, *GetBotStockGbxTradeRequest) (*GetBotStockGbxTradeReply, error) |
|||
// ShareGbxAllPosition ShareGbxAllPosition 英股一键平仓
|
|||
ShareGbxAllPosition(context.Context, *AllGbxOrderRequest) (*AllGbxOrderReply, error) |
|||
// ShareGbxCancel ShareGbxCancel 英股撤单
|
|||
ShareGbxCancel(context.Context, *CancelGbxOrderRequest) (*OrderGbxReply, error) |
|||
// ShareGbxPlaceOrder ShareGbxPlaceOrder 英股下单
|
|||
ShareGbxPlaceOrder(context.Context, *OrderGbxRequest) (*OrderGbxReply, error) |
|||
// ShareGbxPosition ShareGbxPosition 英股平仓
|
|||
ShareGbxPosition(context.Context, *CancelGbxOrderRequest) (*OrderGbxReply, error) |
|||
// ShareGbxUpdateOrder ShareGbxUpdateOrder 英股设置止盈止损
|
|||
ShareGbxUpdateOrder(context.Context, *UpdateGbxOrderRequest) (*OrderGbxReply, error) |
|||
} |
|||
|
|||
func RegisterShareGbxHTTPServer(s *http.Server, srv ShareGbxHTTPServer) { |
|||
r := s.Route("/") |
|||
r.POST("/order_sharegbx/share_list", _ShareGbx_GetBotStockGbxTrade0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharegbx/share_place_order", _ShareGbx_ShareGbxPlaceOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharegbx/share_update_order", _ShareGbx_ShareGbxUpdateOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharegbx/share_position", _ShareGbx_ShareGbxPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharegbx/share_all_position", _ShareGbx_ShareGbxAllPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharegbx/share_cancel", _ShareGbx_ShareGbxCancel0_HTTP_Handler(srv)) |
|||
} |
|||
|
|||
func _ShareGbx_GetBotStockGbxTrade0_HTTP_Handler(srv ShareGbxHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in GetBotStockGbxTradeRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareGbxGetBotStockGbxTrade) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.GetBotStockGbxTrade(ctx, req.(*GetBotStockGbxTradeRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*GetBotStockGbxTradeReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareGbx_ShareGbxPlaceOrder0_HTTP_Handler(srv ShareGbxHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in OrderGbxRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareGbxShareGbxPlaceOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareGbxPlaceOrder(ctx, req.(*OrderGbxRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*OrderGbxReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareGbx_ShareGbxUpdateOrder0_HTTP_Handler(srv ShareGbxHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in UpdateGbxOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareGbxShareGbxUpdateOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareGbxUpdateOrder(ctx, req.(*UpdateGbxOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*OrderGbxReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareGbx_ShareGbxPosition0_HTTP_Handler(srv ShareGbxHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelGbxOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareGbxShareGbxPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareGbxPosition(ctx, req.(*CancelGbxOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*OrderGbxReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareGbx_ShareGbxAllPosition0_HTTP_Handler(srv ShareGbxHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in AllGbxOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareGbxShareGbxAllPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareGbxAllPosition(ctx, req.(*AllGbxOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*AllGbxOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareGbx_ShareGbxCancel0_HTTP_Handler(srv ShareGbxHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelGbxOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareGbxShareGbxCancel) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareGbxCancel(ctx, req.(*CancelGbxOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*OrderGbxReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
type ShareGbxHTTPClient interface { |
|||
GetBotStockGbxTrade(ctx context.Context, req *GetBotStockGbxTradeRequest, opts ...http.CallOption) (rsp *GetBotStockGbxTradeReply, err error) |
|||
ShareGbxAllPosition(ctx context.Context, req *AllGbxOrderRequest, opts ...http.CallOption) (rsp *AllGbxOrderReply, err error) |
|||
ShareGbxCancel(ctx context.Context, req *CancelGbxOrderRequest, opts ...http.CallOption) (rsp *OrderGbxReply, err error) |
|||
ShareGbxPlaceOrder(ctx context.Context, req *OrderGbxRequest, opts ...http.CallOption) (rsp *OrderGbxReply, err error) |
|||
ShareGbxPosition(ctx context.Context, req *CancelGbxOrderRequest, opts ...http.CallOption) (rsp *OrderGbxReply, err error) |
|||
ShareGbxUpdateOrder(ctx context.Context, req *UpdateGbxOrderRequest, opts ...http.CallOption) (rsp *OrderGbxReply, err error) |
|||
} |
|||
|
|||
type ShareGbxHTTPClientImpl struct { |
|||
cc *http.Client |
|||
} |
|||
|
|||
func NewShareGbxHTTPClient(client *http.Client) ShareGbxHTTPClient { |
|||
return &ShareGbxHTTPClientImpl{client} |
|||
} |
|||
|
|||
func (c *ShareGbxHTTPClientImpl) GetBotStockGbxTrade(ctx context.Context, in *GetBotStockGbxTradeRequest, opts ...http.CallOption) (*GetBotStockGbxTradeReply, error) { |
|||
var out GetBotStockGbxTradeReply |
|||
pattern := "/order_sharegbx/share_list" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareGbxGetBotStockGbxTrade)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareGbxHTTPClientImpl) ShareGbxAllPosition(ctx context.Context, in *AllGbxOrderRequest, opts ...http.CallOption) (*AllGbxOrderReply, error) { |
|||
var out AllGbxOrderReply |
|||
pattern := "/order_sharegbx/share_all_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareGbxShareGbxAllPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareGbxHTTPClientImpl) ShareGbxCancel(ctx context.Context, in *CancelGbxOrderRequest, opts ...http.CallOption) (*OrderGbxReply, error) { |
|||
var out OrderGbxReply |
|||
pattern := "/order_sharegbx/share_cancel" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareGbxShareGbxCancel)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareGbxHTTPClientImpl) ShareGbxPlaceOrder(ctx context.Context, in *OrderGbxRequest, opts ...http.CallOption) (*OrderGbxReply, error) { |
|||
var out OrderGbxReply |
|||
pattern := "/order_sharegbx/share_place_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareGbxShareGbxPlaceOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareGbxHTTPClientImpl) ShareGbxPosition(ctx context.Context, in *CancelGbxOrderRequest, opts ...http.CallOption) (*OrderGbxReply, error) { |
|||
var out OrderGbxReply |
|||
pattern := "/order_sharegbx/share_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareGbxShareGbxPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareGbxHTTPClientImpl) ShareGbxUpdateOrder(ctx context.Context, in *UpdateGbxOrderRequest, opts ...http.CallOption) (*OrderGbxReply, error) { |
|||
var out OrderGbxReply |
|||
pattern := "/order_sharegbx/share_update_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareGbxShareGbxUpdateOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,145 @@ |
|||
syntax = "proto3"; |
|||
|
|||
package matchmaking.v1; |
|||
|
|||
import "google/api/annotations.proto"; |
|||
|
|||
option go_package = "matchmaking-system/api/matchmaking/v1;v1"; |
|||
|
|||
service ShareHkd { |
|||
// GetBotStockHkdTrade 港股列表查询 |
|||
rpc GetBotStockHkdTrade(GetBotStockHkdTradeRequest)returns(GetBotStockHkdTradeReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharehkd/share_list", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareHkdPlaceOrder 港股下单 |
|||
rpc ShareHkdPlaceOrder(OrderHkdRequest)returns(OrderHkdReply) { |
|||
option (google.api.http) = { |
|||
post: "/order_sharehkd/share_place_order", |
|||
body: "*", |
|||
}; |
|||
} |
|||
// ShareHkdUpdateOrder 港股设置止盈止损 |
|||
rpc ShareHkdUpdateOrder(UpdateHkdOrderRequest)returns(OrderHkdReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharehkd/share_update_order", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareHkdPosition 港股平仓 |
|||
rpc ShareHkdPosition(CancelHkdOrderRequest)returns(OrderHkdReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharehkd/share_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareHkdAllPosition 港股一键平仓 |
|||
rpc ShareHkdAllPosition(AllHkdOrderRequest)returns(AllHkdOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharehkd/share_all_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareHkdCancel 港股撤单 |
|||
rpc ShareHkdCancel(CancelHkdOrderRequest)returns(OrderHkdReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharehkd/share_cancel", |
|||
body:"*", |
|||
}; |
|||
} |
|||
} |
|||
|
|||
message GetBotStockHkdTradeRequest{ |
|||
int64 status =1;// 状态码 |
|||
int64 pageSize =2; // 每页显示条数 |
|||
int64 pageCount =3;// 开始的位置 |
|||
} |
|||
|
|||
message GetBotStockHkdTradeReply{ |
|||
int64 code =1;// 状态码 |
|||
BotStockHkdTradeData data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message BotStockHkdTradeData{ |
|||
int64 pageSize =1; // 每页显示条数 |
|||
int64 pageCount =2;// 开始的位置 |
|||
repeated BotOrderHkdTrade data =3;// 返回结果 |
|||
int64 totalCount =4;// 总数据 |
|||
} |
|||
|
|||
message BotOrderHkdTrade{ |
|||
string orderId =1;// 订单ID |
|||
string stockId =2;// 股票代码 |
|||
int64 tradeType =3;// 交易类型 |
|||
int64 dealType =4;// 交易方式 |
|||
string limitPrice =5;// 限价 |
|||
string marketPrice =6;// 市价 |
|||
string dealPrice =7;// 开仓价 |
|||
string closingPrice =8;// 平仓价 |
|||
string orderNumber =9;// 订单数量 |
|||
int64 stopType =10;// 止盈止损状态 |
|||
string stopLossPrice =11;// 止损 |
|||
string stopWinPrice =12;// 止盈 |
|||
string serviceCost =13;// 开仓手续费 |
|||
string marketMoney =14;// 订单金额 |
|||
string orderMoney =15;// 订单总金额 |
|||
int64 status =16;// 订单状态 |
|||
string createTime =17;// 订单创建时间 |
|||
string updateTime =18;// 订单更新时间 |
|||
string openTime =19;// 订单开仓时间 |
|||
string closingTime =20;// 订单平仓时间 |
|||
string closingCost =21;// 平仓手续费 |
|||
string faceValue =22;// 面值 |
|||
string pryNum =23;// 杠杆 |
|||
string keepDecimal =24;// 保留小数位 |
|||
string stockName =25;// 股票名称 |
|||
} |
|||
|
|||
message OrderHkdRequest{ |
|||
string stockId =1;// 股票Code |
|||
int64 tradeType =2;// 交易类型:1买入,2卖出 |
|||
int64 dealType =3;// 委托方式:1限价,2市价 |
|||
string limitPrice =4;// 限价 |
|||
string marketPrice =5;// 市价 |
|||
string marketMoney =6;// 订单金额 |
|||
string orderNumber =7;// 订单数量 |
|||
string serviceCost =8;// 手续费 |
|||
int64 stopType =9;// 止损止盈设置:1无设置,2止损止盈 |
|||
string stopLossPrice =10;// 止损 |
|||
string stopWinPrice =11;// 止损 |
|||
string pryNum =12;// 杠杆 |
|||
} |
|||
|
|||
message UpdateHkdOrderRequest{ |
|||
string orderId =1;// 订单Id |
|||
int64 stopType =2;// 止盈止损 |
|||
string stopLossPrice =3;// 止损 |
|||
string stopWinPrice =4;// 止盈 |
|||
} |
|||
|
|||
message OrderHkdReply{ |
|||
int64 code =1;// 状态码 |
|||
OrderHkdResult data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message AllHkdOrderRequest{ |
|||
|
|||
} |
|||
|
|||
message CancelHkdOrderRequest{ |
|||
string orderId =1;// 订单ID |
|||
} |
|||
|
|||
message AllHkdOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
string data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message OrderHkdResult { |
|||
string orderId =1;// 订单Id |
|||
} |
@ -0,0 +1,312 @@ |
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-grpc v1.4.0
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareHkd.proto
|
|||
|
|||
package v1 |
|||
|
|||
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.62.0 or later.
|
|||
const _ = grpc.SupportPackageIsVersion8 |
|||
|
|||
const ( |
|||
ShareHkd_GetBotStockHkdTrade_FullMethodName = "/matchmaking.v1.ShareHkd/GetBotStockHkdTrade" |
|||
ShareHkd_ShareHkdPlaceOrder_FullMethodName = "/matchmaking.v1.ShareHkd/ShareHkdPlaceOrder" |
|||
ShareHkd_ShareHkdUpdateOrder_FullMethodName = "/matchmaking.v1.ShareHkd/ShareHkdUpdateOrder" |
|||
ShareHkd_ShareHkdPosition_FullMethodName = "/matchmaking.v1.ShareHkd/ShareHkdPosition" |
|||
ShareHkd_ShareHkdAllPosition_FullMethodName = "/matchmaking.v1.ShareHkd/ShareHkdAllPosition" |
|||
ShareHkd_ShareHkdCancel_FullMethodName = "/matchmaking.v1.ShareHkd/ShareHkdCancel" |
|||
) |
|||
|
|||
// ShareHkdClient is the client API for ShareHkd 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 ShareHkdClient interface { |
|||
// GetBotStockHkdTrade 港股列表查询
|
|||
GetBotStockHkdTrade(ctx context.Context, in *GetBotStockHkdTradeRequest, opts ...grpc.CallOption) (*GetBotStockHkdTradeReply, error) |
|||
// ShareHkdPlaceOrder 港股下单
|
|||
ShareHkdPlaceOrder(ctx context.Context, in *OrderHkdRequest, opts ...grpc.CallOption) (*OrderHkdReply, error) |
|||
// ShareHkdUpdateOrder 港股设置止盈止损
|
|||
ShareHkdUpdateOrder(ctx context.Context, in *UpdateHkdOrderRequest, opts ...grpc.CallOption) (*OrderHkdReply, error) |
|||
// ShareHkdPosition 港股平仓
|
|||
ShareHkdPosition(ctx context.Context, in *CancelHkdOrderRequest, opts ...grpc.CallOption) (*OrderHkdReply, error) |
|||
// ShareHkdAllPosition 港股一键平仓
|
|||
ShareHkdAllPosition(ctx context.Context, in *AllHkdOrderRequest, opts ...grpc.CallOption) (*AllHkdOrderReply, error) |
|||
// ShareHkdCancel 港股撤单
|
|||
ShareHkdCancel(ctx context.Context, in *CancelHkdOrderRequest, opts ...grpc.CallOption) (*OrderHkdReply, error) |
|||
} |
|||
|
|||
type shareHkdClient struct { |
|||
cc grpc.ClientConnInterface |
|||
} |
|||
|
|||
func NewShareHkdClient(cc grpc.ClientConnInterface) ShareHkdClient { |
|||
return &shareHkdClient{cc} |
|||
} |
|||
|
|||
func (c *shareHkdClient) GetBotStockHkdTrade(ctx context.Context, in *GetBotStockHkdTradeRequest, opts ...grpc.CallOption) (*GetBotStockHkdTradeReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(GetBotStockHkdTradeReply) |
|||
err := c.cc.Invoke(ctx, ShareHkd_GetBotStockHkdTrade_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareHkdClient) ShareHkdPlaceOrder(ctx context.Context, in *OrderHkdRequest, opts ...grpc.CallOption) (*OrderHkdReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(OrderHkdReply) |
|||
err := c.cc.Invoke(ctx, ShareHkd_ShareHkdPlaceOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareHkdClient) ShareHkdUpdateOrder(ctx context.Context, in *UpdateHkdOrderRequest, opts ...grpc.CallOption) (*OrderHkdReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(OrderHkdReply) |
|||
err := c.cc.Invoke(ctx, ShareHkd_ShareHkdUpdateOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareHkdClient) ShareHkdPosition(ctx context.Context, in *CancelHkdOrderRequest, opts ...grpc.CallOption) (*OrderHkdReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(OrderHkdReply) |
|||
err := c.cc.Invoke(ctx, ShareHkd_ShareHkdPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareHkdClient) ShareHkdAllPosition(ctx context.Context, in *AllHkdOrderRequest, opts ...grpc.CallOption) (*AllHkdOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(AllHkdOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareHkd_ShareHkdAllPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareHkdClient) ShareHkdCancel(ctx context.Context, in *CancelHkdOrderRequest, opts ...grpc.CallOption) (*OrderHkdReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(OrderHkdReply) |
|||
err := c.cc.Invoke(ctx, ShareHkd_ShareHkdCancel_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
// ShareHkdServer is the server API for ShareHkd service.
|
|||
// All implementations must embed UnimplementedShareHkdServer
|
|||
// for forward compatibility
|
|||
type ShareHkdServer interface { |
|||
// GetBotStockHkdTrade 港股列表查询
|
|||
GetBotStockHkdTrade(context.Context, *GetBotStockHkdTradeRequest) (*GetBotStockHkdTradeReply, error) |
|||
// ShareHkdPlaceOrder 港股下单
|
|||
ShareHkdPlaceOrder(context.Context, *OrderHkdRequest) (*OrderHkdReply, error) |
|||
// ShareHkdUpdateOrder 港股设置止盈止损
|
|||
ShareHkdUpdateOrder(context.Context, *UpdateHkdOrderRequest) (*OrderHkdReply, error) |
|||
// ShareHkdPosition 港股平仓
|
|||
ShareHkdPosition(context.Context, *CancelHkdOrderRequest) (*OrderHkdReply, error) |
|||
// ShareHkdAllPosition 港股一键平仓
|
|||
ShareHkdAllPosition(context.Context, *AllHkdOrderRequest) (*AllHkdOrderReply, error) |
|||
// ShareHkdCancel 港股撤单
|
|||
ShareHkdCancel(context.Context, *CancelHkdOrderRequest) (*OrderHkdReply, error) |
|||
mustEmbedUnimplementedShareHkdServer() |
|||
} |
|||
|
|||
// UnimplementedShareHkdServer must be embedded to have forward compatible implementations.
|
|||
type UnimplementedShareHkdServer struct { |
|||
} |
|||
|
|||
func (UnimplementedShareHkdServer) GetBotStockHkdTrade(context.Context, *GetBotStockHkdTradeRequest) (*GetBotStockHkdTradeReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method GetBotStockHkdTrade not implemented") |
|||
} |
|||
func (UnimplementedShareHkdServer) ShareHkdPlaceOrder(context.Context, *OrderHkdRequest) (*OrderHkdReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareHkdPlaceOrder not implemented") |
|||
} |
|||
func (UnimplementedShareHkdServer) ShareHkdUpdateOrder(context.Context, *UpdateHkdOrderRequest) (*OrderHkdReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareHkdUpdateOrder not implemented") |
|||
} |
|||
func (UnimplementedShareHkdServer) ShareHkdPosition(context.Context, *CancelHkdOrderRequest) (*OrderHkdReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareHkdPosition not implemented") |
|||
} |
|||
func (UnimplementedShareHkdServer) ShareHkdAllPosition(context.Context, *AllHkdOrderRequest) (*AllHkdOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareHkdAllPosition not implemented") |
|||
} |
|||
func (UnimplementedShareHkdServer) ShareHkdCancel(context.Context, *CancelHkdOrderRequest) (*OrderHkdReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareHkdCancel not implemented") |
|||
} |
|||
func (UnimplementedShareHkdServer) mustEmbedUnimplementedShareHkdServer() {} |
|||
|
|||
// UnsafeShareHkdServer may be embedded to opt out of forward compatibility for this service.
|
|||
// Use of this interface is not recommended, as added methods to ShareHkdServer will
|
|||
// result in compilation errors.
|
|||
type UnsafeShareHkdServer interface { |
|||
mustEmbedUnimplementedShareHkdServer() |
|||
} |
|||
|
|||
func RegisterShareHkdServer(s grpc.ServiceRegistrar, srv ShareHkdServer) { |
|||
s.RegisterService(&ShareHkd_ServiceDesc, srv) |
|||
} |
|||
|
|||
func _ShareHkd_GetBotStockHkdTrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(GetBotStockHkdTradeRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareHkdServer).GetBotStockHkdTrade(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareHkd_GetBotStockHkdTrade_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareHkdServer).GetBotStockHkdTrade(ctx, req.(*GetBotStockHkdTradeRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareHkd_ShareHkdPlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(OrderHkdRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareHkdServer).ShareHkdPlaceOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareHkd_ShareHkdPlaceOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareHkdServer).ShareHkdPlaceOrder(ctx, req.(*OrderHkdRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareHkd_ShareHkdUpdateOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(UpdateHkdOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareHkdServer).ShareHkdUpdateOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareHkd_ShareHkdUpdateOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareHkdServer).ShareHkdUpdateOrder(ctx, req.(*UpdateHkdOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareHkd_ShareHkdPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelHkdOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareHkdServer).ShareHkdPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareHkd_ShareHkdPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareHkdServer).ShareHkdPosition(ctx, req.(*CancelHkdOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareHkd_ShareHkdAllPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(AllHkdOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareHkdServer).ShareHkdAllPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareHkd_ShareHkdAllPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareHkdServer).ShareHkdAllPosition(ctx, req.(*AllHkdOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareHkd_ShareHkdCancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelHkdOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareHkdServer).ShareHkdCancel(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareHkd_ShareHkdCancel_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareHkdServer).ShareHkdCancel(ctx, req.(*CancelHkdOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
// ShareHkd_ServiceDesc is the grpc.ServiceDesc for ShareHkd service.
|
|||
// It's only intended for direct use with grpc.RegisterService,
|
|||
// and not to be introspected or modified (even as a copy)
|
|||
var ShareHkd_ServiceDesc = grpc.ServiceDesc{ |
|||
ServiceName: "matchmaking.v1.ShareHkd", |
|||
HandlerType: (*ShareHkdServer)(nil), |
|||
Methods: []grpc.MethodDesc{ |
|||
{ |
|||
MethodName: "GetBotStockHkdTrade", |
|||
Handler: _ShareHkd_GetBotStockHkdTrade_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareHkdPlaceOrder", |
|||
Handler: _ShareHkd_ShareHkdPlaceOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareHkdUpdateOrder", |
|||
Handler: _ShareHkd_ShareHkdUpdateOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareHkdPosition", |
|||
Handler: _ShareHkd_ShareHkdPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareHkdAllPosition", |
|||
Handler: _ShareHkd_ShareHkdAllPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareHkdCancel", |
|||
Handler: _ShareHkd_ShareHkdCancel_Handler, |
|||
}, |
|||
}, |
|||
Streams: []grpc.StreamDesc{}, |
|||
Metadata: "matchmaking/v1/share/shareHkd.proto", |
|||
} |
@ -0,0 +1,279 @@ |
|||
// Code generated by protoc-gen-go-http. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-http v2.7.3
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareHkd.proto
|
|||
|
|||
package v1 |
|||
|
|||
import ( |
|||
context "context" |
|||
http "github.com/go-kratos/kratos/v2/transport/http" |
|||
binding "github.com/go-kratos/kratos/v2/transport/http/binding" |
|||
) |
|||
|
|||
// This is a compile-time assertion to ensure that this generated file
|
|||
// is compatible with the kratos package it is being compiled against.
|
|||
var _ = new(context.Context) |
|||
var _ = binding.EncodeURL |
|||
|
|||
const _ = http.SupportPackageIsVersion1 |
|||
|
|||
const OperationShareHkdGetBotStockHkdTrade = "/matchmaking.v1.ShareHkd/GetBotStockHkdTrade" |
|||
const OperationShareHkdShareHkdAllPosition = "/matchmaking.v1.ShareHkd/ShareHkdAllPosition" |
|||
const OperationShareHkdShareHkdCancel = "/matchmaking.v1.ShareHkd/ShareHkdCancel" |
|||
const OperationShareHkdShareHkdPlaceOrder = "/matchmaking.v1.ShareHkd/ShareHkdPlaceOrder" |
|||
const OperationShareHkdShareHkdPosition = "/matchmaking.v1.ShareHkd/ShareHkdPosition" |
|||
const OperationShareHkdShareHkdUpdateOrder = "/matchmaking.v1.ShareHkd/ShareHkdUpdateOrder" |
|||
|
|||
type ShareHkdHTTPServer interface { |
|||
// GetBotStockHkdTrade GetBotStockHkdTrade 港股列表查询
|
|||
GetBotStockHkdTrade(context.Context, *GetBotStockHkdTradeRequest) (*GetBotStockHkdTradeReply, error) |
|||
// ShareHkdAllPosition ShareHkdAllPosition 港股一键平仓
|
|||
ShareHkdAllPosition(context.Context, *AllHkdOrderRequest) (*AllHkdOrderReply, error) |
|||
// ShareHkdCancel ShareHkdCancel 港股撤单
|
|||
ShareHkdCancel(context.Context, *CancelHkdOrderRequest) (*OrderHkdReply, error) |
|||
// ShareHkdPlaceOrder ShareHkdPlaceOrder 港股下单
|
|||
ShareHkdPlaceOrder(context.Context, *OrderHkdRequest) (*OrderHkdReply, error) |
|||
// ShareHkdPosition ShareHkdPosition 港股平仓
|
|||
ShareHkdPosition(context.Context, *CancelHkdOrderRequest) (*OrderHkdReply, error) |
|||
// ShareHkdUpdateOrder ShareHkdUpdateOrder 港股设置止盈止损
|
|||
ShareHkdUpdateOrder(context.Context, *UpdateHkdOrderRequest) (*OrderHkdReply, error) |
|||
} |
|||
|
|||
func RegisterShareHkdHTTPServer(s *http.Server, srv ShareHkdHTTPServer) { |
|||
r := s.Route("/") |
|||
r.POST("/order_sharehkd/share_list", _ShareHkd_GetBotStockHkdTrade0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharehkd/share_place_order", _ShareHkd_ShareHkdPlaceOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharehkd/share_update_order", _ShareHkd_ShareHkdUpdateOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharehkd/share_position", _ShareHkd_ShareHkdPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharehkd/share_all_position", _ShareHkd_ShareHkdAllPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharehkd/share_cancel", _ShareHkd_ShareHkdCancel0_HTTP_Handler(srv)) |
|||
} |
|||
|
|||
func _ShareHkd_GetBotStockHkdTrade0_HTTP_Handler(srv ShareHkdHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in GetBotStockHkdTradeRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareHkdGetBotStockHkdTrade) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.GetBotStockHkdTrade(ctx, req.(*GetBotStockHkdTradeRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*GetBotStockHkdTradeReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareHkd_ShareHkdPlaceOrder0_HTTP_Handler(srv ShareHkdHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in OrderHkdRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareHkdShareHkdPlaceOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareHkdPlaceOrder(ctx, req.(*OrderHkdRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*OrderHkdReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareHkd_ShareHkdUpdateOrder0_HTTP_Handler(srv ShareHkdHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in UpdateHkdOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareHkdShareHkdUpdateOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareHkdUpdateOrder(ctx, req.(*UpdateHkdOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*OrderHkdReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareHkd_ShareHkdPosition0_HTTP_Handler(srv ShareHkdHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelHkdOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareHkdShareHkdPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareHkdPosition(ctx, req.(*CancelHkdOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*OrderHkdReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareHkd_ShareHkdAllPosition0_HTTP_Handler(srv ShareHkdHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in AllHkdOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareHkdShareHkdAllPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareHkdAllPosition(ctx, req.(*AllHkdOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*AllHkdOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareHkd_ShareHkdCancel0_HTTP_Handler(srv ShareHkdHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelHkdOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareHkdShareHkdCancel) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareHkdCancel(ctx, req.(*CancelHkdOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*OrderHkdReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
type ShareHkdHTTPClient interface { |
|||
GetBotStockHkdTrade(ctx context.Context, req *GetBotStockHkdTradeRequest, opts ...http.CallOption) (rsp *GetBotStockHkdTradeReply, err error) |
|||
ShareHkdAllPosition(ctx context.Context, req *AllHkdOrderRequest, opts ...http.CallOption) (rsp *AllHkdOrderReply, err error) |
|||
ShareHkdCancel(ctx context.Context, req *CancelHkdOrderRequest, opts ...http.CallOption) (rsp *OrderHkdReply, err error) |
|||
ShareHkdPlaceOrder(ctx context.Context, req *OrderHkdRequest, opts ...http.CallOption) (rsp *OrderHkdReply, err error) |
|||
ShareHkdPosition(ctx context.Context, req *CancelHkdOrderRequest, opts ...http.CallOption) (rsp *OrderHkdReply, err error) |
|||
ShareHkdUpdateOrder(ctx context.Context, req *UpdateHkdOrderRequest, opts ...http.CallOption) (rsp *OrderHkdReply, err error) |
|||
} |
|||
|
|||
type ShareHkdHTTPClientImpl struct { |
|||
cc *http.Client |
|||
} |
|||
|
|||
func NewShareHkdHTTPClient(client *http.Client) ShareHkdHTTPClient { |
|||
return &ShareHkdHTTPClientImpl{client} |
|||
} |
|||
|
|||
func (c *ShareHkdHTTPClientImpl) GetBotStockHkdTrade(ctx context.Context, in *GetBotStockHkdTradeRequest, opts ...http.CallOption) (*GetBotStockHkdTradeReply, error) { |
|||
var out GetBotStockHkdTradeReply |
|||
pattern := "/order_sharehkd/share_list" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareHkdGetBotStockHkdTrade)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareHkdHTTPClientImpl) ShareHkdAllPosition(ctx context.Context, in *AllHkdOrderRequest, opts ...http.CallOption) (*AllHkdOrderReply, error) { |
|||
var out AllHkdOrderReply |
|||
pattern := "/order_sharehkd/share_all_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareHkdShareHkdAllPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareHkdHTTPClientImpl) ShareHkdCancel(ctx context.Context, in *CancelHkdOrderRequest, opts ...http.CallOption) (*OrderHkdReply, error) { |
|||
var out OrderHkdReply |
|||
pattern := "/order_sharehkd/share_cancel" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareHkdShareHkdCancel)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareHkdHTTPClientImpl) ShareHkdPlaceOrder(ctx context.Context, in *OrderHkdRequest, opts ...http.CallOption) (*OrderHkdReply, error) { |
|||
var out OrderHkdReply |
|||
pattern := "/order_sharehkd/share_place_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareHkdShareHkdPlaceOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareHkdHTTPClientImpl) ShareHkdPosition(ctx context.Context, in *CancelHkdOrderRequest, opts ...http.CallOption) (*OrderHkdReply, error) { |
|||
var out OrderHkdReply |
|||
pattern := "/order_sharehkd/share_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareHkdShareHkdPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareHkdHTTPClientImpl) ShareHkdUpdateOrder(ctx context.Context, in *UpdateHkdOrderRequest, opts ...http.CallOption) (*OrderHkdReply, error) { |
|||
var out OrderHkdReply |
|||
pattern := "/order_sharehkd/share_update_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareHkdShareHkdUpdateOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,144 @@ |
|||
syntax = "proto3"; |
|||
|
|||
package matchmaking.v1; |
|||
|
|||
import "google/api/annotations.proto"; |
|||
|
|||
option go_package = "matchmaking-system/api/matchmaking/v1;v1"; |
|||
|
|||
service ShareIdn { |
|||
// GetBotStockIdnTrade 印尼股列表查询 |
|||
rpc GetBotStockIdnTrade(GetIdnBotStockTradeRequest)returns(GetBotStockIdnTradeReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareidn/share_list", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareIdnPlaceOrder 印尼股下单 |
|||
rpc ShareIdnPlaceOrder(ShareIdnOrderRequest)returns(IdnOrderReply) { |
|||
option (google.api.http) = { |
|||
post: "/order_shareidn/share_place_order", |
|||
body: "*", |
|||
}; |
|||
} |
|||
// ShareIdnUpdateOrder 印尼股设置止盈止损 |
|||
rpc ShareIdnUpdateOrder(UpdateIdnOrderRequest)returns(IdnOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareidn/share_update_order", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareIdnPosition 印尼股平仓 |
|||
rpc ShareIdnPosition(CancelIdnOrderRequest)returns(IdnOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareidn/share_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareIdnAllPosition 印尼股一键平仓 |
|||
rpc ShareIdnAllPosition(AllIdnOrderRequest)returns(AllIdnOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareidn/share_all_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareIdnCancel 印尼股撤单 |
|||
rpc ShareIdnCancel(CancelIdnOrderRequest)returns(IdnOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareidn/share_cancel", |
|||
body:"*", |
|||
}; |
|||
} |
|||
} |
|||
|
|||
message GetIdnBotStockTradeRequest{ |
|||
int64 status =1;// 状态码 |
|||
int64 pageSize =2; // 每页显示条数 |
|||
int64 pageCount =3;// 开始的位置 |
|||
} |
|||
message GetBotStockIdnTradeReply{ |
|||
int64 code =1;// 状态码 |
|||
BotStockIdnTradeData data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message BotStockIdnTradeData{ |
|||
int64 pageSize =1; // 每页显示条数 |
|||
int64 pageCount =2;// 开始的位置 |
|||
repeated BotStockIdnTrade data =3;// 返回结果 |
|||
int64 totalCount =4;// 总数据 |
|||
} |
|||
|
|||
message BotStockIdnTrade{ |
|||
string orderId =1;// 订单ID |
|||
string stockId =2;// 股票代码 |
|||
int64 tradeType =3;// 交易类型 |
|||
int64 dealType =4;// 交易方式 |
|||
string limitPrice =5;// 限价 |
|||
string marketPrice =6;// 市价 |
|||
string dealPrice =7;// 开仓价 |
|||
string closingPrice =8;// 平仓价 |
|||
string orderNumber =9;// 订单数量 |
|||
int64 stopType =10;// 止盈止损 |
|||
string stopLossPrice =11;// 止损 |
|||
string stopWinPrice =12;// 止盈 |
|||
string serviceCost =13;// 开仓手续费 |
|||
string marketMoney =14;// 订单金额 |
|||
string orderMoney =15;// 订单总金额 |
|||
int64 status =16;// 订单状态 |
|||
string createTime =17;// 订单创建时间 |
|||
string updateTime =18;// 订单更新时间 |
|||
string openTime =19;// 订单开仓时间 |
|||
string closingTime =20;// 订单平仓时间 |
|||
string closingCost =21;// 平仓手续费 |
|||
string faceValue =22;// 面值 |
|||
string pryNum =23;// 杠杆 |
|||
string keepDecimal =24;// 保留小数位 |
|||
string stockName =25;// 股票名称 |
|||
} |
|||
|
|||
message ShareIdnOrderRequest{ |
|||
string stockId =1;// 股票Code |
|||
int64 tradeType =2;// 交易类型:1买入,2卖出 |
|||
int64 dealType =3;// 委托方式:1限价,2市价 |
|||
string limitPrice =4;// 限价 |
|||
string marketPrice =5;// 市价 |
|||
string marketMoney =6;// 订单金额 |
|||
string orderNumber =7;// 订单数量 |
|||
string serviceCost =8;// 手续费 |
|||
int64 stopType =9;// 止损止盈设置:1无设置,2止损止盈 |
|||
string stopLossPrice =10;// 止损 |
|||
string stopWinPrice =11;// 止损 |
|||
string pryNum =12;// 杠杆 |
|||
} |
|||
|
|||
message UpdateIdnOrderRequest{ |
|||
string orderId =1;// 订单Id |
|||
int64 stopType =2;// 止盈止损 |
|||
string stopLossPrice =3;// 止损 |
|||
string stopWinPrice =4;// 止盈 |
|||
} |
|||
|
|||
message IdnOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
IdnOrderResult data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message IdnOrderResult { |
|||
string orderId =1;// 订单Id |
|||
} |
|||
|
|||
message AllIdnOrderRequest{ |
|||
|
|||
} |
|||
|
|||
message AllIdnOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
string data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message CancelIdnOrderRequest{ |
|||
string orderId =1;// 订单ID |
|||
} |
@ -0,0 +1,312 @@ |
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-grpc v1.4.0
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareIdn.proto
|
|||
|
|||
package v1 |
|||
|
|||
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.62.0 or later.
|
|||
const _ = grpc.SupportPackageIsVersion8 |
|||
|
|||
const ( |
|||
ShareIdn_GetBotStockIdnTrade_FullMethodName = "/matchmaking.v1.ShareIdn/GetBotStockIdnTrade" |
|||
ShareIdn_ShareIdnPlaceOrder_FullMethodName = "/matchmaking.v1.ShareIdn/ShareIdnPlaceOrder" |
|||
ShareIdn_ShareIdnUpdateOrder_FullMethodName = "/matchmaking.v1.ShareIdn/ShareIdnUpdateOrder" |
|||
ShareIdn_ShareIdnPosition_FullMethodName = "/matchmaking.v1.ShareIdn/ShareIdnPosition" |
|||
ShareIdn_ShareIdnAllPosition_FullMethodName = "/matchmaking.v1.ShareIdn/ShareIdnAllPosition" |
|||
ShareIdn_ShareIdnCancel_FullMethodName = "/matchmaking.v1.ShareIdn/ShareIdnCancel" |
|||
) |
|||
|
|||
// ShareIdnClient is the client API for ShareIdn 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 ShareIdnClient interface { |
|||
// GetBotStockIdnTrade 印尼股列表查询
|
|||
GetBotStockIdnTrade(ctx context.Context, in *GetIdnBotStockTradeRequest, opts ...grpc.CallOption) (*GetBotStockIdnTradeReply, error) |
|||
// ShareIdnPlaceOrder 印尼股下单
|
|||
ShareIdnPlaceOrder(ctx context.Context, in *ShareIdnOrderRequest, opts ...grpc.CallOption) (*IdnOrderReply, error) |
|||
// ShareIdnUpdateOrder 印尼股设置止盈止损
|
|||
ShareIdnUpdateOrder(ctx context.Context, in *UpdateIdnOrderRequest, opts ...grpc.CallOption) (*IdnOrderReply, error) |
|||
// ShareIdnPosition 印尼股平仓
|
|||
ShareIdnPosition(ctx context.Context, in *CancelIdnOrderRequest, opts ...grpc.CallOption) (*IdnOrderReply, error) |
|||
// ShareIdnAllPosition 印尼股一键平仓
|
|||
ShareIdnAllPosition(ctx context.Context, in *AllIdnOrderRequest, opts ...grpc.CallOption) (*AllIdnOrderReply, error) |
|||
// ShareIdnCancel 印尼股撤单
|
|||
ShareIdnCancel(ctx context.Context, in *CancelIdnOrderRequest, opts ...grpc.CallOption) (*IdnOrderReply, error) |
|||
} |
|||
|
|||
type shareIdnClient struct { |
|||
cc grpc.ClientConnInterface |
|||
} |
|||
|
|||
func NewShareIdnClient(cc grpc.ClientConnInterface) ShareIdnClient { |
|||
return &shareIdnClient{cc} |
|||
} |
|||
|
|||
func (c *shareIdnClient) GetBotStockIdnTrade(ctx context.Context, in *GetIdnBotStockTradeRequest, opts ...grpc.CallOption) (*GetBotStockIdnTradeReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(GetBotStockIdnTradeReply) |
|||
err := c.cc.Invoke(ctx, ShareIdn_GetBotStockIdnTrade_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareIdnClient) ShareIdnPlaceOrder(ctx context.Context, in *ShareIdnOrderRequest, opts ...grpc.CallOption) (*IdnOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(IdnOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareIdn_ShareIdnPlaceOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareIdnClient) ShareIdnUpdateOrder(ctx context.Context, in *UpdateIdnOrderRequest, opts ...grpc.CallOption) (*IdnOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(IdnOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareIdn_ShareIdnUpdateOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareIdnClient) ShareIdnPosition(ctx context.Context, in *CancelIdnOrderRequest, opts ...grpc.CallOption) (*IdnOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(IdnOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareIdn_ShareIdnPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareIdnClient) ShareIdnAllPosition(ctx context.Context, in *AllIdnOrderRequest, opts ...grpc.CallOption) (*AllIdnOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(AllIdnOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareIdn_ShareIdnAllPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareIdnClient) ShareIdnCancel(ctx context.Context, in *CancelIdnOrderRequest, opts ...grpc.CallOption) (*IdnOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(IdnOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareIdn_ShareIdnCancel_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
// ShareIdnServer is the server API for ShareIdn service.
|
|||
// All implementations must embed UnimplementedShareIdnServer
|
|||
// for forward compatibility
|
|||
type ShareIdnServer interface { |
|||
// GetBotStockIdnTrade 印尼股列表查询
|
|||
GetBotStockIdnTrade(context.Context, *GetIdnBotStockTradeRequest) (*GetBotStockIdnTradeReply, error) |
|||
// ShareIdnPlaceOrder 印尼股下单
|
|||
ShareIdnPlaceOrder(context.Context, *ShareIdnOrderRequest) (*IdnOrderReply, error) |
|||
// ShareIdnUpdateOrder 印尼股设置止盈止损
|
|||
ShareIdnUpdateOrder(context.Context, *UpdateIdnOrderRequest) (*IdnOrderReply, error) |
|||
// ShareIdnPosition 印尼股平仓
|
|||
ShareIdnPosition(context.Context, *CancelIdnOrderRequest) (*IdnOrderReply, error) |
|||
// ShareIdnAllPosition 印尼股一键平仓
|
|||
ShareIdnAllPosition(context.Context, *AllIdnOrderRequest) (*AllIdnOrderReply, error) |
|||
// ShareIdnCancel 印尼股撤单
|
|||
ShareIdnCancel(context.Context, *CancelIdnOrderRequest) (*IdnOrderReply, error) |
|||
mustEmbedUnimplementedShareIdnServer() |
|||
} |
|||
|
|||
// UnimplementedShareIdnServer must be embedded to have forward compatible implementations.
|
|||
type UnimplementedShareIdnServer struct { |
|||
} |
|||
|
|||
func (UnimplementedShareIdnServer) GetBotStockIdnTrade(context.Context, *GetIdnBotStockTradeRequest) (*GetBotStockIdnTradeReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method GetBotStockIdnTrade not implemented") |
|||
} |
|||
func (UnimplementedShareIdnServer) ShareIdnPlaceOrder(context.Context, *ShareIdnOrderRequest) (*IdnOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareIdnPlaceOrder not implemented") |
|||
} |
|||
func (UnimplementedShareIdnServer) ShareIdnUpdateOrder(context.Context, *UpdateIdnOrderRequest) (*IdnOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareIdnUpdateOrder not implemented") |
|||
} |
|||
func (UnimplementedShareIdnServer) ShareIdnPosition(context.Context, *CancelIdnOrderRequest) (*IdnOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareIdnPosition not implemented") |
|||
} |
|||
func (UnimplementedShareIdnServer) ShareIdnAllPosition(context.Context, *AllIdnOrderRequest) (*AllIdnOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareIdnAllPosition not implemented") |
|||
} |
|||
func (UnimplementedShareIdnServer) ShareIdnCancel(context.Context, *CancelIdnOrderRequest) (*IdnOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareIdnCancel not implemented") |
|||
} |
|||
func (UnimplementedShareIdnServer) mustEmbedUnimplementedShareIdnServer() {} |
|||
|
|||
// UnsafeShareIdnServer may be embedded to opt out of forward compatibility for this service.
|
|||
// Use of this interface is not recommended, as added methods to ShareIdnServer will
|
|||
// result in compilation errors.
|
|||
type UnsafeShareIdnServer interface { |
|||
mustEmbedUnimplementedShareIdnServer() |
|||
} |
|||
|
|||
func RegisterShareIdnServer(s grpc.ServiceRegistrar, srv ShareIdnServer) { |
|||
s.RegisterService(&ShareIdn_ServiceDesc, srv) |
|||
} |
|||
|
|||
func _ShareIdn_GetBotStockIdnTrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(GetIdnBotStockTradeRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareIdnServer).GetBotStockIdnTrade(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareIdn_GetBotStockIdnTrade_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareIdnServer).GetBotStockIdnTrade(ctx, req.(*GetIdnBotStockTradeRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareIdn_ShareIdnPlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(ShareIdnOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareIdnServer).ShareIdnPlaceOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareIdn_ShareIdnPlaceOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareIdnServer).ShareIdnPlaceOrder(ctx, req.(*ShareIdnOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareIdn_ShareIdnUpdateOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(UpdateIdnOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareIdnServer).ShareIdnUpdateOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareIdn_ShareIdnUpdateOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareIdnServer).ShareIdnUpdateOrder(ctx, req.(*UpdateIdnOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareIdn_ShareIdnPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelIdnOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareIdnServer).ShareIdnPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareIdn_ShareIdnPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareIdnServer).ShareIdnPosition(ctx, req.(*CancelIdnOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareIdn_ShareIdnAllPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(AllIdnOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareIdnServer).ShareIdnAllPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareIdn_ShareIdnAllPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareIdnServer).ShareIdnAllPosition(ctx, req.(*AllIdnOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareIdn_ShareIdnCancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelIdnOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareIdnServer).ShareIdnCancel(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareIdn_ShareIdnCancel_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareIdnServer).ShareIdnCancel(ctx, req.(*CancelIdnOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
// ShareIdn_ServiceDesc is the grpc.ServiceDesc for ShareIdn service.
|
|||
// It's only intended for direct use with grpc.RegisterService,
|
|||
// and not to be introspected or modified (even as a copy)
|
|||
var ShareIdn_ServiceDesc = grpc.ServiceDesc{ |
|||
ServiceName: "matchmaking.v1.ShareIdn", |
|||
HandlerType: (*ShareIdnServer)(nil), |
|||
Methods: []grpc.MethodDesc{ |
|||
{ |
|||
MethodName: "GetBotStockIdnTrade", |
|||
Handler: _ShareIdn_GetBotStockIdnTrade_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareIdnPlaceOrder", |
|||
Handler: _ShareIdn_ShareIdnPlaceOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareIdnUpdateOrder", |
|||
Handler: _ShareIdn_ShareIdnUpdateOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareIdnPosition", |
|||
Handler: _ShareIdn_ShareIdnPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareIdnAllPosition", |
|||
Handler: _ShareIdn_ShareIdnAllPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareIdnCancel", |
|||
Handler: _ShareIdn_ShareIdnCancel_Handler, |
|||
}, |
|||
}, |
|||
Streams: []grpc.StreamDesc{}, |
|||
Metadata: "matchmaking/v1/share/shareIdn.proto", |
|||
} |
@ -0,0 +1,279 @@ |
|||
// Code generated by protoc-gen-go-http. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-http v2.7.3
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareIdn.proto
|
|||
|
|||
package v1 |
|||
|
|||
import ( |
|||
context "context" |
|||
http "github.com/go-kratos/kratos/v2/transport/http" |
|||
binding "github.com/go-kratos/kratos/v2/transport/http/binding" |
|||
) |
|||
|
|||
// This is a compile-time assertion to ensure that this generated file
|
|||
// is compatible with the kratos package it is being compiled against.
|
|||
var _ = new(context.Context) |
|||
var _ = binding.EncodeURL |
|||
|
|||
const _ = http.SupportPackageIsVersion1 |
|||
|
|||
const OperationShareIdnGetBotStockIdnTrade = "/matchmaking.v1.ShareIdn/GetBotStockIdnTrade" |
|||
const OperationShareIdnShareIdnAllPosition = "/matchmaking.v1.ShareIdn/ShareIdnAllPosition" |
|||
const OperationShareIdnShareIdnCancel = "/matchmaking.v1.ShareIdn/ShareIdnCancel" |
|||
const OperationShareIdnShareIdnPlaceOrder = "/matchmaking.v1.ShareIdn/ShareIdnPlaceOrder" |
|||
const OperationShareIdnShareIdnPosition = "/matchmaking.v1.ShareIdn/ShareIdnPosition" |
|||
const OperationShareIdnShareIdnUpdateOrder = "/matchmaking.v1.ShareIdn/ShareIdnUpdateOrder" |
|||
|
|||
type ShareIdnHTTPServer interface { |
|||
// GetBotStockIdnTrade GetBotStockIdnTrade 印尼股列表查询
|
|||
GetBotStockIdnTrade(context.Context, *GetIdnBotStockTradeRequest) (*GetBotStockIdnTradeReply, error) |
|||
// ShareIdnAllPosition ShareIdnAllPosition 印尼股一键平仓
|
|||
ShareIdnAllPosition(context.Context, *AllIdnOrderRequest) (*AllIdnOrderReply, error) |
|||
// ShareIdnCancel ShareIdnCancel 印尼股撤单
|
|||
ShareIdnCancel(context.Context, *CancelIdnOrderRequest) (*IdnOrderReply, error) |
|||
// ShareIdnPlaceOrder ShareIdnPlaceOrder 印尼股下单
|
|||
ShareIdnPlaceOrder(context.Context, *ShareIdnOrderRequest) (*IdnOrderReply, error) |
|||
// ShareIdnPosition ShareIdnPosition 印尼股平仓
|
|||
ShareIdnPosition(context.Context, *CancelIdnOrderRequest) (*IdnOrderReply, error) |
|||
// ShareIdnUpdateOrder ShareIdnUpdateOrder 印尼股设置止盈止损
|
|||
ShareIdnUpdateOrder(context.Context, *UpdateIdnOrderRequest) (*IdnOrderReply, error) |
|||
} |
|||
|
|||
func RegisterShareIdnHTTPServer(s *http.Server, srv ShareIdnHTTPServer) { |
|||
r := s.Route("/") |
|||
r.POST("/order_shareidn/share_list", _ShareIdn_GetBotStockIdnTrade0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareidn/share_place_order", _ShareIdn_ShareIdnPlaceOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareidn/share_update_order", _ShareIdn_ShareIdnUpdateOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareidn/share_position", _ShareIdn_ShareIdnPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareidn/share_all_position", _ShareIdn_ShareIdnAllPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareidn/share_cancel", _ShareIdn_ShareIdnCancel0_HTTP_Handler(srv)) |
|||
} |
|||
|
|||
func _ShareIdn_GetBotStockIdnTrade0_HTTP_Handler(srv ShareIdnHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in GetIdnBotStockTradeRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareIdnGetBotStockIdnTrade) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.GetBotStockIdnTrade(ctx, req.(*GetIdnBotStockTradeRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*GetBotStockIdnTradeReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareIdn_ShareIdnPlaceOrder0_HTTP_Handler(srv ShareIdnHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in ShareIdnOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareIdnShareIdnPlaceOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareIdnPlaceOrder(ctx, req.(*ShareIdnOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*IdnOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareIdn_ShareIdnUpdateOrder0_HTTP_Handler(srv ShareIdnHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in UpdateIdnOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareIdnShareIdnUpdateOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareIdnUpdateOrder(ctx, req.(*UpdateIdnOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*IdnOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareIdn_ShareIdnPosition0_HTTP_Handler(srv ShareIdnHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelIdnOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareIdnShareIdnPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareIdnPosition(ctx, req.(*CancelIdnOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*IdnOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareIdn_ShareIdnAllPosition0_HTTP_Handler(srv ShareIdnHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in AllIdnOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareIdnShareIdnAllPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareIdnAllPosition(ctx, req.(*AllIdnOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*AllIdnOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareIdn_ShareIdnCancel0_HTTP_Handler(srv ShareIdnHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelIdnOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareIdnShareIdnCancel) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareIdnCancel(ctx, req.(*CancelIdnOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*IdnOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
type ShareIdnHTTPClient interface { |
|||
GetBotStockIdnTrade(ctx context.Context, req *GetIdnBotStockTradeRequest, opts ...http.CallOption) (rsp *GetBotStockIdnTradeReply, err error) |
|||
ShareIdnAllPosition(ctx context.Context, req *AllIdnOrderRequest, opts ...http.CallOption) (rsp *AllIdnOrderReply, err error) |
|||
ShareIdnCancel(ctx context.Context, req *CancelIdnOrderRequest, opts ...http.CallOption) (rsp *IdnOrderReply, err error) |
|||
ShareIdnPlaceOrder(ctx context.Context, req *ShareIdnOrderRequest, opts ...http.CallOption) (rsp *IdnOrderReply, err error) |
|||
ShareIdnPosition(ctx context.Context, req *CancelIdnOrderRequest, opts ...http.CallOption) (rsp *IdnOrderReply, err error) |
|||
ShareIdnUpdateOrder(ctx context.Context, req *UpdateIdnOrderRequest, opts ...http.CallOption) (rsp *IdnOrderReply, err error) |
|||
} |
|||
|
|||
type ShareIdnHTTPClientImpl struct { |
|||
cc *http.Client |
|||
} |
|||
|
|||
func NewShareIdnHTTPClient(client *http.Client) ShareIdnHTTPClient { |
|||
return &ShareIdnHTTPClientImpl{client} |
|||
} |
|||
|
|||
func (c *ShareIdnHTTPClientImpl) GetBotStockIdnTrade(ctx context.Context, in *GetIdnBotStockTradeRequest, opts ...http.CallOption) (*GetBotStockIdnTradeReply, error) { |
|||
var out GetBotStockIdnTradeReply |
|||
pattern := "/order_shareidn/share_list" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareIdnGetBotStockIdnTrade)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareIdnHTTPClientImpl) ShareIdnAllPosition(ctx context.Context, in *AllIdnOrderRequest, opts ...http.CallOption) (*AllIdnOrderReply, error) { |
|||
var out AllIdnOrderReply |
|||
pattern := "/order_shareidn/share_all_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareIdnShareIdnAllPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareIdnHTTPClientImpl) ShareIdnCancel(ctx context.Context, in *CancelIdnOrderRequest, opts ...http.CallOption) (*IdnOrderReply, error) { |
|||
var out IdnOrderReply |
|||
pattern := "/order_shareidn/share_cancel" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareIdnShareIdnCancel)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareIdnHTTPClientImpl) ShareIdnPlaceOrder(ctx context.Context, in *ShareIdnOrderRequest, opts ...http.CallOption) (*IdnOrderReply, error) { |
|||
var out IdnOrderReply |
|||
pattern := "/order_shareidn/share_place_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareIdnShareIdnPlaceOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareIdnHTTPClientImpl) ShareIdnPosition(ctx context.Context, in *CancelIdnOrderRequest, opts ...http.CallOption) (*IdnOrderReply, error) { |
|||
var out IdnOrderReply |
|||
pattern := "/order_shareidn/share_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareIdnShareIdnPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareIdnHTTPClientImpl) ShareIdnUpdateOrder(ctx context.Context, in *UpdateIdnOrderRequest, opts ...http.CallOption) (*IdnOrderReply, error) { |
|||
var out IdnOrderReply |
|||
pattern := "/order_shareidn/share_update_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareIdnShareIdnUpdateOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,145 @@ |
|||
syntax = "proto3"; |
|||
|
|||
package matchmaking.v1; |
|||
|
|||
import "google/api/annotations.proto"; |
|||
|
|||
option go_package = "matchmaking-system/api/matchmaking/v1;v1"; |
|||
|
|||
service ShareInr { |
|||
// GetBotStockInrTrade 印度股列表查询 |
|||
rpc GetBotStockInrTrade(GetInrBotStockTradeRequest)returns(GetBotStockInrTradeReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareinr/share_list", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareInrPlaceOrder 印度股下单 |
|||
rpc ShareInrPlaceOrder(ShareInrOrderRequest)returns(InrOrderReply) { |
|||
option (google.api.http) = { |
|||
post: "/order_shareinr/share_place_order", |
|||
body: "*", |
|||
}; |
|||
} |
|||
// ShareInrUpdateOrder 印度股设置止盈止损 |
|||
rpc ShareInrUpdateOrder(UpdateInrOrderRequest)returns(InrOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareinr/share_update_order", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareInrPosition 印度股平仓 |
|||
rpc ShareInrPosition(CancelInrOrderRequest)returns(InrOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareinr/share_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareInrAllPosition 印度股一键平仓 |
|||
rpc ShareInrAllPosition(AllInrOrderRequest)returns(AllInrOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareinr/share_all_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareInrCancel 印度股撤单 |
|||
rpc ShareInrCancel(CancelInrOrderRequest)returns(InrOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareinr/share_cancel", |
|||
body:"*", |
|||
}; |
|||
} |
|||
} |
|||
|
|||
message CancelInrOrderRequest{ |
|||
string orderId =1;// 订单ID |
|||
} |
|||
|
|||
message UpdateInrOrderRequest{ |
|||
string orderId =1;// 订单Id |
|||
int64 stopType =2;// 止盈止损 |
|||
string stopLossPrice =3;// 止损 |
|||
string stopWinPrice =4;// 止盈 |
|||
} |
|||
|
|||
message ShareInrOrderRequest{ |
|||
string stockId =1;// 股票Code |
|||
int64 tradeType =2;// 交易类型:1买入,2卖出 |
|||
int64 dealType =3;// 委托方式:1限价,2市价 |
|||
string limitPrice =4;// 限价 |
|||
string marketPrice =5;// 市价 |
|||
string marketMoney =6;// 订单金额 |
|||
string orderNumber =7;// 订单数量 |
|||
string serviceCost =8;// 手续费 |
|||
int64 stopType =9;// 止损止盈设置:1无设置,2止损止盈 |
|||
string stopLossPrice =10;// 止损 |
|||
string stopWinPrice =11;// 止损 |
|||
string pryNum =12;// 杠杆 |
|||
} |
|||
|
|||
message GetInrBotStockTradeRequest{ |
|||
int64 status =1;// 状态码 |
|||
int64 pageSize =2; // 每页显示条数 |
|||
int64 pageCount =3;// 开始的位置 |
|||
} |
|||
|
|||
message GetBotStockInrTradeReply{ |
|||
int64 code =1;// 状态码 |
|||
BotStockInrTradeData data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message BotStockInrTradeData{ |
|||
int64 pageSize =1; // 每页显示条数 |
|||
int64 pageCount =2;// 开始的位置 |
|||
repeated BotStockInrTrade data =3;// 返回结果 |
|||
int64 totalCount =4;// 总数据 |
|||
} |
|||
|
|||
message BotStockInrTrade{ |
|||
string orderId =1;// 订单ID |
|||
string stockId =2;// 股票代码 |
|||
int64 tradeType =3;// 交易类型 |
|||
int64 dealType =4;// 交易方式 |
|||
string limitPrice =5;// 限价 |
|||
string marketPrice =6;// 市价 |
|||
string dealPrice =7;// 开仓价 |
|||
string closingPrice =8;// 平仓价 |
|||
string orderNumber =9;// 订单数量 |
|||
int64 stopType =10;// 止盈止损 |
|||
string stopLossPrice =11;// 止损 |
|||
string stopWinPrice =12;// 止盈 |
|||
string serviceCost =13;// 开仓手续费 |
|||
string marketMoney =14;// 订单金额 |
|||
string orderMoney =15;// 订单总金额 |
|||
int64 status =16;// 订单状态 |
|||
string createTime =17;// 订单创建时间 |
|||
string updateTime =18;// 订单更新时间 |
|||
string openTime =19;// 订单开仓时间 |
|||
string closingTime =20;// 订单平仓时间 |
|||
string closingCost =21;// 平仓手续费 |
|||
string faceValue =22;// 面值 |
|||
string pryNum =23;// 杠杆 |
|||
string keepDecimal =24;// 保留小数位 |
|||
string stockName =25;// 股票名称 |
|||
} |
|||
|
|||
message InrOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
InrOrderResult data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message InrOrderResult { |
|||
string orderId =1;// 订单Id |
|||
} |
|||
|
|||
message AllInrOrderRequest{ |
|||
|
|||
} |
|||
|
|||
message AllInrOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
string data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
@ -0,0 +1,312 @@ |
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-grpc v1.4.0
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareInr.proto
|
|||
|
|||
package v1 |
|||
|
|||
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.62.0 or later.
|
|||
const _ = grpc.SupportPackageIsVersion8 |
|||
|
|||
const ( |
|||
ShareInr_GetBotStockInrTrade_FullMethodName = "/matchmaking.v1.ShareInr/GetBotStockInrTrade" |
|||
ShareInr_ShareInrPlaceOrder_FullMethodName = "/matchmaking.v1.ShareInr/ShareInrPlaceOrder" |
|||
ShareInr_ShareInrUpdateOrder_FullMethodName = "/matchmaking.v1.ShareInr/ShareInrUpdateOrder" |
|||
ShareInr_ShareInrPosition_FullMethodName = "/matchmaking.v1.ShareInr/ShareInrPosition" |
|||
ShareInr_ShareInrAllPosition_FullMethodName = "/matchmaking.v1.ShareInr/ShareInrAllPosition" |
|||
ShareInr_ShareInrCancel_FullMethodName = "/matchmaking.v1.ShareInr/ShareInrCancel" |
|||
) |
|||
|
|||
// ShareInrClient is the client API for ShareInr 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 ShareInrClient interface { |
|||
// GetBotStockInrTrade 印度股列表查询
|
|||
GetBotStockInrTrade(ctx context.Context, in *GetInrBotStockTradeRequest, opts ...grpc.CallOption) (*GetBotStockInrTradeReply, error) |
|||
// ShareInrPlaceOrder 印度股下单
|
|||
ShareInrPlaceOrder(ctx context.Context, in *ShareInrOrderRequest, opts ...grpc.CallOption) (*InrOrderReply, error) |
|||
// ShareInrUpdateOrder 印度股设置止盈止损
|
|||
ShareInrUpdateOrder(ctx context.Context, in *UpdateInrOrderRequest, opts ...grpc.CallOption) (*InrOrderReply, error) |
|||
// ShareInrPosition 印度股平仓
|
|||
ShareInrPosition(ctx context.Context, in *CancelInrOrderRequest, opts ...grpc.CallOption) (*InrOrderReply, error) |
|||
// ShareInrAllPosition 印度股一键平仓
|
|||
ShareInrAllPosition(ctx context.Context, in *AllInrOrderRequest, opts ...grpc.CallOption) (*AllInrOrderReply, error) |
|||
// ShareInrCancel 印度股撤单
|
|||
ShareInrCancel(ctx context.Context, in *CancelInrOrderRequest, opts ...grpc.CallOption) (*InrOrderReply, error) |
|||
} |
|||
|
|||
type shareInrClient struct { |
|||
cc grpc.ClientConnInterface |
|||
} |
|||
|
|||
func NewShareInrClient(cc grpc.ClientConnInterface) ShareInrClient { |
|||
return &shareInrClient{cc} |
|||
} |
|||
|
|||
func (c *shareInrClient) GetBotStockInrTrade(ctx context.Context, in *GetInrBotStockTradeRequest, opts ...grpc.CallOption) (*GetBotStockInrTradeReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(GetBotStockInrTradeReply) |
|||
err := c.cc.Invoke(ctx, ShareInr_GetBotStockInrTrade_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareInrClient) ShareInrPlaceOrder(ctx context.Context, in *ShareInrOrderRequest, opts ...grpc.CallOption) (*InrOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(InrOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareInr_ShareInrPlaceOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareInrClient) ShareInrUpdateOrder(ctx context.Context, in *UpdateInrOrderRequest, opts ...grpc.CallOption) (*InrOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(InrOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareInr_ShareInrUpdateOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareInrClient) ShareInrPosition(ctx context.Context, in *CancelInrOrderRequest, opts ...grpc.CallOption) (*InrOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(InrOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareInr_ShareInrPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareInrClient) ShareInrAllPosition(ctx context.Context, in *AllInrOrderRequest, opts ...grpc.CallOption) (*AllInrOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(AllInrOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareInr_ShareInrAllPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareInrClient) ShareInrCancel(ctx context.Context, in *CancelInrOrderRequest, opts ...grpc.CallOption) (*InrOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(InrOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareInr_ShareInrCancel_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
// ShareInrServer is the server API for ShareInr service.
|
|||
// All implementations must embed UnimplementedShareInrServer
|
|||
// for forward compatibility
|
|||
type ShareInrServer interface { |
|||
// GetBotStockInrTrade 印度股列表查询
|
|||
GetBotStockInrTrade(context.Context, *GetInrBotStockTradeRequest) (*GetBotStockInrTradeReply, error) |
|||
// ShareInrPlaceOrder 印度股下单
|
|||
ShareInrPlaceOrder(context.Context, *ShareInrOrderRequest) (*InrOrderReply, error) |
|||
// ShareInrUpdateOrder 印度股设置止盈止损
|
|||
ShareInrUpdateOrder(context.Context, *UpdateInrOrderRequest) (*InrOrderReply, error) |
|||
// ShareInrPosition 印度股平仓
|
|||
ShareInrPosition(context.Context, *CancelInrOrderRequest) (*InrOrderReply, error) |
|||
// ShareInrAllPosition 印度股一键平仓
|
|||
ShareInrAllPosition(context.Context, *AllInrOrderRequest) (*AllInrOrderReply, error) |
|||
// ShareInrCancel 印度股撤单
|
|||
ShareInrCancel(context.Context, *CancelInrOrderRequest) (*InrOrderReply, error) |
|||
mustEmbedUnimplementedShareInrServer() |
|||
} |
|||
|
|||
// UnimplementedShareInrServer must be embedded to have forward compatible implementations.
|
|||
type UnimplementedShareInrServer struct { |
|||
} |
|||
|
|||
func (UnimplementedShareInrServer) GetBotStockInrTrade(context.Context, *GetInrBotStockTradeRequest) (*GetBotStockInrTradeReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method GetBotStockInrTrade not implemented") |
|||
} |
|||
func (UnimplementedShareInrServer) ShareInrPlaceOrder(context.Context, *ShareInrOrderRequest) (*InrOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareInrPlaceOrder not implemented") |
|||
} |
|||
func (UnimplementedShareInrServer) ShareInrUpdateOrder(context.Context, *UpdateInrOrderRequest) (*InrOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareInrUpdateOrder not implemented") |
|||
} |
|||
func (UnimplementedShareInrServer) ShareInrPosition(context.Context, *CancelInrOrderRequest) (*InrOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareInrPosition not implemented") |
|||
} |
|||
func (UnimplementedShareInrServer) ShareInrAllPosition(context.Context, *AllInrOrderRequest) (*AllInrOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareInrAllPosition not implemented") |
|||
} |
|||
func (UnimplementedShareInrServer) ShareInrCancel(context.Context, *CancelInrOrderRequest) (*InrOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareInrCancel not implemented") |
|||
} |
|||
func (UnimplementedShareInrServer) mustEmbedUnimplementedShareInrServer() {} |
|||
|
|||
// UnsafeShareInrServer may be embedded to opt out of forward compatibility for this service.
|
|||
// Use of this interface is not recommended, as added methods to ShareInrServer will
|
|||
// result in compilation errors.
|
|||
type UnsafeShareInrServer interface { |
|||
mustEmbedUnimplementedShareInrServer() |
|||
} |
|||
|
|||
func RegisterShareInrServer(s grpc.ServiceRegistrar, srv ShareInrServer) { |
|||
s.RegisterService(&ShareInr_ServiceDesc, srv) |
|||
} |
|||
|
|||
func _ShareInr_GetBotStockInrTrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(GetInrBotStockTradeRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareInrServer).GetBotStockInrTrade(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareInr_GetBotStockInrTrade_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareInrServer).GetBotStockInrTrade(ctx, req.(*GetInrBotStockTradeRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareInr_ShareInrPlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(ShareInrOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareInrServer).ShareInrPlaceOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareInr_ShareInrPlaceOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareInrServer).ShareInrPlaceOrder(ctx, req.(*ShareInrOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareInr_ShareInrUpdateOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(UpdateInrOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareInrServer).ShareInrUpdateOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareInr_ShareInrUpdateOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareInrServer).ShareInrUpdateOrder(ctx, req.(*UpdateInrOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareInr_ShareInrPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelInrOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareInrServer).ShareInrPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareInr_ShareInrPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareInrServer).ShareInrPosition(ctx, req.(*CancelInrOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareInr_ShareInrAllPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(AllInrOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareInrServer).ShareInrAllPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareInr_ShareInrAllPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareInrServer).ShareInrAllPosition(ctx, req.(*AllInrOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareInr_ShareInrCancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelInrOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareInrServer).ShareInrCancel(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareInr_ShareInrCancel_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareInrServer).ShareInrCancel(ctx, req.(*CancelInrOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
// ShareInr_ServiceDesc is the grpc.ServiceDesc for ShareInr service.
|
|||
// It's only intended for direct use with grpc.RegisterService,
|
|||
// and not to be introspected or modified (even as a copy)
|
|||
var ShareInr_ServiceDesc = grpc.ServiceDesc{ |
|||
ServiceName: "matchmaking.v1.ShareInr", |
|||
HandlerType: (*ShareInrServer)(nil), |
|||
Methods: []grpc.MethodDesc{ |
|||
{ |
|||
MethodName: "GetBotStockInrTrade", |
|||
Handler: _ShareInr_GetBotStockInrTrade_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareInrPlaceOrder", |
|||
Handler: _ShareInr_ShareInrPlaceOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareInrUpdateOrder", |
|||
Handler: _ShareInr_ShareInrUpdateOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareInrPosition", |
|||
Handler: _ShareInr_ShareInrPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareInrAllPosition", |
|||
Handler: _ShareInr_ShareInrAllPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareInrCancel", |
|||
Handler: _ShareInr_ShareInrCancel_Handler, |
|||
}, |
|||
}, |
|||
Streams: []grpc.StreamDesc{}, |
|||
Metadata: "matchmaking/v1/share/shareInr.proto", |
|||
} |
@ -0,0 +1,279 @@ |
|||
// Code generated by protoc-gen-go-http. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-http v2.7.3
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareInr.proto
|
|||
|
|||
package v1 |
|||
|
|||
import ( |
|||
context "context" |
|||
http "github.com/go-kratos/kratos/v2/transport/http" |
|||
binding "github.com/go-kratos/kratos/v2/transport/http/binding" |
|||
) |
|||
|
|||
// This is a compile-time assertion to ensure that this generated file
|
|||
// is compatible with the kratos package it is being compiled against.
|
|||
var _ = new(context.Context) |
|||
var _ = binding.EncodeURL |
|||
|
|||
const _ = http.SupportPackageIsVersion1 |
|||
|
|||
const OperationShareInrGetBotStockInrTrade = "/matchmaking.v1.ShareInr/GetBotStockInrTrade" |
|||
const OperationShareInrShareInrAllPosition = "/matchmaking.v1.ShareInr/ShareInrAllPosition" |
|||
const OperationShareInrShareInrCancel = "/matchmaking.v1.ShareInr/ShareInrCancel" |
|||
const OperationShareInrShareInrPlaceOrder = "/matchmaking.v1.ShareInr/ShareInrPlaceOrder" |
|||
const OperationShareInrShareInrPosition = "/matchmaking.v1.ShareInr/ShareInrPosition" |
|||
const OperationShareInrShareInrUpdateOrder = "/matchmaking.v1.ShareInr/ShareInrUpdateOrder" |
|||
|
|||
type ShareInrHTTPServer interface { |
|||
// GetBotStockInrTrade GetBotStockInrTrade 印度股列表查询
|
|||
GetBotStockInrTrade(context.Context, *GetInrBotStockTradeRequest) (*GetBotStockInrTradeReply, error) |
|||
// ShareInrAllPosition ShareInrAllPosition 印度股一键平仓
|
|||
ShareInrAllPosition(context.Context, *AllInrOrderRequest) (*AllInrOrderReply, error) |
|||
// ShareInrCancel ShareInrCancel 印度股撤单
|
|||
ShareInrCancel(context.Context, *CancelInrOrderRequest) (*InrOrderReply, error) |
|||
// ShareInrPlaceOrder ShareInrPlaceOrder 印度股下单
|
|||
ShareInrPlaceOrder(context.Context, *ShareInrOrderRequest) (*InrOrderReply, error) |
|||
// ShareInrPosition ShareInrPosition 印度股平仓
|
|||
ShareInrPosition(context.Context, *CancelInrOrderRequest) (*InrOrderReply, error) |
|||
// ShareInrUpdateOrder ShareInrUpdateOrder 印度股设置止盈止损
|
|||
ShareInrUpdateOrder(context.Context, *UpdateInrOrderRequest) (*InrOrderReply, error) |
|||
} |
|||
|
|||
func RegisterShareInrHTTPServer(s *http.Server, srv ShareInrHTTPServer) { |
|||
r := s.Route("/") |
|||
r.POST("/order_shareinr/share_list", _ShareInr_GetBotStockInrTrade0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareinr/share_place_order", _ShareInr_ShareInrPlaceOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareinr/share_update_order", _ShareInr_ShareInrUpdateOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareinr/share_position", _ShareInr_ShareInrPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareinr/share_all_position", _ShareInr_ShareInrAllPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareinr/share_cancel", _ShareInr_ShareInrCancel0_HTTP_Handler(srv)) |
|||
} |
|||
|
|||
func _ShareInr_GetBotStockInrTrade0_HTTP_Handler(srv ShareInrHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in GetInrBotStockTradeRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareInrGetBotStockInrTrade) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.GetBotStockInrTrade(ctx, req.(*GetInrBotStockTradeRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*GetBotStockInrTradeReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareInr_ShareInrPlaceOrder0_HTTP_Handler(srv ShareInrHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in ShareInrOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareInrShareInrPlaceOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareInrPlaceOrder(ctx, req.(*ShareInrOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*InrOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareInr_ShareInrUpdateOrder0_HTTP_Handler(srv ShareInrHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in UpdateInrOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareInrShareInrUpdateOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareInrUpdateOrder(ctx, req.(*UpdateInrOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*InrOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareInr_ShareInrPosition0_HTTP_Handler(srv ShareInrHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelInrOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareInrShareInrPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareInrPosition(ctx, req.(*CancelInrOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*InrOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareInr_ShareInrAllPosition0_HTTP_Handler(srv ShareInrHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in AllInrOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareInrShareInrAllPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareInrAllPosition(ctx, req.(*AllInrOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*AllInrOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareInr_ShareInrCancel0_HTTP_Handler(srv ShareInrHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelInrOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareInrShareInrCancel) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareInrCancel(ctx, req.(*CancelInrOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*InrOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
type ShareInrHTTPClient interface { |
|||
GetBotStockInrTrade(ctx context.Context, req *GetInrBotStockTradeRequest, opts ...http.CallOption) (rsp *GetBotStockInrTradeReply, err error) |
|||
ShareInrAllPosition(ctx context.Context, req *AllInrOrderRequest, opts ...http.CallOption) (rsp *AllInrOrderReply, err error) |
|||
ShareInrCancel(ctx context.Context, req *CancelInrOrderRequest, opts ...http.CallOption) (rsp *InrOrderReply, err error) |
|||
ShareInrPlaceOrder(ctx context.Context, req *ShareInrOrderRequest, opts ...http.CallOption) (rsp *InrOrderReply, err error) |
|||
ShareInrPosition(ctx context.Context, req *CancelInrOrderRequest, opts ...http.CallOption) (rsp *InrOrderReply, err error) |
|||
ShareInrUpdateOrder(ctx context.Context, req *UpdateInrOrderRequest, opts ...http.CallOption) (rsp *InrOrderReply, err error) |
|||
} |
|||
|
|||
type ShareInrHTTPClientImpl struct { |
|||
cc *http.Client |
|||
} |
|||
|
|||
func NewShareInrHTTPClient(client *http.Client) ShareInrHTTPClient { |
|||
return &ShareInrHTTPClientImpl{client} |
|||
} |
|||
|
|||
func (c *ShareInrHTTPClientImpl) GetBotStockInrTrade(ctx context.Context, in *GetInrBotStockTradeRequest, opts ...http.CallOption) (*GetBotStockInrTradeReply, error) { |
|||
var out GetBotStockInrTradeReply |
|||
pattern := "/order_shareinr/share_list" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareInrGetBotStockInrTrade)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareInrHTTPClientImpl) ShareInrAllPosition(ctx context.Context, in *AllInrOrderRequest, opts ...http.CallOption) (*AllInrOrderReply, error) { |
|||
var out AllInrOrderReply |
|||
pattern := "/order_shareinr/share_all_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareInrShareInrAllPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareInrHTTPClientImpl) ShareInrCancel(ctx context.Context, in *CancelInrOrderRequest, opts ...http.CallOption) (*InrOrderReply, error) { |
|||
var out InrOrderReply |
|||
pattern := "/order_shareinr/share_cancel" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareInrShareInrCancel)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareInrHTTPClientImpl) ShareInrPlaceOrder(ctx context.Context, in *ShareInrOrderRequest, opts ...http.CallOption) (*InrOrderReply, error) { |
|||
var out InrOrderReply |
|||
pattern := "/order_shareinr/share_place_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareInrShareInrPlaceOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareInrHTTPClientImpl) ShareInrPosition(ctx context.Context, in *CancelInrOrderRequest, opts ...http.CallOption) (*InrOrderReply, error) { |
|||
var out InrOrderReply |
|||
pattern := "/order_shareinr/share_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareInrShareInrPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareInrHTTPClientImpl) ShareInrUpdateOrder(ctx context.Context, in *UpdateInrOrderRequest, opts ...http.CallOption) (*InrOrderReply, error) { |
|||
var out InrOrderReply |
|||
pattern := "/order_shareinr/share_update_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareInrShareInrUpdateOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,144 @@ |
|||
syntax = "proto3"; |
|||
|
|||
package matchmaking.v1; |
|||
|
|||
import "google/api/annotations.proto"; |
|||
|
|||
option go_package = "matchmaking-system/api/matchmaking/v1;v1"; |
|||
|
|||
service ShareJpy { |
|||
// GetBotStockJpyTrade 日本股列表查询 |
|||
rpc GetBotStockJpyTrade(GetJpyBotStockTradeRequest)returns(GetBotStockJpyTradeReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharejpy/share_list", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareJpyPlaceOrder 日本股下单 |
|||
rpc ShareJpyPlaceOrder(ShareJpyOrderRequest)returns(JpyOrderReply) { |
|||
option (google.api.http) = { |
|||
post: "/order_sharejpy/share_place_order", |
|||
body: "*", |
|||
}; |
|||
} |
|||
// ShareJpyUpdateOrder 日本股设置止盈止损 |
|||
rpc ShareJpyUpdateOrder(UpdateJpyOrderRequest)returns(JpyOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharejpy/share_update_order", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareJpyPosition 日本股平仓 |
|||
rpc ShareJpyPosition(CancelJpyOrderRequest)returns(JpyOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharejpy/share_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareJpyAllPosition 日本股一键平仓 |
|||
rpc ShareJpyAllPosition(AllJpyOrderRequest)returns(AllJpyOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharejpy/share_all_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareJpyCancel 日本股撤单 |
|||
rpc ShareJpyCancel(CancelJpyOrderRequest)returns(JpyOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharejpy/share_cancel", |
|||
body:"*", |
|||
}; |
|||
} |
|||
} |
|||
|
|||
message GetJpyBotStockTradeRequest{ |
|||
int64 status =1;// 状态码 |
|||
int64 pageSize =2; // 每页显示条数 |
|||
int64 pageCount =3;// 开始的位置 |
|||
} |
|||
|
|||
message GetBotStockJpyTradeReply{ |
|||
int64 code =1;// 状态码 |
|||
BotStockJpyTradeReply data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message BotStockJpyTradeReply{ |
|||
int64 pageSize =1; // 每页显示条数 |
|||
int64 pageCount =2;// 开始的位置 |
|||
repeated BotStockJpyTrade data =3;// 返回结果 |
|||
int64 totalCount =4;// 总数据 |
|||
} |
|||
|
|||
message BotStockJpyTrade{ |
|||
string orderId =1;// 订单ID |
|||
string stockId =2;// 股票代码 |
|||
int64 tradeType =3;// 交易类型 |
|||
int64 dealType =4;// 交易方式 |
|||
string limitPrice =5;// 限价 |
|||
string marketPrice =6;// 市价 |
|||
string dealPrice =7;// 开仓价 |
|||
string closingPrice =8;// 平仓价 |
|||
string orderNumber =9;// 订单数量 |
|||
int64 stopType =10;// 止盈止损 |
|||
string stopLossPrice =11;// 止损 |
|||
string stopWinPrice =12;// 止盈 |
|||
string serviceCost =13;// 开仓手续费 |
|||
string marketMoney =14;// 订单金额 |
|||
string orderMoney =15;// 订单总金额 |
|||
int64 status =16;// 订单状态 |
|||
string createTime =17;// 订单创建时间 |
|||
string updateTime =18;// 订单更新时间 |
|||
string openTime =19;// 订单开仓时间 |
|||
string closingTime =20;// 订单平仓时间 |
|||
string closingCost =21;// 平仓手续费 |
|||
string faceValue =22;// 面值 |
|||
string pryNum =23;// 杠杆 |
|||
string keepDecimal =24;// 保留小数位 |
|||
string stockName =25;// 股票名称 |
|||
} |
|||
|
|||
message ShareJpyOrderRequest{ |
|||
string stockId =1;// 股票Code |
|||
int64 tradeType =2;// 交易类型:1买入,2卖出 |
|||
int64 dealType =3;// 委托方式:1限价,2市价 |
|||
string limitPrice =4;// 限价 |
|||
string marketPrice =5;// 市价 |
|||
string marketMoney =6;// 订单金额 |
|||
string orderNumber =7;// 订单数量 |
|||
string serviceCost =8;// 手续费 |
|||
int64 stopType =9;// 止损止盈设置:1无设置,2止损止盈 |
|||
string stopLossPrice =10;// 止损 |
|||
string stopWinPrice =11;// 止损 |
|||
string pryNum =12;// 杠杆 |
|||
} |
|||
|
|||
message UpdateJpyOrderRequest{ |
|||
string orderId =1;// 订单Id |
|||
int64 stopType =2;// 止盈止损 |
|||
string stopLossPrice =3;// 止损 |
|||
string stopWinPrice =4;// 止盈 |
|||
} |
|||
|
|||
message JpyOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
JpyOrderResult data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message JpyOrderResult { |
|||
string orderId =1;// 订单Id |
|||
} |
|||
|
|||
message CancelJpyOrderRequest{ |
|||
string orderId =1;// 订单ID |
|||
} |
|||
|
|||
message AllJpyOrderRequest{ |
|||
|
|||
} |
|||
message AllJpyOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
string data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
@ -0,0 +1,312 @@ |
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-grpc v1.4.0
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareJpy.proto
|
|||
|
|||
package v1 |
|||
|
|||
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.62.0 or later.
|
|||
const _ = grpc.SupportPackageIsVersion8 |
|||
|
|||
const ( |
|||
ShareJpy_GetBotStockJpyTrade_FullMethodName = "/matchmaking.v1.ShareJpy/GetBotStockJpyTrade" |
|||
ShareJpy_ShareJpyPlaceOrder_FullMethodName = "/matchmaking.v1.ShareJpy/ShareJpyPlaceOrder" |
|||
ShareJpy_ShareJpyUpdateOrder_FullMethodName = "/matchmaking.v1.ShareJpy/ShareJpyUpdateOrder" |
|||
ShareJpy_ShareJpyPosition_FullMethodName = "/matchmaking.v1.ShareJpy/ShareJpyPosition" |
|||
ShareJpy_ShareJpyAllPosition_FullMethodName = "/matchmaking.v1.ShareJpy/ShareJpyAllPosition" |
|||
ShareJpy_ShareJpyCancel_FullMethodName = "/matchmaking.v1.ShareJpy/ShareJpyCancel" |
|||
) |
|||
|
|||
// ShareJpyClient is the client API for ShareJpy 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 ShareJpyClient interface { |
|||
// GetBotStockJpyTrade 日本股列表查询
|
|||
GetBotStockJpyTrade(ctx context.Context, in *GetJpyBotStockTradeRequest, opts ...grpc.CallOption) (*GetBotStockJpyTradeReply, error) |
|||
// ShareJpyPlaceOrder 日本股下单
|
|||
ShareJpyPlaceOrder(ctx context.Context, in *ShareJpyOrderRequest, opts ...grpc.CallOption) (*JpyOrderReply, error) |
|||
// ShareJpyUpdateOrder 日本股设置止盈止损
|
|||
ShareJpyUpdateOrder(ctx context.Context, in *UpdateJpyOrderRequest, opts ...grpc.CallOption) (*JpyOrderReply, error) |
|||
// ShareJpyPosition 日本股平仓
|
|||
ShareJpyPosition(ctx context.Context, in *CancelJpyOrderRequest, opts ...grpc.CallOption) (*JpyOrderReply, error) |
|||
// ShareJpyAllPosition 日本股一键平仓
|
|||
ShareJpyAllPosition(ctx context.Context, in *AllJpyOrderRequest, opts ...grpc.CallOption) (*AllJpyOrderReply, error) |
|||
// ShareJpyCancel 日本股撤单
|
|||
ShareJpyCancel(ctx context.Context, in *CancelJpyOrderRequest, opts ...grpc.CallOption) (*JpyOrderReply, error) |
|||
} |
|||
|
|||
type shareJpyClient struct { |
|||
cc grpc.ClientConnInterface |
|||
} |
|||
|
|||
func NewShareJpyClient(cc grpc.ClientConnInterface) ShareJpyClient { |
|||
return &shareJpyClient{cc} |
|||
} |
|||
|
|||
func (c *shareJpyClient) GetBotStockJpyTrade(ctx context.Context, in *GetJpyBotStockTradeRequest, opts ...grpc.CallOption) (*GetBotStockJpyTradeReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(GetBotStockJpyTradeReply) |
|||
err := c.cc.Invoke(ctx, ShareJpy_GetBotStockJpyTrade_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareJpyClient) ShareJpyPlaceOrder(ctx context.Context, in *ShareJpyOrderRequest, opts ...grpc.CallOption) (*JpyOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(JpyOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareJpy_ShareJpyPlaceOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareJpyClient) ShareJpyUpdateOrder(ctx context.Context, in *UpdateJpyOrderRequest, opts ...grpc.CallOption) (*JpyOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(JpyOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareJpy_ShareJpyUpdateOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareJpyClient) ShareJpyPosition(ctx context.Context, in *CancelJpyOrderRequest, opts ...grpc.CallOption) (*JpyOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(JpyOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareJpy_ShareJpyPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareJpyClient) ShareJpyAllPosition(ctx context.Context, in *AllJpyOrderRequest, opts ...grpc.CallOption) (*AllJpyOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(AllJpyOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareJpy_ShareJpyAllPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareJpyClient) ShareJpyCancel(ctx context.Context, in *CancelJpyOrderRequest, opts ...grpc.CallOption) (*JpyOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(JpyOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareJpy_ShareJpyCancel_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
// ShareJpyServer is the server API for ShareJpy service.
|
|||
// All implementations must embed UnimplementedShareJpyServer
|
|||
// for forward compatibility
|
|||
type ShareJpyServer interface { |
|||
// GetBotStockJpyTrade 日本股列表查询
|
|||
GetBotStockJpyTrade(context.Context, *GetJpyBotStockTradeRequest) (*GetBotStockJpyTradeReply, error) |
|||
// ShareJpyPlaceOrder 日本股下单
|
|||
ShareJpyPlaceOrder(context.Context, *ShareJpyOrderRequest) (*JpyOrderReply, error) |
|||
// ShareJpyUpdateOrder 日本股设置止盈止损
|
|||
ShareJpyUpdateOrder(context.Context, *UpdateJpyOrderRequest) (*JpyOrderReply, error) |
|||
// ShareJpyPosition 日本股平仓
|
|||
ShareJpyPosition(context.Context, *CancelJpyOrderRequest) (*JpyOrderReply, error) |
|||
// ShareJpyAllPosition 日本股一键平仓
|
|||
ShareJpyAllPosition(context.Context, *AllJpyOrderRequest) (*AllJpyOrderReply, error) |
|||
// ShareJpyCancel 日本股撤单
|
|||
ShareJpyCancel(context.Context, *CancelJpyOrderRequest) (*JpyOrderReply, error) |
|||
mustEmbedUnimplementedShareJpyServer() |
|||
} |
|||
|
|||
// UnimplementedShareJpyServer must be embedded to have forward compatible implementations.
|
|||
type UnimplementedShareJpyServer struct { |
|||
} |
|||
|
|||
func (UnimplementedShareJpyServer) GetBotStockJpyTrade(context.Context, *GetJpyBotStockTradeRequest) (*GetBotStockJpyTradeReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method GetBotStockJpyTrade not implemented") |
|||
} |
|||
func (UnimplementedShareJpyServer) ShareJpyPlaceOrder(context.Context, *ShareJpyOrderRequest) (*JpyOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareJpyPlaceOrder not implemented") |
|||
} |
|||
func (UnimplementedShareJpyServer) ShareJpyUpdateOrder(context.Context, *UpdateJpyOrderRequest) (*JpyOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareJpyUpdateOrder not implemented") |
|||
} |
|||
func (UnimplementedShareJpyServer) ShareJpyPosition(context.Context, *CancelJpyOrderRequest) (*JpyOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareJpyPosition not implemented") |
|||
} |
|||
func (UnimplementedShareJpyServer) ShareJpyAllPosition(context.Context, *AllJpyOrderRequest) (*AllJpyOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareJpyAllPosition not implemented") |
|||
} |
|||
func (UnimplementedShareJpyServer) ShareJpyCancel(context.Context, *CancelJpyOrderRequest) (*JpyOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareJpyCancel not implemented") |
|||
} |
|||
func (UnimplementedShareJpyServer) mustEmbedUnimplementedShareJpyServer() {} |
|||
|
|||
// UnsafeShareJpyServer may be embedded to opt out of forward compatibility for this service.
|
|||
// Use of this interface is not recommended, as added methods to ShareJpyServer will
|
|||
// result in compilation errors.
|
|||
type UnsafeShareJpyServer interface { |
|||
mustEmbedUnimplementedShareJpyServer() |
|||
} |
|||
|
|||
func RegisterShareJpyServer(s grpc.ServiceRegistrar, srv ShareJpyServer) { |
|||
s.RegisterService(&ShareJpy_ServiceDesc, srv) |
|||
} |
|||
|
|||
func _ShareJpy_GetBotStockJpyTrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(GetJpyBotStockTradeRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareJpyServer).GetBotStockJpyTrade(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareJpy_GetBotStockJpyTrade_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareJpyServer).GetBotStockJpyTrade(ctx, req.(*GetJpyBotStockTradeRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareJpy_ShareJpyPlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(ShareJpyOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareJpyServer).ShareJpyPlaceOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareJpy_ShareJpyPlaceOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareJpyServer).ShareJpyPlaceOrder(ctx, req.(*ShareJpyOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareJpy_ShareJpyUpdateOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(UpdateJpyOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareJpyServer).ShareJpyUpdateOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareJpy_ShareJpyUpdateOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareJpyServer).ShareJpyUpdateOrder(ctx, req.(*UpdateJpyOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareJpy_ShareJpyPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelJpyOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareJpyServer).ShareJpyPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareJpy_ShareJpyPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareJpyServer).ShareJpyPosition(ctx, req.(*CancelJpyOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareJpy_ShareJpyAllPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(AllJpyOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareJpyServer).ShareJpyAllPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareJpy_ShareJpyAllPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareJpyServer).ShareJpyAllPosition(ctx, req.(*AllJpyOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareJpy_ShareJpyCancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelJpyOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareJpyServer).ShareJpyCancel(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareJpy_ShareJpyCancel_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareJpyServer).ShareJpyCancel(ctx, req.(*CancelJpyOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
// ShareJpy_ServiceDesc is the grpc.ServiceDesc for ShareJpy service.
|
|||
// It's only intended for direct use with grpc.RegisterService,
|
|||
// and not to be introspected or modified (even as a copy)
|
|||
var ShareJpy_ServiceDesc = grpc.ServiceDesc{ |
|||
ServiceName: "matchmaking.v1.ShareJpy", |
|||
HandlerType: (*ShareJpyServer)(nil), |
|||
Methods: []grpc.MethodDesc{ |
|||
{ |
|||
MethodName: "GetBotStockJpyTrade", |
|||
Handler: _ShareJpy_GetBotStockJpyTrade_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareJpyPlaceOrder", |
|||
Handler: _ShareJpy_ShareJpyPlaceOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareJpyUpdateOrder", |
|||
Handler: _ShareJpy_ShareJpyUpdateOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareJpyPosition", |
|||
Handler: _ShareJpy_ShareJpyPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareJpyAllPosition", |
|||
Handler: _ShareJpy_ShareJpyAllPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareJpyCancel", |
|||
Handler: _ShareJpy_ShareJpyCancel_Handler, |
|||
}, |
|||
}, |
|||
Streams: []grpc.StreamDesc{}, |
|||
Metadata: "matchmaking/v1/share/shareJpy.proto", |
|||
} |
@ -0,0 +1,279 @@ |
|||
// Code generated by protoc-gen-go-http. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-http v2.7.3
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareJpy.proto
|
|||
|
|||
package v1 |
|||
|
|||
import ( |
|||
context "context" |
|||
http "github.com/go-kratos/kratos/v2/transport/http" |
|||
binding "github.com/go-kratos/kratos/v2/transport/http/binding" |
|||
) |
|||
|
|||
// This is a compile-time assertion to ensure that this generated file
|
|||
// is compatible with the kratos package it is being compiled against.
|
|||
var _ = new(context.Context) |
|||
var _ = binding.EncodeURL |
|||
|
|||
const _ = http.SupportPackageIsVersion1 |
|||
|
|||
const OperationShareJpyGetBotStockJpyTrade = "/matchmaking.v1.ShareJpy/GetBotStockJpyTrade" |
|||
const OperationShareJpyShareJpyAllPosition = "/matchmaking.v1.ShareJpy/ShareJpyAllPosition" |
|||
const OperationShareJpyShareJpyCancel = "/matchmaking.v1.ShareJpy/ShareJpyCancel" |
|||
const OperationShareJpyShareJpyPlaceOrder = "/matchmaking.v1.ShareJpy/ShareJpyPlaceOrder" |
|||
const OperationShareJpyShareJpyPosition = "/matchmaking.v1.ShareJpy/ShareJpyPosition" |
|||
const OperationShareJpyShareJpyUpdateOrder = "/matchmaking.v1.ShareJpy/ShareJpyUpdateOrder" |
|||
|
|||
type ShareJpyHTTPServer interface { |
|||
// GetBotStockJpyTrade GetBotStockJpyTrade 日本股列表查询
|
|||
GetBotStockJpyTrade(context.Context, *GetJpyBotStockTradeRequest) (*GetBotStockJpyTradeReply, error) |
|||
// ShareJpyAllPosition ShareJpyAllPosition 日本股一键平仓
|
|||
ShareJpyAllPosition(context.Context, *AllJpyOrderRequest) (*AllJpyOrderReply, error) |
|||
// ShareJpyCancel ShareJpyCancel 日本股撤单
|
|||
ShareJpyCancel(context.Context, *CancelJpyOrderRequest) (*JpyOrderReply, error) |
|||
// ShareJpyPlaceOrder ShareJpyPlaceOrder 日本股下单
|
|||
ShareJpyPlaceOrder(context.Context, *ShareJpyOrderRequest) (*JpyOrderReply, error) |
|||
// ShareJpyPosition ShareJpyPosition 日本股平仓
|
|||
ShareJpyPosition(context.Context, *CancelJpyOrderRequest) (*JpyOrderReply, error) |
|||
// ShareJpyUpdateOrder ShareJpyUpdateOrder 日本股设置止盈止损
|
|||
ShareJpyUpdateOrder(context.Context, *UpdateJpyOrderRequest) (*JpyOrderReply, error) |
|||
} |
|||
|
|||
func RegisterShareJpyHTTPServer(s *http.Server, srv ShareJpyHTTPServer) { |
|||
r := s.Route("/") |
|||
r.POST("/order_sharejpy/share_list", _ShareJpy_GetBotStockJpyTrade0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharejpy/share_place_order", _ShareJpy_ShareJpyPlaceOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharejpy/share_update_order", _ShareJpy_ShareJpyUpdateOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharejpy/share_position", _ShareJpy_ShareJpyPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharejpy/share_all_position", _ShareJpy_ShareJpyAllPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharejpy/share_cancel", _ShareJpy_ShareJpyCancel0_HTTP_Handler(srv)) |
|||
} |
|||
|
|||
func _ShareJpy_GetBotStockJpyTrade0_HTTP_Handler(srv ShareJpyHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in GetJpyBotStockTradeRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareJpyGetBotStockJpyTrade) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.GetBotStockJpyTrade(ctx, req.(*GetJpyBotStockTradeRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*GetBotStockJpyTradeReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareJpy_ShareJpyPlaceOrder0_HTTP_Handler(srv ShareJpyHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in ShareJpyOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareJpyShareJpyPlaceOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareJpyPlaceOrder(ctx, req.(*ShareJpyOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*JpyOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareJpy_ShareJpyUpdateOrder0_HTTP_Handler(srv ShareJpyHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in UpdateJpyOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareJpyShareJpyUpdateOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareJpyUpdateOrder(ctx, req.(*UpdateJpyOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*JpyOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareJpy_ShareJpyPosition0_HTTP_Handler(srv ShareJpyHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelJpyOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareJpyShareJpyPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareJpyPosition(ctx, req.(*CancelJpyOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*JpyOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareJpy_ShareJpyAllPosition0_HTTP_Handler(srv ShareJpyHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in AllJpyOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareJpyShareJpyAllPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareJpyAllPosition(ctx, req.(*AllJpyOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*AllJpyOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareJpy_ShareJpyCancel0_HTTP_Handler(srv ShareJpyHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelJpyOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareJpyShareJpyCancel) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareJpyCancel(ctx, req.(*CancelJpyOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*JpyOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
type ShareJpyHTTPClient interface { |
|||
GetBotStockJpyTrade(ctx context.Context, req *GetJpyBotStockTradeRequest, opts ...http.CallOption) (rsp *GetBotStockJpyTradeReply, err error) |
|||
ShareJpyAllPosition(ctx context.Context, req *AllJpyOrderRequest, opts ...http.CallOption) (rsp *AllJpyOrderReply, err error) |
|||
ShareJpyCancel(ctx context.Context, req *CancelJpyOrderRequest, opts ...http.CallOption) (rsp *JpyOrderReply, err error) |
|||
ShareJpyPlaceOrder(ctx context.Context, req *ShareJpyOrderRequest, opts ...http.CallOption) (rsp *JpyOrderReply, err error) |
|||
ShareJpyPosition(ctx context.Context, req *CancelJpyOrderRequest, opts ...http.CallOption) (rsp *JpyOrderReply, err error) |
|||
ShareJpyUpdateOrder(ctx context.Context, req *UpdateJpyOrderRequest, opts ...http.CallOption) (rsp *JpyOrderReply, err error) |
|||
} |
|||
|
|||
type ShareJpyHTTPClientImpl struct { |
|||
cc *http.Client |
|||
} |
|||
|
|||
func NewShareJpyHTTPClient(client *http.Client) ShareJpyHTTPClient { |
|||
return &ShareJpyHTTPClientImpl{client} |
|||
} |
|||
|
|||
func (c *ShareJpyHTTPClientImpl) GetBotStockJpyTrade(ctx context.Context, in *GetJpyBotStockTradeRequest, opts ...http.CallOption) (*GetBotStockJpyTradeReply, error) { |
|||
var out GetBotStockJpyTradeReply |
|||
pattern := "/order_sharejpy/share_list" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareJpyGetBotStockJpyTrade)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareJpyHTTPClientImpl) ShareJpyAllPosition(ctx context.Context, in *AllJpyOrderRequest, opts ...http.CallOption) (*AllJpyOrderReply, error) { |
|||
var out AllJpyOrderReply |
|||
pattern := "/order_sharejpy/share_all_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareJpyShareJpyAllPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareJpyHTTPClientImpl) ShareJpyCancel(ctx context.Context, in *CancelJpyOrderRequest, opts ...http.CallOption) (*JpyOrderReply, error) { |
|||
var out JpyOrderReply |
|||
pattern := "/order_sharejpy/share_cancel" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareJpyShareJpyCancel)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareJpyHTTPClientImpl) ShareJpyPlaceOrder(ctx context.Context, in *ShareJpyOrderRequest, opts ...http.CallOption) (*JpyOrderReply, error) { |
|||
var out JpyOrderReply |
|||
pattern := "/order_sharejpy/share_place_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareJpyShareJpyPlaceOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareJpyHTTPClientImpl) ShareJpyPosition(ctx context.Context, in *CancelJpyOrderRequest, opts ...http.CallOption) (*JpyOrderReply, error) { |
|||
var out JpyOrderReply |
|||
pattern := "/order_sharejpy/share_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareJpyShareJpyPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareJpyHTTPClientImpl) ShareJpyUpdateOrder(ctx context.Context, in *UpdateJpyOrderRequest, opts ...http.CallOption) (*JpyOrderReply, error) { |
|||
var out JpyOrderReply |
|||
pattern := "/order_sharejpy/share_update_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareJpyShareJpyUpdateOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,146 @@ |
|||
syntax = "proto3"; |
|||
|
|||
package matchmaking.v1; |
|||
|
|||
import "google/api/annotations.proto"; |
|||
|
|||
option go_package = "matchmaking-system/api/matchmaking/v1;v1"; |
|||
|
|||
service ShareMys { |
|||
// GetBotStockMysTrade 马股列表查询 |
|||
rpc GetBotStockMysTrade(GetMysBotStockTradeRequest)returns(GetBotStockMysTradeReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharemys/share_list", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareMysPlaceOrder 马股下单 |
|||
rpc ShareMysPlaceOrder(ShareMysOrderRequest)returns(MysOrderReply) { |
|||
option (google.api.http) = { |
|||
post: "/order_sharemys/share_place_order", |
|||
body: "*", |
|||
}; |
|||
} |
|||
// ShareMysUpdateOrder 马股设置止盈止损 |
|||
rpc ShareMysUpdateOrder(UpdateMysOrderRequest)returns(MysOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharemys/share_update_order", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareMysPosition 马股平仓 |
|||
rpc ShareMysPosition(CancelMysOrderRequest)returns(MysOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharemys/share_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareMysAllPosition 马股一键平仓 |
|||
rpc ShareMysAllPosition(AllMysOrderRequest)returns(AllMysOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharemys/share_all_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareMysCancel 马股撤单 |
|||
rpc ShareMysCancel(CancelMysOrderRequest)returns(MysOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharemys/share_cancel", |
|||
body:"*", |
|||
}; |
|||
} |
|||
} |
|||
|
|||
message GetMysBotStockTradeRequest{ |
|||
int64 status =1;// 状态码 |
|||
int64 pageSize =2; // 每页显示条数 |
|||
int64 pageCount =3;// 开始的位置 |
|||
} |
|||
|
|||
message GetBotStockMysTradeReply{ |
|||
int64 code =1;// 状态码 |
|||
BotStockMysTradeData data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message BotStockMysTradeData{ |
|||
int64 pageSize =1; // 每页显示条数 |
|||
int64 pageCount =2;// 开始的位置 |
|||
repeated BotStockMysTrade data =3;// 返回结果 |
|||
int64 totalCount =4;// 总数据 |
|||
} |
|||
|
|||
message BotStockMysTrade{ |
|||
string orderId =1;// 订单ID |
|||
string stockId =2;// 股票代码 |
|||
int64 tradeType =3;// 交易类型 |
|||
int64 dealType =4;// 交易方式 |
|||
string limitPrice =5;// 限价 |
|||
string marketPrice =6;// 市价 |
|||
string dealPrice =7;// 开仓价 |
|||
string closingPrice =8;// 平仓价 |
|||
string orderNumber =9;// 订单数量 |
|||
int64 stopType =10;// 止盈止损 |
|||
string stopLossPrice =11;// 止损 |
|||
string stopWinPrice =12;// 止盈 |
|||
string serviceCost =13;// 开仓手续费 |
|||
string marketMoney =14;// 订单金额 |
|||
string orderMoney =15;// 订单总金额 |
|||
int64 status =16;// 订单状态 |
|||
string createTime =17;// 订单创建时间 |
|||
string updateTime =18;// 订单更新时间 |
|||
string openTime =19;// 订单开仓时间 |
|||
string closingTime =20;// 订单平仓时间 |
|||
string closingCost =21;// 订单平仓手续费 |
|||
string faceValue =22;// 面值 |
|||
string pryNum =23;// 杠杆 |
|||
string keepDecimal =24;// 保留小数位 |
|||
string stockName =25;// 股票名称 |
|||
string numericCode =26;// 股票数字代码 |
|||
} |
|||
|
|||
message UpdateMysOrderRequest{ |
|||
string orderId =1;// 订单Id |
|||
int64 stopType =2;// 止盈止损 |
|||
string stopLossPrice =3;// 止损 |
|||
string stopWinPrice =4;// 止盈 |
|||
} |
|||
|
|||
message ShareMysOrderRequest{ |
|||
string stockId =1;// 股票Code |
|||
int64 tradeType =2;// 交易类型:1买入,2卖出 |
|||
int64 dealType =3;// 委托方式:1限价,2市价 |
|||
string limitPrice =4;// 限价 |
|||
string marketPrice =5;// 市价 |
|||
string marketMoney =6;// 订单金额 |
|||
string orderNumber =7;// 订单数量 |
|||
string serviceCost =8;// 手续费 |
|||
int64 stopType =9;// 止损止盈设置:1无设置,2止损止盈 |
|||
string stopLossPrice =10;// 止损 |
|||
string stopWinPrice =11;// 止损 |
|||
string pryNum =12;// 杠杆 |
|||
} |
|||
|
|||
message MysOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
ShareMysResult data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message ShareMysResult { |
|||
string orderId =1;// 订单Id |
|||
} |
|||
|
|||
message CancelMysOrderRequest{ |
|||
string orderId =1;// 订单ID |
|||
} |
|||
|
|||
message AllMysOrderRequest{ |
|||
|
|||
} |
|||
|
|||
message AllMysOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
string data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
@ -0,0 +1,312 @@ |
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-grpc v1.4.0
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareMys.proto
|
|||
|
|||
package v1 |
|||
|
|||
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.62.0 or later.
|
|||
const _ = grpc.SupportPackageIsVersion8 |
|||
|
|||
const ( |
|||
ShareMys_GetBotStockMysTrade_FullMethodName = "/matchmaking.v1.ShareMys/GetBotStockMysTrade" |
|||
ShareMys_ShareMysPlaceOrder_FullMethodName = "/matchmaking.v1.ShareMys/ShareMysPlaceOrder" |
|||
ShareMys_ShareMysUpdateOrder_FullMethodName = "/matchmaking.v1.ShareMys/ShareMysUpdateOrder" |
|||
ShareMys_ShareMysPosition_FullMethodName = "/matchmaking.v1.ShareMys/ShareMysPosition" |
|||
ShareMys_ShareMysAllPosition_FullMethodName = "/matchmaking.v1.ShareMys/ShareMysAllPosition" |
|||
ShareMys_ShareMysCancel_FullMethodName = "/matchmaking.v1.ShareMys/ShareMysCancel" |
|||
) |
|||
|
|||
// ShareMysClient is the client API for ShareMys 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 ShareMysClient interface { |
|||
// GetBotStockMysTrade 马股列表查询
|
|||
GetBotStockMysTrade(ctx context.Context, in *GetMysBotStockTradeRequest, opts ...grpc.CallOption) (*GetBotStockMysTradeReply, error) |
|||
// ShareMysPlaceOrder 马股下单
|
|||
ShareMysPlaceOrder(ctx context.Context, in *ShareMysOrderRequest, opts ...grpc.CallOption) (*MysOrderReply, error) |
|||
// ShareMysUpdateOrder 马股设置止盈止损
|
|||
ShareMysUpdateOrder(ctx context.Context, in *UpdateMysOrderRequest, opts ...grpc.CallOption) (*MysOrderReply, error) |
|||
// ShareMysPosition 马股平仓
|
|||
ShareMysPosition(ctx context.Context, in *CancelMysOrderRequest, opts ...grpc.CallOption) (*MysOrderReply, error) |
|||
// ShareMysAllPosition 马股一键平仓
|
|||
ShareMysAllPosition(ctx context.Context, in *AllMysOrderRequest, opts ...grpc.CallOption) (*AllMysOrderReply, error) |
|||
// ShareMysCancel 马股撤单
|
|||
ShareMysCancel(ctx context.Context, in *CancelMysOrderRequest, opts ...grpc.CallOption) (*MysOrderReply, error) |
|||
} |
|||
|
|||
type shareMysClient struct { |
|||
cc grpc.ClientConnInterface |
|||
} |
|||
|
|||
func NewShareMysClient(cc grpc.ClientConnInterface) ShareMysClient { |
|||
return &shareMysClient{cc} |
|||
} |
|||
|
|||
func (c *shareMysClient) GetBotStockMysTrade(ctx context.Context, in *GetMysBotStockTradeRequest, opts ...grpc.CallOption) (*GetBotStockMysTradeReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(GetBotStockMysTradeReply) |
|||
err := c.cc.Invoke(ctx, ShareMys_GetBotStockMysTrade_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareMysClient) ShareMysPlaceOrder(ctx context.Context, in *ShareMysOrderRequest, opts ...grpc.CallOption) (*MysOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(MysOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareMys_ShareMysPlaceOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareMysClient) ShareMysUpdateOrder(ctx context.Context, in *UpdateMysOrderRequest, opts ...grpc.CallOption) (*MysOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(MysOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareMys_ShareMysUpdateOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareMysClient) ShareMysPosition(ctx context.Context, in *CancelMysOrderRequest, opts ...grpc.CallOption) (*MysOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(MysOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareMys_ShareMysPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareMysClient) ShareMysAllPosition(ctx context.Context, in *AllMysOrderRequest, opts ...grpc.CallOption) (*AllMysOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(AllMysOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareMys_ShareMysAllPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareMysClient) ShareMysCancel(ctx context.Context, in *CancelMysOrderRequest, opts ...grpc.CallOption) (*MysOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(MysOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareMys_ShareMysCancel_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
// ShareMysServer is the server API for ShareMys service.
|
|||
// All implementations must embed UnimplementedShareMysServer
|
|||
// for forward compatibility
|
|||
type ShareMysServer interface { |
|||
// GetBotStockMysTrade 马股列表查询
|
|||
GetBotStockMysTrade(context.Context, *GetMysBotStockTradeRequest) (*GetBotStockMysTradeReply, error) |
|||
// ShareMysPlaceOrder 马股下单
|
|||
ShareMysPlaceOrder(context.Context, *ShareMysOrderRequest) (*MysOrderReply, error) |
|||
// ShareMysUpdateOrder 马股设置止盈止损
|
|||
ShareMysUpdateOrder(context.Context, *UpdateMysOrderRequest) (*MysOrderReply, error) |
|||
// ShareMysPosition 马股平仓
|
|||
ShareMysPosition(context.Context, *CancelMysOrderRequest) (*MysOrderReply, error) |
|||
// ShareMysAllPosition 马股一键平仓
|
|||
ShareMysAllPosition(context.Context, *AllMysOrderRequest) (*AllMysOrderReply, error) |
|||
// ShareMysCancel 马股撤单
|
|||
ShareMysCancel(context.Context, *CancelMysOrderRequest) (*MysOrderReply, error) |
|||
mustEmbedUnimplementedShareMysServer() |
|||
} |
|||
|
|||
// UnimplementedShareMysServer must be embedded to have forward compatible implementations.
|
|||
type UnimplementedShareMysServer struct { |
|||
} |
|||
|
|||
func (UnimplementedShareMysServer) GetBotStockMysTrade(context.Context, *GetMysBotStockTradeRequest) (*GetBotStockMysTradeReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method GetBotStockMysTrade not implemented") |
|||
} |
|||
func (UnimplementedShareMysServer) ShareMysPlaceOrder(context.Context, *ShareMysOrderRequest) (*MysOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareMysPlaceOrder not implemented") |
|||
} |
|||
func (UnimplementedShareMysServer) ShareMysUpdateOrder(context.Context, *UpdateMysOrderRequest) (*MysOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareMysUpdateOrder not implemented") |
|||
} |
|||
func (UnimplementedShareMysServer) ShareMysPosition(context.Context, *CancelMysOrderRequest) (*MysOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareMysPosition not implemented") |
|||
} |
|||
func (UnimplementedShareMysServer) ShareMysAllPosition(context.Context, *AllMysOrderRequest) (*AllMysOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareMysAllPosition not implemented") |
|||
} |
|||
func (UnimplementedShareMysServer) ShareMysCancel(context.Context, *CancelMysOrderRequest) (*MysOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareMysCancel not implemented") |
|||
} |
|||
func (UnimplementedShareMysServer) mustEmbedUnimplementedShareMysServer() {} |
|||
|
|||
// UnsafeShareMysServer may be embedded to opt out of forward compatibility for this service.
|
|||
// Use of this interface is not recommended, as added methods to ShareMysServer will
|
|||
// result in compilation errors.
|
|||
type UnsafeShareMysServer interface { |
|||
mustEmbedUnimplementedShareMysServer() |
|||
} |
|||
|
|||
func RegisterShareMysServer(s grpc.ServiceRegistrar, srv ShareMysServer) { |
|||
s.RegisterService(&ShareMys_ServiceDesc, srv) |
|||
} |
|||
|
|||
func _ShareMys_GetBotStockMysTrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(GetMysBotStockTradeRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareMysServer).GetBotStockMysTrade(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareMys_GetBotStockMysTrade_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareMysServer).GetBotStockMysTrade(ctx, req.(*GetMysBotStockTradeRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareMys_ShareMysPlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(ShareMysOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareMysServer).ShareMysPlaceOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareMys_ShareMysPlaceOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareMysServer).ShareMysPlaceOrder(ctx, req.(*ShareMysOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareMys_ShareMysUpdateOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(UpdateMysOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareMysServer).ShareMysUpdateOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareMys_ShareMysUpdateOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareMysServer).ShareMysUpdateOrder(ctx, req.(*UpdateMysOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareMys_ShareMysPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelMysOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareMysServer).ShareMysPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareMys_ShareMysPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareMysServer).ShareMysPosition(ctx, req.(*CancelMysOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareMys_ShareMysAllPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(AllMysOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareMysServer).ShareMysAllPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareMys_ShareMysAllPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareMysServer).ShareMysAllPosition(ctx, req.(*AllMysOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareMys_ShareMysCancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelMysOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareMysServer).ShareMysCancel(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareMys_ShareMysCancel_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareMysServer).ShareMysCancel(ctx, req.(*CancelMysOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
// ShareMys_ServiceDesc is the grpc.ServiceDesc for ShareMys service.
|
|||
// It's only intended for direct use with grpc.RegisterService,
|
|||
// and not to be introspected or modified (even as a copy)
|
|||
var ShareMys_ServiceDesc = grpc.ServiceDesc{ |
|||
ServiceName: "matchmaking.v1.ShareMys", |
|||
HandlerType: (*ShareMysServer)(nil), |
|||
Methods: []grpc.MethodDesc{ |
|||
{ |
|||
MethodName: "GetBotStockMysTrade", |
|||
Handler: _ShareMys_GetBotStockMysTrade_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareMysPlaceOrder", |
|||
Handler: _ShareMys_ShareMysPlaceOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareMysUpdateOrder", |
|||
Handler: _ShareMys_ShareMysUpdateOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareMysPosition", |
|||
Handler: _ShareMys_ShareMysPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareMysAllPosition", |
|||
Handler: _ShareMys_ShareMysAllPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareMysCancel", |
|||
Handler: _ShareMys_ShareMysCancel_Handler, |
|||
}, |
|||
}, |
|||
Streams: []grpc.StreamDesc{}, |
|||
Metadata: "matchmaking/v1/share/shareMys.proto", |
|||
} |
@ -0,0 +1,279 @@ |
|||
// Code generated by protoc-gen-go-http. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-http v2.7.3
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareMys.proto
|
|||
|
|||
package v1 |
|||
|
|||
import ( |
|||
context "context" |
|||
http "github.com/go-kratos/kratos/v2/transport/http" |
|||
binding "github.com/go-kratos/kratos/v2/transport/http/binding" |
|||
) |
|||
|
|||
// This is a compile-time assertion to ensure that this generated file
|
|||
// is compatible with the kratos package it is being compiled against.
|
|||
var _ = new(context.Context) |
|||
var _ = binding.EncodeURL |
|||
|
|||
const _ = http.SupportPackageIsVersion1 |
|||
|
|||
const OperationShareMysGetBotStockMysTrade = "/matchmaking.v1.ShareMys/GetBotStockMysTrade" |
|||
const OperationShareMysShareMysAllPosition = "/matchmaking.v1.ShareMys/ShareMysAllPosition" |
|||
const OperationShareMysShareMysCancel = "/matchmaking.v1.ShareMys/ShareMysCancel" |
|||
const OperationShareMysShareMysPlaceOrder = "/matchmaking.v1.ShareMys/ShareMysPlaceOrder" |
|||
const OperationShareMysShareMysPosition = "/matchmaking.v1.ShareMys/ShareMysPosition" |
|||
const OperationShareMysShareMysUpdateOrder = "/matchmaking.v1.ShareMys/ShareMysUpdateOrder" |
|||
|
|||
type ShareMysHTTPServer interface { |
|||
// GetBotStockMysTrade GetBotStockMysTrade 马股列表查询
|
|||
GetBotStockMysTrade(context.Context, *GetMysBotStockTradeRequest) (*GetBotStockMysTradeReply, error) |
|||
// ShareMysAllPosition ShareMysAllPosition 马股一键平仓
|
|||
ShareMysAllPosition(context.Context, *AllMysOrderRequest) (*AllMysOrderReply, error) |
|||
// ShareMysCancel ShareMysCancel 马股撤单
|
|||
ShareMysCancel(context.Context, *CancelMysOrderRequest) (*MysOrderReply, error) |
|||
// ShareMysPlaceOrder ShareMysPlaceOrder 马股下单
|
|||
ShareMysPlaceOrder(context.Context, *ShareMysOrderRequest) (*MysOrderReply, error) |
|||
// ShareMysPosition ShareMysPosition 马股平仓
|
|||
ShareMysPosition(context.Context, *CancelMysOrderRequest) (*MysOrderReply, error) |
|||
// ShareMysUpdateOrder ShareMysUpdateOrder 马股设置止盈止损
|
|||
ShareMysUpdateOrder(context.Context, *UpdateMysOrderRequest) (*MysOrderReply, error) |
|||
} |
|||
|
|||
func RegisterShareMysHTTPServer(s *http.Server, srv ShareMysHTTPServer) { |
|||
r := s.Route("/") |
|||
r.POST("/order_sharemys/share_list", _ShareMys_GetBotStockMysTrade0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharemys/share_place_order", _ShareMys_ShareMysPlaceOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharemys/share_update_order", _ShareMys_ShareMysUpdateOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharemys/share_position", _ShareMys_ShareMysPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharemys/share_all_position", _ShareMys_ShareMysAllPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharemys/share_cancel", _ShareMys_ShareMysCancel0_HTTP_Handler(srv)) |
|||
} |
|||
|
|||
func _ShareMys_GetBotStockMysTrade0_HTTP_Handler(srv ShareMysHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in GetMysBotStockTradeRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareMysGetBotStockMysTrade) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.GetBotStockMysTrade(ctx, req.(*GetMysBotStockTradeRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*GetBotStockMysTradeReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareMys_ShareMysPlaceOrder0_HTTP_Handler(srv ShareMysHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in ShareMysOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareMysShareMysPlaceOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareMysPlaceOrder(ctx, req.(*ShareMysOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*MysOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareMys_ShareMysUpdateOrder0_HTTP_Handler(srv ShareMysHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in UpdateMysOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareMysShareMysUpdateOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareMysUpdateOrder(ctx, req.(*UpdateMysOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*MysOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareMys_ShareMysPosition0_HTTP_Handler(srv ShareMysHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelMysOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareMysShareMysPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareMysPosition(ctx, req.(*CancelMysOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*MysOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareMys_ShareMysAllPosition0_HTTP_Handler(srv ShareMysHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in AllMysOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareMysShareMysAllPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareMysAllPosition(ctx, req.(*AllMysOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*AllMysOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareMys_ShareMysCancel0_HTTP_Handler(srv ShareMysHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelMysOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareMysShareMysCancel) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareMysCancel(ctx, req.(*CancelMysOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*MysOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
type ShareMysHTTPClient interface { |
|||
GetBotStockMysTrade(ctx context.Context, req *GetMysBotStockTradeRequest, opts ...http.CallOption) (rsp *GetBotStockMysTradeReply, err error) |
|||
ShareMysAllPosition(ctx context.Context, req *AllMysOrderRequest, opts ...http.CallOption) (rsp *AllMysOrderReply, err error) |
|||
ShareMysCancel(ctx context.Context, req *CancelMysOrderRequest, opts ...http.CallOption) (rsp *MysOrderReply, err error) |
|||
ShareMysPlaceOrder(ctx context.Context, req *ShareMysOrderRequest, opts ...http.CallOption) (rsp *MysOrderReply, err error) |
|||
ShareMysPosition(ctx context.Context, req *CancelMysOrderRequest, opts ...http.CallOption) (rsp *MysOrderReply, err error) |
|||
ShareMysUpdateOrder(ctx context.Context, req *UpdateMysOrderRequest, opts ...http.CallOption) (rsp *MysOrderReply, err error) |
|||
} |
|||
|
|||
type ShareMysHTTPClientImpl struct { |
|||
cc *http.Client |
|||
} |
|||
|
|||
func NewShareMysHTTPClient(client *http.Client) ShareMysHTTPClient { |
|||
return &ShareMysHTTPClientImpl{client} |
|||
} |
|||
|
|||
func (c *ShareMysHTTPClientImpl) GetBotStockMysTrade(ctx context.Context, in *GetMysBotStockTradeRequest, opts ...http.CallOption) (*GetBotStockMysTradeReply, error) { |
|||
var out GetBotStockMysTradeReply |
|||
pattern := "/order_sharemys/share_list" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareMysGetBotStockMysTrade)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareMysHTTPClientImpl) ShareMysAllPosition(ctx context.Context, in *AllMysOrderRequest, opts ...http.CallOption) (*AllMysOrderReply, error) { |
|||
var out AllMysOrderReply |
|||
pattern := "/order_sharemys/share_all_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareMysShareMysAllPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareMysHTTPClientImpl) ShareMysCancel(ctx context.Context, in *CancelMysOrderRequest, opts ...http.CallOption) (*MysOrderReply, error) { |
|||
var out MysOrderReply |
|||
pattern := "/order_sharemys/share_cancel" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareMysShareMysCancel)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareMysHTTPClientImpl) ShareMysPlaceOrder(ctx context.Context, in *ShareMysOrderRequest, opts ...http.CallOption) (*MysOrderReply, error) { |
|||
var out MysOrderReply |
|||
pattern := "/order_sharemys/share_place_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareMysShareMysPlaceOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareMysHTTPClientImpl) ShareMysPosition(ctx context.Context, in *CancelMysOrderRequest, opts ...http.CallOption) (*MysOrderReply, error) { |
|||
var out MysOrderReply |
|||
pattern := "/order_sharemys/share_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareMysShareMysPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareMysHTTPClientImpl) ShareMysUpdateOrder(ctx context.Context, in *UpdateMysOrderRequest, opts ...http.CallOption) (*MysOrderReply, error) { |
|||
var out MysOrderReply |
|||
pattern := "/order_sharemys/share_update_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareMysShareMysUpdateOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,144 @@ |
|||
syntax = "proto3"; |
|||
|
|||
package matchmaking.v1; |
|||
|
|||
import "google/api/annotations.proto"; |
|||
|
|||
option go_package = "matchmaking-system/api/matchmaking/v1;v1"; |
|||
|
|||
service ShareSgd { |
|||
// GetBotStockSgdTrade 新加坡股列表查询 |
|||
rpc GetBotStockSgdTrade(GetSgdBotStockTradeRequest)returns(GetBotStockSgdTradeReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharesgd/share_list", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareSgdPlaceOrder 新加坡股下单 |
|||
rpc ShareSgdPlaceOrder(ShareSgdOrderRequest)returns(SgdOrderReply) { |
|||
option (google.api.http) = { |
|||
post: "/order_sharesgd/share_place_order", |
|||
body: "*", |
|||
}; |
|||
} |
|||
// ShareSgdUpdateOrder 新加坡股设置止盈止损 |
|||
rpc ShareSgdUpdateOrder(UpdateSgdOrderRequest)returns(SgdOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharesgd/share_update_order", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareSgdPosition 新加坡股平仓 |
|||
rpc ShareSgdPosition(CancelSgdOrderRequest)returns(SgdOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharesgd/share_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareSgdAllPosition 新加坡股一键平仓 |
|||
rpc ShareSgdAllPosition(AllSgdOrderRequest)returns(AllSgdOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharesgd/share_all_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareSgdCancel 新加坡股撤单 |
|||
rpc ShareSgdCancel(CancelSgdOrderRequest)returns(SgdOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharesgd/share_cancel", |
|||
body:"*", |
|||
}; |
|||
} |
|||
} |
|||
|
|||
message GetSgdBotStockTradeRequest{ |
|||
int64 status =1;// 状态码 |
|||
int64 pageSize =2; // 每页显示条数 |
|||
int64 pageCount =3;// 开始的位置 |
|||
} |
|||
|
|||
message GetBotStockSgdTradeReply{ |
|||
int64 code =1;// 状态码 |
|||
BotStockSgdTradeReply data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message BotStockSgdTradeReply{ |
|||
int64 pageSize =1; // 每页显示条数 |
|||
int64 pageCount =2;// 开始的位置 |
|||
repeated BotStockSgdTrade data =3;// 返回结果 |
|||
int64 totalCount =4;// 总数据 |
|||
} |
|||
|
|||
message BotStockSgdTrade{ |
|||
string orderId =1;// 订单ID |
|||
string stockId =2;// 股票代码 |
|||
int64 tradeType =3;// 交易类型 |
|||
int64 dealType =4;// 交易方式 |
|||
string limitPrice =5;// 限价 |
|||
string marketPrice =6;// 市价 |
|||
string dealPrice =7;// 开仓价 |
|||
string closingPrice =8;// 平仓价 |
|||
string orderNumber =9;// 订单数量 |
|||
int64 stopType =10;// 止盈止损 |
|||
string stopLossPrice =11;// 止损 |
|||
string stopWinPrice =12;// 止盈 |
|||
string serviceCost =13;// 开仓手续费 |
|||
string marketMoney =14;// 订单金额 |
|||
string orderMoney =15;// 订单总金额 |
|||
int64 status =16;// 订单状态 |
|||
string createTime =17;// 订单创建时间 |
|||
string updateTime =18;// 订单更新时间 |
|||
string openTime =19;// 订单开仓时间 |
|||
string closingTime =20;// 订单平仓时间 |
|||
string closingCost =21;// 平仓手续费 |
|||
string faceValue =22;// 面值 |
|||
string pryNum =23;// 杠杆 |
|||
string keepDecimal =24;// 保留小数位 |
|||
string stockName =25;// 股票名称 |
|||
} |
|||
|
|||
message ShareSgdOrderRequest{ |
|||
string stockId =1;// 股票Code |
|||
int64 tradeType =2;// 交易类型:1买入,2卖出 |
|||
int64 dealType =3;// 委托方式:1限价,2市价 |
|||
string limitPrice =4;// 限价 |
|||
string marketPrice =5;// 市价 |
|||
string marketMoney =6;// 订单金额 |
|||
string orderNumber =7;// 订单数量 |
|||
string serviceCost =8;// 手续费 |
|||
int64 stopType =9;// 止损止盈设置:1无设置,2止损止盈 |
|||
string stopLossPrice =10;// 止损 |
|||
string stopWinPrice =11;// 止损 |
|||
string pryNum =12;// 杠杆 |
|||
} |
|||
|
|||
message UpdateSgdOrderRequest{ |
|||
string orderId =1;// 订单Id |
|||
int64 stopType =2;// 止盈止损 |
|||
string stopLossPrice =3;// 止损 |
|||
string stopWinPrice =4;// 止盈 |
|||
} |
|||
|
|||
message SgdOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
SgdOrderResult data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message SgdOrderResult { |
|||
string orderId =1;// 订单Id |
|||
} |
|||
|
|||
message CancelSgdOrderRequest{ |
|||
string orderId =1;// 订单ID |
|||
} |
|||
|
|||
message AllSgdOrderRequest{ |
|||
|
|||
} |
|||
message AllSgdOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
string data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
@ -0,0 +1,312 @@ |
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-grpc v1.4.0
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareSgd.proto
|
|||
|
|||
package v1 |
|||
|
|||
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.62.0 or later.
|
|||
const _ = grpc.SupportPackageIsVersion8 |
|||
|
|||
const ( |
|||
ShareSgd_GetBotStockSgdTrade_FullMethodName = "/matchmaking.v1.ShareSgd/GetBotStockSgdTrade" |
|||
ShareSgd_ShareSgdPlaceOrder_FullMethodName = "/matchmaking.v1.ShareSgd/ShareSgdPlaceOrder" |
|||
ShareSgd_ShareSgdUpdateOrder_FullMethodName = "/matchmaking.v1.ShareSgd/ShareSgdUpdateOrder" |
|||
ShareSgd_ShareSgdPosition_FullMethodName = "/matchmaking.v1.ShareSgd/ShareSgdPosition" |
|||
ShareSgd_ShareSgdAllPosition_FullMethodName = "/matchmaking.v1.ShareSgd/ShareSgdAllPosition" |
|||
ShareSgd_ShareSgdCancel_FullMethodName = "/matchmaking.v1.ShareSgd/ShareSgdCancel" |
|||
) |
|||
|
|||
// ShareSgdClient is the client API for ShareSgd 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 ShareSgdClient interface { |
|||
// GetBotStockSgdTrade 新加坡股列表查询
|
|||
GetBotStockSgdTrade(ctx context.Context, in *GetSgdBotStockTradeRequest, opts ...grpc.CallOption) (*GetBotStockSgdTradeReply, error) |
|||
// ShareSgdPlaceOrder 新加坡股下单
|
|||
ShareSgdPlaceOrder(ctx context.Context, in *ShareSgdOrderRequest, opts ...grpc.CallOption) (*SgdOrderReply, error) |
|||
// ShareSgdUpdateOrder 新加坡股设置止盈止损
|
|||
ShareSgdUpdateOrder(ctx context.Context, in *UpdateSgdOrderRequest, opts ...grpc.CallOption) (*SgdOrderReply, error) |
|||
// ShareSgdPosition 新加坡股平仓
|
|||
ShareSgdPosition(ctx context.Context, in *CancelSgdOrderRequest, opts ...grpc.CallOption) (*SgdOrderReply, error) |
|||
// ShareSgdAllPosition 新加坡股一键平仓
|
|||
ShareSgdAllPosition(ctx context.Context, in *AllSgdOrderRequest, opts ...grpc.CallOption) (*AllSgdOrderReply, error) |
|||
// ShareSgdCancel 新加坡股撤单
|
|||
ShareSgdCancel(ctx context.Context, in *CancelSgdOrderRequest, opts ...grpc.CallOption) (*SgdOrderReply, error) |
|||
} |
|||
|
|||
type shareSgdClient struct { |
|||
cc grpc.ClientConnInterface |
|||
} |
|||
|
|||
func NewShareSgdClient(cc grpc.ClientConnInterface) ShareSgdClient { |
|||
return &shareSgdClient{cc} |
|||
} |
|||
|
|||
func (c *shareSgdClient) GetBotStockSgdTrade(ctx context.Context, in *GetSgdBotStockTradeRequest, opts ...grpc.CallOption) (*GetBotStockSgdTradeReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(GetBotStockSgdTradeReply) |
|||
err := c.cc.Invoke(ctx, ShareSgd_GetBotStockSgdTrade_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareSgdClient) ShareSgdPlaceOrder(ctx context.Context, in *ShareSgdOrderRequest, opts ...grpc.CallOption) (*SgdOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(SgdOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareSgd_ShareSgdPlaceOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareSgdClient) ShareSgdUpdateOrder(ctx context.Context, in *UpdateSgdOrderRequest, opts ...grpc.CallOption) (*SgdOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(SgdOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareSgd_ShareSgdUpdateOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareSgdClient) ShareSgdPosition(ctx context.Context, in *CancelSgdOrderRequest, opts ...grpc.CallOption) (*SgdOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(SgdOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareSgd_ShareSgdPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareSgdClient) ShareSgdAllPosition(ctx context.Context, in *AllSgdOrderRequest, opts ...grpc.CallOption) (*AllSgdOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(AllSgdOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareSgd_ShareSgdAllPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareSgdClient) ShareSgdCancel(ctx context.Context, in *CancelSgdOrderRequest, opts ...grpc.CallOption) (*SgdOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(SgdOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareSgd_ShareSgdCancel_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
// ShareSgdServer is the server API for ShareSgd service.
|
|||
// All implementations must embed UnimplementedShareSgdServer
|
|||
// for forward compatibility
|
|||
type ShareSgdServer interface { |
|||
// GetBotStockSgdTrade 新加坡股列表查询
|
|||
GetBotStockSgdTrade(context.Context, *GetSgdBotStockTradeRequest) (*GetBotStockSgdTradeReply, error) |
|||
// ShareSgdPlaceOrder 新加坡股下单
|
|||
ShareSgdPlaceOrder(context.Context, *ShareSgdOrderRequest) (*SgdOrderReply, error) |
|||
// ShareSgdUpdateOrder 新加坡股设置止盈止损
|
|||
ShareSgdUpdateOrder(context.Context, *UpdateSgdOrderRequest) (*SgdOrderReply, error) |
|||
// ShareSgdPosition 新加坡股平仓
|
|||
ShareSgdPosition(context.Context, *CancelSgdOrderRequest) (*SgdOrderReply, error) |
|||
// ShareSgdAllPosition 新加坡股一键平仓
|
|||
ShareSgdAllPosition(context.Context, *AllSgdOrderRequest) (*AllSgdOrderReply, error) |
|||
// ShareSgdCancel 新加坡股撤单
|
|||
ShareSgdCancel(context.Context, *CancelSgdOrderRequest) (*SgdOrderReply, error) |
|||
mustEmbedUnimplementedShareSgdServer() |
|||
} |
|||
|
|||
// UnimplementedShareSgdServer must be embedded to have forward compatible implementations.
|
|||
type UnimplementedShareSgdServer struct { |
|||
} |
|||
|
|||
func (UnimplementedShareSgdServer) GetBotStockSgdTrade(context.Context, *GetSgdBotStockTradeRequest) (*GetBotStockSgdTradeReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method GetBotStockSgdTrade not implemented") |
|||
} |
|||
func (UnimplementedShareSgdServer) ShareSgdPlaceOrder(context.Context, *ShareSgdOrderRequest) (*SgdOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareSgdPlaceOrder not implemented") |
|||
} |
|||
func (UnimplementedShareSgdServer) ShareSgdUpdateOrder(context.Context, *UpdateSgdOrderRequest) (*SgdOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareSgdUpdateOrder not implemented") |
|||
} |
|||
func (UnimplementedShareSgdServer) ShareSgdPosition(context.Context, *CancelSgdOrderRequest) (*SgdOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareSgdPosition not implemented") |
|||
} |
|||
func (UnimplementedShareSgdServer) ShareSgdAllPosition(context.Context, *AllSgdOrderRequest) (*AllSgdOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareSgdAllPosition not implemented") |
|||
} |
|||
func (UnimplementedShareSgdServer) ShareSgdCancel(context.Context, *CancelSgdOrderRequest) (*SgdOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareSgdCancel not implemented") |
|||
} |
|||
func (UnimplementedShareSgdServer) mustEmbedUnimplementedShareSgdServer() {} |
|||
|
|||
// UnsafeShareSgdServer may be embedded to opt out of forward compatibility for this service.
|
|||
// Use of this interface is not recommended, as added methods to ShareSgdServer will
|
|||
// result in compilation errors.
|
|||
type UnsafeShareSgdServer interface { |
|||
mustEmbedUnimplementedShareSgdServer() |
|||
} |
|||
|
|||
func RegisterShareSgdServer(s grpc.ServiceRegistrar, srv ShareSgdServer) { |
|||
s.RegisterService(&ShareSgd_ServiceDesc, srv) |
|||
} |
|||
|
|||
func _ShareSgd_GetBotStockSgdTrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(GetSgdBotStockTradeRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareSgdServer).GetBotStockSgdTrade(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareSgd_GetBotStockSgdTrade_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareSgdServer).GetBotStockSgdTrade(ctx, req.(*GetSgdBotStockTradeRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareSgd_ShareSgdPlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(ShareSgdOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareSgdServer).ShareSgdPlaceOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareSgd_ShareSgdPlaceOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareSgdServer).ShareSgdPlaceOrder(ctx, req.(*ShareSgdOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareSgd_ShareSgdUpdateOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(UpdateSgdOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareSgdServer).ShareSgdUpdateOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareSgd_ShareSgdUpdateOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareSgdServer).ShareSgdUpdateOrder(ctx, req.(*UpdateSgdOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareSgd_ShareSgdPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelSgdOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareSgdServer).ShareSgdPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareSgd_ShareSgdPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareSgdServer).ShareSgdPosition(ctx, req.(*CancelSgdOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareSgd_ShareSgdAllPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(AllSgdOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareSgdServer).ShareSgdAllPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareSgd_ShareSgdAllPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareSgdServer).ShareSgdAllPosition(ctx, req.(*AllSgdOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareSgd_ShareSgdCancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelSgdOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareSgdServer).ShareSgdCancel(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareSgd_ShareSgdCancel_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareSgdServer).ShareSgdCancel(ctx, req.(*CancelSgdOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
// ShareSgd_ServiceDesc is the grpc.ServiceDesc for ShareSgd service.
|
|||
// It's only intended for direct use with grpc.RegisterService,
|
|||
// and not to be introspected or modified (even as a copy)
|
|||
var ShareSgd_ServiceDesc = grpc.ServiceDesc{ |
|||
ServiceName: "matchmaking.v1.ShareSgd", |
|||
HandlerType: (*ShareSgdServer)(nil), |
|||
Methods: []grpc.MethodDesc{ |
|||
{ |
|||
MethodName: "GetBotStockSgdTrade", |
|||
Handler: _ShareSgd_GetBotStockSgdTrade_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareSgdPlaceOrder", |
|||
Handler: _ShareSgd_ShareSgdPlaceOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareSgdUpdateOrder", |
|||
Handler: _ShareSgd_ShareSgdUpdateOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareSgdPosition", |
|||
Handler: _ShareSgd_ShareSgdPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareSgdAllPosition", |
|||
Handler: _ShareSgd_ShareSgdAllPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareSgdCancel", |
|||
Handler: _ShareSgd_ShareSgdCancel_Handler, |
|||
}, |
|||
}, |
|||
Streams: []grpc.StreamDesc{}, |
|||
Metadata: "matchmaking/v1/share/shareSgd.proto", |
|||
} |
@ -0,0 +1,279 @@ |
|||
// Code generated by protoc-gen-go-http. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-http v2.7.3
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareSgd.proto
|
|||
|
|||
package v1 |
|||
|
|||
import ( |
|||
context "context" |
|||
http "github.com/go-kratos/kratos/v2/transport/http" |
|||
binding "github.com/go-kratos/kratos/v2/transport/http/binding" |
|||
) |
|||
|
|||
// This is a compile-time assertion to ensure that this generated file
|
|||
// is compatible with the kratos package it is being compiled against.
|
|||
var _ = new(context.Context) |
|||
var _ = binding.EncodeURL |
|||
|
|||
const _ = http.SupportPackageIsVersion1 |
|||
|
|||
const OperationShareSgdGetBotStockSgdTrade = "/matchmaking.v1.ShareSgd/GetBotStockSgdTrade" |
|||
const OperationShareSgdShareSgdAllPosition = "/matchmaking.v1.ShareSgd/ShareSgdAllPosition" |
|||
const OperationShareSgdShareSgdCancel = "/matchmaking.v1.ShareSgd/ShareSgdCancel" |
|||
const OperationShareSgdShareSgdPlaceOrder = "/matchmaking.v1.ShareSgd/ShareSgdPlaceOrder" |
|||
const OperationShareSgdShareSgdPosition = "/matchmaking.v1.ShareSgd/ShareSgdPosition" |
|||
const OperationShareSgdShareSgdUpdateOrder = "/matchmaking.v1.ShareSgd/ShareSgdUpdateOrder" |
|||
|
|||
type ShareSgdHTTPServer interface { |
|||
// GetBotStockSgdTrade GetBotStockSgdTrade 新加坡股列表查询
|
|||
GetBotStockSgdTrade(context.Context, *GetSgdBotStockTradeRequest) (*GetBotStockSgdTradeReply, error) |
|||
// ShareSgdAllPosition ShareSgdAllPosition 新加坡股一键平仓
|
|||
ShareSgdAllPosition(context.Context, *AllSgdOrderRequest) (*AllSgdOrderReply, error) |
|||
// ShareSgdCancel ShareSgdCancel 新加坡股撤单
|
|||
ShareSgdCancel(context.Context, *CancelSgdOrderRequest) (*SgdOrderReply, error) |
|||
// ShareSgdPlaceOrder ShareSgdPlaceOrder 新加坡股下单
|
|||
ShareSgdPlaceOrder(context.Context, *ShareSgdOrderRequest) (*SgdOrderReply, error) |
|||
// ShareSgdPosition ShareSgdPosition 新加坡股平仓
|
|||
ShareSgdPosition(context.Context, *CancelSgdOrderRequest) (*SgdOrderReply, error) |
|||
// ShareSgdUpdateOrder ShareSgdUpdateOrder 新加坡股设置止盈止损
|
|||
ShareSgdUpdateOrder(context.Context, *UpdateSgdOrderRequest) (*SgdOrderReply, error) |
|||
} |
|||
|
|||
func RegisterShareSgdHTTPServer(s *http.Server, srv ShareSgdHTTPServer) { |
|||
r := s.Route("/") |
|||
r.POST("/order_sharesgd/share_list", _ShareSgd_GetBotStockSgdTrade0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharesgd/share_place_order", _ShareSgd_ShareSgdPlaceOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharesgd/share_update_order", _ShareSgd_ShareSgdUpdateOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharesgd/share_position", _ShareSgd_ShareSgdPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharesgd/share_all_position", _ShareSgd_ShareSgdAllPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharesgd/share_cancel", _ShareSgd_ShareSgdCancel0_HTTP_Handler(srv)) |
|||
} |
|||
|
|||
func _ShareSgd_GetBotStockSgdTrade0_HTTP_Handler(srv ShareSgdHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in GetSgdBotStockTradeRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareSgdGetBotStockSgdTrade) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.GetBotStockSgdTrade(ctx, req.(*GetSgdBotStockTradeRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*GetBotStockSgdTradeReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareSgd_ShareSgdPlaceOrder0_HTTP_Handler(srv ShareSgdHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in ShareSgdOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareSgdShareSgdPlaceOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareSgdPlaceOrder(ctx, req.(*ShareSgdOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*SgdOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareSgd_ShareSgdUpdateOrder0_HTTP_Handler(srv ShareSgdHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in UpdateSgdOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareSgdShareSgdUpdateOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareSgdUpdateOrder(ctx, req.(*UpdateSgdOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*SgdOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareSgd_ShareSgdPosition0_HTTP_Handler(srv ShareSgdHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelSgdOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareSgdShareSgdPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareSgdPosition(ctx, req.(*CancelSgdOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*SgdOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareSgd_ShareSgdAllPosition0_HTTP_Handler(srv ShareSgdHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in AllSgdOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareSgdShareSgdAllPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareSgdAllPosition(ctx, req.(*AllSgdOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*AllSgdOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareSgd_ShareSgdCancel0_HTTP_Handler(srv ShareSgdHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelSgdOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareSgdShareSgdCancel) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareSgdCancel(ctx, req.(*CancelSgdOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*SgdOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
type ShareSgdHTTPClient interface { |
|||
GetBotStockSgdTrade(ctx context.Context, req *GetSgdBotStockTradeRequest, opts ...http.CallOption) (rsp *GetBotStockSgdTradeReply, err error) |
|||
ShareSgdAllPosition(ctx context.Context, req *AllSgdOrderRequest, opts ...http.CallOption) (rsp *AllSgdOrderReply, err error) |
|||
ShareSgdCancel(ctx context.Context, req *CancelSgdOrderRequest, opts ...http.CallOption) (rsp *SgdOrderReply, err error) |
|||
ShareSgdPlaceOrder(ctx context.Context, req *ShareSgdOrderRequest, opts ...http.CallOption) (rsp *SgdOrderReply, err error) |
|||
ShareSgdPosition(ctx context.Context, req *CancelSgdOrderRequest, opts ...http.CallOption) (rsp *SgdOrderReply, err error) |
|||
ShareSgdUpdateOrder(ctx context.Context, req *UpdateSgdOrderRequest, opts ...http.CallOption) (rsp *SgdOrderReply, err error) |
|||
} |
|||
|
|||
type ShareSgdHTTPClientImpl struct { |
|||
cc *http.Client |
|||
} |
|||
|
|||
func NewShareSgdHTTPClient(client *http.Client) ShareSgdHTTPClient { |
|||
return &ShareSgdHTTPClientImpl{client} |
|||
} |
|||
|
|||
func (c *ShareSgdHTTPClientImpl) GetBotStockSgdTrade(ctx context.Context, in *GetSgdBotStockTradeRequest, opts ...http.CallOption) (*GetBotStockSgdTradeReply, error) { |
|||
var out GetBotStockSgdTradeReply |
|||
pattern := "/order_sharesgd/share_list" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareSgdGetBotStockSgdTrade)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareSgdHTTPClientImpl) ShareSgdAllPosition(ctx context.Context, in *AllSgdOrderRequest, opts ...http.CallOption) (*AllSgdOrderReply, error) { |
|||
var out AllSgdOrderReply |
|||
pattern := "/order_sharesgd/share_all_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareSgdShareSgdAllPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareSgdHTTPClientImpl) ShareSgdCancel(ctx context.Context, in *CancelSgdOrderRequest, opts ...http.CallOption) (*SgdOrderReply, error) { |
|||
var out SgdOrderReply |
|||
pattern := "/order_sharesgd/share_cancel" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareSgdShareSgdCancel)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareSgdHTTPClientImpl) ShareSgdPlaceOrder(ctx context.Context, in *ShareSgdOrderRequest, opts ...http.CallOption) (*SgdOrderReply, error) { |
|||
var out SgdOrderReply |
|||
pattern := "/order_sharesgd/share_place_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareSgdShareSgdPlaceOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareSgdHTTPClientImpl) ShareSgdPosition(ctx context.Context, in *CancelSgdOrderRequest, opts ...http.CallOption) (*SgdOrderReply, error) { |
|||
var out SgdOrderReply |
|||
pattern := "/order_sharesgd/share_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareSgdShareSgdPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareSgdHTTPClientImpl) ShareSgdUpdateOrder(ctx context.Context, in *UpdateSgdOrderRequest, opts ...http.CallOption) (*SgdOrderReply, error) { |
|||
var out SgdOrderReply |
|||
pattern := "/order_sharesgd/share_update_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareSgdShareSgdUpdateOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,144 @@ |
|||
syntax = "proto3"; |
|||
|
|||
package matchmaking.v1; |
|||
|
|||
import "google/api/annotations.proto"; |
|||
|
|||
option go_package = "matchmaking-system/api/matchmaking/v1;v1"; |
|||
|
|||
service ShareTha { |
|||
// GetBotStockThaTrade 泰股列表查询 |
|||
rpc GetBotStockThaTrade(GetThaBotStockTradeRequest)returns(GetBotStockThaTradeReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharetha/share_list", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareThaPlaceOrder 泰股下单 |
|||
rpc ShareThaPlaceOrder(ShareThaOrderRequest)returns(ThaOrderReply) { |
|||
option (google.api.http) = { |
|||
post: "/order_sharetha/share_place_order", |
|||
body: "*", |
|||
}; |
|||
} |
|||
// ShareThaUpdateOrder 泰股设置止盈止损 |
|||
rpc ShareThaUpdateOrder(UpdateThaOrderRequest)returns(ThaOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharetha/share_update_order", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareThaPosition 泰股平仓 |
|||
rpc ShareThaPosition(CancelThaOrderRequest)returns(ThaOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharetha/share_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareThaAllPosition 泰股一键平仓 |
|||
rpc ShareThaAllPosition(AllThaOrderRequest)returns(AllThaOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharetha/share_all_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareThaCancel 泰股撤单 |
|||
rpc ShareThaCancel(CancelThaOrderRequest)returns(ThaOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_sharetha/share_cancel", |
|||
body:"*", |
|||
}; |
|||
} |
|||
} |
|||
|
|||
message GetThaBotStockTradeRequest{ |
|||
int64 status =1;// 状态码 |
|||
int64 pageSize =2; // 每页显示条数 |
|||
int64 pageCount =3;// 开始的位置 |
|||
} |
|||
|
|||
message GetBotStockThaTradeReply{ |
|||
int64 code =1;// 状态码 |
|||
BotStockThaTradeData data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message BotStockThaTradeData{ |
|||
int64 pageSize =1; // 每页显示条数 |
|||
int64 pageCount =2;// 开始的位置 |
|||
repeated BotStockThaTrade data =3;// 返回结果 |
|||
int64 totalCount =4;// 总数据 |
|||
} |
|||
|
|||
message BotStockThaTrade{ |
|||
string orderId =1;// 订单ID |
|||
string stockId =2;// 股票代码 |
|||
int64 tradeType =3;// 交易类型 |
|||
int64 dealType =4;// 交易方式 |
|||
string limitPrice =5;// 限价 |
|||
string marketPrice =6;// 市价 |
|||
string dealPrice =7;// 开仓价 |
|||
string closingPrice =8;// 平仓价 |
|||
string orderNumber =9;// 订单数量 |
|||
int64 stopType =10;// 止盈止损 |
|||
string stopLossPrice =11;// 止损 |
|||
string stopWinPrice =12;// 止盈 |
|||
string serviceCost =13;// 开仓手续费 |
|||
string marketMoney =14;// 订单金额 |
|||
string orderMoney =15;// 订单总金额 |
|||
int64 status =16;// 订单状态 |
|||
string createTime =17;// 订单创建时间 |
|||
string updateTime =18;// 订单更新时间 |
|||
string openTime =19;// 订单开仓时间 |
|||
string closingTime =20;// 订单平仓时间 |
|||
string closingCost =21;// 平仓手续费 |
|||
string faceValue =22;// 面值 |
|||
string pryNum =23;// 杠杆 |
|||
string keepDecimal =24;// 保留小数位 |
|||
string stockName =25;// 股票名称 |
|||
} |
|||
|
|||
message ShareThaOrderRequest{ |
|||
string stockId =1;// 股票Code |
|||
int64 tradeType =2;// 交易类型:1买入,2卖出 |
|||
int64 dealType =3;// 委托方式:1限价,2市价 |
|||
string limitPrice =4;// 限价 |
|||
string marketPrice =5;// 市价 |
|||
string marketMoney =6;// 订单金额 |
|||
string orderNumber =7;// 订单数量 |
|||
string serviceCost =8;// 手续费 |
|||
int64 stopType =9;// 止损止盈设置:1无设置,2止损止盈 |
|||
string stopLossPrice =10;// 止损 |
|||
string stopWinPrice =11;// 止损 |
|||
string pryNum =12;// 杠杆 |
|||
} |
|||
|
|||
message UpdateThaOrderRequest{ |
|||
string orderId =1;// 订单Id |
|||
int64 stopType =2;// 止盈止损 |
|||
string stopLossPrice =3;// 止损 |
|||
string stopWinPrice =4;// 止盈 |
|||
} |
|||
|
|||
message ThaOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
ThaOrderResult data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message ThaOrderResult { |
|||
string orderId =1;// 订单Id |
|||
} |
|||
|
|||
message CancelThaOrderRequest{ |
|||
string orderId =1;// 订单ID |
|||
} |
|||
|
|||
message AllThaOrderRequest{ |
|||
|
|||
} |
|||
message AllThaOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
string data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
@ -0,0 +1,312 @@ |
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-grpc v1.4.0
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareTha.proto
|
|||
|
|||
package v1 |
|||
|
|||
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.62.0 or later.
|
|||
const _ = grpc.SupportPackageIsVersion8 |
|||
|
|||
const ( |
|||
ShareTha_GetBotStockThaTrade_FullMethodName = "/matchmaking.v1.ShareTha/GetBotStockThaTrade" |
|||
ShareTha_ShareThaPlaceOrder_FullMethodName = "/matchmaking.v1.ShareTha/ShareThaPlaceOrder" |
|||
ShareTha_ShareThaUpdateOrder_FullMethodName = "/matchmaking.v1.ShareTha/ShareThaUpdateOrder" |
|||
ShareTha_ShareThaPosition_FullMethodName = "/matchmaking.v1.ShareTha/ShareThaPosition" |
|||
ShareTha_ShareThaAllPosition_FullMethodName = "/matchmaking.v1.ShareTha/ShareThaAllPosition" |
|||
ShareTha_ShareThaCancel_FullMethodName = "/matchmaking.v1.ShareTha/ShareThaCancel" |
|||
) |
|||
|
|||
// ShareThaClient is the client API for ShareTha 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 ShareThaClient interface { |
|||
// GetBotStockThaTrade 泰股列表查询
|
|||
GetBotStockThaTrade(ctx context.Context, in *GetThaBotStockTradeRequest, opts ...grpc.CallOption) (*GetBotStockThaTradeReply, error) |
|||
// ShareThaPlaceOrder 泰股下单
|
|||
ShareThaPlaceOrder(ctx context.Context, in *ShareThaOrderRequest, opts ...grpc.CallOption) (*ThaOrderReply, error) |
|||
// ShareThaUpdateOrder 泰股设置止盈止损
|
|||
ShareThaUpdateOrder(ctx context.Context, in *UpdateThaOrderRequest, opts ...grpc.CallOption) (*ThaOrderReply, error) |
|||
// ShareThaPosition 泰股平仓
|
|||
ShareThaPosition(ctx context.Context, in *CancelThaOrderRequest, opts ...grpc.CallOption) (*ThaOrderReply, error) |
|||
// ShareThaAllPosition 泰股一键平仓
|
|||
ShareThaAllPosition(ctx context.Context, in *AllThaOrderRequest, opts ...grpc.CallOption) (*AllThaOrderReply, error) |
|||
// ShareThaCancel 泰股撤单
|
|||
ShareThaCancel(ctx context.Context, in *CancelThaOrderRequest, opts ...grpc.CallOption) (*ThaOrderReply, error) |
|||
} |
|||
|
|||
type shareThaClient struct { |
|||
cc grpc.ClientConnInterface |
|||
} |
|||
|
|||
func NewShareThaClient(cc grpc.ClientConnInterface) ShareThaClient { |
|||
return &shareThaClient{cc} |
|||
} |
|||
|
|||
func (c *shareThaClient) GetBotStockThaTrade(ctx context.Context, in *GetThaBotStockTradeRequest, opts ...grpc.CallOption) (*GetBotStockThaTradeReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(GetBotStockThaTradeReply) |
|||
err := c.cc.Invoke(ctx, ShareTha_GetBotStockThaTrade_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareThaClient) ShareThaPlaceOrder(ctx context.Context, in *ShareThaOrderRequest, opts ...grpc.CallOption) (*ThaOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(ThaOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareTha_ShareThaPlaceOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareThaClient) ShareThaUpdateOrder(ctx context.Context, in *UpdateThaOrderRequest, opts ...grpc.CallOption) (*ThaOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(ThaOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareTha_ShareThaUpdateOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareThaClient) ShareThaPosition(ctx context.Context, in *CancelThaOrderRequest, opts ...grpc.CallOption) (*ThaOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(ThaOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareTha_ShareThaPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareThaClient) ShareThaAllPosition(ctx context.Context, in *AllThaOrderRequest, opts ...grpc.CallOption) (*AllThaOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(AllThaOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareTha_ShareThaAllPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareThaClient) ShareThaCancel(ctx context.Context, in *CancelThaOrderRequest, opts ...grpc.CallOption) (*ThaOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(ThaOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareTha_ShareThaCancel_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
// ShareThaServer is the server API for ShareTha service.
|
|||
// All implementations must embed UnimplementedShareThaServer
|
|||
// for forward compatibility
|
|||
type ShareThaServer interface { |
|||
// GetBotStockThaTrade 泰股列表查询
|
|||
GetBotStockThaTrade(context.Context, *GetThaBotStockTradeRequest) (*GetBotStockThaTradeReply, error) |
|||
// ShareThaPlaceOrder 泰股下单
|
|||
ShareThaPlaceOrder(context.Context, *ShareThaOrderRequest) (*ThaOrderReply, error) |
|||
// ShareThaUpdateOrder 泰股设置止盈止损
|
|||
ShareThaUpdateOrder(context.Context, *UpdateThaOrderRequest) (*ThaOrderReply, error) |
|||
// ShareThaPosition 泰股平仓
|
|||
ShareThaPosition(context.Context, *CancelThaOrderRequest) (*ThaOrderReply, error) |
|||
// ShareThaAllPosition 泰股一键平仓
|
|||
ShareThaAllPosition(context.Context, *AllThaOrderRequest) (*AllThaOrderReply, error) |
|||
// ShareThaCancel 泰股撤单
|
|||
ShareThaCancel(context.Context, *CancelThaOrderRequest) (*ThaOrderReply, error) |
|||
mustEmbedUnimplementedShareThaServer() |
|||
} |
|||
|
|||
// UnimplementedShareThaServer must be embedded to have forward compatible implementations.
|
|||
type UnimplementedShareThaServer struct { |
|||
} |
|||
|
|||
func (UnimplementedShareThaServer) GetBotStockThaTrade(context.Context, *GetThaBotStockTradeRequest) (*GetBotStockThaTradeReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method GetBotStockThaTrade not implemented") |
|||
} |
|||
func (UnimplementedShareThaServer) ShareThaPlaceOrder(context.Context, *ShareThaOrderRequest) (*ThaOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareThaPlaceOrder not implemented") |
|||
} |
|||
func (UnimplementedShareThaServer) ShareThaUpdateOrder(context.Context, *UpdateThaOrderRequest) (*ThaOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareThaUpdateOrder not implemented") |
|||
} |
|||
func (UnimplementedShareThaServer) ShareThaPosition(context.Context, *CancelThaOrderRequest) (*ThaOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareThaPosition not implemented") |
|||
} |
|||
func (UnimplementedShareThaServer) ShareThaAllPosition(context.Context, *AllThaOrderRequest) (*AllThaOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareThaAllPosition not implemented") |
|||
} |
|||
func (UnimplementedShareThaServer) ShareThaCancel(context.Context, *CancelThaOrderRequest) (*ThaOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareThaCancel not implemented") |
|||
} |
|||
func (UnimplementedShareThaServer) mustEmbedUnimplementedShareThaServer() {} |
|||
|
|||
// UnsafeShareThaServer may be embedded to opt out of forward compatibility for this service.
|
|||
// Use of this interface is not recommended, as added methods to ShareThaServer will
|
|||
// result in compilation errors.
|
|||
type UnsafeShareThaServer interface { |
|||
mustEmbedUnimplementedShareThaServer() |
|||
} |
|||
|
|||
func RegisterShareThaServer(s grpc.ServiceRegistrar, srv ShareThaServer) { |
|||
s.RegisterService(&ShareTha_ServiceDesc, srv) |
|||
} |
|||
|
|||
func _ShareTha_GetBotStockThaTrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(GetThaBotStockTradeRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareThaServer).GetBotStockThaTrade(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareTha_GetBotStockThaTrade_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareThaServer).GetBotStockThaTrade(ctx, req.(*GetThaBotStockTradeRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareTha_ShareThaPlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(ShareThaOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareThaServer).ShareThaPlaceOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareTha_ShareThaPlaceOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareThaServer).ShareThaPlaceOrder(ctx, req.(*ShareThaOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareTha_ShareThaUpdateOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(UpdateThaOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareThaServer).ShareThaUpdateOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareTha_ShareThaUpdateOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareThaServer).ShareThaUpdateOrder(ctx, req.(*UpdateThaOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareTha_ShareThaPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelThaOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareThaServer).ShareThaPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareTha_ShareThaPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareThaServer).ShareThaPosition(ctx, req.(*CancelThaOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareTha_ShareThaAllPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(AllThaOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareThaServer).ShareThaAllPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareTha_ShareThaAllPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareThaServer).ShareThaAllPosition(ctx, req.(*AllThaOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareTha_ShareThaCancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelThaOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareThaServer).ShareThaCancel(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareTha_ShareThaCancel_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareThaServer).ShareThaCancel(ctx, req.(*CancelThaOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
// ShareTha_ServiceDesc is the grpc.ServiceDesc for ShareTha service.
|
|||
// It's only intended for direct use with grpc.RegisterService,
|
|||
// and not to be introspected or modified (even as a copy)
|
|||
var ShareTha_ServiceDesc = grpc.ServiceDesc{ |
|||
ServiceName: "matchmaking.v1.ShareTha", |
|||
HandlerType: (*ShareThaServer)(nil), |
|||
Methods: []grpc.MethodDesc{ |
|||
{ |
|||
MethodName: "GetBotStockThaTrade", |
|||
Handler: _ShareTha_GetBotStockThaTrade_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareThaPlaceOrder", |
|||
Handler: _ShareTha_ShareThaPlaceOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareThaUpdateOrder", |
|||
Handler: _ShareTha_ShareThaUpdateOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareThaPosition", |
|||
Handler: _ShareTha_ShareThaPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareThaAllPosition", |
|||
Handler: _ShareTha_ShareThaAllPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareThaCancel", |
|||
Handler: _ShareTha_ShareThaCancel_Handler, |
|||
}, |
|||
}, |
|||
Streams: []grpc.StreamDesc{}, |
|||
Metadata: "matchmaking/v1/share/shareTha.proto", |
|||
} |
@ -0,0 +1,279 @@ |
|||
// Code generated by protoc-gen-go-http. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-http v2.7.3
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareTha.proto
|
|||
|
|||
package v1 |
|||
|
|||
import ( |
|||
context "context" |
|||
http "github.com/go-kratos/kratos/v2/transport/http" |
|||
binding "github.com/go-kratos/kratos/v2/transport/http/binding" |
|||
) |
|||
|
|||
// This is a compile-time assertion to ensure that this generated file
|
|||
// is compatible with the kratos package it is being compiled against.
|
|||
var _ = new(context.Context) |
|||
var _ = binding.EncodeURL |
|||
|
|||
const _ = http.SupportPackageIsVersion1 |
|||
|
|||
const OperationShareThaGetBotStockThaTrade = "/matchmaking.v1.ShareTha/GetBotStockThaTrade" |
|||
const OperationShareThaShareThaAllPosition = "/matchmaking.v1.ShareTha/ShareThaAllPosition" |
|||
const OperationShareThaShareThaCancel = "/matchmaking.v1.ShareTha/ShareThaCancel" |
|||
const OperationShareThaShareThaPlaceOrder = "/matchmaking.v1.ShareTha/ShareThaPlaceOrder" |
|||
const OperationShareThaShareThaPosition = "/matchmaking.v1.ShareTha/ShareThaPosition" |
|||
const OperationShareThaShareThaUpdateOrder = "/matchmaking.v1.ShareTha/ShareThaUpdateOrder" |
|||
|
|||
type ShareThaHTTPServer interface { |
|||
// GetBotStockThaTrade GetBotStockThaTrade 泰股列表查询
|
|||
GetBotStockThaTrade(context.Context, *GetThaBotStockTradeRequest) (*GetBotStockThaTradeReply, error) |
|||
// ShareThaAllPosition ShareThaAllPosition 泰股一键平仓
|
|||
ShareThaAllPosition(context.Context, *AllThaOrderRequest) (*AllThaOrderReply, error) |
|||
// ShareThaCancel ShareThaCancel 泰股撤单
|
|||
ShareThaCancel(context.Context, *CancelThaOrderRequest) (*ThaOrderReply, error) |
|||
// ShareThaPlaceOrder ShareThaPlaceOrder 泰股下单
|
|||
ShareThaPlaceOrder(context.Context, *ShareThaOrderRequest) (*ThaOrderReply, error) |
|||
// ShareThaPosition ShareThaPosition 泰股平仓
|
|||
ShareThaPosition(context.Context, *CancelThaOrderRequest) (*ThaOrderReply, error) |
|||
// ShareThaUpdateOrder ShareThaUpdateOrder 泰股设置止盈止损
|
|||
ShareThaUpdateOrder(context.Context, *UpdateThaOrderRequest) (*ThaOrderReply, error) |
|||
} |
|||
|
|||
func RegisterShareThaHTTPServer(s *http.Server, srv ShareThaHTTPServer) { |
|||
r := s.Route("/") |
|||
r.POST("/order_sharetha/share_list", _ShareTha_GetBotStockThaTrade0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharetha/share_place_order", _ShareTha_ShareThaPlaceOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharetha/share_update_order", _ShareTha_ShareThaUpdateOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharetha/share_position", _ShareTha_ShareThaPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharetha/share_all_position", _ShareTha_ShareThaAllPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_sharetha/share_cancel", _ShareTha_ShareThaCancel0_HTTP_Handler(srv)) |
|||
} |
|||
|
|||
func _ShareTha_GetBotStockThaTrade0_HTTP_Handler(srv ShareThaHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in GetThaBotStockTradeRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareThaGetBotStockThaTrade) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.GetBotStockThaTrade(ctx, req.(*GetThaBotStockTradeRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*GetBotStockThaTradeReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareTha_ShareThaPlaceOrder0_HTTP_Handler(srv ShareThaHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in ShareThaOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareThaShareThaPlaceOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareThaPlaceOrder(ctx, req.(*ShareThaOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*ThaOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareTha_ShareThaUpdateOrder0_HTTP_Handler(srv ShareThaHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in UpdateThaOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareThaShareThaUpdateOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareThaUpdateOrder(ctx, req.(*UpdateThaOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*ThaOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareTha_ShareThaPosition0_HTTP_Handler(srv ShareThaHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelThaOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareThaShareThaPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareThaPosition(ctx, req.(*CancelThaOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*ThaOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareTha_ShareThaAllPosition0_HTTP_Handler(srv ShareThaHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in AllThaOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareThaShareThaAllPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareThaAllPosition(ctx, req.(*AllThaOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*AllThaOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareTha_ShareThaCancel0_HTTP_Handler(srv ShareThaHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelThaOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareThaShareThaCancel) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareThaCancel(ctx, req.(*CancelThaOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*ThaOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
type ShareThaHTTPClient interface { |
|||
GetBotStockThaTrade(ctx context.Context, req *GetThaBotStockTradeRequest, opts ...http.CallOption) (rsp *GetBotStockThaTradeReply, err error) |
|||
ShareThaAllPosition(ctx context.Context, req *AllThaOrderRequest, opts ...http.CallOption) (rsp *AllThaOrderReply, err error) |
|||
ShareThaCancel(ctx context.Context, req *CancelThaOrderRequest, opts ...http.CallOption) (rsp *ThaOrderReply, err error) |
|||
ShareThaPlaceOrder(ctx context.Context, req *ShareThaOrderRequest, opts ...http.CallOption) (rsp *ThaOrderReply, err error) |
|||
ShareThaPosition(ctx context.Context, req *CancelThaOrderRequest, opts ...http.CallOption) (rsp *ThaOrderReply, err error) |
|||
ShareThaUpdateOrder(ctx context.Context, req *UpdateThaOrderRequest, opts ...http.CallOption) (rsp *ThaOrderReply, err error) |
|||
} |
|||
|
|||
type ShareThaHTTPClientImpl struct { |
|||
cc *http.Client |
|||
} |
|||
|
|||
func NewShareThaHTTPClient(client *http.Client) ShareThaHTTPClient { |
|||
return &ShareThaHTTPClientImpl{client} |
|||
} |
|||
|
|||
func (c *ShareThaHTTPClientImpl) GetBotStockThaTrade(ctx context.Context, in *GetThaBotStockTradeRequest, opts ...http.CallOption) (*GetBotStockThaTradeReply, error) { |
|||
var out GetBotStockThaTradeReply |
|||
pattern := "/order_sharetha/share_list" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareThaGetBotStockThaTrade)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareThaHTTPClientImpl) ShareThaAllPosition(ctx context.Context, in *AllThaOrderRequest, opts ...http.CallOption) (*AllThaOrderReply, error) { |
|||
var out AllThaOrderReply |
|||
pattern := "/order_sharetha/share_all_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareThaShareThaAllPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareThaHTTPClientImpl) ShareThaCancel(ctx context.Context, in *CancelThaOrderRequest, opts ...http.CallOption) (*ThaOrderReply, error) { |
|||
var out ThaOrderReply |
|||
pattern := "/order_sharetha/share_cancel" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareThaShareThaCancel)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareThaHTTPClientImpl) ShareThaPlaceOrder(ctx context.Context, in *ShareThaOrderRequest, opts ...http.CallOption) (*ThaOrderReply, error) { |
|||
var out ThaOrderReply |
|||
pattern := "/order_sharetha/share_place_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareThaShareThaPlaceOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareThaHTTPClientImpl) ShareThaPosition(ctx context.Context, in *CancelThaOrderRequest, opts ...http.CallOption) (*ThaOrderReply, error) { |
|||
var out ThaOrderReply |
|||
pattern := "/order_sharetha/share_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareThaShareThaPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareThaHTTPClientImpl) ShareThaUpdateOrder(ctx context.Context, in *UpdateThaOrderRequest, opts ...http.CallOption) (*ThaOrderReply, error) { |
|||
var out ThaOrderReply |
|||
pattern := "/order_sharetha/share_update_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareThaShareThaUpdateOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,145 @@ |
|||
syntax = "proto3"; |
|||
|
|||
package matchmaking.v1; |
|||
|
|||
import "google/api/annotations.proto"; |
|||
|
|||
option go_package = "matchmaking-system/api/matchmaking/v1;v1"; |
|||
|
|||
service ShareUs { |
|||
// GetBotStockTrade 美股列表查询 |
|||
rpc GetBotStockTrade(GetUsBotStockTradeRequest)returns(GetUsBotStockTradeReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareus/share_list", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// SharePlaceOrder 美股下单 |
|||
rpc SharePlaceOrder(UsOrderRequest)returns(UsOrderReply) { |
|||
option (google.api.http) = { |
|||
post: "/order_shareus/share_place_order", |
|||
body: "*", |
|||
}; |
|||
} |
|||
// ShareUpdateOrder 美股设置止盈止损 |
|||
rpc ShareUpdateOrder(UpdateUsOrderRequest)returns(UsOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareus/share_update_order", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// SharePosition 美股平仓 |
|||
rpc SharePosition(CancelUsOrderRequest)returns(UsOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareus/share_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareCancel 美股一键平仓 |
|||
rpc ShareAllPosition(AllUsOrderRequest)returns(AllUsOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareus/share_all_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ShareCancel 美股撤单 |
|||
rpc ShareCancel(CancelUsOrderRequest)returns(UsOrderReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_shareus/share_cancel", |
|||
body:"*", |
|||
}; |
|||
} |
|||
} |
|||
|
|||
message GetUsBotStockTradeRequest{ |
|||
int64 status =1;// 状态码 |
|||
int64 pageSize =2; // 每页显示条数 |
|||
int64 pageCount =3;// 开始的位置 |
|||
} |
|||
|
|||
message GetUsBotStockTradeReply{ |
|||
int64 code =1;// 状态码 |
|||
BotUsStockTradeData data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message BotUsStockTradeData{ |
|||
int64 pageSize =1; // 每页显示条数 |
|||
int64 pageCount =2;// 开始的位置 |
|||
repeated BotUsOrderTrade data =3;// 返回结果 |
|||
int64 totalCount =4;// 总数据 |
|||
} |
|||
|
|||
message BotUsOrderTrade{ |
|||
string orderId =1;// 订单ID |
|||
string stockId =2;// 股票代码 |
|||
int64 tradeType =3;// 交易类型 |
|||
int64 dealType =4;// 交易方式 |
|||
string limitPrice =5;// 限价 |
|||
string marketPrice =6;// 市价 |
|||
string dealPrice =7;// 开仓价 |
|||
string closingPrice =8;// 平仓价 |
|||
string orderNumber =9;// 订单数量 |
|||
int64 stopType =10;// 止盈止损状态 |
|||
string stopLossPrice =11;// 止损 |
|||
string stopWinPrice =12;// 止盈 |
|||
string serviceCost =13;// 开仓手续费 |
|||
string marketMoney =14;// 订单金额 |
|||
string orderMoney =15;// 订单总金额 |
|||
int64 status =16;// 订单状态 |
|||
string createTime =17;// 订单创建时间 |
|||
string updateTime =18;// 订单更新时间 |
|||
string openTime =19;// 订单开仓时间 |
|||
string closingTime =20;// 订单平仓时间 |
|||
string closingCost =21;// 平仓手续费 |
|||
string faceValue =22;// 面值 |
|||
string pryNum =23;// 杠杆 |
|||
string keepDecimal =24;// 保留小数位 |
|||
string stockName =25;// 股票名称 |
|||
} |
|||
|
|||
message UsOrderRequest{ |
|||
string stockId =1;// 股票Code |
|||
int64 tradeType =2;// 交易类型:1买入,2卖出 |
|||
int64 dealType =3;// 委托方式:1限价,2市价 |
|||
string limitPrice =4;// 限价 |
|||
string marketPrice =5;// 市价 |
|||
string marketMoney =6;// 订单金额 |
|||
string orderNumber =7;// 订单数量 |
|||
string serviceCost =8;// 手续费 |
|||
int64 stopType =9;// 止损止盈设置:1无设置,2止损止盈 |
|||
string stopLossPrice =10;// 止损 |
|||
string stopWinPrice =11;// 止损 |
|||
string pryNum =12;// 杠杆 |
|||
} |
|||
|
|||
message UpdateUsOrderRequest{ |
|||
string orderId =1;// 订单Id |
|||
int64 stopType =2;// 止盈止损 |
|||
string stopLossPrice =3;// 止损 |
|||
string stopWinPrice =4;// 止盈 |
|||
} |
|||
|
|||
message UsOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
UsOrderResult data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message AllUsOrderRequest{ |
|||
|
|||
} |
|||
|
|||
message CancelUsOrderRequest{ |
|||
string orderId =1;// 订单ID |
|||
} |
|||
|
|||
message AllUsOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
string data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message UsOrderResult { |
|||
string orderId =1;// 订单Id |
|||
} |
@ -0,0 +1,312 @@ |
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-grpc v1.4.0
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareUs.proto
|
|||
|
|||
package v1 |
|||
|
|||
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.62.0 or later.
|
|||
const _ = grpc.SupportPackageIsVersion8 |
|||
|
|||
const ( |
|||
ShareUs_GetBotStockTrade_FullMethodName = "/matchmaking.v1.ShareUs/GetBotStockTrade" |
|||
ShareUs_SharePlaceOrder_FullMethodName = "/matchmaking.v1.ShareUs/SharePlaceOrder" |
|||
ShareUs_ShareUpdateOrder_FullMethodName = "/matchmaking.v1.ShareUs/ShareUpdateOrder" |
|||
ShareUs_SharePosition_FullMethodName = "/matchmaking.v1.ShareUs/SharePosition" |
|||
ShareUs_ShareAllPosition_FullMethodName = "/matchmaking.v1.ShareUs/ShareAllPosition" |
|||
ShareUs_ShareCancel_FullMethodName = "/matchmaking.v1.ShareUs/ShareCancel" |
|||
) |
|||
|
|||
// ShareUsClient is the client API for ShareUs 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 ShareUsClient interface { |
|||
// GetBotStockTrade 美股列表查询
|
|||
GetBotStockTrade(ctx context.Context, in *GetUsBotStockTradeRequest, opts ...grpc.CallOption) (*GetUsBotStockTradeReply, error) |
|||
// SharePlaceOrder 美股下单
|
|||
SharePlaceOrder(ctx context.Context, in *UsOrderRequest, opts ...grpc.CallOption) (*UsOrderReply, error) |
|||
// ShareUpdateOrder 美股设置止盈止损
|
|||
ShareUpdateOrder(ctx context.Context, in *UpdateUsOrderRequest, opts ...grpc.CallOption) (*UsOrderReply, error) |
|||
// SharePosition 美股平仓
|
|||
SharePosition(ctx context.Context, in *CancelUsOrderRequest, opts ...grpc.CallOption) (*UsOrderReply, error) |
|||
// ShareCancel 美股一键平仓
|
|||
ShareAllPosition(ctx context.Context, in *AllUsOrderRequest, opts ...grpc.CallOption) (*AllUsOrderReply, error) |
|||
// ShareCancel 美股撤单
|
|||
ShareCancel(ctx context.Context, in *CancelUsOrderRequest, opts ...grpc.CallOption) (*UsOrderReply, error) |
|||
} |
|||
|
|||
type shareUsClient struct { |
|||
cc grpc.ClientConnInterface |
|||
} |
|||
|
|||
func NewShareUsClient(cc grpc.ClientConnInterface) ShareUsClient { |
|||
return &shareUsClient{cc} |
|||
} |
|||
|
|||
func (c *shareUsClient) GetBotStockTrade(ctx context.Context, in *GetUsBotStockTradeRequest, opts ...grpc.CallOption) (*GetUsBotStockTradeReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(GetUsBotStockTradeReply) |
|||
err := c.cc.Invoke(ctx, ShareUs_GetBotStockTrade_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareUsClient) SharePlaceOrder(ctx context.Context, in *UsOrderRequest, opts ...grpc.CallOption) (*UsOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(UsOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareUs_SharePlaceOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareUsClient) ShareUpdateOrder(ctx context.Context, in *UpdateUsOrderRequest, opts ...grpc.CallOption) (*UsOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(UsOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareUs_ShareUpdateOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareUsClient) SharePosition(ctx context.Context, in *CancelUsOrderRequest, opts ...grpc.CallOption) (*UsOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(UsOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareUs_SharePosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareUsClient) ShareAllPosition(ctx context.Context, in *AllUsOrderRequest, opts ...grpc.CallOption) (*AllUsOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(AllUsOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareUs_ShareAllPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *shareUsClient) ShareCancel(ctx context.Context, in *CancelUsOrderRequest, opts ...grpc.CallOption) (*UsOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(UsOrderReply) |
|||
err := c.cc.Invoke(ctx, ShareUs_ShareCancel_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
// ShareUsServer is the server API for ShareUs service.
|
|||
// All implementations must embed UnimplementedShareUsServer
|
|||
// for forward compatibility
|
|||
type ShareUsServer interface { |
|||
// GetBotStockTrade 美股列表查询
|
|||
GetBotStockTrade(context.Context, *GetUsBotStockTradeRequest) (*GetUsBotStockTradeReply, error) |
|||
// SharePlaceOrder 美股下单
|
|||
SharePlaceOrder(context.Context, *UsOrderRequest) (*UsOrderReply, error) |
|||
// ShareUpdateOrder 美股设置止盈止损
|
|||
ShareUpdateOrder(context.Context, *UpdateUsOrderRequest) (*UsOrderReply, error) |
|||
// SharePosition 美股平仓
|
|||
SharePosition(context.Context, *CancelUsOrderRequest) (*UsOrderReply, error) |
|||
// ShareCancel 美股一键平仓
|
|||
ShareAllPosition(context.Context, *AllUsOrderRequest) (*AllUsOrderReply, error) |
|||
// ShareCancel 美股撤单
|
|||
ShareCancel(context.Context, *CancelUsOrderRequest) (*UsOrderReply, error) |
|||
mustEmbedUnimplementedShareUsServer() |
|||
} |
|||
|
|||
// UnimplementedShareUsServer must be embedded to have forward compatible implementations.
|
|||
type UnimplementedShareUsServer struct { |
|||
} |
|||
|
|||
func (UnimplementedShareUsServer) GetBotStockTrade(context.Context, *GetUsBotStockTradeRequest) (*GetUsBotStockTradeReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method GetBotStockTrade not implemented") |
|||
} |
|||
func (UnimplementedShareUsServer) SharePlaceOrder(context.Context, *UsOrderRequest) (*UsOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method SharePlaceOrder not implemented") |
|||
} |
|||
func (UnimplementedShareUsServer) ShareUpdateOrder(context.Context, *UpdateUsOrderRequest) (*UsOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareUpdateOrder not implemented") |
|||
} |
|||
func (UnimplementedShareUsServer) SharePosition(context.Context, *CancelUsOrderRequest) (*UsOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method SharePosition not implemented") |
|||
} |
|||
func (UnimplementedShareUsServer) ShareAllPosition(context.Context, *AllUsOrderRequest) (*AllUsOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareAllPosition not implemented") |
|||
} |
|||
func (UnimplementedShareUsServer) ShareCancel(context.Context, *CancelUsOrderRequest) (*UsOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ShareCancel not implemented") |
|||
} |
|||
func (UnimplementedShareUsServer) mustEmbedUnimplementedShareUsServer() {} |
|||
|
|||
// UnsafeShareUsServer may be embedded to opt out of forward compatibility for this service.
|
|||
// Use of this interface is not recommended, as added methods to ShareUsServer will
|
|||
// result in compilation errors.
|
|||
type UnsafeShareUsServer interface { |
|||
mustEmbedUnimplementedShareUsServer() |
|||
} |
|||
|
|||
func RegisterShareUsServer(s grpc.ServiceRegistrar, srv ShareUsServer) { |
|||
s.RegisterService(&ShareUs_ServiceDesc, srv) |
|||
} |
|||
|
|||
func _ShareUs_GetBotStockTrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(GetUsBotStockTradeRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareUsServer).GetBotStockTrade(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareUs_GetBotStockTrade_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareUsServer).GetBotStockTrade(ctx, req.(*GetUsBotStockTradeRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareUs_SharePlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(UsOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareUsServer).SharePlaceOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareUs_SharePlaceOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareUsServer).SharePlaceOrder(ctx, req.(*UsOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareUs_ShareUpdateOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(UpdateUsOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareUsServer).ShareUpdateOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareUs_ShareUpdateOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareUsServer).ShareUpdateOrder(ctx, req.(*UpdateUsOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareUs_SharePosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelUsOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareUsServer).SharePosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareUs_SharePosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareUsServer).SharePosition(ctx, req.(*CancelUsOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareUs_ShareAllPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(AllUsOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareUsServer).ShareAllPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareUs_ShareAllPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareUsServer).ShareAllPosition(ctx, req.(*AllUsOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _ShareUs_ShareCancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelUsOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ShareUsServer).ShareCancel(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: ShareUs_ShareCancel_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ShareUsServer).ShareCancel(ctx, req.(*CancelUsOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
// ShareUs_ServiceDesc is the grpc.ServiceDesc for ShareUs service.
|
|||
// It's only intended for direct use with grpc.RegisterService,
|
|||
// and not to be introspected or modified (even as a copy)
|
|||
var ShareUs_ServiceDesc = grpc.ServiceDesc{ |
|||
ServiceName: "matchmaking.v1.ShareUs", |
|||
HandlerType: (*ShareUsServer)(nil), |
|||
Methods: []grpc.MethodDesc{ |
|||
{ |
|||
MethodName: "GetBotStockTrade", |
|||
Handler: _ShareUs_GetBotStockTrade_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "SharePlaceOrder", |
|||
Handler: _ShareUs_SharePlaceOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareUpdateOrder", |
|||
Handler: _ShareUs_ShareUpdateOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "SharePosition", |
|||
Handler: _ShareUs_SharePosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareAllPosition", |
|||
Handler: _ShareUs_ShareAllPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ShareCancel", |
|||
Handler: _ShareUs_ShareCancel_Handler, |
|||
}, |
|||
}, |
|||
Streams: []grpc.StreamDesc{}, |
|||
Metadata: "matchmaking/v1/share/shareUs.proto", |
|||
} |
@ -0,0 +1,279 @@ |
|||
// Code generated by protoc-gen-go-http. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-http v2.7.3
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/share/shareUs.proto
|
|||
|
|||
package v1 |
|||
|
|||
import ( |
|||
context "context" |
|||
http "github.com/go-kratos/kratos/v2/transport/http" |
|||
binding "github.com/go-kratos/kratos/v2/transport/http/binding" |
|||
) |
|||
|
|||
// This is a compile-time assertion to ensure that this generated file
|
|||
// is compatible with the kratos package it is being compiled against.
|
|||
var _ = new(context.Context) |
|||
var _ = binding.EncodeURL |
|||
|
|||
const _ = http.SupportPackageIsVersion1 |
|||
|
|||
const OperationShareUsGetBotStockTrade = "/matchmaking.v1.ShareUs/GetBotStockTrade" |
|||
const OperationShareUsShareAllPosition = "/matchmaking.v1.ShareUs/ShareAllPosition" |
|||
const OperationShareUsShareCancel = "/matchmaking.v1.ShareUs/ShareCancel" |
|||
const OperationShareUsSharePlaceOrder = "/matchmaking.v1.ShareUs/SharePlaceOrder" |
|||
const OperationShareUsSharePosition = "/matchmaking.v1.ShareUs/SharePosition" |
|||
const OperationShareUsShareUpdateOrder = "/matchmaking.v1.ShareUs/ShareUpdateOrder" |
|||
|
|||
type ShareUsHTTPServer interface { |
|||
// GetBotStockTrade GetBotStockTrade 美股列表查询
|
|||
GetBotStockTrade(context.Context, *GetUsBotStockTradeRequest) (*GetUsBotStockTradeReply, error) |
|||
// ShareAllPosition ShareCancel 美股一键平仓
|
|||
ShareAllPosition(context.Context, *AllUsOrderRequest) (*AllUsOrderReply, error) |
|||
// ShareCancel ShareCancel 美股撤单
|
|||
ShareCancel(context.Context, *CancelUsOrderRequest) (*UsOrderReply, error) |
|||
// SharePlaceOrder SharePlaceOrder 美股下单
|
|||
SharePlaceOrder(context.Context, *UsOrderRequest) (*UsOrderReply, error) |
|||
// SharePosition SharePosition 美股平仓
|
|||
SharePosition(context.Context, *CancelUsOrderRequest) (*UsOrderReply, error) |
|||
// ShareUpdateOrder ShareUpdateOrder 美股设置止盈止损
|
|||
ShareUpdateOrder(context.Context, *UpdateUsOrderRequest) (*UsOrderReply, error) |
|||
} |
|||
|
|||
func RegisterShareUsHTTPServer(s *http.Server, srv ShareUsHTTPServer) { |
|||
r := s.Route("/") |
|||
r.POST("/order_shareus/share_list", _ShareUs_GetBotStockTrade0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareus/share_place_order", _ShareUs_SharePlaceOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareus/share_update_order", _ShareUs_ShareUpdateOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareus/share_position", _ShareUs_SharePosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareus/share_all_position", _ShareUs_ShareAllPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_shareus/share_cancel", _ShareUs_ShareCancel0_HTTP_Handler(srv)) |
|||
} |
|||
|
|||
func _ShareUs_GetBotStockTrade0_HTTP_Handler(srv ShareUsHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in GetUsBotStockTradeRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareUsGetBotStockTrade) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.GetBotStockTrade(ctx, req.(*GetUsBotStockTradeRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*GetUsBotStockTradeReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareUs_SharePlaceOrder0_HTTP_Handler(srv ShareUsHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in UsOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareUsSharePlaceOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.SharePlaceOrder(ctx, req.(*UsOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*UsOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareUs_ShareUpdateOrder0_HTTP_Handler(srv ShareUsHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in UpdateUsOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareUsShareUpdateOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareUpdateOrder(ctx, req.(*UpdateUsOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*UsOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareUs_SharePosition0_HTTP_Handler(srv ShareUsHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelUsOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareUsSharePosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.SharePosition(ctx, req.(*CancelUsOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*UsOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareUs_ShareAllPosition0_HTTP_Handler(srv ShareUsHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in AllUsOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareUsShareAllPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareAllPosition(ctx, req.(*AllUsOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*AllUsOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _ShareUs_ShareCancel0_HTTP_Handler(srv ShareUsHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelUsOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationShareUsShareCancel) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ShareCancel(ctx, req.(*CancelUsOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*UsOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
type ShareUsHTTPClient interface { |
|||
GetBotStockTrade(ctx context.Context, req *GetUsBotStockTradeRequest, opts ...http.CallOption) (rsp *GetUsBotStockTradeReply, err error) |
|||
ShareAllPosition(ctx context.Context, req *AllUsOrderRequest, opts ...http.CallOption) (rsp *AllUsOrderReply, err error) |
|||
ShareCancel(ctx context.Context, req *CancelUsOrderRequest, opts ...http.CallOption) (rsp *UsOrderReply, err error) |
|||
SharePlaceOrder(ctx context.Context, req *UsOrderRequest, opts ...http.CallOption) (rsp *UsOrderReply, err error) |
|||
SharePosition(ctx context.Context, req *CancelUsOrderRequest, opts ...http.CallOption) (rsp *UsOrderReply, err error) |
|||
ShareUpdateOrder(ctx context.Context, req *UpdateUsOrderRequest, opts ...http.CallOption) (rsp *UsOrderReply, err error) |
|||
} |
|||
|
|||
type ShareUsHTTPClientImpl struct { |
|||
cc *http.Client |
|||
} |
|||
|
|||
func NewShareUsHTTPClient(client *http.Client) ShareUsHTTPClient { |
|||
return &ShareUsHTTPClientImpl{client} |
|||
} |
|||
|
|||
func (c *ShareUsHTTPClientImpl) GetBotStockTrade(ctx context.Context, in *GetUsBotStockTradeRequest, opts ...http.CallOption) (*GetUsBotStockTradeReply, error) { |
|||
var out GetUsBotStockTradeReply |
|||
pattern := "/order_shareus/share_list" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareUsGetBotStockTrade)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareUsHTTPClientImpl) ShareAllPosition(ctx context.Context, in *AllUsOrderRequest, opts ...http.CallOption) (*AllUsOrderReply, error) { |
|||
var out AllUsOrderReply |
|||
pattern := "/order_shareus/share_all_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareUsShareAllPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareUsHTTPClientImpl) ShareCancel(ctx context.Context, in *CancelUsOrderRequest, opts ...http.CallOption) (*UsOrderReply, error) { |
|||
var out UsOrderReply |
|||
pattern := "/order_shareus/share_cancel" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareUsShareCancel)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareUsHTTPClientImpl) SharePlaceOrder(ctx context.Context, in *UsOrderRequest, opts ...http.CallOption) (*UsOrderReply, error) { |
|||
var out UsOrderReply |
|||
pattern := "/order_shareus/share_place_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareUsSharePlaceOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareUsHTTPClientImpl) SharePosition(ctx context.Context, in *CancelUsOrderRequest, opts ...http.CallOption) (*UsOrderReply, error) { |
|||
var out UsOrderReply |
|||
pattern := "/order_shareus/share_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareUsSharePosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ShareUsHTTPClientImpl) ShareUpdateOrder(ctx context.Context, in *UpdateUsOrderRequest, opts ...http.CallOption) (*UsOrderReply, error) { |
|||
var out UsOrderReply |
|||
pattern := "/order_shareus/share_update_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationShareUsShareUpdateOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,151 @@ |
|||
syntax = "proto3"; |
|||
|
|||
package matchmaking.v1; |
|||
|
|||
import "google/api/annotations.proto"; |
|||
import "google/protobuf/timestamp.proto"; |
|||
|
|||
option go_package = "matchmaking-system/api/matchmaking/v1;v1"; |
|||
|
|||
service Contract { |
|||
// GetBotContractTrade 合约列表查询 |
|||
rpc GetBotContractTrade(GetBotContractTradeRequest)returns(GetBotContractTradeReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_contract/contract_list", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ContractPlaceOrder 合约下单 |
|||
rpc ContractPlaceOrder(ContractRequest)returns(ContractReply){ |
|||
option (google.api.http) = { |
|||
post: "/order_contract/contract_place_order", |
|||
body: "*", |
|||
}; |
|||
} |
|||
// ContractUpdatePlaceOrder 合约设置止盈止损 |
|||
rpc ContractUpdatePlaceOrder(UpdateContractRequest)returns(ContractReply){ |
|||
option (google.api.http) = { |
|||
post: "/order_contract/contract_update_order", |
|||
body: "*", |
|||
}; |
|||
} |
|||
// ContractPosition 合约平仓 |
|||
rpc ContractPosition(CancelContractRequest)returns(ContractReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_contract/contract_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ContractAllPosition 合约一键平仓 |
|||
rpc ContractAllPosition(AllContractRequest)returns(AllContractReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_contract/contract_all_position", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// ContractCancel 合约撤单 |
|||
rpc ContractCancel(CancelContractRequest)returns(ContractReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_contract/contract_cancel", |
|||
body:"*", |
|||
}; |
|||
} |
|||
} |
|||
|
|||
message GetBotContractTradeRequest{ |
|||
int64 status =1;// 状态码 |
|||
int64 pageSize =2; // 每页显示条数 |
|||
int64 pageCount =3;// 开始的位置 |
|||
int64 state = 4;// 订单类型 |
|||
} |
|||
|
|||
message GetBotContractTradeReply{ |
|||
int64 code =1;// 状态码 |
|||
BotContractTradeData data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message BotContractTradeData{ |
|||
int64 pageSize =1; // 每页显示条数 |
|||
int64 pageCount =2;// 开始的位置 |
|||
repeated BotContractTrade data =3;// 返回结果 |
|||
int64 totalCount =4;// 总数据 |
|||
} |
|||
|
|||
message BotContractTrade{ |
|||
string orderId =1;// 订单ID |
|||
string contractId =2;// 合约ID |
|||
int64 tradeType =3;// 交易类型 |
|||
int64 dealType =4;// 交易方式 |
|||
string limitPrice =5;// 限价 |
|||
string marketPrice =6;// 市价 |
|||
string dealPrice =7;// 开仓价 |
|||
string closingPrice =8;// 平仓价 |
|||
string orderNumber =9;// 订单数量 |
|||
int64 stopType =10;// 止盈止损状态 |
|||
string stopLossPrice =11;// 止损 |
|||
string stopWinPrice =12;// 止盈 |
|||
string serviceCost =13;// 开仓手续费 |
|||
string earnestMoney =14;// 保证金 |
|||
string orderMoney =15;// 订单总额 |
|||
int64 status =16;// 订单状态 |
|||
google.protobuf.Timestamp createTime =17;// 订单创建时间 |
|||
google.protobuf.Timestamp updateTime =18;// 订单更新时间 |
|||
google.protobuf.Timestamp openTime =19;// 订单开仓时间 |
|||
google.protobuf.Timestamp closingTime =20;// 订单平仓时间 |
|||
string closingCost =21;// 平仓手续费 |
|||
string faceValue =22;// 面值 |
|||
string overnightCost =23;// 过夜手续费 |
|||
string pryNum =24;// 杠杆值 |
|||
string keepDecimal =25;// 保留小数位 |
|||
string secondTime = 26;// 秒合约时间 |
|||
int64 state = 27;// 订单类型 |
|||
} |
|||
|
|||
message ContractRequest{ |
|||
string contractId =1;// 交易对 |
|||
int64 tradeType =2;// 交易类型:1买入,2卖出 |
|||
int64 dealType =3;// 委托方式:1限价,2市价 |
|||
string limitPrice =4;// 限价 |
|||
string marketPrice =5;// 市价 |
|||
string orderAmount =6;// 订单金额 |
|||
string orderNumber =7;// 订单数量 |
|||
string earnestMoney =8;// 保证金 |
|||
string serviceCost =9;// 手续费 |
|||
int64 stopType =10;// 止损止盈设置:0无设置,1止损止盈 |
|||
string stopLossPrice =11;// 止损 |
|||
string stopWinPrice =12;// 止盈 |
|||
string pryNum =13;//杠杆 |
|||
int64 time = 14;// 秒合约时间 |
|||
} |
|||
|
|||
message ContractReply{ |
|||
int64 code =1;// 状态码 |
|||
ContractResult data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message ContractResult { |
|||
string orderId =1;// 订单Id |
|||
} |
|||
|
|||
message UpdateContractRequest{ |
|||
string orderId =1;// 订单Id |
|||
int64 stopType =2;// 止盈止损 |
|||
string stopLossPrice =3;// 止损 |
|||
string stopWinPrice =4;// 止盈 |
|||
} |
|||
|
|||
message CancelContractRequest{ |
|||
string orderId =1;// 订单ID |
|||
} |
|||
|
|||
message AllContractRequest{ |
|||
|
|||
} |
|||
|
|||
message AllContractReply{ |
|||
int64 code =1;// 状态码 |
|||
string data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
@ -0,0 +1,312 @@ |
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-grpc v1.4.0
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/virtually/contract.proto
|
|||
|
|||
package v1 |
|||
|
|||
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.62.0 or later.
|
|||
const _ = grpc.SupportPackageIsVersion8 |
|||
|
|||
const ( |
|||
Contract_GetBotContractTrade_FullMethodName = "/matchmaking.v1.Contract/GetBotContractTrade" |
|||
Contract_ContractPlaceOrder_FullMethodName = "/matchmaking.v1.Contract/ContractPlaceOrder" |
|||
Contract_ContractUpdatePlaceOrder_FullMethodName = "/matchmaking.v1.Contract/ContractUpdatePlaceOrder" |
|||
Contract_ContractPosition_FullMethodName = "/matchmaking.v1.Contract/ContractPosition" |
|||
Contract_ContractAllPosition_FullMethodName = "/matchmaking.v1.Contract/ContractAllPosition" |
|||
Contract_ContractCancel_FullMethodName = "/matchmaking.v1.Contract/ContractCancel" |
|||
) |
|||
|
|||
// ContractClient is the client API for Contract 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 ContractClient interface { |
|||
// GetBotContractTrade 合约列表查询
|
|||
GetBotContractTrade(ctx context.Context, in *GetBotContractTradeRequest, opts ...grpc.CallOption) (*GetBotContractTradeReply, error) |
|||
// ContractPlaceOrder 合约下单
|
|||
ContractPlaceOrder(ctx context.Context, in *ContractRequest, opts ...grpc.CallOption) (*ContractReply, error) |
|||
// ContractUpdatePlaceOrder 合约设置止盈止损
|
|||
ContractUpdatePlaceOrder(ctx context.Context, in *UpdateContractRequest, opts ...grpc.CallOption) (*ContractReply, error) |
|||
// ContractPosition 合约平仓
|
|||
ContractPosition(ctx context.Context, in *CancelContractRequest, opts ...grpc.CallOption) (*ContractReply, error) |
|||
// ContractAllPosition 合约一键平仓
|
|||
ContractAllPosition(ctx context.Context, in *AllContractRequest, opts ...grpc.CallOption) (*AllContractReply, error) |
|||
// ContractCancel 合约撤单
|
|||
ContractCancel(ctx context.Context, in *CancelContractRequest, opts ...grpc.CallOption) (*ContractReply, error) |
|||
} |
|||
|
|||
type contractClient struct { |
|||
cc grpc.ClientConnInterface |
|||
} |
|||
|
|||
func NewContractClient(cc grpc.ClientConnInterface) ContractClient { |
|||
return &contractClient{cc} |
|||
} |
|||
|
|||
func (c *contractClient) GetBotContractTrade(ctx context.Context, in *GetBotContractTradeRequest, opts ...grpc.CallOption) (*GetBotContractTradeReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(GetBotContractTradeReply) |
|||
err := c.cc.Invoke(ctx, Contract_GetBotContractTrade_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *contractClient) ContractPlaceOrder(ctx context.Context, in *ContractRequest, opts ...grpc.CallOption) (*ContractReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(ContractReply) |
|||
err := c.cc.Invoke(ctx, Contract_ContractPlaceOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *contractClient) ContractUpdatePlaceOrder(ctx context.Context, in *UpdateContractRequest, opts ...grpc.CallOption) (*ContractReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(ContractReply) |
|||
err := c.cc.Invoke(ctx, Contract_ContractUpdatePlaceOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *contractClient) ContractPosition(ctx context.Context, in *CancelContractRequest, opts ...grpc.CallOption) (*ContractReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(ContractReply) |
|||
err := c.cc.Invoke(ctx, Contract_ContractPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *contractClient) ContractAllPosition(ctx context.Context, in *AllContractRequest, opts ...grpc.CallOption) (*AllContractReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(AllContractReply) |
|||
err := c.cc.Invoke(ctx, Contract_ContractAllPosition_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *contractClient) ContractCancel(ctx context.Context, in *CancelContractRequest, opts ...grpc.CallOption) (*ContractReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(ContractReply) |
|||
err := c.cc.Invoke(ctx, Contract_ContractCancel_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
// ContractServer is the server API for Contract service.
|
|||
// All implementations must embed UnimplementedContractServer
|
|||
// for forward compatibility
|
|||
type ContractServer interface { |
|||
// GetBotContractTrade 合约列表查询
|
|||
GetBotContractTrade(context.Context, *GetBotContractTradeRequest) (*GetBotContractTradeReply, error) |
|||
// ContractPlaceOrder 合约下单
|
|||
ContractPlaceOrder(context.Context, *ContractRequest) (*ContractReply, error) |
|||
// ContractUpdatePlaceOrder 合约设置止盈止损
|
|||
ContractUpdatePlaceOrder(context.Context, *UpdateContractRequest) (*ContractReply, error) |
|||
// ContractPosition 合约平仓
|
|||
ContractPosition(context.Context, *CancelContractRequest) (*ContractReply, error) |
|||
// ContractAllPosition 合约一键平仓
|
|||
ContractAllPosition(context.Context, *AllContractRequest) (*AllContractReply, error) |
|||
// ContractCancel 合约撤单
|
|||
ContractCancel(context.Context, *CancelContractRequest) (*ContractReply, error) |
|||
mustEmbedUnimplementedContractServer() |
|||
} |
|||
|
|||
// UnimplementedContractServer must be embedded to have forward compatible implementations.
|
|||
type UnimplementedContractServer struct { |
|||
} |
|||
|
|||
func (UnimplementedContractServer) GetBotContractTrade(context.Context, *GetBotContractTradeRequest) (*GetBotContractTradeReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method GetBotContractTrade not implemented") |
|||
} |
|||
func (UnimplementedContractServer) ContractPlaceOrder(context.Context, *ContractRequest) (*ContractReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ContractPlaceOrder not implemented") |
|||
} |
|||
func (UnimplementedContractServer) ContractUpdatePlaceOrder(context.Context, *UpdateContractRequest) (*ContractReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ContractUpdatePlaceOrder not implemented") |
|||
} |
|||
func (UnimplementedContractServer) ContractPosition(context.Context, *CancelContractRequest) (*ContractReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ContractPosition not implemented") |
|||
} |
|||
func (UnimplementedContractServer) ContractAllPosition(context.Context, *AllContractRequest) (*AllContractReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ContractAllPosition not implemented") |
|||
} |
|||
func (UnimplementedContractServer) ContractCancel(context.Context, *CancelContractRequest) (*ContractReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method ContractCancel not implemented") |
|||
} |
|||
func (UnimplementedContractServer) mustEmbedUnimplementedContractServer() {} |
|||
|
|||
// UnsafeContractServer may be embedded to opt out of forward compatibility for this service.
|
|||
// Use of this interface is not recommended, as added methods to ContractServer will
|
|||
// result in compilation errors.
|
|||
type UnsafeContractServer interface { |
|||
mustEmbedUnimplementedContractServer() |
|||
} |
|||
|
|||
func RegisterContractServer(s grpc.ServiceRegistrar, srv ContractServer) { |
|||
s.RegisterService(&Contract_ServiceDesc, srv) |
|||
} |
|||
|
|||
func _Contract_GetBotContractTrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(GetBotContractTradeRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ContractServer).GetBotContractTrade(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Contract_GetBotContractTrade_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ContractServer).GetBotContractTrade(ctx, req.(*GetBotContractTradeRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Contract_ContractPlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(ContractRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ContractServer).ContractPlaceOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Contract_ContractPlaceOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ContractServer).ContractPlaceOrder(ctx, req.(*ContractRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Contract_ContractUpdatePlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(UpdateContractRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ContractServer).ContractUpdatePlaceOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Contract_ContractUpdatePlaceOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ContractServer).ContractUpdatePlaceOrder(ctx, req.(*UpdateContractRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Contract_ContractPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelContractRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ContractServer).ContractPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Contract_ContractPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ContractServer).ContractPosition(ctx, req.(*CancelContractRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Contract_ContractAllPosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(AllContractRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ContractServer).ContractAllPosition(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Contract_ContractAllPosition_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ContractServer).ContractAllPosition(ctx, req.(*AllContractRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Contract_ContractCancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelContractRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(ContractServer).ContractCancel(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Contract_ContractCancel_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(ContractServer).ContractCancel(ctx, req.(*CancelContractRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
// Contract_ServiceDesc is the grpc.ServiceDesc for Contract service.
|
|||
// It's only intended for direct use with grpc.RegisterService,
|
|||
// and not to be introspected or modified (even as a copy)
|
|||
var Contract_ServiceDesc = grpc.ServiceDesc{ |
|||
ServiceName: "matchmaking.v1.Contract", |
|||
HandlerType: (*ContractServer)(nil), |
|||
Methods: []grpc.MethodDesc{ |
|||
{ |
|||
MethodName: "GetBotContractTrade", |
|||
Handler: _Contract_GetBotContractTrade_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ContractPlaceOrder", |
|||
Handler: _Contract_ContractPlaceOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ContractUpdatePlaceOrder", |
|||
Handler: _Contract_ContractUpdatePlaceOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ContractPosition", |
|||
Handler: _Contract_ContractPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ContractAllPosition", |
|||
Handler: _Contract_ContractAllPosition_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "ContractCancel", |
|||
Handler: _Contract_ContractCancel_Handler, |
|||
}, |
|||
}, |
|||
Streams: []grpc.StreamDesc{}, |
|||
Metadata: "matchmaking/v1/virtually/contract.proto", |
|||
} |
@ -0,0 +1,279 @@ |
|||
// Code generated by protoc-gen-go-http. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-http v2.7.3
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/virtually/contract.proto
|
|||
|
|||
package v1 |
|||
|
|||
import ( |
|||
context "context" |
|||
http "github.com/go-kratos/kratos/v2/transport/http" |
|||
binding "github.com/go-kratos/kratos/v2/transport/http/binding" |
|||
) |
|||
|
|||
// This is a compile-time assertion to ensure that this generated file
|
|||
// is compatible with the kratos package it is being compiled against.
|
|||
var _ = new(context.Context) |
|||
var _ = binding.EncodeURL |
|||
|
|||
const _ = http.SupportPackageIsVersion1 |
|||
|
|||
const OperationContractContractAllPosition = "/matchmaking.v1.Contract/ContractAllPosition" |
|||
const OperationContractContractCancel = "/matchmaking.v1.Contract/ContractCancel" |
|||
const OperationContractContractPlaceOrder = "/matchmaking.v1.Contract/ContractPlaceOrder" |
|||
const OperationContractContractPosition = "/matchmaking.v1.Contract/ContractPosition" |
|||
const OperationContractContractUpdatePlaceOrder = "/matchmaking.v1.Contract/ContractUpdatePlaceOrder" |
|||
const OperationContractGetBotContractTrade = "/matchmaking.v1.Contract/GetBotContractTrade" |
|||
|
|||
type ContractHTTPServer interface { |
|||
// ContractAllPosition ContractAllPosition 合约一键平仓
|
|||
ContractAllPosition(context.Context, *AllContractRequest) (*AllContractReply, error) |
|||
// ContractCancel ContractCancel 合约撤单
|
|||
ContractCancel(context.Context, *CancelContractRequest) (*ContractReply, error) |
|||
// ContractPlaceOrder ContractPlaceOrder 合约下单
|
|||
ContractPlaceOrder(context.Context, *ContractRequest) (*ContractReply, error) |
|||
// ContractPosition ContractPosition 合约平仓
|
|||
ContractPosition(context.Context, *CancelContractRequest) (*ContractReply, error) |
|||
// ContractUpdatePlaceOrder ContractUpdatePlaceOrder 合约设置止盈止损
|
|||
ContractUpdatePlaceOrder(context.Context, *UpdateContractRequest) (*ContractReply, error) |
|||
// GetBotContractTrade GetBotContractTrade 合约列表查询
|
|||
GetBotContractTrade(context.Context, *GetBotContractTradeRequest) (*GetBotContractTradeReply, error) |
|||
} |
|||
|
|||
func RegisterContractHTTPServer(s *http.Server, srv ContractHTTPServer) { |
|||
r := s.Route("/") |
|||
r.POST("/order_contract/contract_list", _Contract_GetBotContractTrade0_HTTP_Handler(srv)) |
|||
r.POST("/order_contract/contract_place_order", _Contract_ContractPlaceOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_contract/contract_update_order", _Contract_ContractUpdatePlaceOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_contract/contract_position", _Contract_ContractPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_contract/contract_all_position", _Contract_ContractAllPosition0_HTTP_Handler(srv)) |
|||
r.POST("/order_contract/contract_cancel", _Contract_ContractCancel0_HTTP_Handler(srv)) |
|||
} |
|||
|
|||
func _Contract_GetBotContractTrade0_HTTP_Handler(srv ContractHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in GetBotContractTradeRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationContractGetBotContractTrade) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.GetBotContractTrade(ctx, req.(*GetBotContractTradeRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*GetBotContractTradeReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Contract_ContractPlaceOrder0_HTTP_Handler(srv ContractHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in ContractRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationContractContractPlaceOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ContractPlaceOrder(ctx, req.(*ContractRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*ContractReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Contract_ContractUpdatePlaceOrder0_HTTP_Handler(srv ContractHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in UpdateContractRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationContractContractUpdatePlaceOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ContractUpdatePlaceOrder(ctx, req.(*UpdateContractRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*ContractReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Contract_ContractPosition0_HTTP_Handler(srv ContractHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelContractRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationContractContractPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ContractPosition(ctx, req.(*CancelContractRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*ContractReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Contract_ContractAllPosition0_HTTP_Handler(srv ContractHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in AllContractRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationContractContractAllPosition) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ContractAllPosition(ctx, req.(*AllContractRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*AllContractReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Contract_ContractCancel0_HTTP_Handler(srv ContractHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelContractRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationContractContractCancel) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.ContractCancel(ctx, req.(*CancelContractRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*ContractReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
type ContractHTTPClient interface { |
|||
ContractAllPosition(ctx context.Context, req *AllContractRequest, opts ...http.CallOption) (rsp *AllContractReply, err error) |
|||
ContractCancel(ctx context.Context, req *CancelContractRequest, opts ...http.CallOption) (rsp *ContractReply, err error) |
|||
ContractPlaceOrder(ctx context.Context, req *ContractRequest, opts ...http.CallOption) (rsp *ContractReply, err error) |
|||
ContractPosition(ctx context.Context, req *CancelContractRequest, opts ...http.CallOption) (rsp *ContractReply, err error) |
|||
ContractUpdatePlaceOrder(ctx context.Context, req *UpdateContractRequest, opts ...http.CallOption) (rsp *ContractReply, err error) |
|||
GetBotContractTrade(ctx context.Context, req *GetBotContractTradeRequest, opts ...http.CallOption) (rsp *GetBotContractTradeReply, err error) |
|||
} |
|||
|
|||
type ContractHTTPClientImpl struct { |
|||
cc *http.Client |
|||
} |
|||
|
|||
func NewContractHTTPClient(client *http.Client) ContractHTTPClient { |
|||
return &ContractHTTPClientImpl{client} |
|||
} |
|||
|
|||
func (c *ContractHTTPClientImpl) ContractAllPosition(ctx context.Context, in *AllContractRequest, opts ...http.CallOption) (*AllContractReply, error) { |
|||
var out AllContractReply |
|||
pattern := "/order_contract/contract_all_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationContractContractAllPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ContractHTTPClientImpl) ContractCancel(ctx context.Context, in *CancelContractRequest, opts ...http.CallOption) (*ContractReply, error) { |
|||
var out ContractReply |
|||
pattern := "/order_contract/contract_cancel" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationContractContractCancel)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ContractHTTPClientImpl) ContractPlaceOrder(ctx context.Context, in *ContractRequest, opts ...http.CallOption) (*ContractReply, error) { |
|||
var out ContractReply |
|||
pattern := "/order_contract/contract_place_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationContractContractPlaceOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ContractHTTPClientImpl) ContractPosition(ctx context.Context, in *CancelContractRequest, opts ...http.CallOption) (*ContractReply, error) { |
|||
var out ContractReply |
|||
pattern := "/order_contract/contract_position" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationContractContractPosition)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ContractHTTPClientImpl) ContractUpdatePlaceOrder(ctx context.Context, in *UpdateContractRequest, opts ...http.CallOption) (*ContractReply, error) { |
|||
var out ContractReply |
|||
pattern := "/order_contract/contract_update_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationContractContractUpdatePlaceOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *ContractHTTPClientImpl) GetBotContractTrade(ctx context.Context, in *GetBotContractTradeRequest, opts ...http.CallOption) (*GetBotContractTradeReply, error) { |
|||
var out GetBotContractTradeReply |
|||
pattern := "/order_contract/contract_list" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationContractGetBotContractTrade)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,104 @@ |
|||
syntax = "proto3"; |
|||
|
|||
package matchmaking.v1; |
|||
|
|||
import "google/api/annotations.proto"; |
|||
import "google/protobuf/timestamp.proto"; |
|||
|
|||
option go_package = "matchmaking-system/api/matchmaking/v1;v1"; |
|||
|
|||
service Second { |
|||
// SecondGetBotContractTrade 合约列表查询 |
|||
rpc SecondGetBotContractTrade(GetBotSecondTradeRequest)returns(GetBotSecondTradeReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_second/second_list", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// SecondOrder 秒合约下单 |
|||
rpc SecondOrder(SecondOrderRequest)returns(SecondOrderReply){ |
|||
option (google.api.http) = { |
|||
post: "/order_second/contract_second_order", |
|||
body: "*", |
|||
}; |
|||
} |
|||
} |
|||
|
|||
message GetBotSecondTradeRequest{ |
|||
int64 status =1;// 状态码 |
|||
int64 pageSize =2; // 每页显示条数 |
|||
int64 pageCount =3;// 开始的位置 |
|||
int64 state = 4;// 订单类型 |
|||
} |
|||
|
|||
message GetBotSecondTradeReply{ |
|||
int64 code =1;// 状态码 |
|||
BotSecondTradeData data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message BotSecondTradeData{ |
|||
int64 pageSize =1; // 每页显示条数 |
|||
int64 pageCount =2;// 开始的位置 |
|||
repeated BotSecondTrade data =3;// 返回结果 |
|||
int64 totalCount =4;// 总数据 |
|||
} |
|||
|
|||
message BotSecondTrade{ |
|||
string orderId =1;// 订单ID |
|||
string contractId =2;// 合约ID |
|||
int64 tradeType =3;// 交易类型 |
|||
int64 dealType =4;// 交易方式 |
|||
string limitPrice =5;// 限价 |
|||
string marketPrice =6;// 市价 |
|||
string dealPrice =7;// 开仓价 |
|||
string closingPrice =8;// 平仓价 |
|||
string orderNumber =9;// 订单数量 |
|||
int64 stopType =10;// 止盈止损状态 |
|||
string stopLossPrice =11;// 止损 |
|||
string stopWinPrice =12;// 止盈 |
|||
string serviceCost =13;// 开仓手续费 |
|||
string earnestMoney =14;// 保证金 |
|||
string orderMoney =15;// 订单总额 |
|||
int64 status =16;// 订单状态 |
|||
google.protobuf.Timestamp createTime =17;// 订单创建时间 |
|||
google.protobuf.Timestamp updateTime =18;// 订单更新时间 |
|||
google.protobuf.Timestamp openTime =19;// 订单开仓时间 |
|||
google.protobuf.Timestamp closingTime =20;// 订单平仓时间 |
|||
string closingCost =21;// 平仓手续费 |
|||
string faceValue =22;// 面值 |
|||
string overnightCost =23;// 过夜手续费 |
|||
string pryNum =24;// 杠杆值 |
|||
string keepDecimal =25;// 保留小数位 |
|||
string secondTime = 26;// 秒合约时间 |
|||
int64 state = 27;// 订单类型 |
|||
int64 orderStatus = 28;// 订单盈亏状态 |
|||
string orderValue = 29;// 订单盈亏值 |
|||
} |
|||
|
|||
message SecondOrderRequest{ |
|||
string contractId =1;// 交易对 |
|||
int64 tradeType =2;// 交易类型:1买入,2卖出 |
|||
int64 dealType =3;// 委托方式:1限价,2市价 |
|||
string limitPrice =4;// 限价 |
|||
string marketPrice =5;// 市价 |
|||
string orderAmount =6;// 订单金额 |
|||
string orderNumber =7;// 订单数量 |
|||
string earnestMoney =8;// 保证金 |
|||
string serviceCost =9;// 手续费 |
|||
int64 stopType =10;// 止损止盈设置:0无设置,1止损止盈 |
|||
string stopLossPrice =11;// 止损 |
|||
string stopWinPrice =12;// 止盈 |
|||
string pryNum =13;//杠杆 |
|||
int64 time = 14;// 秒合约时间 |
|||
} |
|||
|
|||
message SecondOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
SecondResult data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message SecondResult { |
|||
string orderId =1;// 订单Id |
|||
} |
@ -0,0 +1,152 @@ |
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-grpc v1.4.0
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/virtually/second.proto
|
|||
|
|||
package v1 |
|||
|
|||
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.62.0 or later.
|
|||
const _ = grpc.SupportPackageIsVersion8 |
|||
|
|||
const ( |
|||
Second_SecondGetBotContractTrade_FullMethodName = "/matchmaking.v1.Second/SecondGetBotContractTrade" |
|||
Second_SecondOrder_FullMethodName = "/matchmaking.v1.Second/SecondOrder" |
|||
) |
|||
|
|||
// SecondClient is the client API for Second 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 SecondClient interface { |
|||
// SecondGetBotContractTrade 合约列表查询
|
|||
SecondGetBotContractTrade(ctx context.Context, in *GetBotSecondTradeRequest, opts ...grpc.CallOption) (*GetBotSecondTradeReply, error) |
|||
// SecondOrder 秒合约下单
|
|||
SecondOrder(ctx context.Context, in *SecondOrderRequest, opts ...grpc.CallOption) (*SecondOrderReply, error) |
|||
} |
|||
|
|||
type secondClient struct { |
|||
cc grpc.ClientConnInterface |
|||
} |
|||
|
|||
func NewSecondClient(cc grpc.ClientConnInterface) SecondClient { |
|||
return &secondClient{cc} |
|||
} |
|||
|
|||
func (c *secondClient) SecondGetBotContractTrade(ctx context.Context, in *GetBotSecondTradeRequest, opts ...grpc.CallOption) (*GetBotSecondTradeReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(GetBotSecondTradeReply) |
|||
err := c.cc.Invoke(ctx, Second_SecondGetBotContractTrade_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *secondClient) SecondOrder(ctx context.Context, in *SecondOrderRequest, opts ...grpc.CallOption) (*SecondOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(SecondOrderReply) |
|||
err := c.cc.Invoke(ctx, Second_SecondOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
// SecondServer is the server API for Second service.
|
|||
// All implementations must embed UnimplementedSecondServer
|
|||
// for forward compatibility
|
|||
type SecondServer interface { |
|||
// SecondGetBotContractTrade 合约列表查询
|
|||
SecondGetBotContractTrade(context.Context, *GetBotSecondTradeRequest) (*GetBotSecondTradeReply, error) |
|||
// SecondOrder 秒合约下单
|
|||
SecondOrder(context.Context, *SecondOrderRequest) (*SecondOrderReply, error) |
|||
mustEmbedUnimplementedSecondServer() |
|||
} |
|||
|
|||
// UnimplementedSecondServer must be embedded to have forward compatible implementations.
|
|||
type UnimplementedSecondServer struct { |
|||
} |
|||
|
|||
func (UnimplementedSecondServer) SecondGetBotContractTrade(context.Context, *GetBotSecondTradeRequest) (*GetBotSecondTradeReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method SecondGetBotContractTrade not implemented") |
|||
} |
|||
func (UnimplementedSecondServer) SecondOrder(context.Context, *SecondOrderRequest) (*SecondOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method SecondOrder not implemented") |
|||
} |
|||
func (UnimplementedSecondServer) mustEmbedUnimplementedSecondServer() {} |
|||
|
|||
// UnsafeSecondServer may be embedded to opt out of forward compatibility for this service.
|
|||
// Use of this interface is not recommended, as added methods to SecondServer will
|
|||
// result in compilation errors.
|
|||
type UnsafeSecondServer interface { |
|||
mustEmbedUnimplementedSecondServer() |
|||
} |
|||
|
|||
func RegisterSecondServer(s grpc.ServiceRegistrar, srv SecondServer) { |
|||
s.RegisterService(&Second_ServiceDesc, srv) |
|||
} |
|||
|
|||
func _Second_SecondGetBotContractTrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(GetBotSecondTradeRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(SecondServer).SecondGetBotContractTrade(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Second_SecondGetBotContractTrade_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(SecondServer).SecondGetBotContractTrade(ctx, req.(*GetBotSecondTradeRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Second_SecondOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(SecondOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(SecondServer).SecondOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Second_SecondOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(SecondServer).SecondOrder(ctx, req.(*SecondOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
// Second_ServiceDesc is the grpc.ServiceDesc for Second service.
|
|||
// It's only intended for direct use with grpc.RegisterService,
|
|||
// and not to be introspected or modified (even as a copy)
|
|||
var Second_ServiceDesc = grpc.ServiceDesc{ |
|||
ServiceName: "matchmaking.v1.Second", |
|||
HandlerType: (*SecondServer)(nil), |
|||
Methods: []grpc.MethodDesc{ |
|||
{ |
|||
MethodName: "SecondGetBotContractTrade", |
|||
Handler: _Second_SecondGetBotContractTrade_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "SecondOrder", |
|||
Handler: _Second_SecondOrder_Handler, |
|||
}, |
|||
}, |
|||
Streams: []grpc.StreamDesc{}, |
|||
Metadata: "matchmaking/v1/virtually/second.proto", |
|||
} |
@ -0,0 +1,119 @@ |
|||
// Code generated by protoc-gen-go-http. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-http v2.7.3
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/virtually/second.proto
|
|||
|
|||
package v1 |
|||
|
|||
import ( |
|||
context "context" |
|||
http "github.com/go-kratos/kratos/v2/transport/http" |
|||
binding "github.com/go-kratos/kratos/v2/transport/http/binding" |
|||
) |
|||
|
|||
// This is a compile-time assertion to ensure that this generated file
|
|||
// is compatible with the kratos package it is being compiled against.
|
|||
var _ = new(context.Context) |
|||
var _ = binding.EncodeURL |
|||
|
|||
const _ = http.SupportPackageIsVersion1 |
|||
|
|||
const OperationSecondSecondGetBotContractTrade = "/matchmaking.v1.Second/SecondGetBotContractTrade" |
|||
const OperationSecondSecondOrder = "/matchmaking.v1.Second/SecondOrder" |
|||
|
|||
type SecondHTTPServer interface { |
|||
// SecondGetBotContractTrade SecondGetBotContractTrade 合约列表查询
|
|||
SecondGetBotContractTrade(context.Context, *GetBotSecondTradeRequest) (*GetBotSecondTradeReply, error) |
|||
// SecondOrder SecondOrder 秒合约下单
|
|||
SecondOrder(context.Context, *SecondOrderRequest) (*SecondOrderReply, error) |
|||
} |
|||
|
|||
func RegisterSecondHTTPServer(s *http.Server, srv SecondHTTPServer) { |
|||
r := s.Route("/") |
|||
r.POST("/order_second/second_list", _Second_SecondGetBotContractTrade0_HTTP_Handler(srv)) |
|||
r.POST("/order_second/contract_second_order", _Second_SecondOrder0_HTTP_Handler(srv)) |
|||
} |
|||
|
|||
func _Second_SecondGetBotContractTrade0_HTTP_Handler(srv SecondHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in GetBotSecondTradeRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationSecondSecondGetBotContractTrade) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.SecondGetBotContractTrade(ctx, req.(*GetBotSecondTradeRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*GetBotSecondTradeReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Second_SecondOrder0_HTTP_Handler(srv SecondHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in SecondOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationSecondSecondOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.SecondOrder(ctx, req.(*SecondOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*SecondOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
type SecondHTTPClient interface { |
|||
SecondGetBotContractTrade(ctx context.Context, req *GetBotSecondTradeRequest, opts ...http.CallOption) (rsp *GetBotSecondTradeReply, err error) |
|||
SecondOrder(ctx context.Context, req *SecondOrderRequest, opts ...http.CallOption) (rsp *SecondOrderReply, err error) |
|||
} |
|||
|
|||
type SecondHTTPClientImpl struct { |
|||
cc *http.Client |
|||
} |
|||
|
|||
func NewSecondHTTPClient(client *http.Client) SecondHTTPClient { |
|||
return &SecondHTTPClientImpl{client} |
|||
} |
|||
|
|||
func (c *SecondHTTPClientImpl) SecondGetBotContractTrade(ctx context.Context, in *GetBotSecondTradeRequest, opts ...http.CallOption) (*GetBotSecondTradeReply, error) { |
|||
var out GetBotSecondTradeReply |
|||
pattern := "/order_second/second_list" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationSecondSecondGetBotContractTrade)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *SecondHTTPClientImpl) SecondOrder(ctx context.Context, in *SecondOrderRequest, opts ...http.CallOption) (*SecondOrderReply, error) { |
|||
var out SecondOrderReply |
|||
pattern := "/order_second/contract_second_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationSecondSecondOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,106 @@ |
|||
syntax = "proto3"; |
|||
|
|||
package matchmaking.v1; |
|||
|
|||
import "google/api/annotations.proto"; |
|||
import "google/protobuf/timestamp.proto"; |
|||
|
|||
option go_package = "matchmaking-system/api/matchmaking/v1;v1"; |
|||
|
|||
service Spots { |
|||
// GetBotDigitalTrade 现货列表查询 |
|||
rpc GetBotDigitalTrade(GetBotDigitalTradeRequest)returns(GetBotDigitalTradeReply){ |
|||
option (google.api.http) = { |
|||
post:"/order_spots/spots_list", |
|||
body:"*", |
|||
}; |
|||
} |
|||
// SpotsPlaceOrder 现货下单 |
|||
rpc SpotsPlaceOrder(SpotsOrderRequest)returns(SpotsOrderReply) { |
|||
option (google.api.http) = { |
|||
post: "/order_spots/spots_place_order", |
|||
body: "*", |
|||
}; |
|||
} |
|||
// SpotsCancel 现货撤单 |
|||
rpc SpotsCancel(CancelSpotsOrderRequest)returns(SpotsOrderReply) { |
|||
option (google.api.http) = { |
|||
post: "/order_spots/spots_cancel", |
|||
body: "*", |
|||
}; |
|||
} |
|||
// SpotsOneClickRedemption 现货一键兑换 |
|||
rpc SpotsOneClickRedemption(SpotsOrderRequest)returns(SpotsOrderReply){ |
|||
option (google.api.http) = { |
|||
post: "/order_spots/spots_one_click_redemption", |
|||
body: "*", |
|||
}; |
|||
} |
|||
} |
|||
|
|||
message GetBotDigitalTradeRequest{ |
|||
int64 status =1;// 状态码 |
|||
int64 pageSize =2; // 每页显示条数 |
|||
int64 pageCount =3;// 开始的位置 |
|||
} |
|||
|
|||
message GetBotDigitalTradeReply{ |
|||
int64 code =1;// 状态码 |
|||
BotDigitalTradeData data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message BotDigitalTradeData{ |
|||
int64 pageSize =1; // 每页显示条数 |
|||
int64 pageCount =2;// 开始的位置 |
|||
repeated BotDigitalTrade data =3;// 返回结果 |
|||
int64 totalCount =4;// 总数据 |
|||
} |
|||
|
|||
message BotDigitalTrade{ |
|||
string orderId =1;// 订单ID |
|||
string digitalId =2;// 现货交易对 |
|||
int64 tradeType =3;// 交易类型 |
|||
int64 dealType =4;// 交易方式 |
|||
string dealPrice =7;// 开仓价 |
|||
string closingPrice =8;// 平仓价格 |
|||
string limitPrice =5;// 限价 |
|||
string marketPrice =6;// 市价 |
|||
string orderNumber =9;// 订单数量 |
|||
string serviceCost =10;// 开仓手续费 |
|||
string orderMoney =11;// 订单金额 |
|||
string totalMoney =12;// 订单总金额 |
|||
int64 status =13;// 订单状态 |
|||
google.protobuf.Timestamp createTime =14;// 订单创建时间 |
|||
google.protobuf.Timestamp updateTime =15;// 订单更新时间 |
|||
google.protobuf.Timestamp openTime =16;// 订单开仓时间 |
|||
google.protobuf.Timestamp closingTime =17;// 订单平仓时间 |
|||
string closingCost =18;// 平仓手续费 |
|||
string keepDecimal =19;// 保留小数位 |
|||
} |
|||
|
|||
message SpotsOrderRequest{ |
|||
string digitalId =1;// 交易对 |
|||
int64 tradeType =2;// 交易类型:1买入,2卖出 |
|||
int64 dealType =3;// 委托方式:1限价,2市价 |
|||
string limitPrice =4;// 限价 |
|||
string marketPrice =5;// 市价 |
|||
string dealPrice =6;// 订单价格 |
|||
string orderNumber =7;// 订单数量 |
|||
string orderMoney =8;// 订单金额 |
|||
string serviceCost =9;// 手续费 |
|||
} |
|||
|
|||
message CancelSpotsOrderRequest{ |
|||
string orderId =1;// 订单ID |
|||
} |
|||
|
|||
message SpotsOrderReply{ |
|||
int64 code =1;// 状态码 |
|||
SpotsOrderResult data =2;// 返回结果 |
|||
string message =3;// 返回消息提示 |
|||
} |
|||
|
|||
message SpotsOrderResult { |
|||
string orderId =1;// 订单Id |
|||
} |
@ -0,0 +1,232 @@ |
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-grpc v1.4.0
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/virtually/spots.proto
|
|||
|
|||
package v1 |
|||
|
|||
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.62.0 or later.
|
|||
const _ = grpc.SupportPackageIsVersion8 |
|||
|
|||
const ( |
|||
Spots_GetBotDigitalTrade_FullMethodName = "/matchmaking.v1.Spots/GetBotDigitalTrade" |
|||
Spots_SpotsPlaceOrder_FullMethodName = "/matchmaking.v1.Spots/SpotsPlaceOrder" |
|||
Spots_SpotsCancel_FullMethodName = "/matchmaking.v1.Spots/SpotsCancel" |
|||
Spots_SpotsOneClickRedemption_FullMethodName = "/matchmaking.v1.Spots/SpotsOneClickRedemption" |
|||
) |
|||
|
|||
// SpotsClient is the client API for Spots 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 SpotsClient interface { |
|||
// GetBotDigitalTrade 现货列表查询
|
|||
GetBotDigitalTrade(ctx context.Context, in *GetBotDigitalTradeRequest, opts ...grpc.CallOption) (*GetBotDigitalTradeReply, error) |
|||
// SpotsPlaceOrder 现货下单
|
|||
SpotsPlaceOrder(ctx context.Context, in *SpotsOrderRequest, opts ...grpc.CallOption) (*SpotsOrderReply, error) |
|||
// SpotsCancel 现货撤单
|
|||
SpotsCancel(ctx context.Context, in *CancelSpotsOrderRequest, opts ...grpc.CallOption) (*SpotsOrderReply, error) |
|||
// SpotsOneClickRedemption 现货一键兑换
|
|||
SpotsOneClickRedemption(ctx context.Context, in *SpotsOrderRequest, opts ...grpc.CallOption) (*SpotsOrderReply, error) |
|||
} |
|||
|
|||
type spotsClient struct { |
|||
cc grpc.ClientConnInterface |
|||
} |
|||
|
|||
func NewSpotsClient(cc grpc.ClientConnInterface) SpotsClient { |
|||
return &spotsClient{cc} |
|||
} |
|||
|
|||
func (c *spotsClient) GetBotDigitalTrade(ctx context.Context, in *GetBotDigitalTradeRequest, opts ...grpc.CallOption) (*GetBotDigitalTradeReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(GetBotDigitalTradeReply) |
|||
err := c.cc.Invoke(ctx, Spots_GetBotDigitalTrade_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *spotsClient) SpotsPlaceOrder(ctx context.Context, in *SpotsOrderRequest, opts ...grpc.CallOption) (*SpotsOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(SpotsOrderReply) |
|||
err := c.cc.Invoke(ctx, Spots_SpotsPlaceOrder_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *spotsClient) SpotsCancel(ctx context.Context, in *CancelSpotsOrderRequest, opts ...grpc.CallOption) (*SpotsOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(SpotsOrderReply) |
|||
err := c.cc.Invoke(ctx, Spots_SpotsCancel_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
func (c *spotsClient) SpotsOneClickRedemption(ctx context.Context, in *SpotsOrderRequest, opts ...grpc.CallOption) (*SpotsOrderReply, error) { |
|||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) |
|||
out := new(SpotsOrderReply) |
|||
err := c.cc.Invoke(ctx, Spots_SpotsOneClickRedemption_FullMethodName, in, out, cOpts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return out, nil |
|||
} |
|||
|
|||
// SpotsServer is the server API for Spots service.
|
|||
// All implementations must embed UnimplementedSpotsServer
|
|||
// for forward compatibility
|
|||
type SpotsServer interface { |
|||
// GetBotDigitalTrade 现货列表查询
|
|||
GetBotDigitalTrade(context.Context, *GetBotDigitalTradeRequest) (*GetBotDigitalTradeReply, error) |
|||
// SpotsPlaceOrder 现货下单
|
|||
SpotsPlaceOrder(context.Context, *SpotsOrderRequest) (*SpotsOrderReply, error) |
|||
// SpotsCancel 现货撤单
|
|||
SpotsCancel(context.Context, *CancelSpotsOrderRequest) (*SpotsOrderReply, error) |
|||
// SpotsOneClickRedemption 现货一键兑换
|
|||
SpotsOneClickRedemption(context.Context, *SpotsOrderRequest) (*SpotsOrderReply, error) |
|||
mustEmbedUnimplementedSpotsServer() |
|||
} |
|||
|
|||
// UnimplementedSpotsServer must be embedded to have forward compatible implementations.
|
|||
type UnimplementedSpotsServer struct { |
|||
} |
|||
|
|||
func (UnimplementedSpotsServer) GetBotDigitalTrade(context.Context, *GetBotDigitalTradeRequest) (*GetBotDigitalTradeReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method GetBotDigitalTrade not implemented") |
|||
} |
|||
func (UnimplementedSpotsServer) SpotsPlaceOrder(context.Context, *SpotsOrderRequest) (*SpotsOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method SpotsPlaceOrder not implemented") |
|||
} |
|||
func (UnimplementedSpotsServer) SpotsCancel(context.Context, *CancelSpotsOrderRequest) (*SpotsOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method SpotsCancel not implemented") |
|||
} |
|||
func (UnimplementedSpotsServer) SpotsOneClickRedemption(context.Context, *SpotsOrderRequest) (*SpotsOrderReply, error) { |
|||
return nil, status.Errorf(codes.Unimplemented, "method SpotsOneClickRedemption not implemented") |
|||
} |
|||
func (UnimplementedSpotsServer) mustEmbedUnimplementedSpotsServer() {} |
|||
|
|||
// UnsafeSpotsServer may be embedded to opt out of forward compatibility for this service.
|
|||
// Use of this interface is not recommended, as added methods to SpotsServer will
|
|||
// result in compilation errors.
|
|||
type UnsafeSpotsServer interface { |
|||
mustEmbedUnimplementedSpotsServer() |
|||
} |
|||
|
|||
func RegisterSpotsServer(s grpc.ServiceRegistrar, srv SpotsServer) { |
|||
s.RegisterService(&Spots_ServiceDesc, srv) |
|||
} |
|||
|
|||
func _Spots_GetBotDigitalTrade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(GetBotDigitalTradeRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(SpotsServer).GetBotDigitalTrade(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Spots_GetBotDigitalTrade_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(SpotsServer).GetBotDigitalTrade(ctx, req.(*GetBotDigitalTradeRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Spots_SpotsPlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(SpotsOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(SpotsServer).SpotsPlaceOrder(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Spots_SpotsPlaceOrder_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(SpotsServer).SpotsPlaceOrder(ctx, req.(*SpotsOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Spots_SpotsCancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(CancelSpotsOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(SpotsServer).SpotsCancel(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Spots_SpotsCancel_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(SpotsServer).SpotsCancel(ctx, req.(*CancelSpotsOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
func _Spots_SpotsOneClickRedemption_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|||
in := new(SpotsOrderRequest) |
|||
if err := dec(in); err != nil { |
|||
return nil, err |
|||
} |
|||
if interceptor == nil { |
|||
return srv.(SpotsServer).SpotsOneClickRedemption(ctx, in) |
|||
} |
|||
info := &grpc.UnaryServerInfo{ |
|||
Server: srv, |
|||
FullMethod: Spots_SpotsOneClickRedemption_FullMethodName, |
|||
} |
|||
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.(SpotsServer).SpotsOneClickRedemption(ctx, req.(*SpotsOrderRequest)) |
|||
} |
|||
return interceptor(ctx, in, info, handler) |
|||
} |
|||
|
|||
// Spots_ServiceDesc is the grpc.ServiceDesc for Spots service.
|
|||
// It's only intended for direct use with grpc.RegisterService,
|
|||
// and not to be introspected or modified (even as a copy)
|
|||
var Spots_ServiceDesc = grpc.ServiceDesc{ |
|||
ServiceName: "matchmaking.v1.Spots", |
|||
HandlerType: (*SpotsServer)(nil), |
|||
Methods: []grpc.MethodDesc{ |
|||
{ |
|||
MethodName: "GetBotDigitalTrade", |
|||
Handler: _Spots_GetBotDigitalTrade_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "SpotsPlaceOrder", |
|||
Handler: _Spots_SpotsPlaceOrder_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "SpotsCancel", |
|||
Handler: _Spots_SpotsCancel_Handler, |
|||
}, |
|||
{ |
|||
MethodName: "SpotsOneClickRedemption", |
|||
Handler: _Spots_SpotsOneClickRedemption_Handler, |
|||
}, |
|||
}, |
|||
Streams: []grpc.StreamDesc{}, |
|||
Metadata: "matchmaking/v1/virtually/spots.proto", |
|||
} |
@ -0,0 +1,199 @@ |
|||
// Code generated by protoc-gen-go-http. DO NOT EDIT.
|
|||
// versions:
|
|||
// - protoc-gen-go-http v2.7.3
|
|||
// - protoc v5.27.1
|
|||
// source: matchmaking/v1/virtually/spots.proto
|
|||
|
|||
package v1 |
|||
|
|||
import ( |
|||
context "context" |
|||
http "github.com/go-kratos/kratos/v2/transport/http" |
|||
binding "github.com/go-kratos/kratos/v2/transport/http/binding" |
|||
) |
|||
|
|||
// This is a compile-time assertion to ensure that this generated file
|
|||
// is compatible with the kratos package it is being compiled against.
|
|||
var _ = new(context.Context) |
|||
var _ = binding.EncodeURL |
|||
|
|||
const _ = http.SupportPackageIsVersion1 |
|||
|
|||
const OperationSpotsGetBotDigitalTrade = "/matchmaking.v1.Spots/GetBotDigitalTrade" |
|||
const OperationSpotsSpotsCancel = "/matchmaking.v1.Spots/SpotsCancel" |
|||
const OperationSpotsSpotsOneClickRedemption = "/matchmaking.v1.Spots/SpotsOneClickRedemption" |
|||
const OperationSpotsSpotsPlaceOrder = "/matchmaking.v1.Spots/SpotsPlaceOrder" |
|||
|
|||
type SpotsHTTPServer interface { |
|||
// GetBotDigitalTrade GetBotDigitalTrade 现货列表查询
|
|||
GetBotDigitalTrade(context.Context, *GetBotDigitalTradeRequest) (*GetBotDigitalTradeReply, error) |
|||
// SpotsCancel SpotsCancel 现货撤单
|
|||
SpotsCancel(context.Context, *CancelSpotsOrderRequest) (*SpotsOrderReply, error) |
|||
// SpotsOneClickRedemption SpotsOneClickRedemption 现货一键兑换
|
|||
SpotsOneClickRedemption(context.Context, *SpotsOrderRequest) (*SpotsOrderReply, error) |
|||
// SpotsPlaceOrder SpotsPlaceOrder 现货下单
|
|||
SpotsPlaceOrder(context.Context, *SpotsOrderRequest) (*SpotsOrderReply, error) |
|||
} |
|||
|
|||
func RegisterSpotsHTTPServer(s *http.Server, srv SpotsHTTPServer) { |
|||
r := s.Route("/") |
|||
r.POST("/order_spots/spots_list", _Spots_GetBotDigitalTrade0_HTTP_Handler(srv)) |
|||
r.POST("/order_spots/spots_place_order", _Spots_SpotsPlaceOrder0_HTTP_Handler(srv)) |
|||
r.POST("/order_spots/spots_cancel", _Spots_SpotsCancel0_HTTP_Handler(srv)) |
|||
r.POST("/order_spots/spots_one_click_redemption", _Spots_SpotsOneClickRedemption0_HTTP_Handler(srv)) |
|||
} |
|||
|
|||
func _Spots_GetBotDigitalTrade0_HTTP_Handler(srv SpotsHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in GetBotDigitalTradeRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationSpotsGetBotDigitalTrade) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.GetBotDigitalTrade(ctx, req.(*GetBotDigitalTradeRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*GetBotDigitalTradeReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Spots_SpotsPlaceOrder0_HTTP_Handler(srv SpotsHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in SpotsOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationSpotsSpotsPlaceOrder) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.SpotsPlaceOrder(ctx, req.(*SpotsOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*SpotsOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Spots_SpotsCancel0_HTTP_Handler(srv SpotsHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in CancelSpotsOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationSpotsSpotsCancel) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.SpotsCancel(ctx, req.(*CancelSpotsOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*SpotsOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
func _Spots_SpotsOneClickRedemption0_HTTP_Handler(srv SpotsHTTPServer) func(ctx http.Context) error { |
|||
return func(ctx http.Context) error { |
|||
var in SpotsOrderRequest |
|||
if err := ctx.Bind(&in); err != nil { |
|||
return err |
|||
} |
|||
if err := ctx.BindQuery(&in); err != nil { |
|||
return err |
|||
} |
|||
http.SetOperation(ctx, OperationSpotsSpotsOneClickRedemption) |
|||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { |
|||
return srv.SpotsOneClickRedemption(ctx, req.(*SpotsOrderRequest)) |
|||
}) |
|||
out, err := h(ctx, &in) |
|||
if err != nil { |
|||
return err |
|||
} |
|||
reply := out.(*SpotsOrderReply) |
|||
return ctx.Result(200, reply) |
|||
} |
|||
} |
|||
|
|||
type SpotsHTTPClient interface { |
|||
GetBotDigitalTrade(ctx context.Context, req *GetBotDigitalTradeRequest, opts ...http.CallOption) (rsp *GetBotDigitalTradeReply, err error) |
|||
SpotsCancel(ctx context.Context, req *CancelSpotsOrderRequest, opts ...http.CallOption) (rsp *SpotsOrderReply, err error) |
|||
SpotsOneClickRedemption(ctx context.Context, req *SpotsOrderRequest, opts ...http.CallOption) (rsp *SpotsOrderReply, err error) |
|||
SpotsPlaceOrder(ctx context.Context, req *SpotsOrderRequest, opts ...http.CallOption) (rsp *SpotsOrderReply, err error) |
|||
} |
|||
|
|||
type SpotsHTTPClientImpl struct { |
|||
cc *http.Client |
|||
} |
|||
|
|||
func NewSpotsHTTPClient(client *http.Client) SpotsHTTPClient { |
|||
return &SpotsHTTPClientImpl{client} |
|||
} |
|||
|
|||
func (c *SpotsHTTPClientImpl) GetBotDigitalTrade(ctx context.Context, in *GetBotDigitalTradeRequest, opts ...http.CallOption) (*GetBotDigitalTradeReply, error) { |
|||
var out GetBotDigitalTradeReply |
|||
pattern := "/order_spots/spots_list" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationSpotsGetBotDigitalTrade)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *SpotsHTTPClientImpl) SpotsCancel(ctx context.Context, in *CancelSpotsOrderRequest, opts ...http.CallOption) (*SpotsOrderReply, error) { |
|||
var out SpotsOrderReply |
|||
pattern := "/order_spots/spots_cancel" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationSpotsSpotsCancel)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *SpotsHTTPClientImpl) SpotsOneClickRedemption(ctx context.Context, in *SpotsOrderRequest, opts ...http.CallOption) (*SpotsOrderReply, error) { |
|||
var out SpotsOrderReply |
|||
pattern := "/order_spots/spots_one_click_redemption" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationSpotsSpotsOneClickRedemption)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
|||
|
|||
func (c *SpotsHTTPClientImpl) SpotsPlaceOrder(ctx context.Context, in *SpotsOrderRequest, opts ...http.CallOption) (*SpotsOrderReply, error) { |
|||
var out SpotsOrderReply |
|||
pattern := "/order_spots/spots_place_order" |
|||
path := binding.EncodeURL(pattern, in, false) |
|||
opts = append(opts, http.Operation(OperationSpotsSpotsPlaceOrder)) |
|||
opts = append(opts, http.PathTemplate(pattern)) |
|||
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...) |
|||
if err != nil { |
|||
return nil, err |
|||
} |
|||
return &out, nil |
|||
} |
@ -0,0 +1,102 @@ |
|||
package main |
|||
|
|||
import ( |
|||
"flag" |
|||
"github.com/go-kratos/kratos/v2" |
|||
"github.com/go-kratos/kratos/v2/log" |
|||
"github.com/go-kratos/kratos/v2/middleware/tracing" |
|||
"github.com/go-kratos/kratos/v2/transport/grpc" |
|||
"github.com/go-kratos/kratos/v2/transport/http" |
|||
_ "go.uber.org/automaxprocs" |
|||
"gopkg.in/yaml.v2" |
|||
"io/ioutil" |
|||
"matchmaking-system/internal/conf" |
|||
"matchmaking-system/internal/pkg/flags" |
|||
"matchmaking-system/internal/pkg/logging/applogger" |
|||
"os" |
|||
) |
|||
|
|||
// go build -ldflags "-X main.Version=x.y.z"
|
|||
var ( |
|||
// Name is the name of the compiled software.
|
|||
Name string |
|||
// Version is the version of the compiled software.
|
|||
Version string |
|||
// flagConfig is the config flag.
|
|||
flagConfig string |
|||
// Select subscription type
|
|||
check string |
|||
// network
|
|||
network string |
|||
|
|||
id, err = os.Hostname() |
|||
) |
|||
|
|||
func init() { |
|||
flag.StringVar(&flagConfig, "conf", "../../configs/money.yaml", "config path, eg: -conf config.yaml") |
|||
flag.StringVar(&check, "check", "money", "check content, eg: -check sport|contract|share-|admin-|") |
|||
flag.StringVar(&network, "network", "test", "network content, eg: -check test|onLine") |
|||
} |
|||
|
|||
func newApp(logger log.Logger, gs *grpc.Server, hs *http.Server) *kratos.App { |
|||
return kratos.New( |
|||
kratos.Name(Name), |
|||
kratos.Version(Version), |
|||
kratos.Metadata(map[string]string{}), |
|||
kratos.Logger(logger), |
|||
kratos.Server( |
|||
gs, |
|||
hs, |
|||
), |
|||
) |
|||
} |
|||
|
|||
func main() { |
|||
flag.Parse() |
|||
logger := log.With(log.NewStdLogger(os.Stdout), |
|||
"ts", log.DefaultTimestamp, |
|||
"caller", log.DefaultCaller, |
|||
"service.id", id, |
|||
"service.name", Name, |
|||
"service.version", Version, |
|||
"trace.id", tracing.TraceID(), |
|||
"span.id", tracing.SpanID(), |
|||
) |
|||
|
|||
// yaml ReadFile config
|
|||
yamlFile, err := ioutil.ReadFile(flagConfig) |
|||
if err != nil { |
|||
panic(err) |
|||
} |
|||
|
|||
// Bootstrap parsing
|
|||
var bc conf.Bootstrap |
|||
err = yaml.Unmarshal(yamlFile, &bc) |
|||
if err != nil { |
|||
panic(err) |
|||
} |
|||
|
|||
// System environment variables
|
|||
flags.CheckEnvironment = check |
|||
flags.CheckNetwork = network |
|||
flags.CheckAdminService = bc.Server.GetCheck() |
|||
switch network { |
|||
case flags.CheckOnLine: |
|||
flags.CheckSetting = true |
|||
case flags.CheckTest: |
|||
flags.CheckSetting = false |
|||
} |
|||
applogger.Info("methods:%v ,network:%v,adminService:%v", check, network, flags.CheckAdminService) |
|||
|
|||
// load wire app data
|
|||
app, cleanup, err := wireApp(bc.Server, bc.Data, logger) |
|||
if err != nil { |
|||
panic(err) |
|||
} |
|||
defer cleanup() |
|||
|
|||
// start and wait for stop signal
|
|||
if err = app.Run(); err != nil { |
|||
panic(err) |
|||
} |
|||
} |
@ -0,0 +1,22 @@ |
|||
//go:build wireinject
|
|||
// +build wireinject
|
|||
|
|||
// The build tag makes sure the stub is not built in the final build.
|
|||
|
|||
package main |
|||
|
|||
import ( |
|||
"github.com/go-kratos/kratos/v2" |
|||
"github.com/go-kratos/kratos/v2/log" |
|||
"github.com/google/wire" |
|||
"matchmaking-system/internal/biz" |
|||
"matchmaking-system/internal/conf" |
|||
"matchmaking-system/internal/data" |
|||
"matchmaking-system/internal/server" |
|||
"matchmaking-system/internal/service" |
|||
) |
|||
|
|||
// wireApp init kratos application.
|
|||
func wireApp(*conf.Server, *conf.Data, log.Logger) (*kratos.App, func(), error) { |
|||
panic(wire.Build(server.ProviderSet, data.ProviderSet, biz.ProviderSet, service.ProviderSet, newApp)) |
|||
} |
@ -0,0 +1,89 @@ |
|||
// Code generated by Wire. DO NOT EDIT.
|
|||
|
|||
//go:generate go run -mod=mod github.com/google/wire/cmd/wire
|
|||
//go:build !wireinject
|
|||
// +build !wireinject
|
|||
|
|||
package main |
|||
|
|||
import ( |
|||
"github.com/go-kratos/kratos/v2" |
|||
"github.com/go-kratos/kratos/v2/log" |
|||
"matchmaking-system/internal/biz" |
|||
"matchmaking-system/internal/conf" |
|||
"matchmaking-system/internal/data" |
|||
"matchmaking-system/internal/data/cache" |
|||
"matchmaking-system/internal/data/mysql" |
|||
"matchmaking-system/internal/data/redis" |
|||
"matchmaking-system/internal/data/sms" |
|||
"matchmaking-system/internal/server" |
|||
"matchmaking-system/internal/service" |
|||
) |
|||
|
|||
import ( |
|||
_ "go.uber.org/automaxprocs" |
|||
) |
|||
|
|||
// Injectors from wire.go:
|
|||
|
|||
// wireApp init kratos application.
|
|||
func wireApp(confServer *conf.Server, confData *conf.Data, logger log.Logger) (*kratos.App, func(), error) { |
|||
engineGroup := mysql.NewMySql(confData) |
|||
client := redis.NewRedis(confData) |
|||
cacheCache := cache.NewCacheDB(confData) |
|||
dataData, cleanup, err2 := data.NewData(confData, logger, engineGroup, client, cacheCache) |
|||
if err2 != nil { |
|||
return nil, nil, err |
|||
} |
|||
aLiYunRepo := data.NewALiYunRepo(dataData, logger) |
|||
aLiYunCase := sms.NewMsgSend(aLiYunRepo, logger) |
|||
userOrderRepo := data.NewUserOrderRepo(dataData, logger) |
|||
userOrder := biz.NewUserOrderRepo(userOrderRepo, logger) |
|||
userSecondOrderRepo := data.NewUserSecondRepo(dataData, logger) |
|||
userSecondOrder := biz.NewUserSecondOrderRepo(userSecondOrderRepo, logger) |
|||
userSpotsOrderRepo := data.NewUserSpotsRepo(dataData, logger) |
|||
userSpotsOrder := biz.NewUserSpotsOrderRepo(userSpotsOrderRepo, logger) |
|||
userContractOrderRepo := data.NewUserContractRepo(dataData, logger) |
|||
userContractOrder := biz.NewUserContractOrderRepo(userContractOrderRepo, logger) |
|||
userForexOrderRepo := data.NewUserForexRepo(dataData, logger) |
|||
userForexOrder := biz.NewUserForexOrderRepo(userForexOrderRepo, logger) |
|||
userMoneyOrderRepo := data.NewUserMoneyRepo(dataData, logger) |
|||
userMoneyOrder := biz.NewUserMoneyOrderRepo(userMoneyOrderRepo, logger) |
|||
userShareUsOrderRepo := data.NewUserShareUsRepo(dataData, logger) |
|||
userShareUsOrder := biz.NewUserShareUsOrderRepo(userShareUsOrderRepo, logger) |
|||
userShareThaOrderRepo := data.NewUserShareThaRepo(dataData, logger) |
|||
userShareThaOrder := biz.NewUserShareThaOrderRepo(userShareThaOrderRepo, logger) |
|||
userShareIdnOrderRepo := data.NewUserShareIdnRepo(dataData, logger) |
|||
userShareIdnOrder := biz.NewUserShareIdnOrderRepo(userShareIdnOrderRepo, logger) |
|||
userShareInrOrderRepo := data.NewUserShareInrRepo(dataData, logger) |
|||
userShareInrOrder := biz.NewUserShareInrOrderRepo(userShareInrOrderRepo, logger) |
|||
userShareMysOrderRepo := data.NewUserShareMysRepo(dataData, logger) |
|||
userShareMysOrder := biz.NewUserShareMysOrderRepo(userShareMysOrderRepo, logger) |
|||
userShareSgdOrderRepo := data.NewUserShareSgdRepo(dataData, logger) |
|||
userShareSgdOrder := biz.NewUserShareSgdOrderRepo(userShareSgdOrderRepo, logger) |
|||
userShareHkdOrderRepo := data.NewUserShareHkdRepo(dataData, logger) |
|||
userShareHkdOrder := biz.NewUserShareHkdOrderRepo(userShareHkdOrderRepo, logger) |
|||
userShareGbxOrderRepo := data.NewUserShareGbxRepo(dataData, logger) |
|||
userShareGbxOrder := biz.NewUserShareGbxOrderRepo(userShareGbxOrderRepo, logger) |
|||
userShareEurOrderRepo := data.NewUserShareEurRepo(dataData, logger) |
|||
userShareEurOrder := biz.NewUserShareEurOrderRepo(userShareEurOrderRepo, logger) |
|||
userShareFurOrderRepo := data.NewUserShareFurRepo(dataData, logger) |
|||
userShareFurOrder := biz.NewUserShareFurOrderRepo(userShareFurOrderRepo, logger) |
|||
userShareJpyOrderRepo := data.NewUserShareJpyRepo(dataData, logger) |
|||
userShareJpyOrder := biz.NewUserShareJpyOrderRepo(userShareJpyOrderRepo, logger) |
|||
userShareBrlOrderRepo := data.NewUserShareBrlRepo(dataData, logger) |
|||
userShareBrlOrder := biz.NewUserShareBrlOrderRepo(userShareBrlOrderRepo, logger) |
|||
userShareBlockOrderRepo := data.NewUserShareBlkRepo(dataData, logger) |
|||
userShareBlockOrder := biz.NewUserShareBlockOrderRepo(userShareHkdOrderRepo, userShareIdnOrderRepo, userShareInrOrderRepo, userShareMysOrderRepo, userShareSgdOrderRepo, userShareThaOrderRepo, userShareUsOrderRepo, userShareGbxOrderRepo, userShareFurOrderRepo, userShareEurOrderRepo, userShareBrlOrderRepo, userShareJpyOrderRepo, userShareBlockOrderRepo, logger) |
|||
userOptionInrOrderRepo := data.NewUserOptionInrRepo(dataData, logger) |
|||
userOptionInrOrder := biz.NewUserOptionInrOrderRepo(userOptionInrOrderRepo, logger) |
|||
userBackendRepo := data.NewUserBackendRepo(dataData, logger) |
|||
userBackend := biz.NewUserBackendRepo(userBackendRepo, logger) |
|||
conduitService := service.NewConduitService(aLiYunCase, userOrder, userSecondOrder, userSpotsOrder, userContractOrder, userForexOrder, userMoneyOrder, userShareUsOrder, userShareThaOrder, userShareIdnOrder, userShareInrOrder, userShareMysOrder, userShareSgdOrder, userShareHkdOrder, userShareGbxOrder, userShareEurOrder, userShareFurOrder, userShareJpyOrder, userShareBrlOrder, userShareBlockOrder, userOptionInrOrder, userBackend, logger) |
|||
grpcServer := server.NewGRPCServer(confServer, conduitService, logger) |
|||
httpServer := server.NewHTTPServer(confServer, conduitService, logger) |
|||
app := newApp(logger, grpcServer, httpServer) |
|||
return app, func() { |
|||
cleanup() |
|||
}, nil |
|||
} |
@ -0,0 +1,72 @@ |
|||
# 项目部署说明 |
|||
|
|||
## 服务域名规划 |
|||
|
|||
### git 分支管理 |
|||
``` |
|||
1、主分支-main |
|||
2、项目分支-p1_main、p2_main...... |
|||
``` |
|||
|
|||
### (测试(谷歌云)-新加坡交易所|股票)测试环境[虚拟币-(合约|秒合约|现货)、股票-(美股|泰股|马股|印尼股|印度股|新加坡股|港股|英股)、期权-(印度股)、新股申购(美股|泰股|马股|印尼股|印度股|新加坡股|港股|英股)、大宗交易(美股|泰股|马股|印尼股|印度股|新加坡股|港股|英股)]: |
|||
``` |
|||
1、PC端:https://stockpc-india2.testjd.cc |
|||
2、H5端:https://stockh5-india2.testjd.cc |
|||
3、后台:https://stockmg-india2.testjd.cc |
|||
``` |
|||
|
|||
### (project01(谷歌云)-正式环境[美股、印度股、新股申购、大宗交易]: |
|||
``` |
|||
1、交易订单域名: https://trade.lazardinvestgroup.net |
|||
2、交易订单Wss: wss://trade.lazardinvestgroup.net |
|||
``` |
|||
|
|||
### (project02(谷歌云)-正式环境[美股、马股、泰股、港股、印度股、新加坡股、新股申购]: |
|||
``` |
|||
1、交易订单域名: https://trade.troweinvestgroup.com |
|||
2、交易订单Wss: wss://trade.troweinvestgroup.com |
|||
``` |
|||
|
|||
### (project04(谷歌云)-正式环境[美股、印度股、新股申购、大宗交易]: |
|||
``` |
|||
1、交易订单域名: https://trade.voceangcp.com |
|||
2、交易订单Wss: wss://trade.voceangcp.com |
|||
``` |
|||
|
|||
### (project05(谷歌云)-正式环境[美股、印度股、新股申购、大宗交易、期权(印度)]: |
|||
``` |
|||
1、交易订单域名: https://trade.abglobalfund.com |
|||
2、交易订单Wss: wss://trade.abglobalfund.com |
|||
``` |
|||
|
|||
### (project06(谷歌云)-正式环境[美股、英股、新股申购]: |
|||
``` |
|||
1、交易订单域名: https://trade.twinim.com |
|||
2、交易订单Wss: wss://trade.twinim.com |
|||
``` |
|||
|
|||
### (project07(谷歌云)-正式环境[美股、新股申购]: |
|||
``` |
|||
1、交易订单域名: https://trade.sysdev8.cc |
|||
2、交易订单Wss: wss://trade.sysdev8.cc |
|||
``` |
|||
|
|||
### (project08(谷歌云)-测试环境[现货、合约、秒合约]: |
|||
``` |
|||
1、交易订单域名: https://trade.chdh.me |
|||
2、交易订单Wss: wss://trade.chdh.me |
|||
``` |
|||
|
|||
### 服务环境和服务部署 |
|||
``` |
|||
服务环境: |
|||
1>数据库DB(mysql) |
|||
2>数据缓存(redis) |
|||
3>数据存储(mongodb) |
|||
4>代理服务(nginx) |
|||
5>进程管理器(supervisor) |
|||
6>消息队列(RabbitMQ)--等待接入 |
|||
服务部署: |
|||
1>服务编译(make api | make config | make wire | make error | make win_build[windows编译]),参见项目:Makefile |
|||
2>服务配置文件(上传到服务器:/home/ubuntu/service/config),参见项目:configs |
|||
``` |
@ -0,0 +1,26 @@ |
|||
server: |
|||
http: |
|||
addr: 0.0.0.0:8000 |
|||
grpc: |
|||
addr: 0.0.0.0:9000 |
|||
check: second,contract,forex,shareUs,shareJpy |
|||
#check: second,contract,forex,shareUs,shareTha,shareIdn,shareInr,shareMys,shareSgd,shareHkd,shareGbx,shareFur,shareEur,shareJpy,shareBrl,optionInr |
|||
data: |
|||
database: |
|||
driver: mysql |
|||
source: root:Meetingyou0))@tcp(172.26.45.216:3306)/bourse?charset=utf8 |
|||
redis: |
|||
addr: 172.26.45.216:6379 |
|||
db: 0 |
|||
password: MRrfvtyujnb&hg56 |
|||
mongodb: |
|||
addr: 172.26.45.214:27085 |
|||
user: pqRRVamndJ |
|||
password: 35LlW3pXF76&WD!OOlnI |
|||
db: bourse |
|||
mq: |
|||
address: "amqp://admin:admin@127.0.0.1:5672/" |
|||
type: "direct" |
|||
position: "" |
|||
entrust: "" |
|||
start: True |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue