mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-29 18:00:51 +01:00
Add swagger docs
This commit is contained in:
@@ -13,6 +13,14 @@ type SettingBody struct {
|
||||
EnableDemoSpiders string `json:"enable_demo_spiders"`
|
||||
}
|
||||
|
||||
// @Summary Get version
|
||||
// @Description Get version
|
||||
// @Tags setting
|
||||
// @Produce json
|
||||
// @Param Authorization header string true "Authorization token"
|
||||
// @Success 200 json string Response
|
||||
// @Failure 400 json string Response
|
||||
// @Router /version [get]
|
||||
func GetVersion(c *gin.Context) {
|
||||
version := viper.GetString("version")
|
||||
|
||||
@@ -23,6 +31,14 @@ func GetVersion(c *gin.Context) {
|
||||
})
|
||||
}
|
||||
|
||||
// @Summary Get setting
|
||||
// @Description Get setting
|
||||
// @Tags setting
|
||||
// @Produce json
|
||||
// @Param Authorization header string true "Authorization token"
|
||||
// @Success 200 json string Response
|
||||
// @Failure 400 json string Response
|
||||
// @Router /setting [get]
|
||||
func GetSetting(c *gin.Context) {
|
||||
body := SettingBody{
|
||||
AllowRegister: viper.GetString("setting.allowRegister"),
|
||||
|
||||
Reference in New Issue
Block a user