mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-23 08:56:42 +08:00
Go: remove unused API route (#14028)
### What problem does this PR solve? As title ### Type of change - [x] Refactoring --------- Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
@@ -34,7 +34,7 @@ import (
|
||||
// @Produce json
|
||||
// @Security ApiKeyAuth
|
||||
// @Success 200 {object} map[string]interface{}
|
||||
// @Router /v1/system/token_list [get]
|
||||
// @Router /api/v1/system/tokens [get]
|
||||
func (h *SystemHandler) ListTokens(c *gin.Context) {
|
||||
// Get current user from context
|
||||
user, exists := c.Get("user")
|
||||
@@ -94,7 +94,7 @@ func (h *SystemHandler) ListTokens(c *gin.Context) {
|
||||
// @Security ApiKeyAuth
|
||||
// @Param name query string false "Name of the token"
|
||||
// @Success 200 {object} map[string]interface{}
|
||||
// @Router /v1/system/new_token [post]
|
||||
// @Router /api/v1/system/tokens [post]
|
||||
func (h *SystemHandler) CreateToken(c *gin.Context) {
|
||||
// Get current user from context
|
||||
user, exists := c.Get("user")
|
||||
@@ -164,7 +164,7 @@ func (h *SystemHandler) CreateToken(c *gin.Context) {
|
||||
// @Security ApiKeyAuth
|
||||
// @Param token path string true "The API token to remove"
|
||||
// @Success 200 {object} map[string]interface{}
|
||||
// @Router /v1/system/token/{token} [delete]
|
||||
// @Router /api/v1/system/tokens/{token} [delete]
|
||||
func (h *SystemHandler) DeleteToken(c *gin.Context) {
|
||||
// Get current user from context
|
||||
user, exists := c.Get("user")
|
||||
|
||||
@@ -117,11 +117,6 @@ func (r *Router) Setup(engine *gin.Engine) {
|
||||
// User set tenant info endpoint
|
||||
authorized.POST("/v1/user/set_tenant_info", r.userHandler.SetTenantInfo)
|
||||
|
||||
// System token endpoints (requires authentication)
|
||||
authorized.GET("/v1/system/token_list", r.systemHandler.ListTokens)
|
||||
authorized.POST("/v1/system/new_token", r.systemHandler.CreateToken)
|
||||
authorized.DELETE("/v1/system/token/:token", r.systemHandler.DeleteToken)
|
||||
|
||||
// API v1 route group
|
||||
v1 := authorized.Group("/api/v1")
|
||||
{
|
||||
@@ -134,13 +129,6 @@ func (r *Router) Setup(engine *gin.Engine) {
|
||||
// users.GET("/:id", r.userHandler.GetUserByID)
|
||||
//}
|
||||
|
||||
//apiTokens := v1.Group("/tokens")
|
||||
//{
|
||||
// apiTokens.POST("", r.systemHandler.CreateToken)
|
||||
// apiTokens.GET("", r.systemHandler.ListTokens)
|
||||
// apiTokens.DELETE("/:token", r.systemHandler.DeleteToken)
|
||||
//}
|
||||
|
||||
// Document routes
|
||||
documents := v1.Group("/documents")
|
||||
{
|
||||
@@ -193,13 +181,13 @@ func (r *Router) Setup(engine *gin.Engine) {
|
||||
chats.GET("/:chat_id", r.chatHandler.GetChat)
|
||||
}
|
||||
|
||||
searches := v1.Group("/searches")
|
||||
{
|
||||
searches.GET("", r.searchHandler.ListSearches)
|
||||
searches.POST("", r.searchHandler.CreateSearch)
|
||||
searches.GET("/:search_id", r.searchHandler.GetSearch)
|
||||
searches.DELETE("/:search_id", r.searchHandler.DeleteSearch)
|
||||
}
|
||||
searches := v1.Group("/searches")
|
||||
{
|
||||
searches.GET("", r.searchHandler.ListSearches)
|
||||
searches.POST("", r.searchHandler.CreateSearch)
|
||||
searches.GET("/:search_id", r.searchHandler.GetSearch)
|
||||
searches.DELETE("/:search_id", r.searchHandler.DeleteSearch)
|
||||
}
|
||||
|
||||
file := v1.Group("/files")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user