2023-09-12 03:42:13 +00:00
|
|
|
|
|
|
|
.PHONY: swagger
|
|
|
|
|
|
|
|
swagger:
|
|
|
|
cp ../auth/swagger/auth-work.yaml ./swagger
|
|
|
|
cp ../auth/swagger/auth-work.yaml ./swagger/external
|
2023-10-01 15:54:52 +00:00
|
|
|
cp ../crm/swagger/crm-work.yaml ./swagger
|
|
|
|
cp ../crm/swagger/crm-work.yaml ./swagger/external
|
2023-09-23 17:19:44 +00:00
|
|
|
cp ../members/swagger/members-work.yaml ./swagger
|
|
|
|
cp ../members/swagger/members-work.yaml ./swagger/external
|
2023-10-01 15:54:52 +00:00
|
|
|
cp ../research/swagger/research-work.yaml ./swagger
|
|
|
|
cp ../research/swagger/research-work.yaml ./swagger/external
|
2023-09-23 17:19:44 +00:00
|
|
|
cp ../sf-gate/swagger/sf-gate-work.yaml ./swagger
|
|
|
|
cp ../sf-gate/swagger/sf-gate-work.yaml ./swagger/external
|
2023-09-12 03:42:13 +00:00
|
|
|
#
|
|
|
|
rm -rf api
|
|
|
|
#
|
|
|
|
# generate auth client
|
|
|
|
#
|
|
|
|
mkdir -p api/auth
|
|
|
|
swagger generate client \
|
|
|
|
--log-output=./swagger/logs/generate-auth-client.log \
|
|
|
|
--copyright-file=./build/COPYRIGHT \
|
|
|
|
--name=auth \
|
|
|
|
--spec=./swagger/auth-work.yaml \
|
|
|
|
--target=./api/auth \
|
|
|
|
--client-package=auth-client \
|
|
|
|
--model-package=auth-models \
|
|
|
|
--principal=app.User
|
|
|
|
#
|
|
|
|
# update external auth client
|
|
|
|
#
|
|
|
|
sed -i 's|"http"|"https"|g' ./swagger/external/auth-work.yaml
|
|
|
|
sed -i 's|auth.work.com:8080|gw.tnxs.net|g' ./swagger/external/auth-work.yaml
|
2023-09-23 17:19:44 +00:00
|
|
|
sed -i 's|"/v1"|"/work/auth/v1"|g' ./swagger/external/auth-work.yaml
|
2023-09-12 03:42:13 +00:00
|
|
|
#
|
2023-10-01 15:54:52 +00:00
|
|
|
# generate crm client
|
|
|
|
#
|
|
|
|
mkdir api/crm
|
|
|
|
swagger generate client \
|
|
|
|
--log-output=./swagger/logs/generate-crm-client.log \
|
|
|
|
--copyright-file=./build/COPYRIGHT \
|
|
|
|
--name=crm \
|
|
|
|
--spec=./swagger/crm-work.yaml \
|
|
|
|
--target=./api/crm \
|
|
|
|
--client-package=crm-client \
|
|
|
|
--model-package=crm-models \
|
|
|
|
--principal=app.User
|
|
|
|
#
|
|
|
|
# update external crm client
|
|
|
|
#
|
|
|
|
sed -i 's|"http"|"https"|g' ./swagger/external/crm-work.yaml
|
|
|
|
sed -i 's|crm.work.com:8080|gw.tnxs.net|g' ./swagger/external/crm-work.yaml
|
|
|
|
sed -i 's|"/v1"|"/vk/crm/v1"|g' ./swagger/external/crm-work.yaml
|
|
|
|
#
|
|
|
|
# generate research client
|
|
|
|
#
|
|
|
|
mkdir api/research
|
|
|
|
swagger generate client \
|
|
|
|
--log-output=./swagger/logs/generate-research-client.log \
|
|
|
|
--copyright-file=./build/COPYRIGHT \
|
|
|
|
--name=research \
|
|
|
|
--spec=./swagger/research-work.yaml \
|
|
|
|
--target=./api/research \
|
|
|
|
--client-package=research-client \
|
|
|
|
--model-package=research-models \
|
|
|
|
--principal=app.User
|
|
|
|
#
|
|
|
|
# update external research client
|
|
|
|
#
|
|
|
|
sed -i 's|"http"|"https"|g' ./swagger/external/research-work.yaml
|
|
|
|
sed -i 's|research.work.com:8080|gw.tnxs.net|g' ./swagger/external/research-work.yaml
|
|
|
|
sed -i 's|"/v1"|"/vk/research/v1"|g' ./swagger/external/research-work.yaml
|
|
|
|
#
|
2023-09-23 17:19:44 +00:00
|
|
|
# generate members client
|
2023-09-12 03:42:13 +00:00
|
|
|
#
|
2023-09-23 17:19:44 +00:00
|
|
|
mkdir api/members
|
2023-09-12 03:42:13 +00:00
|
|
|
swagger generate client \
|
2023-09-23 17:19:44 +00:00
|
|
|
--log-output=./swagger/logs/generate-members-client.log \
|
2023-09-12 03:42:13 +00:00
|
|
|
--copyright-file=./build/COPYRIGHT \
|
2023-09-23 17:19:44 +00:00
|
|
|
--name=members \
|
|
|
|
--spec=./swagger/members-work.yaml \
|
|
|
|
--target=./api/members \
|
|
|
|
--client-package=members-client \
|
|
|
|
--model-package=members-models \
|
2023-09-12 03:42:13 +00:00
|
|
|
--principal=app.User
|
|
|
|
#
|
2023-09-23 17:19:44 +00:00
|
|
|
# update external members client
|
2023-09-12 03:42:13 +00:00
|
|
|
#
|
2023-09-23 17:19:44 +00:00
|
|
|
sed -i 's|"http"|"https"|g' ./swagger/external/members-work.yaml
|
|
|
|
sed -i 's|members.work.com:8080|gw.tnxs.net|g' ./swagger/external/members-work.yaml
|
|
|
|
sed -i 's|"/v1"|"/work/members/v1"|g' ./swagger/external/members-work.yaml
|
|
|
|
#
|
|
|
|
# generate sfgate client
|
|
|
|
#
|
|
|
|
mkdir api/sfgate
|
|
|
|
swagger generate client \
|
|
|
|
--log-output=./swagger/logs/generate-sfgate-client.log \
|
|
|
|
--copyright-file=./build/COPYRIGHT \
|
|
|
|
--name=sfgate \
|
|
|
|
--spec=./swagger/sf-gate-work.yaml \
|
|
|
|
--target=./api/sfgate \
|
|
|
|
--client-package=sfgate-client \
|
|
|
|
--model-package=sfgate-models \
|
|
|
|
--principal=app.User
|
|
|
|
#
|
|
|
|
# update external client
|
|
|
|
#
|
|
|
|
sed -i 's|"http"|"https"|g' ./swagger/external/sf-gate-work.yaml
|
|
|
|
sed -i 's|sf-gate.members.work.com.com:8080|gw.tnxs.net|g' ./swagger/external/sf-gate-work.yaml
|
|
|
|
sed -i 's|"/v1"|"/work/sf-gate/v1"|g' ./swagger/external/sf-gate-work.yaml
|
2023-09-12 03:42:13 +00:00
|
|
|
#
|
|
|
|
# copy external swagger files
|
|
|
|
#
|
|
|
|
scp ./swagger/external/*.yaml root@whm.noc.tnxs.net:/home/taxassets/www/swagger/external
|