refactor: declaring controller methods externally because the big idiot swaggo does not want to work unless the comments are attached to a gin handler func;
fix: swagger docs work now; chore: remove incomplete account and profile controllers; fix: correct client info type in request middleware
This commit is contained in:
@@ -1,94 +0,0 @@
|
||||
// Copyright (c) 2025 Nikolai Papin
|
||||
//
|
||||
// This file is part of Easywish
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
||||
// the GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type ProfileController interface {
|
||||
GetProfile(c *gin.Context)
|
||||
GetOwnProfile(c *gin.Context)
|
||||
UpdateProfile(c *gin.Context)
|
||||
GetPrivacySettings(c *gin.Context)
|
||||
UpdatePrivacySettings(c *gin.Context)
|
||||
Router
|
||||
}
|
||||
|
||||
type profileControllerImpl struct {
|
||||
}
|
||||
|
||||
func NewProfileController() ProfileController {
|
||||
return &profileControllerImpl{}
|
||||
}
|
||||
|
||||
// @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 (p *profileControllerImpl) GetProfile(c *gin.Context) {
|
||||
c.Status(http.StatusNotImplemented)
|
||||
}
|
||||
|
||||
// @Summary Get own profile when authorized
|
||||
// @Tags Profile
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security JWT
|
||||
// @Router /profile/me [get]
|
||||
func (p *profileControllerImpl) GetOwnProfile(c *gin.Context) {
|
||||
c.Status(http.StatusNotImplemented)
|
||||
}
|
||||
|
||||
// @Summary Update profile
|
||||
// @Tags Profile
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security JWT
|
||||
// @Router /profile [patch]
|
||||
func (p *profileControllerImpl) UpdateProfile(c *gin.Context) {
|
||||
c.Status(http.StatusNotImplemented)
|
||||
}
|
||||
|
||||
// @Summary Get profile privacy settings
|
||||
// @Tags Profile
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security JWT
|
||||
// @Router /profile/privacy [get]
|
||||
func (p *profileControllerImpl) 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 (p *profileControllerImpl) UpdatePrivacySettings(c *gin.Context) {
|
||||
c.Status(http.StatusNotImplemented)
|
||||
}
|
||||
|
||||
func (p *profileControllerImpl) RegisterRoutes(group *gin.RouterGroup) {
|
||||
}
|
||||
Reference in New Issue
Block a user