mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
30 lines
552 B
Go
30 lines
552 B
Go
package routes
|
|
|
|
import (
|
|
"crawlab/services"
|
|
"github.com/gin-gonic/gin"
|
|
"net/http"
|
|
)
|
|
|
|
func GetGitBranches(c *gin.Context) {
|
|
url := c.Query("url")
|
|
branches, err := services.GetGitBranches(url)
|
|
if err != nil {
|
|
HandleError(http.StatusInternalServerError, c, err)
|
|
}
|
|
c.JSON(http.StatusOK, Response{
|
|
Status: "ok",
|
|
Message: "success",
|
|
Data: branches,
|
|
})
|
|
}
|
|
|
|
func GetGitSshPublicKey(c *gin.Context) {
|
|
content := services.GetGitSshPublicKey()
|
|
c.JSON(http.StatusOK, Response{
|
|
Status: "ok",
|
|
Message: "success",
|
|
Data: content,
|
|
})
|
|
}
|