From 6ced549deaecb42b9bb93ea9efcb4c1bbaabe8a4 Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Sat, 20 Sep 2025 09:35:50 +0200 Subject: docs: add comments for all functions --- web/controller/base.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'web/controller/base.go') diff --git a/web/controller/base.go b/web/controller/base.go index 15e8cb57..7bc61b64 100644 --- a/web/controller/base.go +++ b/web/controller/base.go @@ -1,3 +1,5 @@ +// Package controller provides HTTP request handlers and controllers for the 3x-ui web management panel. +// It handles routing, authentication, and API endpoints for managing Xray inbounds, settings, and more. package controller import ( @@ -10,8 +12,10 @@ import ( "github.com/gin-gonic/gin" ) +// BaseController provides common functionality for all controllers, including authentication checks. type BaseController struct{} +// checkLogin is a middleware that verifies user authentication and handles unauthorized access. func (a *BaseController) checkLogin(c *gin.Context) { if !session.IsLogin(c) { if isAjax(c) { @@ -25,6 +29,7 @@ func (a *BaseController) checkLogin(c *gin.Context) { } } +// I18nWeb retrieves an internationalized message for the web interface based on the current locale. func I18nWeb(c *gin.Context, name string, params ...string) string { anyfunc, funcExists := c.Get("I18n") if !funcExists { -- cgit v1.2.3