based on:
api(BFF层):
- apiuser: user相关api接口
rpc(Service层):
- user: user相关rpc接口,对外只提供基础CRUD接口,无服务依赖
use kratos swagger plugin
浏览器中访问服务的/api/swagger-ui/路径即可打开Swagger UI。如apiuser:
http://127.0.0.1:8000/api/swagger-ui/
example user rpc:
$ protoc --proto_path=. \
--proto_path=./third_party \
--openapiv2_out . \
--openapiv2_opt logtostderr=true \
--openapiv2_opt json_names_for_fields=false \
rpc/user/api/auth/auth.proto
example user rpc:
$ cd rpc/user/internal/data
$ ent generate ./schema --target=ent