.idea/.gitignore
View Diff
|
9 |
8 |
88.9% |
|
@@ -6,4 +6,3 @@ # Datasource local storage ignored files /dataSources/ /dataSources.local.xml -/protoeditor.xml |
.idea/modules.xml
View Diff
|
8 |
8 |
98.3% |
|
@@ -2,7 +2,7 @@ <project version="4"> <component name="ProjectModuleManager"> <modules> - <module fileurl="file://$PROJECT_DIR$/.idea/toktik.iml" filepath="$PROJECT_DIR$/.idea/toktik.iml" /> + <module fileurl="file://$PROJECT_DIR$/.idea/simpledouyin.iml" filepath="$PROJECT_DIR$/.idea/simpledouyin.iml" /> </modules> </component> </project> |
.idea/vcs.xml
|
6 |
6 |
100.0% |
|
Dockerfile
View Diff
|
37 |
2 |
5.4% |
|
@@ -1,37 +1,8 @@ -# 编译镜像 -FROM docker.io/nicognaw/toktik-basic-build:v1 AS build -ENV TZ=Asia/Shanghai -ENV DEBIAN_FRONTEND=noninteractive +# 使用 OpenTelemetry Collector 官方镜像作为基础镜像 +FROM otel/opentelemetry-collector-contrib:latest -# 构建依赖 -RUN apt-get update && \ - apt-get install -yq git ffmpeg libavcodec-dev libavutil-dev libavformat-dev libswscale-dev && \ - apt-get clean && \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false && \ - rm -rf /var/lib/apt/lists/* +# 将本地配置文件复制到容器的配置目录中 +COPY ./otel.yaml /etc/otel-collector-config.yaml -# 获取文件 -RUN mkdir -p /source -WORKDIR /source -COPY . . - -# 编译 -RUN bash unit-test.sh && bash build-all.sh - -# 运行环境 -FROM docker.io/nicognaw/toktik-basic:v1 -ENV TZ=Asia/Shanghai -ENV DEBIAN_FRONTEND=noninteractive - -# FFmpeg 及依赖 -RUN apt-get update && \ - apt-get install -yq ca-certificates && \ - apt-get clean && \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false && \ - rm -rf /var/lib/apt/lists/* - -# RUN mkdir -p /data/apps/toktik-service-bundle -WORKDIR /data/apps/toktik-service-bundle - -# 收集数据 -COPY --from=build /source/output/ . +# 设置默认命令以启动 OpenTelemetry Collector +CMD [ "--config=/etc/otel-collector-config.yaml" ] |
add-kitex-service.sh
View Diff
|
49 |
34 |
68.5% |
|
@@ -9,28 +9,12 @@ # 检查 protoc 命令是否存在于 PATH 环境变量中 if ! command -v protoc &>/dev/null; then echo "错误:protoc 命令未在 PATH 中找到。请安装或将其添加到 PATH 中。" - # 检查操作系统是否为 macOS - if [[ $(uname) == "Darwin" ]]; then - # 如果是macOS,则检查brew是否在PATH中 - if ! command -v brew &>/dev/null; then - echo "错误:brew 命令未在 PATH 中找到。请安装或将其添加到 PATH 中。" - exit 1 - else - echo "尝试安装 protoc......" - brew install protobuf - fi - fi -fi - -# 再次检查 protoc 命令是否存在于 PATH 环境变量中 -if ! command -v protoc &>/dev/null; then - echo "错误:protoc 命令未在 PATH 中找到,看起来安装失败了。请手动安装。" exit 1 fi # 检查 kitex 命令是否存在于 PATH 环境变量中 if ! command -v kitex &>/dev/null; then - echo "错误:kitex 命令未在 PATH 中找到,尝试安装......" + echo "错误:kitex 命令未在 PATH 中找到,尝试安装..." go install github.com/cloudwego/kitex/tool/cmd/kitex@latest fi @@ -40,10 +24,17 @@ exit 1 fi +# 创建生成目录 mkdir -p kitex_gen -kitex -module "toktik" -I idl/ idl/"$1".proto -mkdir -p service/"$1" -cd service/"$1" && kitex -module "toktik" -service "$1" -use toktik/kitex_gen/ -I ../../idl/ ../../idl/"$1".proto +# 运行 kitex 生成代码 +kitex -module "simpledouyin" -I idl/ "idl/$1.proto" +# 创建 service 目录 +mkdir -p "service/$1" + +# 进入 service 目录并运行 kitex +cd "service/$1" && kitex -module "simpledouyin" -service "$1" -use simpledouyin/kitex_gen/ -I ../../idl/ "../../idl/$1.proto" + +# 执行 go mod tidy 来整理依赖 go mod tidy |
docs/HowToAddServices.md
View Diff
|
8 |
7 |
87.5% |
|
@@ -2,7 +2,7 @@ 1. 确定要添加的服务的名称(如:`user`, `auth`, `feed` 等)可参考 `service/web/main.go` 下的 hertz group 或 API URL 2. 编写 proto IDL 文件,并将文件命名为`{服务名称}.proto` ,放入 idl 目录 -3. 打开终端 cd 到项目根目录,然后调用 `./add-kitex-service.sh {服务名称}` +3. 打开终端 cd 到项目根目录,然后调用 `./add-kitex-service.sh {服务名称}`,如果是 windows 平台,则是 `./add-kitex-service.sh {服务名称}`。 4. 此时 kitex 生成的代码将被放入 `kitex_gen` 目录(无需改动)和 `service/{服务名称}` 5. 完成服务业务逻辑并妥善修改 `service/{服务名称}/handler.go` 6. 在 `service/web` web api 中添加对 RPC 服务的调用 |
go.mod
View Diff
|
177 |
124 |
67.3% |
|
@@ -1,177 +1,150 @@ -module toktik +module simpledouyin -go 1.19 +go 1.22.0 -replace github.com/docker/docker => github.com/docker/docker v20.10.3-0.20221013203545-33ab36d6b304+incompatible // 22.06 branch +toolchain go1.23.4 require ( - github.com/DATA-DOG/go-sqlmock v1.5.0 - github.com/aws/aws-sdk-go-v2 v1.17.4 - github.com/aws/aws-sdk-go-v2/config v1.18.12 - github.com/aws/aws-sdk-go-v2/credentials v1.13.12 - github.com/aws/aws-sdk-go-v2/service/s3 v1.30.2 + github.com/aws/aws-sdk-go-v2 v1.36.0 + github.com/aws/aws-sdk-go-v2/config v1.29.5 + github.com/aws/aws-sdk-go-v2/credentials v1.17.58 + github.com/aws/aws-sdk-go-v2/service/s3 v1.75.3 github.com/bakape/thumbnailer/v2 v2.7.1 - github.com/cloudwego/fastpb v0.0.4-0.20230131074846-6fc453d58b96 - github.com/cloudwego/hertz v0.5.2 - github.com/cloudwego/kitex v0.4.5-0.20230208074253-5c9bc30c9f87 - github.com/gavv/httpexpect/v2 v2.8.0 - github.com/gofrs/uuid v4.4.0+incompatible - github.com/golang/protobuf v1.5.2 - github.com/hertz-contrib/gzip v0.0.1 - github.com/hertz-contrib/obs-opentelemetry/provider v0.2.0 - github.com/hertz-contrib/obs-opentelemetry/tracing v0.2.0 - github.com/hertz-contrib/pprof v0.1.0 - github.com/hertz-contrib/swagger v0.0.0-20220711030440-b6402d4709f0 - github.com/joho/godotenv v1.5.0 - github.com/kitex-contrib/obs-opentelemetry v0.2.1 - github.com/kitex-contrib/registry-consul v0.0.0-20221024133802-971ac457240a - github.com/redis/go-redis/extra/redisotel/v9 v9.0.2 - github.com/redis/go-redis/v9 v9.0.2 + github.com/cloudwego/fastpb v0.0.5 + github.com/cloudwego/hertz v0.9.5 + github.com/cloudwego/kitex v0.12.1 + github.com/golang/protobuf v1.5.4 + github.com/google/uuid v1.6.0 + github.com/hertz-contrib/gzip v0.0.3 + github.com/hertz-contrib/obs-opentelemetry/provider v0.3.0 + github.com/hertz-contrib/obs-opentelemetry/tracing v0.4.1 + github.com/hertz-contrib/pprof v0.1.2 + github.com/hertz-contrib/swagger v0.1.0 + github.com/joho/godotenv v1.5.1 + github.com/kitex-contrib/obs-opentelemetry v0.2.9 + github.com/kitex-contrib/registry-consul v0.1.0 + github.com/redis/go-redis/extra/redisotel/v9 v9.7.0 + github.com/redis/go-redis/v9 v9.7.0 github.com/segmentio/ksuid v1.0.4 - github.com/sirupsen/logrus v1.9.0 - github.com/stretchr/testify v1.8.1 - github.com/swaggo/files v1.0.0 - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.39.0 - golang.org/x/crypto v0.4.0 - google.golang.org/protobuf v1.28.1 - gorm.io/driver/postgres v1.4.6 - gorm.io/gen v0.3.21 - gorm.io/gorm v1.24.5 - gorm.io/plugin/dbresolver v1.3.0 - gorm.io/plugin/opentelemetry v0.1.1 + github.com/sirupsen/logrus v1.9.3 + github.com/swaggo/files v1.0.1 + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 + golang.org/x/crypto v0.30.0 + google.golang.org/protobuf v1.36.4 + gorm.io/driver/mysql v1.5.1 + gorm.io/gen v0.3.26 + gorm.io/gorm v1.25.9 + gorm.io/plugin/dbresolver v1.5.0 + gorm.io/plugin/opentelemetry v0.1.11 ) require ( github.com/KyleBanks/depth v1.2.1 // indirect - github.com/PuerkitoBio/purell v1.1.1 // indirect - github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect - github.com/ajg/form v1.5.1 // indirect - github.com/andeya/goutil v1.0.0 // indirect - github.com/andybalholm/brotli v1.0.4 // indirect - github.com/apache/thrift v0.13.0 // indirect github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.22 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.28 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.22 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.3.29 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.19 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.23 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.22 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.22 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.12.1 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.1 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.18.3 // indirect |
go.sum
View Diff
|
1,178 |
331 |
28.0% |
|
@@ -1,284 +1,168 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.19.0/go.mod h1:h6H6c8enJmmocHUbLiiGY6sx7f9i+X3m1CHdd5c6Rdw= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.11.0/go.mod h1:HcM1YX14R7CJcghJGOYCgdezslRSVzqwLf/q+4Y2r/0= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.7.0/go.mod h1:yqy467j36fJxcRV2TzfVZ1pCb5vxm4BtZPUdYWe/Xo8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= -github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= -github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= -github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/andeya/goutil v0.0.0-20220704075712-42f2ec55fe8d/go.mod h1:jEG5/QnnhG7yGxwFUX6Q+JGMif7sjdHmmNVjn7nhJDo= -github.com/andeya/goutil v1.0.0 h1:ZBF/1dParfzTTiZ3SivkrV3Rd50SnXPqqf4IRvULvNQ= -github.com/andeya/goutil v1.0.0/go.mod h1:jEG5/QnnhG7yGxwFUX6Q+JGMif7sjdHmmNVjn7nhJDo= -github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= -github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= -github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/thrift v0.13.0 h1:5hryIiq9gtn+MiLVn0wP37kb/uTeRZgN08WoCsAhIhI= -github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aws/aws-sdk-go-v2 v1.17.4 h1:wyC6p9Yfq6V2y98wfDsj6OnNQa4w2BLGCLIxzNhwOGY= -github.com/aws/aws-sdk-go-v2 v1.17.4/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 h1:dK82zF6kkPeCo8J1e+tGx4JdvDIQzj7ygIoLg8WMuGs= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10/go.mod h1:VeTZetY5KRJLuD/7fkQXMU6Mw7H5m/KP2J5Iy9osMno= -github.com/aws/aws-sdk-go-v2/config v1.18.12 h1:fKs/I4wccmfrNRO9rdrbMO1NgLxct6H9rNMiPdBxHWw= -github.com/aws/aws-sdk-go-v2/config v1.18.12/go.mod h1:J36fOhj1LQBr+O4hJCiT8FwVvieeoSGOtPuvhKlsNu8= -github.com/aws/aws-sdk-go-v2/credentials v1.13.12 h1:Cb+HhuEnV19zHRaYYVglwvdHGMJWbdsyP4oHhw04xws= -github.com/aws/aws-sdk-go-v2/credentials v1.13.12/go.mod h1:37HG2MBroXK3jXfxVGtbM2J48ra2+Ltu+tmwr/jO0KA= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.22 h1:3aMfcTmoXtTZnaT86QlVaYh+BRMbvrrmZwIQ5jWqCZQ= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.22/go.mod h1:YGSIJyQ6D6FjKMQh16hVFSIUD54L4F7zTGePqYMYYJU= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.28 h1:r+XwaCLpIvCKjBIYy/HVZujQS9tsz5ohHG3ZIe0wKoE= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.28/go.mod h1:3lwChorpIM/BhImY/hy+Z6jekmN92cXGPI1QJasVPYY= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.22 h1:7AwGYXDdqRQYsluvKFmWoqpcOQJ4bH634SkYf3FNj/A= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.22/go.mod h1:EqK7gVrIGAHyZItrD1D8B0ilgwMD1GiWAmbU4u/JHNk= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.29 h1:J4xhFd6zHhdF9jPP0FQJ6WknzBboGMBNjKOv4iTuw4A= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.29/go.mod h1:TwuqRBGzxjQJIwH16/fOZodwXt2Zxa9/cwJC5ke4j7s= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.19 h1:FGvpyTg2LKEmMrLlpjOgkoNp9XF5CGeyAyo33LdqZW8= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.19/go.mod h1:8W88sW3PjamQpKFUQvHWWKay6ARsNvZnzU7+a4apubw= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11 h1:y2+VQzC6Zh2ojtV2LoC0MNwHWc6qXv/j2vrQtlftkdA= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11/go.mod h1:iV4q2hsqtNECrfmlXyord9u4zyuFEJX9eLgLpSPzWA8= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.23 h1:c5+bNdV8E4fIPteWx4HZSkqI07oY9exbfQ7JH7Yx4PI= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.23/go.mod h1:1jcUfF+FAOEwtIcNiHPaV4TSoZqkUIPzrohmD7fb95c= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.22 h1:LjFQf8hFuMO22HkV5VWGLBvmCLBCLPivUAmpdpnp4Vs= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.22/go.mod h1:xt0Au8yPIwYXf/GYPy/vl4K3CgwhfQMYbrH7DlUUIws= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.22 h1:ISLJ2BKXe4zzyZ7mp5ewKECiw0U7KpLgS3S6OxY9Cm0= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.22/go.mod h1:QFVbqK54XArazLvn2wvWMRBi/jGrWii46qbr5DyPGjc= -github.com/aws/aws-sdk-go-v2/service/s3 v1.30.2 h1:5EQWIFO+Hc8E2hFcXQJ1vm6ufl/PMt/6RVRDZRju2vM= -github.com/aws/aws-sdk-go-v2/service/s3 v1.30.2/go.mod h1:SXDHd6fI2RhqB7vmAzyYQCTQnpZrIprVJvYxpzW3JAM= -github.com/aws/aws-sdk-go-v2/service/sso v1.12.1 h1:lQKN/LNa3qqu2cDOQZybP7oL4nMGGiFqob0jZJaR8/4= -github.com/aws/aws-sdk-go-v2/service/sso v1.12.1/go.mod h1:IgV8l3sj22nQDd5qcAGY0WenwCzCphqdbFOpfktZPrI= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.1 h1:0bLhH6DRAqox+g0LatcjGKjjhU6Eudyys6HB6DJVPj8= |
idl/auth.proto
View Diff
|
48 |
47 |
97.6% |
|
@@ -1,6 +1,7 @@ syntax = "proto3"; -package douyin.auth; +package simpledouyin.auth; option go_package = "douyin/auth"; + message LoginRequest { string username = 1; // 登录用户名 |
idl/comment.proto
View Diff
|
63 |
63 |
99.8% |
|
@@ -1,5 +1,5 @@ syntax = "proto3"; -package douyin.comment; +package simpledouyin.comment; option go_package = "douyin/comment"; import "user.proto"; |
idl/favorite.proto
View Diff
|
83 |
82 |
98.7% |
|
@@ -1,5 +1,5 @@ syntax = "proto3"; -package douyin.favorite; +package simpledouyin.favorite; option go_package = "douyin/favorite"; import "feed.proto"; @@ -80,3 +80,4 @@ rpc CountUserTotalFavorited (CountUserTotalFavoritedRequest) returns (CountUserTotalFavoritedResponse) { } } + |
idl/feed.proto
View Diff
|
45 |
45 |
99.7% |
|
@@ -1,6 +1,6 @@ syntax = "proto3"; -package douyin.feed; +package simpledouyin.feed; option go_package = "douyin/feed"; import "user.proto"; |
idl/publish.proto
View Diff
|
44 |
43 |
97.5% |
|
@@ -1,6 +1,7 @@ syntax = "proto3"; -package douyin.publish; +package simpledouyin.publish; option go_package = "douyin/publish"; + import "feed.proto"; |
idl/relation.proto
View Diff
|
102 |
102 |
99.9% |
|
@@ -1,6 +1,6 @@ syntax = "proto3"; -package douyin.user; +package simpledouyin.user; option go_package = "douyin/relation"; import "user.proto"; |
idl/user.proto
View Diff
|
35 |
34 |
96.8% |
|
@@ -1,5 +1,5 @@ syntax = "proto3"; -package douyin.user; +package simpledouyin.user; option go_package = "douyin/user"; message UserRequest { @@ -27,8 +27,9 @@ optional uint32 favorite_count = 11; // 点赞数量 } - service UserService { rpc GetUser (UserRequest) returns (UserResponse) { } } + + |
idl/wechat.proto
View Diff
|
40 |
40 |
99.7% |
|
@@ -1,5 +1,5 @@ syntax = "proto3"; -package douyin.wechat; +package simpledouyin.wechat; option go_package = "douyin/wechat"; message MessageChatRequest { |
kitex_gen/douyin/auth/auth.pb.fast.go
|
669 |
669 |
100.0% |
|
kitex_gen/douyin/auth/auth.pb.go
View Diff
|
592 |
564 |
94.5% |
|
@@ -1,8 +1,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.12 -// source: auth.proto +// protoc-gen-go v1.33.0 +// protoc v5.26.1 +// source: auth.md.proto package auth @@ -386,60 +386,63 @@ var File_auth_proto protoreflect.FileDescriptor var file_auth_proto_rawDesc = []byte{ - 0x0a, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x64, 0x6f, - 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x22, 0x46, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, - 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, - 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, - 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x22, 0x81, 0x01, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, - 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, - 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x12, - 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x49, 0x0a, 0x0f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x22, 0x84, 0x01, 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, - 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, - 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x2b, 0x0a, 0x13, 0x41, 0x75, 0x74, 0x68, 0x65, - 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, - 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x72, 0x0a, 0x14, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, - 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1e, - 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x12, 0x18, - 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x32, 0xf1, 0x01, 0x0a, 0x0b, 0x41, 0x75, 0x74, - 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x55, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x68, - 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x20, 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, - 0x6e, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x64, 0x6f, 0x75, - 0x79, 0x69, 0x6e, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, - 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x49, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x64, 0x6f, - 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x64, 0x6f, 0x75, 0x79, - 0x69, 0x6e, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x05, 0x4c, 0x6f, - 0x67, 0x69, 0x6e, 0x12, 0x19, 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x61, 0x75, 0x74, - 0x68, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, - 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x4c, 0x6f, 0x67, - 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x1e, 0x5a, 0x1c, - 0x74, 0x6f, 0x6b, 0x74, 0x69, 0x6b, 0x2f, 0x6b, 0x69, 0x74, 0x65, 0x78, 0x5f, 0x67, 0x65, 0x6e, + 0x0a, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x73, 0x69, + 0x6d, 0x70, 0x6c, 0x65, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x22, + 0x46, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x81, 0x01, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x69, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x49, 0x0a, 0x0f, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, + 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x84, 0x01, 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x0a, + 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x12, 0x18, 0x0a, + 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x2b, 0x0a, |
kitex_gen/douyin/auth/authservice/authservice.go
View Diff
|
602 |
500 |
82.9% |
|
@@ -1,40 +1,102 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package authservice import ( "context" - "fmt" + "errors" client "github.com/cloudwego/kitex/client" kitex "github.com/cloudwego/kitex/pkg/serviceinfo" streaming "github.com/cloudwego/kitex/pkg/streaming" proto "google.golang.org/protobuf/proto" - auth "toktik/kitex_gen/douyin/auth" + auth "simpledouyin/kitex_gen/douyin/auth" ) +var errInvalidMessageType = errors.New("invalid message type for service method handler") + +var serviceMethods = map[string]kitex.MethodInfo{ + "Authenticate": kitex.NewMethodInfo( + authenticateHandler, + newAuthenticateArgs, + newAuthenticateResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), + "Register": kitex.NewMethodInfo( + registerHandler, + newRegisterArgs, + newRegisterResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), + "Login": kitex.NewMethodInfo( + loginHandler, + newLoginArgs, + newLoginResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), +} + +var ( + authServiceServiceInfo = NewServiceInfo() + authServiceServiceInfoForClient = NewServiceInfoForClient() + authServiceServiceInfoForStreamClient = NewServiceInfoForStreamClient() +) + +// for server func serviceInfo() *kitex.ServiceInfo { return authServiceServiceInfo } -var authServiceServiceInfo = NewServiceInfo() - +// for stream client +func serviceInfoForStreamClient() *kitex.ServiceInfo { + return authServiceServiceInfoForStreamClient +} + +// for client +func serviceInfoForClient() *kitex.ServiceInfo { + return authServiceServiceInfoForClient +} + +// NewServiceInfo creates a new ServiceInfo containing all methods func NewServiceInfo() *kitex.ServiceInfo { + return newServiceInfo(false, true, true) +} + +// NewServiceInfo creates a new ServiceInfo containing non-streaming methods +func NewServiceInfoForClient() *kitex.ServiceInfo { + return newServiceInfo(false, false, true) +} +func NewServiceInfoForStreamClient() *kitex.ServiceInfo { + return newServiceInfo(true, true, false) +} + +func newServiceInfo(hasStreaming bool, keepStreamingMethods bool, keepNonStreamingMethods bool) *kitex.ServiceInfo { serviceName := "AuthService" handlerType := (*auth.AuthService)(nil) - methods := map[string]kitex.MethodInfo{ - "Authenticate": kitex.NewMethodInfo(authenticateHandler, newAuthenticateArgs, newAuthenticateResult, false), - "Register": kitex.NewMethodInfo(registerHandler, newRegisterArgs, newRegisterResult, false), - "Login": kitex.NewMethodInfo(loginHandler, newLoginArgs, newLoginResult, false), + methods := map[string]kitex.MethodInfo{} + for name, m := range serviceMethods { + if m.IsStreaming() && !keepStreamingMethods { + continue + } + if !m.IsStreaming() && !keepNonStreamingMethods { + continue + } + methods[name] = m } extra := map[string]interface{}{ |
kitex_gen/douyin/auth/authservice/client.go
View Diff
|
61 |
61 |
99.6% |
|
@@ -1,4 +1,4 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package authservice @@ -6,7 +6,7 @@ "context" client "github.com/cloudwego/kitex/client" callopt "github.com/cloudwego/kitex/client/callopt" - auth "toktik/kitex_gen/douyin/auth" + auth "simpledouyin/kitex_gen/douyin/auth" ) // Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework. |
kitex_gen/douyin/auth/authservice/server.go
View Diff
|
24 |
20 |
82.3% |
|
@@ -1,9 +1,9 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package authservice import ( server "github.com/cloudwego/kitex/server" - auth "toktik/kitex_gen/douyin/auth" + auth "simpledouyin/kitex_gen/douyin/auth" ) // NewServer creates a server.Server with the given handler and options. @@ -18,3 +18,7 @@ } return svr } + +func RegisterService(svr server.Server, handler auth.AuthService, opts ...server.RegisterOption) error { + return svr.RegisterService(serviceInfo(), handler, opts...) +} |
kitex_gen/douyin/comment/comment.pb.fast.go
View Diff
|
909 |
909 |
100.0% |
|
@@ -5,7 +5,7 @@ import ( fmt "fmt" fastpb "github.com/cloudwego/fastpb" - user "toktik/kitex_gen/douyin/user" + user "simpledouyin/kitex_gen/douyin/user" ) var ( |
kitex_gen/douyin/comment/comment.pb.go
View Diff
|
822 |
794 |
95.5% |
|
@@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.12 +// protoc-gen-go v1.33.0 +// protoc v5.26.1 // source: comment.proto package comment @@ -11,8 +11,8 @@ protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" + user "simpledouyin/kitex_gen/douyin/user" sync "sync" - user "toktik/kitex_gen/douyin/user" ) const ( @@ -149,7 +149,7 @@ ActorId uint32 `protobuf:"varint,1,opt,name=actor_id,json=actorId,proto3" json:"actor_id,omitempty"` VideoId uint32 `protobuf:"varint,2,opt,name=video_id,json=videoId,proto3" json:"video_id,omitempty"` - ActionType ActionCommentType `protobuf:"varint,3,opt,name=action_type,json=actionType,proto3,enum=douyin.comment.ActionCommentType" json:"action_type,omitempty"` + ActionType ActionCommentType `protobuf:"varint,3,opt,name=action_type,json=actionType,proto3,enum=simpledouyin.comment.ActionCommentType" json:"action_type,omitempty"` // Types that are assignable to Action: // // *ActionCommentRequest_CommentText @@ -550,99 +550,103 @@ var file_comment_proto_rawDesc = []byte{ 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x0e, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x1a, - 0x0a, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7b, 0x0a, 0x07, 0x43, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x75, 0x73, - 0x65, 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x18, 0x0a, - 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x65, 0x22, 0xe0, 0x01, 0x0a, 0x14, 0x41, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x07, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, - 0x76, 0x69, 0x64, 0x65, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, - 0x76, 0x69, 0x64, 0x65, 0x6f, 0x49, 0x64, 0x12, 0x42, 0x0a, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x64, + 0x14, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x1a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x81, 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2b, 0x0a, + 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x69, + 0x6d, 0x70, 0x6c, 0x65, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x64, + 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x44, 0x61, 0x74, 0x65, 0x22, 0xe6, 0x01, 0x0a, 0x14, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, + 0x0a, 0x08, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x07, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x76, 0x69, 0x64, + 0x65, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x69, 0x64, + 0x65, 0x6f, 0x49, 0x64, 0x12, 0x48, 0x0a, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x73, 0x69, 0x6d, 0x70, + 0x6c, 0x65, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, + 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x54, + 0x65, 0x78, 0x74, 0x12, 0x1f, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x49, 0x64, 0x42, 0x08, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xb5, + 0x01, 0x0a, 0x15, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, + 0x09, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x73, 0x67, 0x88, 0x01, 0x01, 0x12, 0x3c, 0x0a, + 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x01, 0x52, + 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x63, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x4a, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, + 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, + 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x76, 0x69, 0x64, 0x65, 0x6f, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x69, 0x64, 0x65, 0x6f, + 0x49, 0x64, 0x22, 0xab, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x73, 0x67, 0x88, 0x01, 0x01, 0x12, + 0x40, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x64, 0x6f, |
kitex_gen/douyin/comment/commentservice/client.go
View Diff
|
61 |
61 |
99.7% |
|
@@ -1,4 +1,4 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package commentservice @@ -6,7 +6,7 @@ "context" client "github.com/cloudwego/kitex/client" callopt "github.com/cloudwego/kitex/client/callopt" - comment "toktik/kitex_gen/douyin/comment" + comment "simpledouyin/kitex_gen/douyin/comment" ) // Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework. |
kitex_gen/douyin/comment/commentservice/commentservice.go
View Diff
|
602 |
500 |
83.0% |
|
@@ -1,40 +1,102 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package commentservice import ( "context" - "fmt" + "errors" client "github.com/cloudwego/kitex/client" kitex "github.com/cloudwego/kitex/pkg/serviceinfo" streaming "github.com/cloudwego/kitex/pkg/streaming" proto "google.golang.org/protobuf/proto" - comment "toktik/kitex_gen/douyin/comment" + comment "simpledouyin/kitex_gen/douyin/comment" ) +var errInvalidMessageType = errors.New("invalid message type for service method handler") + +var serviceMethods = map[string]kitex.MethodInfo{ + "ActionComment": kitex.NewMethodInfo( + actionCommentHandler, + newActionCommentArgs, + newActionCommentResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), + "ListComment": kitex.NewMethodInfo( + listCommentHandler, + newListCommentArgs, + newListCommentResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), + "CountComment": kitex.NewMethodInfo( + countCommentHandler, + newCountCommentArgs, + newCountCommentResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), +} + +var ( + commentServiceServiceInfo = NewServiceInfo() + commentServiceServiceInfoForClient = NewServiceInfoForClient() + commentServiceServiceInfoForStreamClient = NewServiceInfoForStreamClient() +) + +// for server func serviceInfo() *kitex.ServiceInfo { return commentServiceServiceInfo } -var commentServiceServiceInfo = NewServiceInfo() - +// for stream client +func serviceInfoForStreamClient() *kitex.ServiceInfo { + return commentServiceServiceInfoForStreamClient +} + +// for client +func serviceInfoForClient() *kitex.ServiceInfo { + return commentServiceServiceInfoForClient +} + +// NewServiceInfo creates a new ServiceInfo containing all methods func NewServiceInfo() *kitex.ServiceInfo { + return newServiceInfo(false, true, true) +} + +// NewServiceInfo creates a new ServiceInfo containing non-streaming methods +func NewServiceInfoForClient() *kitex.ServiceInfo { + return newServiceInfo(false, false, true) +} +func NewServiceInfoForStreamClient() *kitex.ServiceInfo { + return newServiceInfo(true, true, false) +} + +func newServiceInfo(hasStreaming bool, keepStreamingMethods bool, keepNonStreamingMethods bool) *kitex.ServiceInfo { serviceName := "CommentService" handlerType := (*comment.CommentService)(nil) - methods := map[string]kitex.MethodInfo{ - "ActionComment": kitex.NewMethodInfo(actionCommentHandler, newActionCommentArgs, newActionCommentResult, false), - "ListComment": kitex.NewMethodInfo(listCommentHandler, newListCommentArgs, newListCommentResult, false), - "CountComment": kitex.NewMethodInfo(countCommentHandler, newCountCommentArgs, newCountCommentResult, false), + methods := map[string]kitex.MethodInfo{} + for name, m := range serviceMethods { + if m.IsStreaming() && !keepStreamingMethods { + continue + } + if !m.IsStreaming() && !keepNonStreamingMethods { + continue + } + methods[name] = m } extra := map[string]interface{}{ |
kitex_gen/douyin/comment/commentservice/server.go
View Diff
|
24 |
20 |
82.5% |
|
@@ -1,9 +1,9 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package commentservice import ( server "github.com/cloudwego/kitex/server" - comment "toktik/kitex_gen/douyin/comment" + comment "simpledouyin/kitex_gen/douyin/comment" ) // NewServer creates a server.Server with the given handler and options. @@ -18,3 +18,7 @@ } return svr } + +func RegisterService(svr server.Server, handler comment.CommentService, opts ...server.RegisterOption) error { + return svr.RegisterService(serviceInfo(), handler, opts...) +} |
kitex_gen/douyin/favorite/favorite.pb.fast.go
View Diff
|
1,168 |
1,168 |
100.0% |
|
@@ -5,7 +5,7 @@ import ( fmt "fmt" fastpb "github.com/cloudwego/fastpb" - feed "toktik/kitex_gen/douyin/feed" + feed "simpledouyin/kitex_gen/douyin/feed" ) var ( |
kitex_gen/douyin/favorite/favorite.pb.go
View Diff
|
1,066 |
1,024 |
95.0% |
|
@@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.12 +// protoc-gen-go v1.33.0 +// protoc v5.26.1 // source: favorite.proto package favorite @@ -11,8 +11,8 @@ protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" + feed "simpledouyin/kitex_gen/douyin/feed" sync "sync" - feed "toktik/kitex_gen/douyin/feed" ) const ( @@ -702,123 +702,129 @@ var file_favorite_proto_rawDesc = []byte{ 0x0a, 0x0e, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x0f, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, - 0x65, 0x1a, 0x0a, 0x66, 0x65, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x68, 0x0a, - 0x0f, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x19, 0x0a, 0x08, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x07, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x76, - 0x69, 0x64, 0x65, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, - 0x69, 0x64, 0x65, 0x6f, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0x66, 0x0a, 0x10, 0x46, 0x61, 0x76, 0x6f, 0x72, - 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x0a, 0x0a, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x48, 0x00, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x73, 0x67, 0x88, 0x01, 0x01, - 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x22, - 0x49, 0x0a, 0x13, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x12, 0x15, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x66, + 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x1a, 0x0a, 0x66, 0x65, 0x65, 0x64, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x68, 0x0a, 0x0f, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, - 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x9d, 0x01, 0x0a, 0x14, 0x46, - 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, - 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x43, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, - 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x4d, 0x73, 0x67, 0x88, 0x01, 0x01, 0x12, 0x31, 0x0a, 0x0a, 0x76, 0x69, 0x64, 0x65, - 0x6f, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, - 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x66, 0x65, 0x65, 0x64, 0x2e, 0x56, 0x69, 0x64, 0x65, 0x6f, - 0x52, 0x09, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x22, 0x47, 0x0a, 0x11, 0x49, 0x73, - 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x76, 0x69, 0x64, 0x65, - 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x69, 0x64, 0x65, - 0x6f, 0x49, 0x64, 0x22, 0x2c, 0x0a, 0x12, 0x49, 0x73, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x22, 0x31, 0x0a, 0x14, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, - 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x76, 0x69, 0x64, - 0x65, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x69, 0x64, - 0x65, 0x6f, 0x49, 0x64, 0x22, 0x81, 0x01, 0x0a, 0x15, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x46, 0x61, - 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, - 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, - 0x22, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x73, 0x67, - 0x88, 0x01, 0x01, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x22, 0x33, 0x0a, 0x18, 0x43, 0x6f, 0x75, 0x6e, - 0x74, 0x55, 0x73, 0x65, 0x72, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x85, 0x01, - 0x0a, 0x19, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x46, 0x61, 0x76, 0x6f, 0x72, - 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, + 0x64, 0x12, 0x19, 0x0a, 0x08, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0x66, 0x0a, + 0x10, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, + 0x64, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x4d, 0x73, 0x67, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x22, 0x49, 0x0a, 0x13, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, + 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, + 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, + 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, + 0x22, 0xa3, 0x01, 0x0a, 0x14, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, |
kitex_gen/douyin/favorite/favoriteservice/client.go
View Diff
|
79 |
79 |
99.7% |
|
@@ -1,4 +1,4 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package favoriteservice @@ -6,7 +6,7 @@ "context" client "github.com/cloudwego/kitex/client" callopt "github.com/cloudwego/kitex/client/callopt" - favorite "toktik/kitex_gen/douyin/favorite" + favorite "simpledouyin/kitex_gen/douyin/favorite" ) // Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework. |
kitex_gen/douyin/favorite/favoriteservice/favoriteservice.go
View Diff
|
1,112 |
953 |
85.7% |
|
@@ -1,43 +1,123 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package favoriteservice import ( "context" - "fmt" + "errors" client "github.com/cloudwego/kitex/client" kitex "github.com/cloudwego/kitex/pkg/serviceinfo" streaming "github.com/cloudwego/kitex/pkg/streaming" proto "google.golang.org/protobuf/proto" - favorite "toktik/kitex_gen/douyin/favorite" + favorite "simpledouyin/kitex_gen/douyin/favorite" ) +var errInvalidMessageType = errors.New("invalid message type for service method handler") + +var serviceMethods = map[string]kitex.MethodInfo{ + "FavoriteAction": kitex.NewMethodInfo( + favoriteActionHandler, + newFavoriteActionArgs, + newFavoriteActionResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), + "FavoriteList": kitex.NewMethodInfo( + favoriteListHandler, + newFavoriteListArgs, + newFavoriteListResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), + "IsFavorite": kitex.NewMethodInfo( + isFavoriteHandler, + newIsFavoriteArgs, + newIsFavoriteResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), + "CountFavorite": kitex.NewMethodInfo( + countFavoriteHandler, + newCountFavoriteArgs, + newCountFavoriteResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), + "CountUserFavorite": kitex.NewMethodInfo( + countUserFavoriteHandler, + newCountUserFavoriteArgs, + newCountUserFavoriteResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), + "CountUserTotalFavorited": kitex.NewMethodInfo( + countUserTotalFavoritedHandler, + newCountUserTotalFavoritedArgs, + newCountUserTotalFavoritedResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), +} + +var ( + favoriteServiceServiceInfo = NewServiceInfo() + favoriteServiceServiceInfoForClient = NewServiceInfoForClient() + favoriteServiceServiceInfoForStreamClient = NewServiceInfoForStreamClient() +) + +// for server func serviceInfo() *kitex.ServiceInfo { return favoriteServiceServiceInfo } -var favoriteServiceServiceInfo = NewServiceInfo() - +// for stream client +func serviceInfoForStreamClient() *kitex.ServiceInfo { + return favoriteServiceServiceInfoForStreamClient +} + +// for client +func serviceInfoForClient() *kitex.ServiceInfo { + return favoriteServiceServiceInfoForClient +} + +// NewServiceInfo creates a new ServiceInfo containing all methods func NewServiceInfo() *kitex.ServiceInfo { + return newServiceInfo(false, true, true) +} + +// NewServiceInfo creates a new ServiceInfo containing non-streaming methods +func NewServiceInfoForClient() *kitex.ServiceInfo { + return newServiceInfo(false, false, true) +} +func NewServiceInfoForStreamClient() *kitex.ServiceInfo { |
kitex_gen/douyin/favorite/favoriteservice/server.go
View Diff
|
24 |
20 |
82.5% |
|
@@ -1,9 +1,9 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package favoriteservice import ( server "github.com/cloudwego/kitex/server" - favorite "toktik/kitex_gen/douyin/favorite" + favorite "simpledouyin/kitex_gen/douyin/favorite" ) // NewServer creates a server.Server with the given handler and options. @@ -18,3 +18,7 @@ } return svr } + +func RegisterService(svr server.Server, handler favorite.FavoriteService, opts ...server.RegisterOption) error { + return svr.RegisterService(serviceInfo(), handler, opts...) +} |
kitex_gen/douyin/feed/feed.pb.fast.go
View Diff
|
774 |
774 |
100.0% |
|
@@ -5,7 +5,7 @@ import ( fmt "fmt" fastpb "github.com/cloudwego/fastpb" - user "toktik/kitex_gen/douyin/user" + user "simpledouyin/kitex_gen/douyin/user" ) var ( |
kitex_gen/douyin/feed/feed.pb.go
View Diff
|
580 |
548 |
93.4% |
|
@@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.12 +// protoc-gen-go v1.33.0 +// protoc v5.26.1 // source: feed.proto package feed @@ -11,8 +11,8 @@ protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" + user "simpledouyin/kitex_gen/douyin/user" sync "sync" - user "toktik/kitex_gen/douyin/user" ) const ( @@ -372,73 +372,76 @@ var File_feed_proto protoreflect.FileDescriptor var file_feed_proto_rawDesc = []byte{ - 0x0a, 0x0a, 0x66, 0x65, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x64, 0x6f, - 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x66, 0x65, 0x65, 0x64, 0x1a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfd, 0x01, 0x0a, 0x05, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x29, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x11, 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x6c, - 0x61, 0x79, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x6c, - 0x61, 0x79, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x75, - 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x55, - 0x72, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x66, 0x61, 0x76, 0x6f, - 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, - 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x74, 0x69, 0x74, 0x6c, 0x65, 0x22, 0x74, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x65, 0x65, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0b, 0x6c, 0x61, 0x74, 0x65, - 0x73, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, - 0x0a, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1e, - 0x0a, 0x08, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, - 0x48, 0x01, 0x52, 0x07, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0e, - 0x0a, 0x0c, 0x5f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x0b, - 0x0a, 0x09, 0x5f, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x22, 0xc9, 0x01, 0x0a, 0x10, - 0x4c, 0x69, 0x73, 0x74, 0x46, 0x65, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, - 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, - 0x73, 0x67, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, 0x09, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x08, 0x6e, 0x65, 0x78, 0x74, - 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x31, 0x0a, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, - 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x6f, - 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x66, 0x65, 0x65, 0x64, 0x2e, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x52, - 0x09, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x6e, 0x65, - 0x78, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x4c, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x56, 0x69, 0x64, 0x65, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, - 0x08, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x07, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x69, 0x64, 0x65, - 0x6f, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x08, 0x76, 0x69, 0x64, - 0x65, 0x6f, 0x49, 0x64, 0x73, 0x22, 0x9c, 0x01, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, - 0x69, 0x64, 0x65, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, - 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x22, - 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x73, 0x67, 0x88, - 0x01, 0x01, 0x12, 0x31, 0x0a, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x5f, 0x6c, 0x69, 0x73, 0x74, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, - 0x66, 0x65, 0x65, 0x64, 0x2e, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x52, 0x09, 0x76, 0x69, 0x64, 0x65, - 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x5f, 0x6d, 0x73, 0x67, 0x32, 0xaa, 0x01, 0x0a, 0x0b, 0x46, 0x65, 0x65, 0x64, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x64, 0x65, - 0x6f, 0x73, 0x12, 0x1c, 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x66, 0x65, 0x65, 0x64, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x65, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1d, 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x66, 0x65, 0x65, 0x64, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x46, 0x65, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x50, 0x0a, 0x0b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x73, 0x12, 0x1f, - 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x66, 0x65, 0x65, 0x64, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x20, 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x66, 0x65, 0x65, 0x64, 0x2e, 0x51, 0x75, + 0x0a, 0x0a, 0x66, 0x65, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x73, 0x69, + 0x6d, 0x70, 0x6c, 0x65, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x66, 0x65, 0x65, 0x64, 0x1a, + 0x0a, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x83, 0x02, 0x0a, 0x05, + 0x56, 0x69, 0x64, 0x65, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2f, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x64, 0x6f, + 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x06, + 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x75, + 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x55, 0x72, + 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x25, |
kitex_gen/douyin/feed/feedservice/client.go
View Diff
|
55 |
55 |
99.6% |
|
@@ -1,4 +1,4 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package feedservice @@ -6,7 +6,7 @@ "context" client "github.com/cloudwego/kitex/client" callopt "github.com/cloudwego/kitex/client/callopt" - feed "toktik/kitex_gen/douyin/feed" + feed "simpledouyin/kitex_gen/douyin/feed" ) // Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework. |
kitex_gen/douyin/feed/feedservice/feedservice.go
View Diff
|
432 |
349 |
80.6% |
|
@@ -1,39 +1,95 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package feedservice import ( "context" - "fmt" + "errors" client "github.com/cloudwego/kitex/client" kitex "github.com/cloudwego/kitex/pkg/serviceinfo" streaming "github.com/cloudwego/kitex/pkg/streaming" proto "google.golang.org/protobuf/proto" - feed "toktik/kitex_gen/douyin/feed" + feed "simpledouyin/kitex_gen/douyin/feed" ) +var errInvalidMessageType = errors.New("invalid message type for service method handler") + +var serviceMethods = map[string]kitex.MethodInfo{ + "ListVideos": kitex.NewMethodInfo( + listVideosHandler, + newListVideosArgs, + newListVideosResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), + "QueryVideos": kitex.NewMethodInfo( + queryVideosHandler, + newQueryVideosArgs, + newQueryVideosResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), +} + +var ( + feedServiceServiceInfo = NewServiceInfo() + feedServiceServiceInfoForClient = NewServiceInfoForClient() + feedServiceServiceInfoForStreamClient = NewServiceInfoForStreamClient() +) + +// for server func serviceInfo() *kitex.ServiceInfo { return feedServiceServiceInfo } -var feedServiceServiceInfo = NewServiceInfo() - +// for stream client +func serviceInfoForStreamClient() *kitex.ServiceInfo { + return feedServiceServiceInfoForStreamClient +} + +// for client +func serviceInfoForClient() *kitex.ServiceInfo { + return feedServiceServiceInfoForClient +} + +// NewServiceInfo creates a new ServiceInfo containing all methods func NewServiceInfo() *kitex.ServiceInfo { + return newServiceInfo(false, true, true) +} + +// NewServiceInfo creates a new ServiceInfo containing non-streaming methods +func NewServiceInfoForClient() *kitex.ServiceInfo { + return newServiceInfo(false, false, true) +} +func NewServiceInfoForStreamClient() *kitex.ServiceInfo { + return newServiceInfo(true, true, false) +} + +func newServiceInfo(hasStreaming bool, keepStreamingMethods bool, keepNonStreamingMethods bool) *kitex.ServiceInfo { serviceName := "FeedService" handlerType := (*feed.FeedService)(nil) - methods := map[string]kitex.MethodInfo{ - "ListVideos": kitex.NewMethodInfo(listVideosHandler, newListVideosArgs, newListVideosResult, false), - "QueryVideos": kitex.NewMethodInfo(queryVideosHandler, newQueryVideosArgs, newQueryVideosResult, false), + methods := map[string]kitex.MethodInfo{} + for name, m := range serviceMethods { + if m.IsStreaming() && !keepStreamingMethods { + continue + } + if !m.IsStreaming() && !keepNonStreamingMethods { + continue + } + methods[name] = m } extra := map[string]interface{}{ - "PackageName": "douyin.feed", + "PackageName": "simpledouyin.feed", + } + if hasStreaming { + extra["streaming"] = hasStreaming } svcInfo := &kitex.ServiceInfo{ ServiceName: serviceName, |
kitex_gen/douyin/feed/feedservice/server.go
View Diff
|
24 |
20 |
82.3% |
|
@@ -1,9 +1,9 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package feedservice import ( server "github.com/cloudwego/kitex/server" - feed "toktik/kitex_gen/douyin/feed" + feed "simpledouyin/kitex_gen/douyin/feed" ) // NewServer creates a server.Server with the given handler and options. @@ -18,3 +18,7 @@ } return svr } + +func RegisterService(svr server.Server, handler feed.FeedService, opts ...server.RegisterOption) error { + return svr.RegisterService(serviceInfo(), handler, opts...) +} |
kitex_gen/douyin/publish/publish.pb.fast.go
View Diff
|
625 |
625 |
99.7% |
|
@@ -5,7 +5,7 @@ import ( fmt "fmt" fastpb "github.com/cloudwego/fastpb" - feed "toktik/kitex_gen/douyin/feed" + feed "simpledouyin/kitex_gen/douyin/feed" ) var ( @@ -264,7 +264,7 @@ if x.ActorId == 0 { return offset } - offset += fastpb.WriteUint32(buf[offset:], 1, x.ActorId) + offset += fastpb.WriteUint32(buf[offset:], 1, x.GetActorId()) return offset } @@ -272,7 +272,7 @@ if len(x.Data) == 0 { return offset } - offset += fastpb.WriteBytes(buf[offset:], 2, x.Data) + offset += fastpb.WriteBytes(buf[offset:], 2, x.GetData()) return offset } @@ -280,7 +280,7 @@ if x.Title == "" { return offset } - offset += fastpb.WriteString(buf[offset:], 3, x.Title) + offset += fastpb.WriteString(buf[offset:], 3, x.GetTitle()) return offset } @@ -297,7 +297,7 @@ if x.StatusCode == 0 { return offset } - offset += fastpb.WriteUint32(buf[offset:], 1, x.StatusCode) + offset += fastpb.WriteUint32(buf[offset:], 1, x.GetStatusCode()) return offset } @@ -305,7 +305,7 @@ if x.StatusMsg == "" { return offset } - offset += fastpb.WriteString(buf[offset:], 2, x.StatusMsg) + offset += fastpb.WriteString(buf[offset:], 2, x.GetStatusMsg()) return offset } @@ -322,7 +322,7 @@ if x.UserId == 0 { return offset } - offset += fastpb.WriteUint32(buf[offset:], 1, x.UserId) + offset += fastpb.WriteUint32(buf[offset:], 1, x.GetUserId()) return offset } @@ -330,7 +330,7 @@ if x.ActorId == 0 { return offset } - offset += fastpb.WriteUint32(buf[offset:], 2, x.ActorId) + offset += fastpb.WriteUint32(buf[offset:], 2, x.GetActorId()) return offset } @@ -348,7 +348,7 @@ if x.StatusCode == 0 { return offset } - offset += fastpb.WriteUint32(buf[offset:], 1, x.StatusCode) + offset += fastpb.WriteUint32(buf[offset:], 1, x.GetStatusCode()) return offset } @@ -356,7 +356,7 @@ if x.StatusMsg == nil { return offset } - offset += fastpb.WriteString(buf[offset:], 2, *x.StatusMsg) + offset += fastpb.WriteString(buf[offset:], 2, x.GetStatusMsg()) return offset } @@ -364,8 +364,8 @@ if x.VideoList == nil { return offset } - for i := range x.VideoList { - offset += fastpb.WriteMessage(buf[offset:], 3, x.VideoList[i]) + for i := range x.GetVideoList() { + offset += fastpb.WriteMessage(buf[offset:], 3, x.GetVideoList()[i]) |
kitex_gen/douyin/publish/publish.pb.go
View Diff
|
585 |
552 |
93.5% |
|
@@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v4.22.0 +// protoc-gen-go v1.33.0 +// protoc v5.26.1 // source: publish.proto package publish @@ -11,8 +11,8 @@ protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" + feed "simpledouyin/kitex_gen/douyin/feed" sync "sync" - feed "toktik/kitex_gen/douyin/feed" ) const ( @@ -372,65 +372,68 @@ var file_publish_proto_rawDesc = []byte{ 0x0a, 0x0d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x0e, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x1a, - 0x0a, 0x66, 0x65, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x59, 0x0a, 0x12, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x07, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, - 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x22, 0x57, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x56, 0x69, 0x64, 0x65, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, - 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x12, - 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x22, - 0x46, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, - 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, - 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x9a, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, - 0x56, 0x69, 0x64, 0x65, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, - 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x22, - 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x73, 0x67, 0x88, - 0x01, 0x01, 0x12, 0x31, 0x0a, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x5f, 0x6c, 0x69, 0x73, 0x74, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, - 0x66, 0x65, 0x65, 0x64, 0x2e, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x52, 0x09, 0x76, 0x69, 0x64, 0x65, - 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x5f, 0x6d, 0x73, 0x67, 0x22, 0x2c, 0x0a, 0x11, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x69, 0x64, + 0x14, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x73, 0x68, 0x1a, 0x0a, 0x66, 0x65, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x59, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x69, 0x64, 0x65, 0x6f, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x63, 0x74, 0x6f, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x61, 0x63, 0x74, 0x6f, 0x72, + 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x22, 0x57, 0x0a, 0x13, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, + 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x22, 0x46, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, - 0x49, 0x64, 0x22, 0x7e, 0x0a, 0x12, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x69, 0x64, 0x65, 0x6f, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, - 0x09, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x73, 0x67, 0x88, 0x01, 0x01, 0x12, 0x14, 0x0a, - 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, - 0x73, 0x67, 0x32, 0x95, 0x02, 0x0a, 0x0e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x58, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, - 0x69, 0x64, 0x65, 0x6f, 0x12, 0x22, 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x69, 0x64, 0x65, - 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, - 0x6e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x56, 0x69, 0x64, 0x65, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x52, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x12, 0x20, 0x2e, 0x64, - 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, - 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x0a, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x69, 0x64, 0x65, - 0x6f, 0x12, 0x21, 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x73, 0x68, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x70, 0x75, + 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0xa0, 0x01, + 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x43, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, |
kitex_gen/douyin/publish/publishservice/client.go
View Diff
|
61 |
61 |
99.7% |
|
@@ -1,4 +1,4 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package publishservice @@ -6,7 +6,7 @@ "context" client "github.com/cloudwego/kitex/client" callopt "github.com/cloudwego/kitex/client/callopt" - publish "toktik/kitex_gen/douyin/publish" + publish "simpledouyin/kitex_gen/douyin/publish" ) // Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework. |
kitex_gen/douyin/publish/publishservice/publishservice.go
View Diff
|
602 |
500 |
83.0% |
|
@@ -1,40 +1,102 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package publishservice import ( "context" - "fmt" + "errors" client "github.com/cloudwego/kitex/client" kitex "github.com/cloudwego/kitex/pkg/serviceinfo" streaming "github.com/cloudwego/kitex/pkg/streaming" proto "google.golang.org/protobuf/proto" - publish "toktik/kitex_gen/douyin/publish" + publish "simpledouyin/kitex_gen/douyin/publish" ) +var errInvalidMessageType = errors.New("invalid message type for service method handler") + +var serviceMethods = map[string]kitex.MethodInfo{ + "CreateVideo": kitex.NewMethodInfo( + createVideoHandler, + newCreateVideoArgs, + newCreateVideoResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), + "ListVideo": kitex.NewMethodInfo( + listVideoHandler, + newListVideoArgs, + newListVideoResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), + "CountVideo": kitex.NewMethodInfo( + countVideoHandler, + newCountVideoArgs, + newCountVideoResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), +} + +var ( + publishServiceServiceInfo = NewServiceInfo() + publishServiceServiceInfoForClient = NewServiceInfoForClient() + publishServiceServiceInfoForStreamClient = NewServiceInfoForStreamClient() +) + +// for server func serviceInfo() *kitex.ServiceInfo { return publishServiceServiceInfo } -var publishServiceServiceInfo = NewServiceInfo() - +// for stream client +func serviceInfoForStreamClient() *kitex.ServiceInfo { + return publishServiceServiceInfoForStreamClient +} + +// for client +func serviceInfoForClient() *kitex.ServiceInfo { + return publishServiceServiceInfoForClient +} + +// NewServiceInfo creates a new ServiceInfo containing all methods func NewServiceInfo() *kitex.ServiceInfo { + return newServiceInfo(false, true, true) +} + +// NewServiceInfo creates a new ServiceInfo containing non-streaming methods +func NewServiceInfoForClient() *kitex.ServiceInfo { + return newServiceInfo(false, false, true) +} +func NewServiceInfoForStreamClient() *kitex.ServiceInfo { + return newServiceInfo(true, true, false) +} + +func newServiceInfo(hasStreaming bool, keepStreamingMethods bool, keepNonStreamingMethods bool) *kitex.ServiceInfo { serviceName := "PublishService" handlerType := (*publish.PublishService)(nil) - methods := map[string]kitex.MethodInfo{ - "CreateVideo": kitex.NewMethodInfo(createVideoHandler, newCreateVideoArgs, newCreateVideoResult, false), - "ListVideo": kitex.NewMethodInfo(listVideoHandler, newListVideoArgs, newListVideoResult, false), - "CountVideo": kitex.NewMethodInfo(countVideoHandler, newCountVideoArgs, newCountVideoResult, false), + methods := map[string]kitex.MethodInfo{} + for name, m := range serviceMethods { + if m.IsStreaming() && !keepStreamingMethods { + continue + } + if !m.IsStreaming() && !keepNonStreamingMethods { + continue + } + methods[name] = m } extra := map[string]interface{}{ |
kitex_gen/douyin/publish/publishservice/server.go
View Diff
|
24 |
20 |
82.5% |
|
@@ -1,9 +1,9 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package publishservice import ( server "github.com/cloudwego/kitex/server" - publish "toktik/kitex_gen/douyin/publish" + publish "simpledouyin/kitex_gen/douyin/publish" ) // NewServer creates a server.Server with the given handler and options. @@ -18,3 +18,7 @@ } return svr } + +func RegisterService(svr server.Server, handler publish.PublishService, opts ...server.RegisterOption) error { + return svr.RegisterService(serviceInfo(), handler, opts...) +} |
kitex_gen/douyin/relation/relation.pb.fast.go
View Diff
|
1,361 |
1,361 |
99.7% |
|
@@ -5,7 +5,7 @@ import ( fmt "fmt" fastpb "github.com/cloudwego/fastpb" - user "toktik/kitex_gen/douyin/user" + user "simpledouyin/kitex_gen/douyin/user" ) var ( @@ -551,7 +551,7 @@ if x.ActorId == 0 { return offset } - offset += fastpb.WriteUint32(buf[offset:], 1, x.ActorId) + offset += fastpb.WriteUint32(buf[offset:], 1, x.GetActorId()) return offset } @@ -559,7 +559,7 @@ if x.UserId == 0 { return offset } - offset += fastpb.WriteUint32(buf[offset:], 2, x.UserId) + offset += fastpb.WriteUint32(buf[offset:], 2, x.GetUserId()) return offset } @@ -576,7 +576,7 @@ if x.StatusCode == 0 { return offset } - offset += fastpb.WriteUint32(buf[offset:], 1, x.StatusCode) + offset += fastpb.WriteUint32(buf[offset:], 1, x.GetStatusCode()) return offset } @@ -584,7 +584,7 @@ if x.StatusMsg == "" { return offset } - offset += fastpb.WriteString(buf[offset:], 2, x.StatusMsg) + offset += fastpb.WriteString(buf[offset:], 2, x.GetStatusMsg()) return offset } @@ -601,7 +601,7 @@ if x.ActorId == 0 { return offset } - offset += fastpb.WriteUint32(buf[offset:], 1, x.ActorId) + offset += fastpb.WriteUint32(buf[offset:], 1, x.GetActorId()) return offset } @@ -609,7 +609,7 @@ if x.UserId == 0 { return offset } - offset += fastpb.WriteUint32(buf[offset:], 2, x.UserId) + offset += fastpb.WriteUint32(buf[offset:], 2, x.GetUserId()) return offset } @@ -627,7 +627,7 @@ if x.StatusCode == 0 { return offset } - offset += fastpb.WriteInt32(buf[offset:], 1, x.StatusCode) + offset += fastpb.WriteInt32(buf[offset:], 1, x.GetStatusCode()) return offset } @@ -635,7 +635,7 @@ if x.StatusMsg == "" { return offset } - offset += fastpb.WriteString(buf[offset:], 2, x.StatusMsg) + offset += fastpb.WriteString(buf[offset:], 2, x.GetStatusMsg()) return offset } @@ -643,8 +643,8 @@ if x.UserList == nil { return offset } - for i := range x.UserList { - offset += fastpb.WriteMessage(buf[offset:], 3, x.UserList[i]) + for i := range x.GetUserList() { + offset += fastpb.WriteMessage(buf[offset:], 3, x.GetUserList()[i]) } return offset } @@ -661,7 +661,7 @@ if x.UserId == 0 { return offset } - offset += fastpb.WriteUint32(buf[offset:], 1, x.UserId) + offset += fastpb.WriteUint32(buf[offset:], 1, x.GetUserId()) |
kitex_gen/douyin/relation/relation.pb.go
View Diff
|
1,217 |
1,173 |
95.4% |
|
@@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v4.22.0 +// protoc-gen-go v1.33.0 +// protoc v5.26.1 // source: relation.proto package relation @@ -11,8 +11,8 @@ protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" + user "simpledouyin/kitex_gen/douyin/user" sync "sync" - user "toktik/kitex_gen/douyin/user" ) const ( @@ -812,134 +812,141 @@ var file_relation_proto_rawDesc = []byte{ 0x0a, 0x0e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x0b, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x0a, 0x75, - 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4b, 0x0a, 0x15, 0x52, 0x65, 0x6c, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x17, 0x0a, - 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, - 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x58, 0x0a, 0x16, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, - 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x73, 0x67, - 0x22, 0x47, 0x0a, 0x11, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, - 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x84, 0x01, 0x0a, 0x12, 0x46, 0x6f, - 0x6c, 0x6c, 0x6f, 0x77, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, - 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x73, 0x67, - 0x12, 0x2e, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x75, 0x73, 0x65, - 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, - 0x22, 0x31, 0x0a, 0x16, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, - 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x75, 0x73, 0x65, - 0x72, 0x49, 0x64, 0x22, 0x6f, 0x0a, 0x17, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x46, 0x6f, 0x6c, 0x6c, - 0x6f, 0x77, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, - 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, - 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x73, 0x67, 0x12, 0x14, - 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x49, 0x0a, 0x13, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, + 0x12, 0x11, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x1a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x4b, 0x0a, 0x15, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x63, 0x74, 0x6f, + 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x61, 0x63, 0x74, 0x6f, + 0x72, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x58, 0x0a, 0x16, + 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x4d, 0x73, 0x67, 0x22, 0x47, 0x0a, 0x11, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, - 0x86, 0x01, 0x0a, 0x14, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x73, 0x67, 0x12, 0x2e, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, - 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, 0x6f, - 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x08, - 0x75, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x33, 0x0a, 0x18, 0x43, 0x6f, 0x75, 0x6e, - 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x71, 0x0a, - 0x19, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69, + 0x8a, 0x01, 0x0a, 0x12, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x4d, 0x73, 0x67, 0x12, 0x34, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, + 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x69, 0x6d, 0x70, + 0x6c, 0x65, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x73, |
kitex_gen/douyin/relation/relationservice/client.go
View Diff
|
91 |
91 |
99.8% |
|
@@ -1,4 +1,4 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package relationservice @@ -6,7 +6,7 @@ "context" client "github.com/cloudwego/kitex/client" callopt "github.com/cloudwego/kitex/client/callopt" - relation "toktik/kitex_gen/douyin/relation" + relation "simpledouyin/kitex_gen/douyin/relation" ) // Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework. |
kitex_gen/douyin/relation/relationservice/relationservice.go
View Diff
|
1,452 |
1,255 |
86.4% |
|
@@ -1,45 +1,137 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package relationservice import ( "context" - "fmt" + "errors" client "github.com/cloudwego/kitex/client" kitex "github.com/cloudwego/kitex/pkg/serviceinfo" streaming "github.com/cloudwego/kitex/pkg/streaming" proto "google.golang.org/protobuf/proto" - relation "toktik/kitex_gen/douyin/relation" + relation "simpledouyin/kitex_gen/douyin/relation" ) +var errInvalidMessageType = errors.New("invalid message type for service method handler") + +var serviceMethods = map[string]kitex.MethodInfo{ + "Follow": kitex.NewMethodInfo( + followHandler, + newFollowArgs, + newFollowResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), + "Unfollow": kitex.NewMethodInfo( + unfollowHandler, + newUnfollowArgs, + newUnfollowResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), + "GetFollowList": kitex.NewMethodInfo( + getFollowListHandler, + newGetFollowListArgs, + newGetFollowListResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), + "CountFollowList": kitex.NewMethodInfo( + countFollowListHandler, + newCountFollowListArgs, + newCountFollowListResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), + "GetFollowerList": kitex.NewMethodInfo( + getFollowerListHandler, + newGetFollowerListArgs, + newGetFollowerListResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), + "CountFollowerList": kitex.NewMethodInfo( + countFollowerListHandler, + newCountFollowerListArgs, + newCountFollowerListResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), + "GetFriendList": kitex.NewMethodInfo( + getFriendListHandler, + newGetFriendListArgs, + newGetFriendListResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), + "IsFollow": kitex.NewMethodInfo( + isFollowHandler, + newIsFollowArgs, + newIsFollowResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), +} + +var ( + relationServiceServiceInfo = NewServiceInfo() + relationServiceServiceInfoForClient = NewServiceInfoForClient() + relationServiceServiceInfoForStreamClient = NewServiceInfoForStreamClient() +) + +// for server func serviceInfo() *kitex.ServiceInfo { return relationServiceServiceInfo } -var relationServiceServiceInfo = NewServiceInfo() - +// for stream client +func serviceInfoForStreamClient() *kitex.ServiceInfo { + return relationServiceServiceInfoForStreamClient +} + +// for client |
kitex_gen/douyin/relation/relationservice/server.go
View Diff
|
24 |
20 |
82.5% |
|
@@ -1,9 +1,9 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package relationservice import ( server "github.com/cloudwego/kitex/server" - relation "toktik/kitex_gen/douyin/relation" + relation "simpledouyin/kitex_gen/douyin/relation" ) // NewServer creates a server.Server with the given handler and options. @@ -18,3 +18,7 @@ } return svr } + +func RegisterService(svr server.Server, handler relation.RelationService, opts ...server.RegisterOption) error { + return svr.RegisterService(serviceInfo(), handler, opts...) +} |
kitex_gen/douyin/user/user.pb.fast.go
|
585 |
585 |
100.0% |
|
kitex_gen/douyin/user/user.pb.go
View Diff
|
429 |
393 |
90.7% |
|
@@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.12 +// protoc-gen-go v1.33.0 +// protoc v5.26.1 // source: user.proto package user @@ -269,59 +269,61 @@ var File_user_proto protoreflect.FileDescriptor var file_user_proto_rawDesc = []byte{ - 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x64, 0x6f, - 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x22, 0x41, 0x0a, 0x0b, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, - 0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x07, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x89, 0x01, 0x0a, - 0x0c, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, - 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x22, - 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x73, 0x67, 0x88, - 0x01, 0x01, 0x12, 0x25, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x11, 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x22, 0xe3, 0x03, 0x0a, 0x04, 0x55, 0x73, 0x65, - 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x66, 0x6f, 0x6c, - 0x6c, 0x6f, 0x77, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x6f, 0x6c, 0x6c, - 0x6f, 0x77, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x0d, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x1b, 0x0a, 0x06, - 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, - 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x88, 0x01, 0x01, 0x12, 0x2e, 0x0a, 0x10, 0x62, 0x61, 0x63, - 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x0f, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, - 0x64, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x09, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x88, 0x01, 0x01, 0x12, 0x2c, 0x0a, 0x0f, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x64, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x03, 0x52, 0x0e, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x46, 0x61, - 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x64, 0x88, 0x01, 0x01, 0x12, 0x22, 0x0a, 0x0a, 0x77, 0x6f, - 0x72, 0x6b, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x04, - 0x52, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x2a, - 0x0a, 0x0e, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x05, 0x52, 0x0d, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, - 0x74, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x61, - 0x76, 0x61, 0x74, 0x61, 0x72, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, - 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x5f, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x64, 0x42, 0x0d, 0x0a, 0x0b, - 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x11, 0x0a, 0x0f, 0x5f, - 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0x4f, - 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x40, 0x0a, - 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, - 0x6e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x75, 0x73, 0x65, 0x72, - 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, - 0x1e, 0x5a, 0x1c, 0x74, 0x6f, 0x6b, 0x74, 0x69, 0x6b, 0x2f, 0x6b, 0x69, 0x74, 0x65, 0x78, 0x5f, - 0x67, 0x65, 0x6e, 0x2f, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x73, 0x69, + 0x6d, 0x70, 0x6c, 0x65, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x22, + 0x41, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, + 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x63, 0x74, 0x6f, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x61, 0x63, 0x74, 0x6f, 0x72, + 0x49, 0x64, 0x22, 0x8f, 0x01, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x43, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, + 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x4d, 0x73, 0x67, 0x88, 0x01, 0x01, 0x12, 0x2b, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x64, + 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x04, 0x75, 0x73, 0x65, 0x72, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x5f, 0x6d, 0x73, 0x67, 0x22, 0xe3, 0x03, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, + 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x66, 0x6f, + 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x69, + 0x73, 0x5f, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, + 0x69, 0x73, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x1b, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, + 0x61, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, + 0x61, 0x72, 0x88, 0x01, 0x01, 0x12, 0x2e, 0x0a, 0x10, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, + 0x75, 0x6e, 0x64, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x01, 0x52, 0x0f, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x49, 0x6d, 0x61, + 0x67, 0x65, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, |
kitex_gen/douyin/user/userservice/client.go
View Diff
|
49 |
49 |
99.5% |
|
@@ -1,4 +1,4 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package userservice @@ -6,7 +6,7 @@ "context" client "github.com/cloudwego/kitex/client" callopt "github.com/cloudwego/kitex/client/callopt" - user "toktik/kitex_gen/douyin/user" + user "simpledouyin/kitex_gen/douyin/user" ) // Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework. |
kitex_gen/douyin/user/userservice/server.go
View Diff
|
24 |
20 |
82.3% |
|
@@ -1,9 +1,9 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package userservice import ( server "github.com/cloudwego/kitex/server" - user "toktik/kitex_gen/douyin/user" + user "simpledouyin/kitex_gen/douyin/user" ) // NewServer creates a server.Server with the given handler and options. @@ -18,3 +18,7 @@ } return svr } + +func RegisterService(svr server.Server, handler user.UserService, opts ...server.RegisterOption) error { + return svr.RegisterService(serviceInfo(), handler, opts...) +} |
kitex_gen/douyin/user/userservice/userservice.go
View Diff
|
262 |
198 |
75.3% |
|
@@ -1,38 +1,88 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package userservice import ( "context" - "fmt" + "errors" client "github.com/cloudwego/kitex/client" kitex "github.com/cloudwego/kitex/pkg/serviceinfo" streaming "github.com/cloudwego/kitex/pkg/streaming" proto "google.golang.org/protobuf/proto" - user "toktik/kitex_gen/douyin/user" + user "simpledouyin/kitex_gen/douyin/user" ) +var errInvalidMessageType = errors.New("invalid message type for service method handler") + +var serviceMethods = map[string]kitex.MethodInfo{ + "GetUser": kitex.NewMethodInfo( + getUserHandler, + newGetUserArgs, + newGetUserResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), +} + +var ( + userServiceServiceInfo = NewServiceInfo() + userServiceServiceInfoForClient = NewServiceInfoForClient() + userServiceServiceInfoForStreamClient = NewServiceInfoForStreamClient() +) + +// for server func serviceInfo() *kitex.ServiceInfo { return userServiceServiceInfo } -var userServiceServiceInfo = NewServiceInfo() - +// for stream client +func serviceInfoForStreamClient() *kitex.ServiceInfo { + return userServiceServiceInfoForStreamClient +} + +// for client +func serviceInfoForClient() *kitex.ServiceInfo { + return userServiceServiceInfoForClient +} + +// NewServiceInfo creates a new ServiceInfo containing all methods func NewServiceInfo() *kitex.ServiceInfo { + return newServiceInfo(false, true, true) +} + +// NewServiceInfo creates a new ServiceInfo containing non-streaming methods +func NewServiceInfoForClient() *kitex.ServiceInfo { + return newServiceInfo(false, false, true) +} +func NewServiceInfoForStreamClient() *kitex.ServiceInfo { + return newServiceInfo(true, true, false) +} + +func newServiceInfo(hasStreaming bool, keepStreamingMethods bool, keepNonStreamingMethods bool) *kitex.ServiceInfo { serviceName := "UserService" handlerType := (*user.UserService)(nil) - methods := map[string]kitex.MethodInfo{ - "GetUser": kitex.NewMethodInfo(getUserHandler, newGetUserArgs, newGetUserResult, false), + methods := map[string]kitex.MethodInfo{} + for name, m := range serviceMethods { + if m.IsStreaming() && !keepStreamingMethods { + continue + } + if !m.IsStreaming() && !keepNonStreamingMethods { + continue + } + methods[name] = m } extra := map[string]interface{}{ - "PackageName": "douyin.user", + "PackageName": "simpledouyin.user", + } + if hasStreaming { + extra["streaming"] = hasStreaming } svcInfo := &kitex.ServiceInfo{ ServiceName: serviceName, HandlerType: handlerType, Methods: methods, PayloadCodec: kitex.Protobuf, - KiteXGenVersion: "v0.4.4", + KiteXGenVersion: "v0.12.1", Extra: extra, } return svcInfo |
kitex_gen/douyin/wechat/wechat.pb.fast.go
View Diff
|
677 |
677 |
99.7% |
|
@@ -278,7 +278,7 @@ if x.SenderId == 0 { return offset } - offset += fastpb.WriteUint32(buf[offset:], 1, x.SenderId) + offset += fastpb.WriteUint32(buf[offset:], 1, x.GetSenderId()) return offset } @@ -286,7 +286,7 @@ if x.ReceiverId == 0 { return offset } - offset += fastpb.WriteUint32(buf[offset:], 2, x.ReceiverId) + offset += fastpb.WriteUint32(buf[offset:], 2, x.GetReceiverId()) return offset } @@ -294,7 +294,7 @@ if x.PreMsgTime == 0 { return offset } - offset += fastpb.WriteInt64(buf[offset:], 6, x.PreMsgTime) + offset += fastpb.WriteInt64(buf[offset:], 6, x.GetPreMsgTime()) return offset } @@ -314,7 +314,7 @@ if x.Id == 0 { return offset } - offset += fastpb.WriteUint32(buf[offset:], 1, x.Id) + offset += fastpb.WriteUint32(buf[offset:], 1, x.GetId()) return offset } @@ -322,7 +322,7 @@ if x.Content == "" { return offset } - offset += fastpb.WriteString(buf[offset:], 2, x.Content) + offset += fastpb.WriteString(buf[offset:], 2, x.GetContent()) return offset } @@ -330,7 +330,7 @@ if x.CreateTime == 0 { return offset } - offset += fastpb.WriteInt64(buf[offset:], 3, x.CreateTime) + offset += fastpb.WriteInt64(buf[offset:], 3, x.GetCreateTime()) return offset } @@ -338,7 +338,7 @@ if x.FromUserId == nil { return offset } - offset += fastpb.WriteUint32(buf[offset:], 4, *x.FromUserId) + offset += fastpb.WriteUint32(buf[offset:], 4, x.GetFromUserId()) return offset } @@ -346,7 +346,7 @@ if x.ToUserId == nil { return offset } - offset += fastpb.WriteUint32(buf[offset:], 5, *x.ToUserId) + offset += fastpb.WriteUint32(buf[offset:], 5, x.GetToUserId()) return offset } @@ -364,7 +364,7 @@ if x.StatusCode == 0 { return offset } - offset += fastpb.WriteUint32(buf[offset:], 1, x.StatusCode) + offset += fastpb.WriteUint32(buf[offset:], 1, x.GetStatusCode()) return offset } @@ -372,7 +372,7 @@ if x.StatusMsg == "" { return offset } - offset += fastpb.WriteString(buf[offset:], 2, x.StatusMsg) + offset += fastpb.WriteString(buf[offset:], 2, x.GetStatusMsg()) return offset } @@ -380,8 +380,8 @@ if x.MessageList == nil { return offset } - for i := range x.MessageList { - offset += fastpb.WriteMessage(buf[offset:], 3, x.MessageList[i]) + for i := range x.GetMessageList() { + offset += fastpb.WriteMessage(buf[offset:], 3, x.GetMessageList()[i]) |
kitex_gen/douyin/wechat/wechat.pb.go
View Diff
|
551 |
517 |
93.1% |
|
@@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.12 +// protoc-gen-go v1.33.0 +// protoc v5.26.1 // source: wechat.proto package wechat @@ -355,67 +355,69 @@ var File_wechat_proto protoreflect.FileDescriptor var file_wechat_proto_rawDesc = []byte{ - 0x0a, 0x0c, 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, - 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x22, 0x74, 0x0a, - 0x12, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x68, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x49, 0x64, - 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x49, - 0x64, 0x12, 0x20, 0x0a, 0x0c, 0x70, 0x72, 0x65, 0x5f, 0x6d, 0x73, 0x67, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x4d, 0x73, 0x67, 0x54, - 0x69, 0x6d, 0x65, 0x22, 0xbe, 0x01, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0c, 0x66, 0x72, - 0x6f, 0x6d, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, - 0x48, 0x00, 0x52, 0x0a, 0x66, 0x72, 0x6f, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x88, 0x01, - 0x01, 0x12, 0x21, 0x0a, 0x0a, 0x74, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x01, 0x52, 0x08, 0x74, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x49, - 0x64, 0x88, 0x01, 0x01, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x75, 0x73, - 0x65, 0x72, 0x5f, 0x69, 0x64, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x74, 0x6f, 0x5f, 0x75, 0x73, 0x65, - 0x72, 0x5f, 0x69, 0x64, 0x22, 0x90, 0x01, 0x0a, 0x13, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x43, 0x68, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, - 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x73, 0x67, 0x12, 0x39, 0x0a, 0x0c, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x63, 0x68, - 0x61, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0b, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x8f, 0x01, 0x0a, 0x14, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, - 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x0a, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, - 0x0a, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x57, 0x0a, 0x15, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x0a, 0x0c, 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, + 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x63, + 0x68, 0x61, 0x74, 0x22, 0x74, 0x0a, 0x12, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x68, + 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x73, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x72, 0x65, 0x63, + 0x65, 0x69, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0c, 0x70, 0x72, 0x65, 0x5f, 0x6d, + 0x73, 0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x70, + 0x72, 0x65, 0x4d, 0x73, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xbe, 0x01, 0x0a, 0x07, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, + 0x1f, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, + 0x12, 0x25, 0x0a, 0x0c, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0a, 0x66, 0x72, 0x6f, 0x6d, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x0a, 0x74, 0x6f, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x01, 0x52, 0x08, 0x74, + 0x6f, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x66, + 0x72, 0x6f, 0x6d, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, + 0x74, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x22, 0x96, 0x01, 0x0a, 0x13, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x68, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, - 0x73, 0x67, 0x32, 0xc3, 0x01, 0x0a, 0x0d, 0x57, 0x65, 0x63, 0x68, 0x61, 0x74, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x55, 0x0a, 0x0a, 0x57, 0x65, 0x63, 0x68, 0x61, 0x74, 0x43, 0x68, - 0x61, 0x74, 0x12, 0x21, 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x63, 0x68, - 0x61, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x68, 0x61, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x77, - 0x65, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x68, 0x61, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x0c, 0x57, - 0x65, 0x63, 0x68, 0x61, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x2e, 0x64, 0x6f, - 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x24, 0x2e, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, - 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x20, 0x5a, 0x1e, 0x74, 0x6f, 0x6b, 0x74, - 0x69, 0x6b, 0x2f, 0x6b, 0x69, 0x74, 0x65, 0x78, 0x5f, 0x67, 0x65, 0x6e, 0x2f, 0x64, 0x6f, 0x75, - 0x79, 0x69, 0x6e, 0x2f, 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, |
kitex_gen/douyin/wechat/wechatservice/client.go
View Diff
|
55 |
55 |
99.6% |
|
@@ -1,4 +1,4 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package wechatservice @@ -6,7 +6,7 @@ "context" client "github.com/cloudwego/kitex/client" callopt "github.com/cloudwego/kitex/client/callopt" - wechat "toktik/kitex_gen/douyin/wechat" + wechat "simpledouyin/kitex_gen/douyin/wechat" ) // Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework. |
kitex_gen/douyin/wechat/wechatservice/server.go
View Diff
|
24 |
20 |
82.4% |
|
@@ -1,9 +1,9 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package wechatservice import ( server "github.com/cloudwego/kitex/server" - wechat "toktik/kitex_gen/douyin/wechat" + wechat "simpledouyin/kitex_gen/douyin/wechat" ) // NewServer creates a server.Server with the given handler and options. @@ -18,3 +18,7 @@ } return svr } + +func RegisterService(svr server.Server, handler wechat.WechatService, opts ...server.RegisterOption) error { + return svr.RegisterService(serviceInfo(), handler, opts...) +} |
kitex_gen/douyin/wechat/wechatservice/wechatservice.go
View Diff
|
432 |
349 |
80.6% |
|
@@ -1,39 +1,95 @@ -// Code generated by Kitex v0.4.4. DO NOT EDIT. +// Code generated by Kitex v0.12.1. DO NOT EDIT. package wechatservice import ( "context" - "fmt" + "errors" client "github.com/cloudwego/kitex/client" kitex "github.com/cloudwego/kitex/pkg/serviceinfo" streaming "github.com/cloudwego/kitex/pkg/streaming" proto "google.golang.org/protobuf/proto" - wechat "toktik/kitex_gen/douyin/wechat" + wechat "simpledouyin/kitex_gen/douyin/wechat" ) +var errInvalidMessageType = errors.New("invalid message type for service method handler") + +var serviceMethods = map[string]kitex.MethodInfo{ + "WechatChat": kitex.NewMethodInfo( + wechatChatHandler, + newWechatChatArgs, + newWechatChatResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), + "WechatAction": kitex.NewMethodInfo( + wechatActionHandler, + newWechatActionArgs, + newWechatActionResult, + false, + kitex.WithStreamingMode(kitex.StreamingUnary), + ), +} + +var ( + wechatServiceServiceInfo = NewServiceInfo() + wechatServiceServiceInfoForClient = NewServiceInfoForClient() + wechatServiceServiceInfoForStreamClient = NewServiceInfoForStreamClient() +) + +// for server func serviceInfo() *kitex.ServiceInfo { return wechatServiceServiceInfo } -var wechatServiceServiceInfo = NewServiceInfo() - +// for stream client +func serviceInfoForStreamClient() *kitex.ServiceInfo { + return wechatServiceServiceInfoForStreamClient +} + +// for client +func serviceInfoForClient() *kitex.ServiceInfo { + return wechatServiceServiceInfoForClient +} + +// NewServiceInfo creates a new ServiceInfo containing all methods func NewServiceInfo() *kitex.ServiceInfo { + return newServiceInfo(false, true, true) +} + +// NewServiceInfo creates a new ServiceInfo containing non-streaming methods +func NewServiceInfoForClient() *kitex.ServiceInfo { + return newServiceInfo(false, false, true) +} +func NewServiceInfoForStreamClient() *kitex.ServiceInfo { + return newServiceInfo(true, true, false) +} + +func newServiceInfo(hasStreaming bool, keepStreamingMethods bool, keepNonStreamingMethods bool) *kitex.ServiceInfo { serviceName := "WechatService" handlerType := (*wechat.WechatService)(nil) - methods := map[string]kitex.MethodInfo{ - "WechatChat": kitex.NewMethodInfo(wechatChatHandler, newWechatChatArgs, newWechatChatResult, false), - "WechatAction": kitex.NewMethodInfo(wechatActionHandler, newWechatActionArgs, newWechatActionResult, false), + methods := map[string]kitex.MethodInfo{} + for name, m := range serviceMethods { + if m.IsStreaming() && !keepStreamingMethods { + continue + } + if !m.IsStreaming() && !keepNonStreamingMethods { + continue + } + methods[name] = m } extra := map[string]interface{}{ - "PackageName": "douyin.wechat", + "PackageName": "simpledouyin.wechat", + } + if hasStreaming { + extra["streaming"] = hasStreaming } svcInfo := &kitex.ServiceInfo{ ServiceName: serviceName, |
logging/init.go
|
26 |
26 |
100.0% |
|
otel.yaml
View Diff
|
38 |
34 |
88.9% |
|
@@ -2,15 +2,16 @@ otlp: protocols: grpc: + endpoint: 127.0.0.1:4317 exporters: prometheusremotewrite: endpoint: "http://victoriametrics:8428/api/v1/write" - logging: + debug: - jaeger: - endpoint: jaeger-all-in-one:14250 + otlp: + endpoint: jaeger-all-in-one:4317 tls: insecure: true @@ -30,8 +31,8 @@ traces: receivers: [ otlp ] processors: [ batch ] - exporters: [ logging, jaeger ] + exporters: [ debug, otlp ] metrics: receivers: [ otlp ] processors: [ batch ] - exporters: [ logging, prometheusremotewrite ] + exporters: [ debug, prometheusremotewrite ] |
repo/comments.gen.go
View Diff
|
434 |
429 |
98.8% |
|
@@ -17,7 +17,7 @@ "gorm.io/plugin/dbresolver" - "toktik/repo/model" + "simpledouyin/repo/model" ) func newComment(db *gorm.DB, opts ...gen.DOOption) comment { @@ -243,10 +243,6 @@ return c.withDO(c.DO.Where(conds...)) } -func (c commentDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) ICommentDo { - return c.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) -} - func (c commentDo) Order(conds ...field.Expr) ICommentDo { return c.withDO(c.DO.Order(conds...)) } |
repo/favorites.gen.go
View Diff
|
404 |
399 |
98.8% |
|
@@ -16,7 +16,7 @@ "gorm.io/plugin/dbresolver" - "toktik/repo/model" + "simpledouyin/repo/model" ) func newFavorite(db *gorm.DB, opts ...gen.DOOption) favorite { @@ -213,10 +213,6 @@ return f.withDO(f.DO.Where(conds...)) } -func (f favoriteDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) IFavoriteDo { - return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) -} - func (f favoriteDo) Order(conds ...field.Expr) IFavoriteDo { return f.withDO(f.DO.Order(conds...)) } |
repo/gen.go
View Diff
|
143 |
138 |
96.4% |
|
@@ -117,10 +117,14 @@ } func (q *Query) Begin(opts ...*sql.TxOptions) *QueryTx { - return &QueryTx{q.clone(q.db.Begin(opts...))} + tx := q.db.Begin(opts...) + return &QueryTx{Query: q.clone(tx), Error: tx.Error} } -type QueryTx struct{ *Query } +type QueryTx struct { + *Query + Error error +} func (q *QueryTx) Commit() error { return q.db.Commit().Error |
repo/init.go
View Diff
|
41 |
38 |
92.3% |
|
@@ -1,14 +1,13 @@ package repo import ( - "time" - "toktik/constant/config" - - "gorm.io/driver/postgres" + "gorm.io/driver/mysql" "gorm.io/gorm" "gorm.io/gorm/logger" "gorm.io/plugin/opentelemetry/logging/logrus" "gorm.io/plugin/opentelemetry/tracing" + "simpledouyin/config" + "time" ) var DB *gorm.DB @@ -24,7 +23,7 @@ }, ) DB, err = gorm.Open( - postgres.Open(config.EnvConfig.GetDSN()), + mysql.Open(config.EnvConfig.GetDSN()), &gorm.Config{ PrepareStmt: true, Logger: gormlogrus, |
repo/migrate/migrate.go
View Diff
|
28 |
23 |
82.1% |
|
@@ -2,18 +2,18 @@ import ( "fmt" - "toktik/constant/config" - "toktik/repo/model" + "gorm.io/driver/mysql" + "simpledouyin/config" + "simpledouyin/repo/model" - "gorm.io/driver/postgres" "gorm.io/gorm" ) func main() { var err error db, err := gorm.Open( - postgres.New( - postgres.Config{ + mysql.New( + mysql.Config{ DSN: config.EnvConfig.GetDSN(), }), &gorm.Config{ DisableForeignKeyConstraintWhenMigrating: true, |
repo/model/comment.go
|
10 |
10 |
100.0% |
|
repo/model/favorite.go
|
8 |
8 |
100.0% |
|
repo/model/model.go
|
14 |
14 |
100.0% |
|
repo/model/relation.go
|
8 |
8 |
100.0% |
|
repo/model/token.go
View Diff
|
9 |
7 |
77.8% |
|
@@ -1,9 +1,8 @@ package model -// UserToken 用户令牌儿表 /* type UserToken struct { Token string `gorm:"not null;primaryKey"` - Username string `gorm:"not null;unique;size: 32"` // 用户名 + Username string `gorm:"not null;unique;type:varchar(32)"` // 用户名,指定 VARCHAR 类型,长度为 32 UserID uint32 `gorm:"not null;index"` Role string `gorm:"not null;default:0"` // 用户角色 } |
repo/model/user.go
View Diff
|
200 |
195 |
97.4% |
|
@@ -3,21 +3,22 @@ import ( "crypto/md5" "encoding/hex" - "encoding/json" "fmt" + "github.com/cloudwego/hertz/pkg/common/json" "io" "net/http" + + "simpledouyin/config" + "simpledouyin/logging" + "simpledouyin/rpc" "strings" - "toktik/constant/config" - "toktik/logging" - "toktik/rpc" ) // User 用户表 /* type User struct { Model // 基础模型 - Username string `gorm:"not null;unique;size: 32;index"` // 用户名 - Password *string `gorm:"not null;size: 32"` // 密码 + Username string `gorm:"not null;unique;size: 32;index;type:varchar(32)"` // 用户名 + Password *string `gorm:"not null;size: 32;type:varchar(127)"` // 密码 Avatar *string // 用户头像 BackgroundImage *string // 背景图片 Signature *string // 个人简介 |
repo/model/user_test.go
|
36 |
36 |
100.0% |
|
repo/model/video.go
|
13 |
13 |
100.0% |
|
repo/relations.gen.go
View Diff
|
404 |
399 |
98.8% |
|
@@ -16,7 +16,7 @@ "gorm.io/plugin/dbresolver" - "toktik/repo/model" + "simpledouyin/repo/model" ) func newRelation(db *gorm.DB, opts ...gen.DOOption) relation { @@ -213,10 +213,6 @@ return r.withDO(r.DO.Where(conds...)) } -func (r relationDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) IRelationDo { - return r.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) -} - func (r relationDo) Order(conds ...field.Expr) IRelationDo { return r.withDO(r.DO.Order(conds...)) } |
repo/user_tokens.gen.go
View Diff
|
418 |
413 |
98.8% |
|
@@ -17,7 +17,7 @@ "gorm.io/plugin/dbresolver" - "toktik/repo/model" + "simpledouyin/repo/model" ) func newUserToken(db *gorm.DB, opts ...gen.DOOption) userToken { @@ -227,10 +227,6 @@ return u.withDO(u.DO.Where(conds...)) } -func (u userTokenDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) IUserTokenDo { - return u.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) -} - func (u userTokenDo) Order(conds ...field.Expr) IUserTokenDo { return u.withDO(u.DO.Order(conds...)) } |
repo/users.gen.go
View Diff
|
438 |
433 |
98.9% |
|
@@ -17,7 +17,7 @@ "gorm.io/plugin/dbresolver" - "toktik/repo/model" + "simpledouyin/repo/model" ) func newUser(db *gorm.DB, opts ...gen.DOOption) user { @@ -247,10 +247,6 @@ return u.withDO(u.DO.Where(conds...)) } -func (u userDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) IUserDo { - return u.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) -} - func (u userDo) Order(conds ...field.Expr) IUserDo { return u.withDO(u.DO.Order(conds...)) } |
repo/videos.gen.go
View Diff
|
434 |
429 |
98.8% |
|
@@ -17,7 +17,7 @@ "gorm.io/plugin/dbresolver" - "toktik/repo/model" + "simpledouyin/repo/model" ) func newVideo(db *gorm.DB, opts ...gen.DOOption) video { @@ -243,10 +243,6 @@ return v.withDO(v.DO.Where(conds...)) } -func (v videoDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) IVideoDo { - return v.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB())) -} - func (v videoDo) Order(conds ...field.Expr) IVideoDo { return v.withDO(v.DO.Order(conds...)) } |
rpc/http.go
|
39 |
39 |
100.0% |
|
service/auth/build.sh
|
13 |
13 |
100.0% |
|
service/auth/handler.go
View Diff
|
181 |
175 |
96.7% |
|
@@ -2,15 +2,14 @@ import ( "context" - "toktik/constant/biz" - "toktik/kitex_gen/douyin/auth" - "toktik/logging" - "toktik/repo" - commonModel "toktik/repo/model" - "github.com/segmentio/ksuid" "github.com/sirupsen/logrus" "golang.org/x/crypto/bcrypt" + "simpledouyin/constants/biz" + "simpledouyin/kitex_gen/douyin/auth" + "simpledouyin/logging" + "simpledouyin/repo" + commonModel "simpledouyin/repo/model" ) func HashPassword(password string) (string, error) { |
service/auth/kitex_info.yaml
View Diff
|
5 |
4 |
76.2% |
|
@@ -1,4 +1,5 @@ kitexinfo: - ServiceName: 'auth' - ToolVersion: 'v0.4.4' + ServiceName: 'auth.md' + ToolVersion: 'v0.12.1' + address: "172.21.176.1:40127" |
service/auth/main.go
View Diff
|
48 |
46 |
95.4% |
|
@@ -1,27 +1,27 @@ package main import ( - "log" - "net" - "toktik/constant/config" - auth "toktik/kitex_gen/douyin/auth/authservice" - "github.com/cloudwego/kitex/pkg/rpcinfo" "github.com/cloudwego/kitex/server" "github.com/kitex-contrib/obs-opentelemetry/provider" "github.com/kitex-contrib/obs-opentelemetry/tracing" consul "github.com/kitex-contrib/registry-consul" + "log" + "net" + "simpledouyin/config" + auth "simpledouyin/kitex_gen/douyin/auth/authservice" ) func main() { var err error + log.Println(config.EnvConfig.CONSUL_ADDR) r, err := consul.NewConsulRegister(config.EnvConfig.CONSUL_ADDR) if err != nil { log.Fatal(err) } - addr, err := net.ResolveTCPAddr("tcp", config.AuthServiceAddr) + addr, err := net.ResolveTCPAddr("tcp", config.IP+config.AuthServiceAddr) if err != nil { panic(err) } |
service/auth/script/bootstrap.sh
|
22 |
22 |
100.0% |
|
service/comment/build.sh
|
13 |
13 |
100.0% |
|
service/comment/handler.go
View Diff
|
330 |
322 |
97.5% |
|
@@ -2,20 +2,19 @@ import ( "context" - "log" - "toktik/constant/biz" - "toktik/constant/config" - "toktik/kitex_gen/douyin/comment" - "toktik/kitex_gen/douyin/user" - "toktik/kitex_gen/douyin/user/userservice" - "toktik/logging" - gen "toktik/repo" - "toktik/repo/model" - "github.com/cloudwego/kitex/client" "github.com/kitex-contrib/obs-opentelemetry/tracing" consul "github.com/kitex-contrib/registry-consul" "github.com/sirupsen/logrus" + "log" + "simpledouyin/config" + "simpledouyin/constants/biz" + comment "simpledouyin/kitex_gen/douyin/comment" + "simpledouyin/kitex_gen/douyin/user" + "simpledouyin/kitex_gen/douyin/user/userservice" + "simpledouyin/logging" + gen "simpledouyin/repo" + "simpledouyin/repo/model" ) var UserClient userservice.Client |
service/comment/kitex_info.yaml
View Diff
|
4 |
4 |
97.1% |
|
@@ -1,4 +1,4 @@ kitexinfo: - ServiceName: 'comment' - ToolVersion: 'v0.4.4' + ServiceName: 'comment' + ToolVersion: 'v0.12.1' |
service/comment/main.go
View Diff
|
50 |
49 |
97.6% |
|
@@ -3,8 +3,8 @@ import ( "log" "net" - "toktik/constant/config" - comment "toktik/kitex_gen/douyin/comment/commentservice" + "simpledouyin/config" + comment "simpledouyin/kitex_gen/douyin/comment/commentservice" "github.com/cloudwego/kitex/pkg/rpcinfo" "github.com/cloudwego/kitex/server" @@ -21,7 +21,7 @@ log.Fatal(err) } - addr, err := net.ResolveTCPAddr("tcp", config.CommentServiceAddr) + addr, err := net.ResolveTCPAddr("tcp", config.IP+config.CommentServiceAddr) if err != nil { panic(err) } |
service/comment/script/bootstrap.sh
|
22 |
22 |
100.0% |
|
service/favorite/build.sh
|
13 |
13 |
100.0% |
|
service/favorite/handler.go
View Diff
|
275 |
267 |
97.0% |
|
@@ -2,20 +2,19 @@ import ( "context" - "google.golang.org/protobuf/proto" - "toktik/constant/biz" - "toktik/constant/config" - "toktik/kitex_gen/douyin/favorite" - "toktik/kitex_gen/douyin/feed" - feedService "toktik/kitex_gen/douyin/feed/feedservice" - "toktik/logging" - gen "toktik/repo" - "toktik/repo/model" - "github.com/cloudwego/kitex/client" "github.com/kitex-contrib/obs-opentelemetry/tracing" consul "github.com/kitex-contrib/registry-consul" "github.com/sirupsen/logrus" + "google.golang.org/protobuf/proto" + "simpledouyin/config" + "simpledouyin/constants/biz" + favorite "simpledouyin/kitex_gen/douyin/favorite" + "simpledouyin/kitex_gen/douyin/feed" + feedService "simpledouyin/kitex_gen/douyin/feed/feedservice" + "simpledouyin/logging" + gen "simpledouyin/repo" + "simpledouyin/repo/model" ) var FeedClient feedService.Client |
service/favorite/kitex_info.yaml
View Diff
|
4 |
4 |
97.1% |
|
@@ -1,4 +1,4 @@ kitexinfo: ServiceName: 'favorite' - ToolVersion: 'v0.4.4' + ToolVersion: 'v0.12.1' |
service/favorite/main.go
View Diff
|
48 |
47 |
97.6% |
|
@@ -3,8 +3,8 @@ import ( "log" "net" - "toktik/constant/config" - favoriteService "toktik/kitex_gen/douyin/favorite/favoriteservice" + "simpledouyin/config" + favoriteService "simpledouyin/kitex_gen/douyin/favorite/favoriteservice" "github.com/cloudwego/kitex/pkg/rpcinfo" "github.com/cloudwego/kitex/server" @@ -21,7 +21,7 @@ log.Fatal(err) } - addr, err := net.ResolveTCPAddr("tcp", config.FavoriteServiceAddr) + addr, err := net.ResolveTCPAddr("tcp", config.IP+config.FavoriteServiceAddr) if err != nil { panic(err) } |
service/favorite/script/bootstrap.sh
|
22 |
22 |
100.0% |
|
service/feed/build.sh
|
13 |
13 |
100.0% |
|
service/feed/handler.go
View Diff
|
291 |
281 |
96.3% |
|
@@ -2,28 +2,27 @@ import ( "context" - "log" - "strconv" - "sync" - "time" - "toktik/constant/biz" - "toktik/constant/config" - "toktik/kitex_gen/douyin/comment" - "toktik/kitex_gen/douyin/comment/commentservice" - "toktik/kitex_gen/douyin/favorite" - favoriteService "toktik/kitex_gen/douyin/favorite/favoriteservice" - "toktik/kitex_gen/douyin/feed" - "toktik/kitex_gen/douyin/user" - "toktik/kitex_gen/douyin/user/userservice" - "toktik/logging" - gen "toktik/repo" - "toktik/repo/model" - "toktik/storage" - "github.com/cloudwego/kitex/client" "github.com/kitex-contrib/obs-opentelemetry/tracing" consul "github.com/kitex-contrib/registry-consul" "github.com/sirupsen/logrus" + "log" + "simpledouyin/config" + "simpledouyin/constants/biz" + "simpledouyin/kitex_gen/douyin/comment" + "simpledouyin/kitex_gen/douyin/comment/commentservice" + "simpledouyin/kitex_gen/douyin/favorite" + favoriteService "simpledouyin/kitex_gen/douyin/favorite/favoriteservice" + feed "simpledouyin/kitex_gen/douyin/feed" + "simpledouyin/kitex_gen/douyin/user" + "simpledouyin/kitex_gen/douyin/user/userservice" + "simpledouyin/logging" + gen "simpledouyin/repo" + "simpledouyin/repo/model" + "simpledouyin/storage" + "strconv" + "sync" + "time" ) var UserClient userservice.Client @@ -131,7 +130,7 @@ return video.WithContext(ctx). Where(video.CreatedAt.Lte(time.UnixMilli(latestTime))). Order(video.CreatedAt.Desc()). - Limit(biz.VideoCount). + Limit(30). Offset(0). Find() } |
service/feed/kitex_info.yaml
View Diff
|
4 |
4 |
97.1% |
|
@@ -1,4 +1,4 @@ kitexinfo: - ServiceName: 'feed' - ToolVersion: 'v0.4.4' + ServiceName: 'feed' + ToolVersion: 'v0.12.1' |
service/feed/main.go
View Diff
|
50 |
49 |
97.6% |
|
@@ -3,8 +3,8 @@ import ( "log" "net" - "toktik/constant/config" - feed "toktik/kitex_gen/douyin/feed/feedservice" + "simpledouyin/config" + feed "simpledouyin/kitex_gen/douyin/feed/feedservice" "github.com/cloudwego/kitex/pkg/rpcinfo" "github.com/cloudwego/kitex/server" @@ -21,7 +21,7 @@ log.Fatal(err) } - addr, err := net.ResolveTCPAddr("tcp", config.FeedServiceAddr) + addr, err := net.ResolveTCPAddr("tcp", config.IP+config.FeedServiceAddr) if err != nil { panic(err) } |
service/feed/script/bootstrap.sh
|
22 |
22 |
100.0% |
|
service/publish/build.sh
|
13 |
13 |
100.0% |
|
service/publish/handler.go
View Diff
|
260 |
237 |
91.0% |
|
@@ -5,30 +5,25 @@ "context" "errors" "fmt" + "github.com/bakape/thumbnailer/v2" + "github.com/cloudwego/kitex/client" + "github.com/google/uuid" + "github.com/kitex-contrib/obs-opentelemetry/tracing" + consul "github.com/kitex-contrib/registry-consul" + "github.com/sirupsen/logrus" + "image/jpeg" "io" "log" "net/http" - "toktik/constant/biz" - "toktik/constant/config" - "toktik/kitex_gen/douyin/feed" - feedService "toktik/kitex_gen/douyin/feed/feedservice" - "toktik/logging" - "toktik/repo/model" - - "github.com/cloudwego/kitex/client" - "github.com/kitex-contrib/obs-opentelemetry/tracing" - consul "github.com/kitex-contrib/registry-consul" - - "github.com/sirupsen/logrus" - - "github.com/bakape/thumbnailer/v2" - "github.com/gofrs/uuid" - - "image/jpeg" - - "toktik/kitex_gen/douyin/publish" - gen "toktik/repo" - "toktik/storage" + "simpledouyin/config" + "simpledouyin/constants/biz" + "simpledouyin/kitex_gen/douyin/feed" + feedService "simpledouyin/kitex_gen/douyin/feed/feedservice" + publish "simpledouyin/kitex_gen/douyin/publish" + "simpledouyin/logging" + gen "simpledouyin/repo" + "simpledouyin/repo/model" + "simpledouyin/storage" ) var FeedClient feedService.Client @@ -85,10 +80,10 @@ StatusMsg: biz.BadRequestStatusMsg, }, nil } + // byte[] -> reader reader := bytes.NewReader(req.Data) - // V7 based on timestamp generatedUUID, err := uuid.NewV7() if err != nil { logger.WithFields(logrus.Fields{ @@ -104,7 +99,6 @@ }) logger.Debug("generated uuid") - // Upload video file fileName := fmt.Sprintf("%d/%s.%s", req.ActorId, generatedUUID.String(), "mp4") _, err = storage.Upload(fileName, reader) if err != nil { @@ -121,7 +115,6 @@ "file_name": fileName, }).Debug("uploaded video") - // Generate thumbnail coverName := fmt.Sprintf("%d/%s.%s", req.ActorId, generatedUUID.String(), "jpg") thumbData, err := getThumbnail(reader) if err != nil { @@ -177,15 +170,8 @@ StatusMsg: biz.InternalServerErrorStatusMsg, }, nil } - logger.WithFields(logrus.Fields{ - "entry": publishModel, - }).Debug("saved db entry") - - resp = &publish.CreateVideoResponse{StatusCode: 0, StatusMsg: biz.PublishActionSuccess} - logger.WithFields(logrus.Fields{ - "response": resp, - }).Debug("all process done, ready to launch response") - return resp, nil + + return } // ListVideo implements the PublishServiceImpl interface. |
service/publish/kitex_info.yaml
View Diff
|
4 |
4 |
97.1% |
|
@@ -1,4 +1,4 @@ kitexinfo: - ServiceName: 'publish' - ToolVersion: 'v0.4.4' + ServiceName: 'publish' + ToolVersion: 'v0.12.1' |
service/publish/main.go
View Diff
|
48 |
47 |
97.5% |
|
@@ -3,8 +3,8 @@ import ( "log" "net" - "toktik/constant/config" - publish "toktik/kitex_gen/douyin/publish/publishservice" + "simpledouyin/config" + publish "simpledouyin/kitex_gen/douyin/publish/publishservice" "github.com/kitex-contrib/obs-opentelemetry/provider" "github.com/kitex-contrib/obs-opentelemetry/tracing" @@ -21,7 +21,7 @@ log.Fatal(err) } - addr, err := net.ResolveTCPAddr("tcp", config.PublishServiceAddr) + addr, err := net.ResolveTCPAddr("tcp", config.IP+config.PublishServiceAddr) if err != nil { panic(err) } |
service/publish/script/bootstrap.sh
|
22 |
22 |
100.0% |
|
service/relation/build.sh
|
13 |
13 |
100.0% |
|
service/relation/handler.go
View Diff
|
447 |
441 |
98.6% |
|
@@ -3,15 +3,15 @@ import ( "context" "log" + "simpledouyin/config" + "simpledouyin/constants/biz" + "simpledouyin/kitex_gen/douyin/relation" + "simpledouyin/kitex_gen/douyin/user" + "simpledouyin/kitex_gen/douyin/user/userservice" + "simpledouyin/logging" + "simpledouyin/repo" + "simpledouyin/repo/model" "sync" - "toktik/constant/biz" - "toktik/constant/config" - "toktik/kitex_gen/douyin/relation" - "toktik/kitex_gen/douyin/user" - "toktik/kitex_gen/douyin/user/userservice" - "toktik/logging" - "toktik/repo" - "toktik/repo/model" "github.com/kitex-contrib/obs-opentelemetry/tracing" |
service/relation/kitex_info.yaml
View Diff
|
4 |
4 |
97.1% |
|
@@ -1,4 +1,4 @@ kitexinfo: - ServiceName: 'relation' - ToolVersion: 'v0.4.4' + ServiceName: 'relation' + ToolVersion: 'v0.12.1' |
service/relation/main.go
View Diff
|
48 |
47 |
97.5% |
|
@@ -3,8 +3,8 @@ import ( "log" "net" - "toktik/constant/config" - relation "toktik/kitex_gen/douyin/relation/relationservice" + "simpledouyin/config" + relation "simpledouyin/kitex_gen/douyin/relation/relationservice" "github.com/kitex-contrib/obs-opentelemetry/provider" "github.com/kitex-contrib/obs-opentelemetry/tracing" @@ -21,7 +21,7 @@ log.Fatal(err) } - addr, err := net.ResolveTCPAddr("tcp", config.RelationServiceAddr) + addr, err := net.ResolveTCPAddr("tcp", config.IP+config.RelationServiceAddr) if err != nil { panic(err) } |
service/relation/script/bootstrap.sh
|
22 |
22 |
100.0% |
|
service/user/build.sh
|
13 |
13 |
100.0% |
|
service/user/handler.go
View Diff
|
252 |
247 |
97.7% |
|
@@ -3,23 +3,23 @@ import ( "context" "log" - "sync" - "toktik/constant/biz" - bizConfig "toktik/constant/config" - "toktik/kitex_gen/douyin/favorite" - favoriteService "toktik/kitex_gen/douyin/favorite/favoriteservice" - "toktik/kitex_gen/douyin/publish" - publishService "toktik/kitex_gen/douyin/publish/publishservice" - "toktik/kitex_gen/douyin/relation" - relationService "toktik/kitex_gen/douyin/relation/relationservice" - "toktik/kitex_gen/douyin/user" - "toktik/logging" - "toktik/repo" + "simpledouyin/constants/biz" + "simpledouyin/kitex_gen/douyin/favorite" + "simpledouyin/logging" "github.com/cloudwego/kitex/client" "github.com/kitex-contrib/obs-opentelemetry/tracing" consul "github.com/kitex-contrib/registry-consul" "github.com/sirupsen/logrus" + bizConfig "simpledouyin/config" + favoriteService "simpledouyin/kitex_gen/douyin/favorite/favoriteservice" + "simpledouyin/kitex_gen/douyin/publish" + publishService "simpledouyin/kitex_gen/douyin/publish/publishservice" + "simpledouyin/kitex_gen/douyin/relation" + relationService "simpledouyin/kitex_gen/douyin/relation/relationservice" + "simpledouyin/kitex_gen/douyin/user" + "simpledouyin/repo" + "sync" ) // UserServiceImpl implements the last service interface defined in the IDL. |
service/user/kitex_info.yaml
View Diff
|
4 |
4 |
97.1% |
|
@@ -1,4 +1,4 @@ kitexinfo: - ServiceName: 'user' - ToolVersion: 'v0.4.4' + ServiceName: 'user' + ToolVersion: 'v0.12.1' |
service/user/main.go
View Diff
|
48 |
46 |
95.4% |
|
@@ -1,16 +1,15 @@ package main import ( - "log" - "net" - "toktik/constant/config" - "toktik/kitex_gen/douyin/user/userservice" - "github.com/cloudwego/kitex/pkg/rpcinfo" "github.com/cloudwego/kitex/server" "github.com/kitex-contrib/obs-opentelemetry/provider" "github.com/kitex-contrib/obs-opentelemetry/tracing" consul "github.com/kitex-contrib/registry-consul" + "log" + "net" + "simpledouyin/config" + "simpledouyin/kitex_gen/douyin/user/userservice" ) func main() { @@ -21,7 +20,7 @@ log.Fatal(err) } - addr, err := net.ResolveTCPAddr("tcp", config.UserServiceAddr) + addr, err := net.ResolveTCPAddr("tcp", config.IP+config.UserServiceAddr) if err != nil { panic(err) } |
service/user/script/bootstrap.sh
|
22 |
22 |
100.0% |
|
service/web/auth/handler.go
View Diff
|
103 |
99 |
96.0% |
|
@@ -2,21 +2,19 @@ import ( "context" - "log" - bizConstant "toktik/constant/biz" - "toktik/constant/config" - "toktik/kitex_gen/douyin/auth" - authService "toktik/kitex_gen/douyin/auth/authservice" - "toktik/logging" - - "github.com/kitex-contrib/obs-opentelemetry/provider" - "github.com/kitex-contrib/obs-opentelemetry/tracing" - "github.com/cloudwego/hertz/pkg/app" httpStatus "github.com/cloudwego/hertz/pkg/protocol/consts" "github.com/cloudwego/kitex/client" + "github.com/kitex-contrib/obs-opentelemetry/provider" + "github.com/kitex-contrib/obs-opentelemetry/tracing" consul "github.com/kitex-contrib/registry-consul" "github.com/sirupsen/logrus" + "log" + "simpledouyin/config" + bizConstant "simpledouyin/constants/biz" + "simpledouyin/kitex_gen/douyin/auth" + authService "simpledouyin/kitex_gen/douyin/auth/authservice" + "simpledouyin/logging" ) var Client authService.Client @@ -53,10 +51,12 @@ bizConstant.NoUserNameOrPassWord.WithFields(&methodFields).LaunchError(c) return } + logger.WithFields(logrus.Fields{ "username": username, "password": password, }).Debugf("Executing register") + registerResponse, err := Client.Register(ctx, &auth.RegisterRequest{ Username: username, Password: password, |
service/web/comment/handler.go
View Diff
|
190 |
184 |
96.6% |
|
@@ -4,23 +4,21 @@ "context" "errors" "fmt" - "log" - "strconv" - "toktik/constant/biz" - "toktik/constant/config" - "toktik/kitex_gen/douyin/comment" - "toktik/kitex_gen/douyin/comment/commentservice" - "toktik/logging" - "toktik/service/web/mw" - - "github.com/kitex-contrib/obs-opentelemetry/provider" - "github.com/kitex-contrib/obs-opentelemetry/tracing" - "github.com/cloudwego/hertz/pkg/app" "github.com/cloudwego/hertz/pkg/protocol/consts" "github.com/cloudwego/kitex/client" + "github.com/hertz-contrib/obs-opentelemetry/provider" + "github.com/kitex-contrib/obs-opentelemetry/tracing" consul "github.com/kitex-contrib/registry-consul" "github.com/sirupsen/logrus" + "log" + "simpledouyin/config" + "simpledouyin/constants/biz" + "simpledouyin/kitex_gen/douyin/comment" + "simpledouyin/kitex_gen/douyin/comment/commentservice" + "simpledouyin/logging" + "simpledouyin/service/web/mw" + "strconv" ) var commentClient commentservice.Client |
service/web/favorite/handler.go
View Diff
|
170 |
166 |
97.5% |
|
@@ -3,13 +3,13 @@ import ( "context" "net/http" + "simpledouyin/config" + "simpledouyin/constants/biz" + "simpledouyin/kitex_gen/douyin/favorite" + favoriteService "simpledouyin/kitex_gen/douyin/favorite/favoriteservice" + "simpledouyin/logging" + "simpledouyin/service/web/mw" "strconv" - "toktik/constant/biz" - "toktik/constant/config" - "toktik/kitex_gen/douyin/favorite" - favoriteService "toktik/kitex_gen/douyin/favorite/favoriteservice" - "toktik/logging" - "toktik/service/web/mw" "github.com/cloudwego/hertz/pkg/app" "github.com/cloudwego/hertz/pkg/protocol/consts" |
service/web/feed/handler.go
View Diff
|
89 |
84 |
94.2% |
|
@@ -2,13 +2,13 @@ import ( "context" + "simpledouyin/config" + bizConstant "simpledouyin/constants/biz" + "simpledouyin/kitex_gen/douyin/feed" + feedService "simpledouyin/kitex_gen/douyin/feed/feedservice" + "simpledouyin/logging" + "simpledouyin/service/web/mw" "strconv" - bizConstant "toktik/constant/biz" - "toktik/constant/config" - "toktik/kitex_gen/douyin/feed" - feedService "toktik/kitex_gen/douyin/feed/feedservice" - "toktik/logging" - "toktik/service/web/mw" "github.com/kitex-contrib/obs-opentelemetry/provider" "github.com/kitex-contrib/obs-opentelemetry/tracing" |
service/web/main.go
View Diff
|
86 |
73 |
84.9% |
|
@@ -2,16 +2,15 @@ import ( "context" - "toktik/constant/config" - "toktik/service/web/auth" - "toktik/service/web/comment" - "toktik/service/web/favorite" - "toktik/service/web/feed" - "toktik/service/web/mw" - "toktik/service/web/publish" - "toktik/service/web/relation" - "toktik/service/web/user" - "toktik/service/web/wechat" + swaggerFiles "github.com/swaggo/files" + "simpledouyin/service/web/auth" + "simpledouyin/service/web/comment" + "simpledouyin/service/web/favorite" + "simpledouyin/service/web/mw" + "simpledouyin/service/web/publish" + "simpledouyin/service/web/relation" + "simpledouyin/service/web/user" + "simpledouyin/service/web/wechat" "github.com/cloudwego/hertz/pkg/app/server" "github.com/hertz-contrib/gzip" @@ -19,7 +18,7 @@ "github.com/hertz-contrib/obs-opentelemetry/tracing" "github.com/hertz-contrib/pprof" "github.com/hertz-contrib/swagger" - swaggerFiles "github.com/swaggo/files" + "simpledouyin/config" ) func main() { @@ -33,7 +32,7 @@ tracer, cfg := tracing.NewServerTracer() h := server.Default( server.WithHostPorts(config.WebServiceAddr), - server.WithMaxRequestBodySize(config.EnvConfig.MAX_REQUEST_BODY_SIZE), + //server.WithMaxRequestBodySize(config.EnvConfig.MAX_REQUEST_BODY_SIZE), tracer, ) h.Use(gzip.Gzip(gzip.DefaultCompression)) @@ -42,9 +41,6 @@ pprof.Register(h) douyin := h.Group("/douyin") - - // feed service - douyin.GET("/feed", feed.Action) // user service userGroup := douyin.Group("/user") |
service/web/mw/auth.go
View Diff
|
126 |
123 |
97.5% |
|
@@ -2,12 +2,11 @@ import ( "context" - "toktik/constant/biz" - "toktik/kitex_gen/douyin/auth" - authHandler "toktik/service/web/auth" - "github.com/cloudwego/hertz/pkg/app" "github.com/cloudwego/hertz/pkg/common/hlog" + "simpledouyin/constants/biz" + "simpledouyin/kitex_gen/douyin/auth" + authHandler "simpledouyin/service/web/auth" ) // AuthResult Authentication result enum |
service/web/mw/json.go
|
29 |
29 |
100.0% |
|
service/web/publish/handler.go
View Diff
|
172 |
168 |
97.5% |
|
@@ -4,13 +4,13 @@ "context" "fmt" "mime/multipart" + "simpledouyin/config" + bizConstant "simpledouyin/constants/biz" + "simpledouyin/kitex_gen/douyin/publish" + publishService "simpledouyin/kitex_gen/douyin/publish/publishservice" + "simpledouyin/logging" + "simpledouyin/service/web/mw" "strconv" - bizConstant "toktik/constant/biz" - "toktik/constant/config" - "toktik/kitex_gen/douyin/publish" - publishService "toktik/kitex_gen/douyin/publish/publishservice" - "toktik/logging" - "toktik/service/web/mw" "github.com/kitex-contrib/obs-opentelemetry/provider" "github.com/kitex-contrib/obs-opentelemetry/tracing" |
service/web/relation/handler.go
View Diff
|
255 |
251 |
98.3% |
|
@@ -2,13 +2,13 @@ import ( "context" + "simpledouyin/config" + bizConstant "simpledouyin/constants/biz" + "simpledouyin/kitex_gen/douyin/relation" + relationService "simpledouyin/kitex_gen/douyin/relation/relationservice" + "simpledouyin/logging" + "simpledouyin/service/web/mw" "strconv" - bizConstant "toktik/constant/biz" - "toktik/constant/config" - "toktik/kitex_gen/douyin/relation" - relationService "toktik/kitex_gen/douyin/relation/relationservice" - "toktik/logging" - "toktik/service/web/mw" "github.com/kitex-contrib/obs-opentelemetry/provider" "github.com/kitex-contrib/obs-opentelemetry/tracing" |
service/web/user/handler.go
View Diff
|
82 |
77 |
93.8% |
|
@@ -2,13 +2,13 @@ import ( "context" + "simpledouyin/config" + "simpledouyin/constants/biz" + "simpledouyin/kitex_gen/douyin/user" + userService "simpledouyin/kitex_gen/douyin/user/userservice" + "simpledouyin/logging" + "simpledouyin/service/web/mw" "strconv" - "toktik/constant/biz" - "toktik/constant/config" - "toktik/kitex_gen/douyin/user" - userService "toktik/kitex_gen/douyin/user/userservice" - "toktik/logging" - "toktik/service/web/mw" "github.com/kitex-contrib/obs-opentelemetry/provider" "github.com/kitex-contrib/obs-opentelemetry/tracing" |
service/web/wechat/handler.go
View Diff
|
164 |
160 |
97.4% |
|
@@ -3,13 +3,13 @@ import ( "context" "log" + bizConfig "simpledouyin/config" + bizConstant "simpledouyin/constants/biz" + "simpledouyin/kitex_gen/douyin/wechat" + "simpledouyin/kitex_gen/douyin/wechat/wechatservice" + "simpledouyin/logging" + "simpledouyin/service/web/mw" "strconv" - bizConstant "toktik/constant/biz" - bizConfig "toktik/constant/config" - "toktik/kitex_gen/douyin/wechat" - "toktik/kitex_gen/douyin/wechat/wechatservice" - "toktik/logging" - "toktik/service/web/mw" "github.com/cloudwego/hertz/pkg/app" httpStatus "github.com/cloudwego/hertz/pkg/protocol/consts" |
service/wechat/build.sh
|
13 |
13 |
100.0% |
|
service/wechat/db/gen.sh
|
3 |
3 |
100.0% |
|
service/wechat/db/msg.pb.go
|
262 |
262 |
100.0% |
|
service/wechat/db/msg.proto
|
17 |
17 |
100.0% |
|
service/wechat/handler.go
View Diff
|
225 |
220 |
97.7% |
|
@@ -3,17 +3,18 @@ import ( "context" "fmt" + "github.com/redis/go-redis/extra/redisotel/v9" + "github.com/redis/go-redis/v9" + "simpledouyin/config" + "simpledouyin/logging" + + "simpledouyin/constants/biz" + "simpledouyin/kitex_gen/douyin/wechat" + "simpledouyin/service/wechat/db" "strconv" "time" - "toktik/constant/biz" - "toktik/constant/config" - "toktik/kitex_gen/douyin/wechat" - "toktik/logging" - "toktik/service/wechat/db" "github.com/golang/protobuf/proto" - "github.com/redis/go-redis/extra/redisotel/v9" - "github.com/redis/go-redis/v9" "github.com/sirupsen/logrus" "google.golang.org/protobuf/encoding/protojson" ) |
service/wechat/kitex_info.yaml
View Diff
|
4 |
4 |
97.1% |
|
@@ -1,4 +1,4 @@ kitexinfo: - ServiceName: 'wechat' - ToolVersion: 'v0.4.4' + ServiceName: 'wechat' + ToolVersion: 'v0.12.1' |
service/wechat/main.go
View Diff
|
48 |
47 |
97.5% |
|
@@ -3,8 +3,8 @@ import ( "log" "net" - "toktik/constant/config" - "toktik/kitex_gen/douyin/wechat/wechatservice" + "simpledouyin/config" + "simpledouyin/kitex_gen/douyin/wechat/wechatservice" "github.com/cloudwego/kitex/pkg/rpcinfo" "github.com/cloudwego/kitex/server" @@ -21,7 +21,7 @@ log.Fatal(err) } - addr, err := net.ResolveTCPAddr("tcp", config.WechatServiceAddr) + addr, err := net.ResolveTCPAddr("tcp", config.IP+config.WechatServiceAddr) if err != nil { panic(err) } |
service/wechat/script/bootstrap.sh
|
22 |
22 |
100.0% |
|
storage/fs.go
View Diff
|
53 |
51 |
96.2% |
|
@@ -5,8 +5,8 @@ "net/url" "os" "path" - "toktik/constant/config" - "toktik/logging" + "simpledouyin/config" + "simpledouyin/logging" "github.com/sirupsen/logrus" ) |
storage/provider.go
View Diff
|
37 |
35 |
94.6% |
|
@@ -2,8 +2,8 @@ import ( "io" - "toktik/constant/config" - "toktik/logging" + "simpledouyin/config" + "simpledouyin/logging" "github.com/sirupsen/logrus" ) |
storage/s3.go
View Diff
|
56 |
54 |
96.4% |
|
@@ -5,8 +5,9 @@ "io" "log" "net/url" + appcfg "simpledouyin/config" + "strconv" - appcfg "toktik/constant/config" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/config" |