dns_provider.go 455 B

1234567891011121314151617181920212223242526
  1. package certificate
  2. import (
  3. "github.com/0xJacky/Nginx-UI/internal/cert/dns"
  4. "github.com/gin-gonic/gin"
  5. "net/http"
  6. )
  7. func GetDNSProvidersList(c *gin.Context) {
  8. c.JSON(http.StatusOK, dns.GetProvidersList())
  9. }
  10. func GetDNSProvider(c *gin.Context) {
  11. code := c.Param("code")
  12. provider, ok := dns.GetProvider(code)
  13. if !ok {
  14. c.JSON(http.StatusNotFound, gin.H{
  15. "message": "provider not found",
  16. })
  17. return
  18. }
  19. c.JSON(http.StatusOK, provider)
  20. }