kopia lustrzana https://github.com/reiver/greatape
docs(app): 📝 update for routes
rodzic
0a900796e4
commit
17005cd73d
|
@ -12,15 +12,15 @@ import (
|
||||||
"server"
|
"server"
|
||||||
)
|
)
|
||||||
|
|
||||||
// @title GreatApe API
|
// @title GreatApe API
|
||||||
// @version 1.0
|
// @version 1.0
|
||||||
// @description GreatApe is a free audio and video social-media platform that can be used via an app.
|
// @description GreatApe is a free audio and video social-media platform that can be used via an app.
|
||||||
// @description It is a Fediverse technology that supports federation via ActivityPub.
|
// @description It is a Fediverse technology that supports federation via ActivityPub.
|
||||||
// @BasePath /
|
// @BasePath /
|
||||||
// @securityDefinitions.apiKey JWT
|
// @securityDefinitions.apiKey JWT
|
||||||
// @in header
|
// @in header
|
||||||
// @name Authorization
|
// @name Authorization
|
||||||
// @description Example: Bearer {Your JWT Token}
|
// @description Example: Bearer {Your JWT Token}
|
||||||
func main() {
|
func main() {
|
||||||
if config.IsProduction() {
|
if config.IsProduction() {
|
||||||
docs.SwaggerInfo.Host = config.DOMAIN
|
docs.SwaggerInfo.Host = config.DOMAIN
|
||||||
|
|
|
@ -11,13 +11,13 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Followers godoc
|
// Followers godoc
|
||||||
// @Tags ActivityPub
|
// @Tags ActivityPub
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param username path string true "Username"
|
// @Param username path string true "Username"
|
||||||
// @Success 200 {object} map[string]interface{}
|
// @Success 200 {object} map[string]interface{}
|
||||||
// @Router /u/{username}/followers [get]
|
// @Router /u/{username}/followers [get]
|
||||||
func _() {}
|
func _() {}
|
||||||
|
|
||||||
var Followers = route.New(HttpGet, "/u/:username/followers", func(x IContext) error {
|
var Followers = route.New(HttpGet, "/u/:username/followers", func(x IContext) error {
|
||||||
|
|
|
@ -10,12 +10,12 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// Following godoc
|
// Following godoc
|
||||||
// @Tags ActivityPub
|
// @Tags ActivityPub
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param username path string true "Username"
|
// @Param username path string true "Username"
|
||||||
// @Success 200 {object} map[string]interface{}
|
// @Success 200 {object} map[string]interface{}
|
||||||
// @Router /u/{username}/following [get]
|
// @Router /u/{username}/following [get]
|
||||||
func _() {}
|
func _() {}
|
||||||
|
|
||||||
var Following = route.New(HttpGet, "/u/:username/following", func(x IContext) error {
|
var Following = route.New(HttpGet, "/u/:username/following", func(x IContext) error {
|
||||||
|
|
|
@ -11,12 +11,12 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// Login godoc
|
// Login godoc
|
||||||
// @Tags Authentication
|
// @Tags Authentication
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param payload body dto.LoginRequest true "Payload"
|
// @Param payload body dto.LoginRequest true "Payload"
|
||||||
// @Success 200 {object} dto.LoginResponse
|
// @Success 200 {object} dto.LoginResponse
|
||||||
// @Router /api/v1/login [post]
|
// @Router /api/v1/login [post]
|
||||||
func _() {}
|
func _() {}
|
||||||
|
|
||||||
var Login = route.New(HttpPost, "/api/v1/login", func(x IContext) error {
|
var Login = route.New(HttpPost, "/api/v1/login", func(x IContext) error {
|
||||||
|
|
|
@ -18,12 +18,12 @@ var Profile = route.New(HttpGet, "/profile", func(x IContext) error {
|
||||||
})
|
})
|
||||||
|
|
||||||
// GetProfile godoc
|
// GetProfile godoc
|
||||||
// @Tags User
|
// @Tags User
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Security JWT
|
// @Security JWT
|
||||||
// @Success 200 {object} dto.User
|
// @Success 200 {object} dto.User
|
||||||
// @Router /api/v1/profile [get]
|
// @Router /api/v1/profile [get]
|
||||||
func _() {}
|
func _() {}
|
||||||
|
|
||||||
var GetProfile = route.New(HttpGet, "/api/v1/profile", func(x IContext) error {
|
var GetProfile = route.New(HttpGet, "/api/v1/profile", func(x IContext) error {
|
||||||
|
|
|
@ -12,12 +12,12 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// Signup godoc
|
// Signup godoc
|
||||||
// @Tags Authentication
|
// @Tags Authentication
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param payload body dto.SignupRequest true "Payload"
|
// @Param payload body dto.SignupRequest true "Payload"
|
||||||
// @Success 200 {object} dto.SignupResponse
|
// @Success 200 {object} dto.SignupResponse
|
||||||
// @Router /api/v1/signup [post]
|
// @Router /api/v1/signup [post]
|
||||||
func _() {}
|
func _() {}
|
||||||
|
|
||||||
var Signup = route.New(HttpPost, "/api/v1/signup", func(x IContext) error {
|
var Signup = route.New(HttpPost, "/api/v1/signup", func(x IContext) error {
|
||||||
|
@ -64,12 +64,12 @@ var Signup = route.New(HttpPost, "/api/v1/signup", func(x IContext) error {
|
||||||
})
|
})
|
||||||
|
|
||||||
// Verify godoc
|
// Verify godoc
|
||||||
// @Tags Authentication
|
// @Tags Authentication
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param payload body dto.VerifyRequest true "Payload"
|
// @Param payload body dto.VerifyRequest true "Payload"
|
||||||
// @Success 200 {object} dto.VerifyResponse
|
// @Success 200 {object} dto.VerifyResponse
|
||||||
// @Router /api/v1/verify [post]
|
// @Router /api/v1/verify [post]
|
||||||
func _() {}
|
func _() {}
|
||||||
|
|
||||||
var Verify = route.New(HttpPost, "/api/v1/verify", func(x IContext) error {
|
var Verify = route.New(HttpPost, "/api/v1/verify", func(x IContext) error {
|
||||||
|
|
|
@ -9,12 +9,12 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// User godoc
|
// User godoc
|
||||||
// @Tags ActivityPub
|
// @Tags ActivityPub
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param username path string true "Username"
|
// @Param username path string true "Username"
|
||||||
// @Success 200 {object} map[string]interface{}
|
// @Success 200 {object} map[string]interface{}
|
||||||
// @Router /u/{username} [get]
|
// @Router /u/{username} [get]
|
||||||
func _() {}
|
func _() {}
|
||||||
|
|
||||||
var User = route.New(contracts.HttpGet, "/u/:username", func(x contracts.IContext) error {
|
var User = route.New(contracts.HttpGet, "/u/:username", func(x contracts.IContext) error {
|
||||||
|
|
|
@ -9,12 +9,12 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// WebFinger godoc
|
// WebFinger godoc
|
||||||
// @Tags WebFinger
|
// @Tags WebFinger
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param resource query string true "Resource" default(acct:user@domain.com)
|
// @Param resource query string true "Resource" default(acct:user@domain.com)
|
||||||
// @Success 200 {object} map[string]interface{}
|
// @Success 200 {object} map[string]interface{}
|
||||||
// @Router /.well-known/webfinger [get]
|
// @Router /.well-known/webfinger [get]
|
||||||
func _() {}
|
func _() {}
|
||||||
|
|
||||||
var WebFinger = route.New(HttpGet, "/.well-known/webfinger", func(x IContext) error {
|
var WebFinger = route.New(HttpGet, "/.well-known/webfinger", func(x IContext) error {
|
||||||
|
|
Ładowanie…
Reference in New Issue