Add swagger docs

This commit is contained in:
hantmac
2020-05-01 23:11:51 +08:00
parent 09ea0bb56a
commit f59ca2b605
11 changed files with 7977 additions and 0 deletions

View File

@@ -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"),