Skip to content

Commit

Permalink
删除多余代码
Browse files Browse the repository at this point in the history
  • Loading branch information
yahahaff committed Apr 1, 2024
1 parent 304bf7b commit 58ae8e0
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 6,196 deletions.
2,298 changes: 0 additions & 2,298 deletions docs/docs.go

This file was deleted.

2,273 changes: 0 additions & 2,273 deletions docs/swagger.json

This file was deleted.

1,441 changes: 0 additions & 1,441 deletions docs/swagger.yaml

This file was deleted.

62 changes: 0 additions & 62 deletions internal/controllers/api/cloudflare/dns_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,6 @@ type ErrorChain struct {
Message string `json:"message"`
}

// GetDnsList 获取dns列表
// @BasePath
// @Summary 获取dns列表
// @Security Bearer
// @Schemes
// @Description
// @Tags cloudflare
// @Accept json
// @Produce json
// @Param zone_id query string true "zone_id"
// @Success 200 {object} response.Response
// @Router /api/cloudflare/dns/getDnsList [get]
func (d *DnsController) GetDnsList(c *gin.Context) {
CloudflareApi := config.GetString("cloudflare.api")
fmt.Println(CloudflareApi)
Expand Down Expand Up @@ -93,18 +81,6 @@ func (d *DnsController) GetDnsList(c *gin.Context) {
response.OK(c, Data)
}

// CreateDnsRecord 创建Dns记录
// @BasePath
// @Summary 创建Dns记录
// @Security Bearer
// @Schemes
// @Description
// @Tags cloudflare
// @Param data body cloudflare.DnsCreateRequest{} true "body"
// @Accept json
// @Produce json
// @Success 200 {object} response.Response
// @Router /api/cloudflare/dns/createDnsRecord [POST]
func (d *DnsController) CreateDnsRecord(c *gin.Context) {
// 1.参数验证
var request cloudflare.DnsCreateRequest
Expand Down Expand Up @@ -160,19 +136,6 @@ func (d *DnsController) CreateDnsRecord(c *gin.Context) {

}

// DeleteDnsRecord 删除Dns记录
// @BasePath
// @Summary 删除Dns记录
// @Security Bearer
// @Schemes
// @Description
// @Tags cloudflare
// @Param zone_id query string true "zone_id"
// @Param dns_id query string true "dns_id"
// @Accept json
// @Produce json
// @Success 200 {object} response.Response
// @Router /api/cloudflare/dns/deleteDnsRecord [DELETE]
func (d *DnsController) DeleteDnsRecord(c *gin.Context) {
// 1.参数验证
request := cloudflare.DnsDeleteRequest{
Expand Down Expand Up @@ -216,19 +179,6 @@ func (d *DnsController) DeleteDnsRecord(c *gin.Context) {

}

// GetDnsRecordDetail 获取Dns记录详情
// @BasePath
// @Summary 获取Dns记录详情
// @Security Bearer
// @Schemes
// @Description
// @Tags cloudflare
// @Param zone_id query string true "zone_id"
// @Param dns_id query string true "dns_id"
// @Accept json
// @Produce json
// @Success 200 {object} response.Response
// @Router /api/cloudflare/dns/getDnsRecordDetail [GET]
func (d *DnsController) GetDnsRecordDetail(c *gin.Context) {
// 1.参数验证
request := cloudflare.DnsDeleteRequest{
Expand Down Expand Up @@ -272,18 +222,6 @@ func (d *DnsController) GetDnsRecordDetail(c *gin.Context) {

}

// UpdateDnsRecord 更新Dns记录
// @BasePath
// @Summary 更新Dns记录
// @Security Bearer
// @Schemes
// @Description
// @Tags cloudflare
// @Param data body cloudflare.DnsUpdateRequest{} true "body"
// @Accept json
// @Produce json
// @Success 200 {object} response.Response
// @Router /api/cloudflare/dns/UpdateDnsRecord [PUT]
func (d *DnsController) UpdateDnsRecord(c *gin.Context) {
// 1.参数验证
var request cloudflare.DnsUpdateRequest
Expand Down
71 changes: 0 additions & 71 deletions internal/controllers/api/cloudflare/zones_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,6 @@ type ZoneError struct {
Message string `json:"message"`
}

// GetZoneList 获取zones列表
// @BasePath
// @Summary 获取zones列表
// @Security Bearer
// @Schemes
// @Description
// @Tags cloudflare
// @Accept json
// @Produce json
// @Success 200 {object} response.Response
// @Router /api/cloudflare/zones/getZoneList [get]
func (d *ZonesController) GetZoneList(c *gin.Context) {

url := "https://api.cloudflare.com/client/v4/zones"
Expand Down Expand Up @@ -89,18 +78,6 @@ func (d *ZonesController) GetZoneList(c *gin.Context) {
response.OK(c, Data)
}

// CreateZone 创建zone
// @BasePath
// @Summary 创建zone
// @Security Bearer
// @Schemes
// @Description
// @Tags cloudflare
// @Param data body cloudflare.CreateZoneRequest{} true "body"
// @Accept json
// @Produce json
// @Success 200 {object} response.Response
// @Router /api/cloudflare/zones/createZone [POST]
func (d *ZonesController) CreateZone(c *gin.Context) {
// 1.参数验证
var request cloudflare.CreateZoneRequest
Expand Down Expand Up @@ -147,18 +124,6 @@ func (d *ZonesController) CreateZone(c *gin.Context) {

}

// DeleteZone 删除zone
// @BasePath
// @Summary 删除zone
// @Security Bearer
// @Schemes
// @Description
// @Tags cloudflare
// @Param data body cloudflare.ZoneIDRequest{} true "body"
// @Accept json
// @Produce json
// @Success 200 {object} response.Response
// @Router /api/cloudflare/zones/deleteZone [DELETE]
func (d *ZonesController) DeleteZone(c *gin.Context) {
// 1.参数验证
var request cloudflare.ZoneIDRequest
Expand Down Expand Up @@ -195,18 +160,6 @@ func (d *ZonesController) DeleteZone(c *gin.Context) {

}

// GetZoneDetails 获取zone详情
// @BasePath
// @Summary 获取zone详情
// @Security Bearer
// @Schemes
// @Description
// @Tags cloudflare
// @Accept json
// @Produce json
// @Param zone_id query string true "zone_id"
// @Success 200 {object} response.Response
// @Router /api/cloudflare/zones/getZoneDetails [get]
func (d *ZonesController) GetZoneDetails(c *gin.Context) {
// 1.参数验证
var request cloudflare.ZoneIDRequest
Expand Down Expand Up @@ -242,18 +195,6 @@ func (d *ZonesController) GetZoneDetails(c *gin.Context) {

}

// EditZone 更新zone
// @BasePath
// @Summary 更新zone
// @Security Bearer
// @Schemes
// @Description
// @Tags cloudflare
// @Accept json
// @Produce json
// @Param data body cloudflare.EditZoneRequest{} true "body"
// @Success 200 {object} response.Response
// @Router /api/cloudflare/zones/editZone [PATCH]
func (d *ZonesController) EditZone(c *gin.Context) {
// 1.参数验证
var request cloudflare.EditZoneRequest
Expand Down Expand Up @@ -291,18 +232,6 @@ func (d *ZonesController) EditZone(c *gin.Context) {
response.OK(c, responseData)
}

// PurgeCacheZone 清空zone缓存
// @BasePath 清空zone缓存
// @Summary
// @Security Bearer
// @Schemes
// @Description
// @Tags cloudflare
// @Accept json
// @Produce json
// @Param zone_id query string true "zone_id"
// @Success 200 {object} response.Response
// @Router /api/cloudflare/zones/purgeCache [POST]
func (d *ZonesController) PurgeCacheZone(c *gin.Context) {
// 1.参数验证
var request cloudflare.ZoneIDRequest
Expand Down
18 changes: 0 additions & 18 deletions internal/controllers/api/domain/domain_controller.go

This file was deleted.

12 changes: 0 additions & 12 deletions internal/routes/domain/domain.go

This file was deleted.

9 changes: 0 additions & 9 deletions internal/routes/oss/aliyun.go

This file was deleted.

9 changes: 0 additions & 9 deletions internal/routes/oss/oss.go

This file was deleted.

3 changes: 1 addition & 2 deletions internal/routes/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ package routes
import (
"github.com/gin-gonic/gin"
"github.com/yahahaff/rapide/internal/middlewares"
"github.com/yahahaff/rapide/internal/routes/cloudflare"
"github.com/yahahaff/rapide/internal/routes/sys"
)

// RegisterAPIRoutes 注册分支路由
func RegisterAPIRoutes(Router *gin.Engine) {
Router.Use(middlewares.RecordOperation())
sys.RouterGroup(Router)
cloudflare.RouterGroup(Router)
//cloudflare.RouterGroup(Router)
}
3 changes: 2 additions & 1 deletion internal/routes/sys/sys.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package sys
import "github.com/gin-gonic/gin"

func RouterGroup(router *gin.Engine) *gin.RouterGroup {
sys := router.Group("/api")
internal := router.Group("")
InternalRouter(internal)

sys := router.Group("/api")
AuthRouter(sys)
UserRouter(sys)
CaptchaRouter(sys)
Expand Down

0 comments on commit 58ae8e0

Please sign in to comment.