Add swaggo annotations to all handlers and regenerate full Swagger docs
- Added @Summary/@Router/@Param/@Success/@Security annotations to all API handlers - Regenerated docs/swagger.json, docs/swagger.yaml, docs/docs.go with full endpoint definitions - Fixed generated docs.go to remove unsupported LeftDelim/RightDelim fields
This commit is contained in:
@@ -39,6 +39,18 @@ type tokenResponse struct {
|
||||
LiveKitURL string `json:"livekit_url"`
|
||||
}
|
||||
|
||||
// @Summary Get voice token
|
||||
// @Description Get a LiveKit access token for a voice room
|
||||
// @Tags voice
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Security SessionAuth
|
||||
// @Param body body tokenRequest true "Room data"
|
||||
// @Success 200 {object} tokenResponse
|
||||
// @Failure 400 {object} map[string]string
|
||||
// @Failure 401 {object} map[string]string
|
||||
// @Failure 404 {object} map[string]string
|
||||
// @Router /voice/token [post]
|
||||
func (h *Handler) GetToken(w http.ResponseWriter, r *http.Request) {
|
||||
userID, ok := middleware.UserIDFromContext(r.Context())
|
||||
if !ok {
|
||||
@@ -94,6 +106,15 @@ func (h *Handler) GetToken(w http.ResponseWriter, r *http.Request) {
|
||||
})
|
||||
}
|
||||
|
||||
// @Summary Get voice room participants
|
||||
// @Description Get participants in a voice room
|
||||
// @Tags voice
|
||||
// @Produce json
|
||||
// @Param roomID path string true "Room ID"
|
||||
// @Success 200 {array} object
|
||||
// @Failure 400 {object} map[string]string
|
||||
// @Failure 500 {object} map[string]string
|
||||
// @Router /voice/rooms/{roomID}/participants [get]
|
||||
func (h *Handler) GetParticipants(w http.ResponseWriter, r *http.Request) {
|
||||
roomID := chi.URLParam(r, "roomID")
|
||||
if roomID == "" {
|
||||
|
||||
Reference in New Issue
Block a user