You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
510 B
Go
28 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)
|
|
}
|
|
|