66 lines
1.7 KiB
Go
66 lines
1.7 KiB
Go
//go:generate swag init --parseDependency --parseDepth 4
|
|
package main
|
|
|
|
import (
|
|
"flag"
|
|
"os"
|
|
"stat/common/version"
|
|
"stat/server"
|
|
)
|
|
|
|
// @title 统计中心 接口文档
|
|
// @version 1.0
|
|
// @description This is a sample server celler server.
|
|
// @termsOfService
|
|
|
|
// @contact.name
|
|
// @contact.url
|
|
// @contact.email
|
|
|
|
// @license.name Apache 2.0
|
|
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
|
|
|
|
// @host localhost:8088
|
|
// @BasePath /api/stat
|
|
// @Schemes http https
|
|
|
|
// @securityDefinitions.basic BasicAuth
|
|
|
|
// @securityDefinitions.apikey ApiKeyAuth
|
|
// @in header
|
|
// @name Authorization
|
|
|
|
// @securitydefinitions.oauth2.application OAuth2Application
|
|
// @tokenUrl https://example.com/oauth/token
|
|
// @scope.write Grants write access
|
|
// @scope.admin Grants read and write access to administrative information
|
|
|
|
// @securitydefinitions.oauth2.implicit OAuth2Implicit
|
|
// @authorizationUrl https://example.com/oauth/authorize
|
|
// @scope.write Grants write access
|
|
// @scope.admin Grants read and write access to administrative information
|
|
|
|
// @securitydefinitions.oauth2.password OAuth2Password
|
|
// @tokenUrl https://example.com/oauth/token
|
|
// @scope.read Grants read access
|
|
// @scope.write Grants write access
|
|
// @scope.admin Grants read and write access to administrative information
|
|
|
|
// @securitydefinitions.oauth2.accessCode OAuth2AccessCode
|
|
// @tokenUrl https://example.com/oauth/token
|
|
// @authorizationUrl https://example.com/oauth/authorize
|
|
// @scope.admin Grants read and write access to administrative information
|
|
|
|
func cmdLine() {
|
|
info := flag.Bool("info", false, "show service build info")
|
|
flag.Parse()
|
|
if *info {
|
|
version.Info() //内部会自动退进程.
|
|
}
|
|
}
|
|
|
|
func main() {
|
|
cmdLine()
|
|
server.Run(os.Args)
|
|
}
|