Skip to content

Commit

Permalink
Update : Swagger documentation for REST API
Browse files Browse the repository at this point in the history
  • Loading branch information
heedaeshin committed Aug 20, 2024
1 parent b6a94d1 commit ea3e36d
Show file tree
Hide file tree
Showing 11 changed files with 3,680 additions and 306 deletions.
179 changes: 94 additions & 85 deletions websrc/controllers/generateHandlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,17 @@ import (
)

// GenerateLinuxPostHandler godoc
// @Summary Generate test data on on-premise Linux
// @Description Generate test data on on-premise Linux.
// @Tags [Test Data Generation] On-premise Linux
// @Accept json
// @Produce json
// @Param RequestBody body GenDataParams true "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully generated test data"
// @Failure 400 {object} models.BasicResponse "Invalid Request"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /generate/linux [post]
//
// @Summary Generate test data on on-premise Linux
// @Description Generate test data on on-premise Linux.
// @Tags [Test Data Generation]
// @Accept json
// @Produce json
// @Param RequestBody body GenDataParams true "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully generated test data"
// @Failure 400 {object} models.BasicResponse "Invalid Request"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /generate/linux [post]
func GenerateLinuxPostHandler(ctx echo.Context) error {

start := time.Now()
Expand Down Expand Up @@ -67,16 +68,17 @@ func GenerateLinuxPostHandler(ctx echo.Context) error {
}

// GenerateWindowsPostHandler godoc
// @Summary Generate test data on on-premise Windows
// @Description Generate test data on on-premise Windows.
// @Tags [Test Data Generation] On-premise Windows
// @Accept json
// @Produce json
// @Param RequestBody body GenDataParams true "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully generated test data"
// @Failure 400 {object} models.BasicResponse "Invalid Request"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /generate/windows [post]
//
// @Summary Generate test data on on-premise Windows
// @Description Generate test data on on-premise Windows.
// @Tags [Test Data Generation]
// @Accept json
// @Produce json
// @Param RequestBody body GenDataParams true "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully generated test data"
// @Failure 400 {object} models.BasicResponse "Invalid Request"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /generate/windows [post]
func GenerateWindowsPostHandler(ctx echo.Context) error {

start := time.Now()
Expand Down Expand Up @@ -114,15 +116,16 @@ type GenerateS3PostHandlerResponseBody struct {
}

// GenerateS3PostHandler godoc
// @Summary Generate test data on AWS S3
// @Description Generate test data on AWS S3.
// @Tags [Test Data Generation] AWS S3
// @Accept json
// @Produce json
// @Param RequestBody body GenDataParams true "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully generated test data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /generate/s3 [post]
//
// @Summary Generate test data on AWS S3
// @Description Generate test data on AWS S3.
// @Tags [Test Data Generation]
// @Accept json
// @Produce json
// @Param RequestBody body GenDataParams true "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully generated test data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /generate/s3 [post]
func GenerateS3PostHandler(ctx echo.Context) error {
start := time.Now()

Expand Down Expand Up @@ -174,16 +177,17 @@ func GenerateS3PostHandler(ctx echo.Context) error {
}

// GenerateGCPPostHandler godoc
// @Summary Generate test data on GCP Cloud Storage
// @Description Generate test data on GCP Cloud Storage.
// @Tags [Test Data Generation] GCP Cloud Storage
// @Accept json
// @Produce json
// @Param RequestBody body GenDataParams true "Parameters required to generate test data"
// @Param CredentialGCP formData file true "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully generated test data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /generate/gcp [post]
//
// @Summary Generate test data on GCP Cloud Storage
// @Description Generate test data on GCP Cloud Storage.
// @Tags [Test Data Generation]
// @Accept json
// @Produce json
// @Param RequestBody body GenDataParams true "Parameters required to generate test data"
// @Param CredentialGCP formData file true "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully generated test data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /generate/gcp [post]
func GenerateGCPPostHandler(ctx echo.Context) error {
start := time.Now()

Expand Down Expand Up @@ -251,15 +255,16 @@ func GenerateGCPPostHandler(ctx echo.Context) error {
}

// GenerateNCPPostHandler godoc
// @Summary Generate test data on NCP Object Storage
// @Description Generate test data on NCP Object Storage.
// @Tags [Test Data Generation] NCP Object Storage
// @Accept json
// @Produce json
// @Param RequestBody body GenDataParams true "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully generated test data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /generate/ncp [post]
//
// @Summary Generate test data on NCP Object Storage
// @Description Generate test data on NCP Object Storage.
// @Tags [Test Data Generation]
// @Accept json
// @Produce json
// @Param RequestBody body GenDataParams true "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully generated test data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /generate/ncp [post]
func GenerateNCPPostHandler(ctx echo.Context) error {
start := time.Now()

Expand Down Expand Up @@ -311,15 +316,16 @@ func GenerateNCPPostHandler(ctx echo.Context) error {
}

// GenerateMySQLPostHandler godoc
// @Summary Generate test data on MySQL
// @Description Generate test data on MySQL.
// @Tags [Test Data Generation] MySQL
// @Accept json
// @Produce json
// @Param RequestBody body GenDataParams true "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully generated test data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /generate/mysql [post]
//
// @Summary Generate test data on MySQL
// @Description Generate test data on MySQL.
// @Tags [Test Data Generation]
// @Accept json
// @Produce json
// @Param RequestBody body GenDataParams true "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully generated test data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /generate/mysql [post]
func GenerateMySQLPostHandler(ctx echo.Context) error {
start := time.Now()

Expand Down Expand Up @@ -403,15 +409,16 @@ func GenerateMySQLPostHandler(ctx echo.Context) error {
}

// GenerateDynamoDBPostHandler godoc
// @Summary Generate test data on AWS DynamoDB
// @Description Generate test data on AWS DynamoDB.
// @Tags [Test Data Generation] AWS DynamoDB
// @Accept json
// @Produce json
// @Param RequestBody body GenDataParams true "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully generated test data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /generate/dynamodb [post]
//
// @Summary Generate test data on AWS DynamoDB
// @Description Generate test data on AWS DynamoDB.
// @Tags [Test Data Generation]
// @Accept json
// @Produce json
// @Param RequestBody body GenDataParams true "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully generated test data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /generate/dynamodb [post]
func GenerateDynamoDBPostHandler(ctx echo.Context) error {
start := time.Now()

Expand Down Expand Up @@ -470,16 +477,17 @@ func GenerateDynamoDBPostHandler(ctx echo.Context) error {
}

// GenerateFirestorePostHandler godoc
// @Summary Generate test data on GCP Firestore
// @Description Generate test data on GCP Firestore.
// @Tags [Test Data Generation] GCP Firestore
// @Accept json
// @Produce json
// @Param RequestBody body GenDataParams true "Parameters required to generate test data"
// @Param CredentialGCP formData file true "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully generated test data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /generate/firestore [post]
//
// @Summary Generate test data on GCP Firestore
// @Description Generate test data on GCP Firestore.
// @Tags [Test Data Generation]
// @Accept json
// @Produce json
// @Param RequestBody body GenDataParams true "Parameters required to generate test data"
// @Param CredentialGCP formData file true "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully generated test data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /generate/firestore [post]
func GenerateFirestorePostHandler(ctx echo.Context) error {
start := time.Now()

Expand Down Expand Up @@ -553,15 +561,16 @@ func GenerateFirestorePostHandler(ctx echo.Context) error {
}

// GenerateMongoDBPostHandler godoc
// @Summary Generate test data on NCP MongoDB
// @Description Generate test data on NCP MongoDB.
// @Tags [Test Data Generation] NCP MongoDB
// @Accept json
// @Produce json
// @Param RequestBody body GenDataParams true "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully generated test data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /generate/mongodb [post]
//
// @Summary Generate test data on NCP MongoDB
// @Description Generate test data on NCP MongoDB.
// @Tags [Test Data Generation]
// @Accept json
// @Produce json
// @Param RequestBody body GenDataParams true "Parameters required to generate test data"
// @Success 200 {object} models.BasicResponse "Successfully generated test data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /generate/mongodb [post]
func GenerateMongoDBPostHandler(ctx echo.Context) error {
start := time.Now()

Expand Down
50 changes: 46 additions & 4 deletions websrc/controllers/migrationGCPHandlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,18 @@ import (
"github.com/labstack/echo/v4"
)

// Object Storage

// FROM Google Cloud Storage

// MigrationGCPToLinuxPostHandler godoc
//
// @Summary Migrate data from GCP to Linux
// @Description Migrate data stored in GCP Cloud Storage to a Linux-based system.
// @Tags [Data Migration]
// @Accept json
// @Produce json
// @Param RequestBody body MigrationForm true "Parameters required for migration"
// @Success 200 {object} models.BasicResponse "Successfully migrated data"
// @Failure 400 {object} models.BasicResponse "Invalid Request"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /gcp/linux [post]
func MigrationGCPToLinuxPostHandler(ctx echo.Context) error {

start := time.Now()
Expand Down Expand Up @@ -81,6 +89,18 @@ func MigrationGCPToLinuxPostHandler(ctx echo.Context) error {
})
}

// MigrationGCPToWindowsPostHandler godoc
//
// @Summary Migrate data from GCP to Windows
// @Description Migrate data stored in GCP Cloud Storage to a Windows-based system.
// @Tags [Data Migration]
// @Accept json
// @Produce json
// @Param RequestBody body MigrationForm true "Parameters required for migration"
// @Success 200 {object} models.BasicResponse "Successfully migrated data"
// @Failure 400 {object} models.BasicResponse "Invalid Request"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /gcp/windows [post]
func MigrationGCPToWindowsPostHandler(ctx echo.Context) error {

start := time.Now()
Expand Down Expand Up @@ -134,6 +154,17 @@ func MigrationGCPToWindowsPostHandler(ctx echo.Context) error {
})
}

// MigrationGCPToS3PostHandler godoc
//
// @Summary Migrate data from GCP to AWS S3
// @Description Migrate data stored in GCP Cloud Storage to AWS S3.
// @Tags [Data Migration]
// @Accept json
// @Produce json
// @Param RequestBody body MigrationForm true "Parameters required for migration"
// @Success 200 {object} models.BasicResponse "Successfully migrated data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /gcp/s3 [post]
func MigrationGCPToS3PostHandler(ctx echo.Context) error {

start := time.Now()
Expand Down Expand Up @@ -193,6 +224,17 @@ func MigrationGCPToS3PostHandler(ctx echo.Context) error {
})
}

// MigrationGCPToNCPPostHandler godoc
//
// @Summary Migrate data from GCP to NCP Object Storage
// @Description Migrate data stored in GCP Cloud Storage to NCP Object Storage.
// @Tags [Data Migration]
// @Accept json
// @Produce json
// @Param RequestBody body MigrationForm true "Parameters required for migration"
// @Success 200 {object} models.BasicResponse "Successfully migrated data"
// @Failure 500 {object} models.BasicResponse "Internal Server Error"
// @Router /gcp/ncp [post]
func MigrationGCPToNCPPostHandler(ctx echo.Context) error {

start := time.Now()
Expand Down
Loading

0 comments on commit ea3e36d

Please sign in to comment.