feat: Update project structure and configuration files

This commit is contained in:
rogeecn
2025-03-24 09:29:38 +08:00
parent ea15a51556
commit 8de43c2861
159 changed files with 498 additions and 0 deletions

54
backend/docs/docs.go Normal file
View File

@@ -0,0 +1,54 @@
// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs
import "github.com/rogeecn/swag"
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "UserName",
"url": "http://www.swagger.io/support",
"email": "support@swagger.io"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {},
"securityDefinitions": {
"BasicAuth": {
"type": "basic"
}
},
"externalDocs": {
"description": "OpenAPI",
"url": "https://swagger.io/resources/open-api/"
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0",
Host: "localhost:8080",
BasePath: "/api/v1",
Schemes: []string{},
Title: "ApiDoc",
Description: "This is a sample server celler server.",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}

10
backend/docs/ember.go Normal file
View File

@@ -0,0 +1,10 @@
package docs
import (
_ "embed"
_ "github.com/rogeecn/swag"
)
//go:embed swagger.json
var SwaggerSpec string

30
backend/docs/swagger.json Normal file
View File

@@ -0,0 +1,30 @@
{
"swagger": "2.0",
"info": {
"description": "This is a sample server celler server.",
"title": "ApiDoc",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "UserName",
"url": "http://www.swagger.io/support",
"email": "support@swagger.io"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "1.0"
},
"host": "localhost:8080",
"basePath": "/api/v1",
"paths": {},
"securityDefinitions": {
"BasicAuth": {
"type": "basic"
}
},
"externalDocs": {
"description": "OpenAPI",
"url": "https://swagger.io/resources/open-api/"
}
}

22
backend/docs/swagger.yaml Normal file
View File

@@ -0,0 +1,22 @@
basePath: /api/v1
externalDocs:
description: OpenAPI
url: https://swagger.io/resources/open-api/
host: localhost:8080
info:
contact:
email: support@swagger.io
name: UserName
url: http://www.swagger.io/support
description: This is a sample server celler server.
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
termsOfService: http://swagger.io/terms/
title: ApiDoc
version: "1.0"
paths: {}
securityDefinitions:
BasicAuth:
type: basic
swagger: "2.0"