mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 10:25:52 +02:00
27 lines
510 B
Go
27 lines
510 B
Go
package certificate
|
|
|
|
import (
|
|
"github.com/0xJacky/Nginx-UI/internal/cert/dns"
|
|
"github.com/gin-gonic/gin"
|
|
"net/http"
|
|
)
|
|
|
|
func GetDNSProvidersList(c *gin.Context) {
|
|
c.JSON(http.StatusOK, dns.GetProvidersList())
|
|
}
|
|
|
|
func GetDNSProvider(c *gin.Context) {
|
|
code := c.Param("code")
|
|
|
|
provider, ok := dns.GetProvider(code)
|
|
|
|
if !ok {
|
|
c.JSON(http.StatusNotFound, gin.H{
|
|
"message": "provider not found",
|
|
})
|
|
return
|
|
}
|
|
|
|
c.JSON(http.StatusOK, provider)
|
|
}
|
|
|