feat: initialized all controllers for release 1;

feat: authentication added to swagger
This commit is contained in:
2025-06-18 18:27:12 +03:00
parent 582c0f15d8
commit b1ef3e06f6
7 changed files with 434 additions and 7 deletions

View File

@@ -0,0 +1,65 @@
package controllers
import (
"net/http"
"github.com/gin-gonic/gin"
)
// @Summary Get someone's profile details
// @Tags Profile
// @Accept json
// @Produce json
// @Param username path string true "Username"
// @Security JWT
// @Router /profile/{username} [get]
func GetProfile(c *gin.Context) {
username := c.Param("username")
if username == "" {
c.JSON(http.StatusBadRequest, gin.H{
"error": "Username cannot be empty",
})
return
}
c.JSON(http.StatusNotImplemented, gin.H{
"username": username,
})
}
// @Summary Get own profile when authorized
// @Tags Profile
// @Accept json
// @Produce json
// @Security JWT
// @Router /profile/me [get]
func GetOwnProfile(c *gin.Context) {
username := "Gregory House"
c.JSON(http.StatusNotImplemented, gin.H{
"username": username,
})
}
// @Summary Get profile privacy settings
// @Tags Profile
// @Accept json
// @Produce json
// @Security JWT
// @Router /profile/privacy [get]
func GetPrivacySettings(c *gin.Context) {
c.Status(http.StatusNotImplemented)
}
// @Summary Update profile privacy settings
// @Tags Profile
// @Accept json
// @Produce json
// @Security JWT
// @Router /profile/privacy [patch]
func UpdatePrivacySettings(c *gin.Context) {
c.Status(http.StatusNotImplemented)
}