diff --git a/pkg/common/db/controller/storage.go b/pkg/common/db/controller/storage.go index ab20e7da8..c383eb8ec 100644 --- a/pkg/common/db/controller/storage.go +++ b/pkg/common/db/controller/storage.go @@ -14,7 +14,6 @@ package controller -import "C" import ( "bytes" "context" diff --git a/scripts/common.sh b/scripts/common.sh index a254412de..3a2090b6f 100755 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -1,4 +1,18 @@ #!/usr/bin/env bash +# Copyright © 2023 OpenIM. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # shellcheck disable=SC2034 # Variables sourced in other scripts. diff --git a/scripts/make-rules/swagger.mk b/scripts/make-rules/swagger.mk new file mode 100644 index 000000000..0598813c3 --- /dev/null +++ b/scripts/make-rules/swagger.mk @@ -0,0 +1,12 @@ +# ============================================================================== +# Makefile helper functions for swagger +# + +.PHONY: swagger.run +swagger.run: tools.verify.swagger + @echo "===========> Generating swagger API docs" + @swagger generate spec --scan-models -w $(ROOT_DIR)/cmd/genswaggertypedocs -o $(ROOT_DIR)/api/swagger/swagger.yaml + +.PHONY: swagger.serve +swagger.serve: tools.verify.swagger + @swagger serve -F=redoc --no-open --port 36666 $(ROOT_DIR)/api/swagger/swagger.yaml