Browse Source

feat:xiugai

wangchuanjin 5 months ago
parent
commit
28b60d0e30

BIN
aiChat.exe


+ 1 - 1
api/aiSearch/aiSearch.go

@@ -18,5 +18,5 @@ type IAiSearchV1 interface {
 	ProblemDelete(ctx context.Context, req *v1.ProblemDeleteReq) (res *v1.ProblemDeleteRes, err error)
 	ProblemList(ctx context.Context, req *v1.ProblemListReq) (res *v1.ProblemListRes, err error)
 	ProblemConfiguration(ctx context.Context, req *v1.ProblemConfigurationReq) (res *v1.ProblemConfigurationRes, err error)
-	ProblemCollect(ctx context.Context, req *v1.ProblemCollectReq) (res *v1.ProblemCollectRes, err error)
+	Chat(ctx context.Context, req *v1.ChatReq) (res *v1.ChatRes, err error)
 }

+ 5 - 3
api/aiSearch/v1/aiSearchApi.go

@@ -70,11 +70,13 @@ type ProblemConfigurationRes struct {
 	ErrorMsg  string      `dc:"错误信息"`
 	Data      interface{} `dc:"返回数据"`
 }
-type ProblemCollectReq struct {
-	g.Meta `path:"/problem/collect" tags:"AiSearch" method:"post" summary:"问题收藏"`
+type ChatReq struct {
+	g.Meta  `path:"/chat" tags:"AiSearch" method:"post" summary:"聊天"`
+	SId     int    `json:"sId" v:"required" dc:"当前会话id"`
+	Content string `json:"content" v:"required" dc:"用户发送内容"`
 }
 
-type ProblemCollectRes struct {
+type ChatRes struct {
 	ErrorCode int         `dc:"状态码"`
 	ErrorMsg  string      `dc:"错误信息"`
 	Data      interface{} `dc:"返回数据"`

+ 115 - 0
internal/controller/aiSearch/aiSearch_v1_chat.go

@@ -0,0 +1,115 @@
+package aiSearch
+
+import (
+	"aiChat/api/aiSearch/v1"
+	"context"
+	"errors"
+	"fmt"
+	"io/ioutil"
+	"log"
+	"strings"
+	"time"
+
+	"github.com/gogf/gf/v2/encoding/gjson"
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/os/gtime"
+)
+
+func (c *ControllerV1) Chat(ctx context.Context, req *v1.ChatReq) (res *v1.ChatRes, err error) {
+	content := fmt.Sprintf(g.Cfg("ai_search.yaml").MustGet(ctx, "prompt").String(), req.Content)
+	query, largeModelReply, err := c.doubao(ctx, content)
+	if err != nil {
+		query, largeModelReply, err = c.zhipu(ctx, content)
+	}
+	log.Println(query, largeModelReply, err)
+	return nil, nil
+}
+
+//调用豆包大模型
+func (c *ControllerV1) doubao(ctx context.Context, content string) (string, string, error) {
+	count, err := g.Redis("main").Incr(ctx, fmt.Sprintf("aiSearch_doubaoCall_%s", gtime.Now().Format("YYYYmmdd")))
+	if err != nil {
+		g.Log().Error(ctx, "从redis获取doubao调用次数出错", err)
+		return "", "", err
+	} else if doubaoCallMax := g.Cfg("ai_search.yaml").MustGet(ctx, "doubaoCallMax").Int64(); count > doubaoCallMax {
+		g.Log().Info(ctx, "doubao调用次数达到上限", doubaoCallMax, count)
+		return "", "", errors.New("doubao调用次数达到上限")
+	}
+	// 构造请求数据
+	messages := []map[string]interface{}{}
+	messages = append(messages, map[string]interface{}{
+		"role":    "user",
+		"content": content,
+	})
+	//glm-4-air	glm-4-0520  glm-4-flash
+	requestData := map[string]interface{}{
+		"model":       "ep-20250207170552-g8dsx",
+		"temperature": 0.1,
+		"top_p":       0.7,
+		"messages":    messages,
+	}
+	return c.post(ctx, "doubao", "https://ark.cn-beijing.volces.com/api/v3/chat/completions", "3dd861bf-b8a7-41d4-bb0b-5076362c572d", requestData)
+}
+
+//调用智普大模型
+func (c *ControllerV1) zhipu(ctx context.Context, content string) (string, string, error) {
+	count, err := g.Redis("main").Incr(ctx, fmt.Sprintf("aiSearch_doubaoCall_%s", gtime.Now().Format("YYYYmmdd")))
+	if err != nil {
+		g.Log().Error(ctx, "从redis获取zhipu调用次数出错", err)
+		return "", "", err
+	} else if doubaoCallMax := g.Cfg("ai_search.yaml").MustGet(ctx, "zhipuCallMax").Int64(); count > doubaoCallMax {
+		g.Log().Info(ctx, "zhipu调用次数达到上限", doubaoCallMax, count)
+		return "", "", errors.New("zhipu调用次数达到上限")
+	}
+	// 构造请求数据
+	messages := []map[string]interface{}{}
+	messages = append(messages, map[string]interface{}{
+		"role":    "user",
+		"content": content,
+	})
+	//glm-4-air	glm-4-0520  glm-4-flash
+	requestData := map[string]interface{}{
+		"model":       "glm-4-flash",
+		"messages":    messages,
+		"temperature": 0.1,
+		"max_tokens":  4096,
+	}
+	return c.post(ctx, "zhipu", "https://open.bigmodel.cn/api/paas/v4/chat/completions", "3d84d30b7ab4c94dbf71853cb7e44719.hLLS4CA2MqVQs6kR", requestData)
+}
+
+func (c *ControllerV1) post(ctx context.Context, t, apiURL, pass string, requestData map[string]interface{}) (string, string, error) {
+	resp, err := g.Client().Timeout(time.Duration(g.Cfg("ai_search.yaml").MustGet(ctx, "timeout").Int())*time.Second).
+		SetHeader("Authorization", fmt.Sprintf("Bearer %s", pass)).
+		ContentType("application/json").
+		Post(ctx, apiURL, requestData)
+	if err != nil {
+		g.Log().Error(ctx, t, "请求出错", err)
+		return "", "", err
+	}
+	defer resp.Body.Close()
+	b, be := ioutil.ReadAll(resp.Body)
+	if be != nil {
+		g.Log().Error(ctx, t, "gjson.LoadJson出错", be)
+		return "", "", err
+	}
+	largeModelReply := string(b)
+	g.Log().Error(ctx, t, "请求回复", largeModelReply)
+	r, re := gjson.LoadJson(b)
+	if re != nil {
+		g.Log().Error(ctx, t, largeModelReply, "gjson.LoadJson出错", re)
+		return "", largeModelReply, err
+	}
+	content := ""
+	choices := r.GetJsons("choices")
+	if len(choices) == 0 {
+		return "", largeModelReply, err
+	}
+	message := choices[0].GetJson("message")
+	if message == nil {
+		return "", largeModelReply, err
+	}
+	content = message.Get("content").String()
+	content = strings.ReplaceAll(content, "```json", "")
+	content = strings.ReplaceAll(content, "```", "")
+	return content, largeModelReply, nil
+}

+ 0 - 14
internal/controller/aiSearch/aiSearch_v1_problem_collect.go

@@ -1,14 +0,0 @@
-package aiSearch
-
-import (
-	"context"
-
-	"github.com/gogf/gf/v2/errors/gcode"
-	"github.com/gogf/gf/v2/errors/gerror"
-
-	"aiChat/api/aiSearch/v1"
-)
-
-func (c *ControllerV1) ProblemCollect(ctx context.Context, req *v1.ProblemCollectReq) (res *v1.ProblemCollectRes, err error) {
-	return nil, gerror.NewCode(gcode.CodeNotImplemented)
-}

+ 31 - 0
logs/2025-02-25.log

@@ -0,0 +1,31 @@
+2025-02-25 18:45:11.210 [INFO] {24d20b209f6d27186c2dce28a52329bf} 初始化mongodb
+2025-02-25 18:48:05.765 [INFO] {78f364c4c76d2718b5ebe47feb3308e3} 初始化mongodb
+2025-02-25 18:50:56.671 [INFO] {20ab178fef6d2718662295286f51b026} 初始化mongodb
+2025-02-25 18:51:57.372 [ERRO] {4093c1abfd6d27186b229528222114ee} doubao调用次数达到上限 0 1 
+Stack:
+1.  aiChat/internal/controller/aiSearch.(*ControllerV1).doubao
+    D:/workspace/go_project/SocialPlatform/aiChat/internal/controller/aiSearch/aiSearch_v1_chat.go:30
+2.  aiChat/internal/controller/aiSearch.(*ControllerV1).Chat
+    D:/workspace/go_project/SocialPlatform/aiChat/internal/controller/aiSearch/aiSearch_v1_chat.go:17
+3.  aiChat/internal/middleware.MiddlewareHandlerSession
+    D:/workspace/go_project/SocialPlatform/aiChat/internal/middleware/sessionMiddleware.go:13
+4.  aiChat/internal/middleware.MiddlewareHandlerResponse
+    D:/workspace/go_project/SocialPlatform/aiChat/internal/middleware/resMiddleware.go:25
+
+2025-02-25 18:51:57.401 [ERRO] {4093c1abfd6d27186b229528222114ee} doubao调用次数达到上限 0 2 
+Stack:
+1.  aiChat/internal/controller/aiSearch.(*ControllerV1).zhipu
+    D:/workspace/go_project/SocialPlatform/aiChat/internal/controller/aiSearch/aiSearch_v1_chat.go:57
+2.  aiChat/internal/controller/aiSearch.(*ControllerV1).Chat
+    D:/workspace/go_project/SocialPlatform/aiChat/internal/controller/aiSearch/aiSearch_v1_chat.go:18
+3.  aiChat/internal/middleware.MiddlewareHandlerSession
+    D:/workspace/go_project/SocialPlatform/aiChat/internal/middleware/sessionMiddleware.go:13
+4.  aiChat/internal/middleware.MiddlewareHandlerResponse
+    D:/workspace/go_project/SocialPlatform/aiChat/internal/middleware/resMiddleware.go:25
+
+2025-02-25 18:54:26.444 [INFO] {0cc18a66206e271852d0361ee0669e6e} 初始化mongodb
+2025-02-25 18:55:48.646 [INFO] {28d4298a336e2718b94bd55e309142c7} 初始化mongodb
+2025-02-25 18:57:03.110 [INFO] {702d8fe0446e2718867fc45b67ed30a0} 初始化mongodb
+2025-02-25 18:58:09.601 [INFO] {6c7cc35b546e2718a2a39f6950f2c28b} 初始化mongodb
+2025-02-25 19:00:07.592 [INFO] {b89349d46f6e2718525a86067d73ed35} 初始化mongodb
+2025-02-25 19:01:44.295 [INFO] {f0148758866e2718411378487aa66e76} 初始化mongodb

+ 42 - 0
logs/2025-02-26.log

@@ -0,0 +1,42 @@
+2025-02-26 09:59:57.800 [INFO] {5c808e678a9f27181e75a94180416003} 初始化mongodb
+2025-02-26 10:00:15.305 [ERRO] {44a3b5728e9f27182275a941430261b5} doubao 请求出错 request failed: Post "https://ark.cn-beijing.volces.com/api/v3/chat/completions": context deadline exceeded (Client.Timeout exceeded while awaiting headers) 
+Stack:
+1.  aiChat/internal/controller/aiSearch.(*ControllerV1).post
+    D:/workspace/go_project/SocialPlatform/aiChat/internal/controller/aiSearch/aiSearch_v1_chat.go:85
+2.  aiChat/internal/controller/aiSearch.(*ControllerV1).doubao
+    D:/workspace/go_project/SocialPlatform/aiChat/internal/controller/aiSearch/aiSearch_v1_chat.go:50
+3.  aiChat/internal/controller/aiSearch.(*ControllerV1).Chat
+    D:/workspace/go_project/SocialPlatform/aiChat/internal/controller/aiSearch/aiSearch_v1_chat.go:19
+4.  aiChat/internal/middleware.MiddlewareHandlerSession
+    D:/workspace/go_project/SocialPlatform/aiChat/internal/middleware/sessionMiddleware.go:13
+5.  aiChat/internal/middleware.MiddlewareHandlerResponse
+    D:/workspace/go_project/SocialPlatform/aiChat/internal/middleware/resMiddleware.go:25
+
+2025-02-26 10:00:15.330 [ERRO] {44a3b5728e9f27182275a941430261b5} zhipu 请求出错 request failed: Post "https://open.bigmodel.cn/api/paas/v4/chat/completions": context deadline exceeded (Client.Timeout exceeded while awaiting headers) 
+Stack:
+1.  aiChat/internal/controller/aiSearch.(*ControllerV1).post
+    D:/workspace/go_project/SocialPlatform/aiChat/internal/controller/aiSearch/aiSearch_v1_chat.go:85
+2.  aiChat/internal/controller/aiSearch.(*ControllerV1).zhipu
+    D:/workspace/go_project/SocialPlatform/aiChat/internal/controller/aiSearch/aiSearch_v1_chat.go:76
+3.  aiChat/internal/controller/aiSearch.(*ControllerV1).Chat
+    D:/workspace/go_project/SocialPlatform/aiChat/internal/controller/aiSearch/aiSearch_v1_chat.go:21
+4.  aiChat/internal/middleware.MiddlewareHandlerSession
+    D:/workspace/go_project/SocialPlatform/aiChat/internal/middleware/sessionMiddleware.go:13
+5.  aiChat/internal/middleware.MiddlewareHandlerResponse
+    D:/workspace/go_project/SocialPlatform/aiChat/internal/middleware/resMiddleware.go:25
+
+2025-02-26 10:01:31.330 [INFO] {a4d4972ea09f2718711a0f30513757e0} 初始化mongodb
+2025-02-26 10:01:38.562 [ERRO] {50c6371da19f2718751a0f30685518c4} doubao 请求回复 {"choices":[{"finish_reason":"stop","index":0,"logprobs":null,"message":{"content":"```json\n{\n  \"关键词\": [\"光刻胶\"],\n  \"发布时间范围\": \"最近30天\",\n  \"信息类型\": \"全部\",\n  \"地区\": \"河南\",\n  \"行业\": \"全部\",\n  \"金额\": \"不限\",\n  \"采购单位类型\": \"全部\"\n}\n```","role":"assistant"}}],"created":1740535297,"id":"021740535294688a311a7d2cadff902157269149096aef630a12f","model":"deepseek-v3-241226","object":"chat.completion","usage":{"completion_tokens":64,"prompt_tokens":970,"total_tokens":1034,"prompt_tokens_details":{"cached_tokens":0},"completion_tokens_details":{"reasoning_tokens":0}}} 
+Stack:
+1.  aiChat/internal/controller/aiSearch.(*ControllerV1).post
+    D:/workspace/go_project/SocialPlatform/aiChat/internal/controller/aiSearch/aiSearch_v1_chat.go:96
+2.  aiChat/internal/controller/aiSearch.(*ControllerV1).doubao
+    D:/workspace/go_project/SocialPlatform/aiChat/internal/controller/aiSearch/aiSearch_v1_chat.go:51
+3.  aiChat/internal/controller/aiSearch.(*ControllerV1).Chat
+    D:/workspace/go_project/SocialPlatform/aiChat/internal/controller/aiSearch/aiSearch_v1_chat.go:20
+4.  aiChat/internal/middleware.MiddlewareHandlerSession
+    D:/workspace/go_project/SocialPlatform/aiChat/internal/middleware/sessionMiddleware.go:13
+5.  aiChat/internal/middleware.MiddlewareHandlerResponse
+    D:/workspace/go_project/SocialPlatform/aiChat/internal/middleware/resMiddleware.go:25
+
+2025-02-26 10:05:45.747 [INFO] {00580e6bdb9f27184de4c00585e75aeb} 初始化mongodb

+ 273 - 0
logs/server/2025-02-25.log

@@ -0,0 +1,273 @@
+2025-02-25 18:50:57.692 [INFO] swagger ui is serving at address: http://127.0.0.1:8001/swagger/
+2025-02-25 18:50:57.692 [INFO] pid[24728]: http server started listening on [:8001]
+2025-02-25 18:50:57.693 [INFO] openapi specification is serving at address: http://127.0.0.1:8001/api.json
+
+  ADDRESS | METHOD |                 ROUTE                  |                                 HANDLER                                  |    MIDDLEWARE      
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /*                                     | aiChat/internal/middleware.MiddlewareHandlerSession                      | GLOBAL MIDDLEWARE  
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/chat                  | aiChat/internal/controller/aiSearch.(*ControllerV1).Chat                 |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/configuration | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemConfiguration |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/delete        | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemDelete        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/list          | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemList          |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/session/detail        | aiChat/internal/controller/aiSearch.(*ControllerV1).SessionDetail        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/session/like          | aiChat/internal/controller/aiSearch.(*ControllerV1).LikeSession          |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | GET    | /aiChat/aiSearch/session/list          | aiChat/internal/controller/aiSearch.(*ControllerV1).HistorySsList        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | GET    | /aiChat/aiSearch/session/newCreate     | aiChat/internal/controller/aiSearch.(*ControllerV1).CreateNewSession     |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/chatHistory                    | aiChat/internal/controller.(*cChatHistory).Method                        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/evaluate                       | aiChat/internal/controller.(*cEvaluate).Method                           |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/findAnswer                     | aiChat/internal/controller.(*cFindAnswer).Method                         |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/usuallyProblem                 | aiChat/internal/controller.(*cUsuallyProblem).Method                     |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /aiChat/ws                             | aiChat/internal/controller.glob..func1                                   |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /api.json                              | github.com/gogf/gf/v2/net/ghttp.(*Server).openapiSpec                    |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /swagger/*                             | github.com/gogf/gf/v2/net/ghttp.(*Server).swaggerUI                      | HOOK_BEFORE_SERVE  
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+
+2025-02-25 18:54:27.132 [INFO] swagger ui is serving at address: http://127.0.0.1:8001/swagger/
+2025-02-25 18:54:27.132 [INFO] pid[12336]: http server started listening on [:8001]
+2025-02-25 18:54:27.134 [INFO] openapi specification is serving at address: http://127.0.0.1:8001/api.json
+
+  ADDRESS | METHOD |                 ROUTE                  |                                 HANDLER                                  |    MIDDLEWARE      
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /*                                     | aiChat/internal/middleware.MiddlewareHandlerSession                      | GLOBAL MIDDLEWARE  
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/chat                  | aiChat/internal/controller/aiSearch.(*ControllerV1).Chat                 |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/configuration | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemConfiguration |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/delete        | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemDelete        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/list          | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemList          |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/session/detail        | aiChat/internal/controller/aiSearch.(*ControllerV1).SessionDetail        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/session/like          | aiChat/internal/controller/aiSearch.(*ControllerV1).LikeSession          |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | GET    | /aiChat/aiSearch/session/list          | aiChat/internal/controller/aiSearch.(*ControllerV1).HistorySsList        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | GET    | /aiChat/aiSearch/session/newCreate     | aiChat/internal/controller/aiSearch.(*ControllerV1).CreateNewSession     |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/chatHistory                    | aiChat/internal/controller.(*cChatHistory).Method                        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/evaluate                       | aiChat/internal/controller.(*cEvaluate).Method                           |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/findAnswer                     | aiChat/internal/controller.(*cFindAnswer).Method                         |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/usuallyProblem                 | aiChat/internal/controller.(*cUsuallyProblem).Method                     |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /aiChat/ws                             | aiChat/internal/controller.glob..func1                                   |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /api.json                              | github.com/gogf/gf/v2/net/ghttp.(*Server).openapiSpec                    |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /swagger/*                             | github.com/gogf/gf/v2/net/ghttp.(*Server).swaggerUI                      | HOOK_BEFORE_SERVE  
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+
+2025-02-25 18:55:48.956 [INFO] swagger ui is serving at address: http://127.0.0.1:8001/swagger/
+2025-02-25 18:55:48.956 [INFO] pid[18688]: http server started listening on [:8001]
+2025-02-25 18:55:48.957 [INFO] openapi specification is serving at address: http://127.0.0.1:8001/api.json
+
+  ADDRESS | METHOD |                 ROUTE                  |                                 HANDLER                                  |    MIDDLEWARE      
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /*                                     | aiChat/internal/middleware.MiddlewareHandlerSession                      | GLOBAL MIDDLEWARE  
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/chat                  | aiChat/internal/controller/aiSearch.(*ControllerV1).Chat                 |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/configuration | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemConfiguration |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/delete        | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemDelete        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/list          | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemList          |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/session/detail        | aiChat/internal/controller/aiSearch.(*ControllerV1).SessionDetail        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/session/like          | aiChat/internal/controller/aiSearch.(*ControllerV1).LikeSession          |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | GET    | /aiChat/aiSearch/session/list          | aiChat/internal/controller/aiSearch.(*ControllerV1).HistorySsList        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | GET    | /aiChat/aiSearch/session/newCreate     | aiChat/internal/controller/aiSearch.(*ControllerV1).CreateNewSession     |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/chatHistory                    | aiChat/internal/controller.(*cChatHistory).Method                        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/evaluate                       | aiChat/internal/controller.(*cEvaluate).Method                           |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/findAnswer                     | aiChat/internal/controller.(*cFindAnswer).Method                         |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/usuallyProblem                 | aiChat/internal/controller.(*cUsuallyProblem).Method                     |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /aiChat/ws                             | aiChat/internal/controller.glob..func1                                   |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /api.json                              | github.com/gogf/gf/v2/net/ghttp.(*Server).openapiSpec                    |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /swagger/*                             | github.com/gogf/gf/v2/net/ghttp.(*Server).swaggerUI                      | HOOK_BEFORE_SERVE  
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+
+2025-02-25 18:57:03.404 [INFO] swagger ui is serving at address: http://127.0.0.1:8001/swagger/
+2025-02-25 18:57:03.404 [INFO] pid[1944]: http server started listening on [:8001]
+2025-02-25 18:57:03.407 [INFO] openapi specification is serving at address: http://127.0.0.1:8001/api.json
+
+  ADDRESS | METHOD |                 ROUTE                  |                                 HANDLER                                  |    MIDDLEWARE      
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /*                                     | aiChat/internal/middleware.MiddlewareHandlerSession                      | GLOBAL MIDDLEWARE  
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/chat                  | aiChat/internal/controller/aiSearch.(*ControllerV1).Chat                 |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/configuration | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemConfiguration |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/delete        | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemDelete        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/list          | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemList          |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/session/detail        | aiChat/internal/controller/aiSearch.(*ControllerV1).SessionDetail        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/session/like          | aiChat/internal/controller/aiSearch.(*ControllerV1).LikeSession          |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | GET    | /aiChat/aiSearch/session/list          | aiChat/internal/controller/aiSearch.(*ControllerV1).HistorySsList        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | GET    | /aiChat/aiSearch/session/newCreate     | aiChat/internal/controller/aiSearch.(*ControllerV1).CreateNewSession     |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/chatHistory                    | aiChat/internal/controller.(*cChatHistory).Method                        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/evaluate                       | aiChat/internal/controller.(*cEvaluate).Method                           |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/findAnswer                     | aiChat/internal/controller.(*cFindAnswer).Method                         |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/usuallyProblem                 | aiChat/internal/controller.(*cUsuallyProblem).Method                     |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /aiChat/ws                             | aiChat/internal/controller.glob..func1                                   |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /api.json                              | github.com/gogf/gf/v2/net/ghttp.(*Server).openapiSpec                    |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /swagger/*                             | github.com/gogf/gf/v2/net/ghttp.(*Server).swaggerUI                      | HOOK_BEFORE_SERVE  
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+
+2025-02-25 18:58:09.889 [INFO] swagger ui is serving at address: http://127.0.0.1:8001/swagger/
+2025-02-25 18:58:09.889 [INFO] pid[24968]: http server started listening on [:8001]
+2025-02-25 18:58:09.891 [INFO] openapi specification is serving at address: http://127.0.0.1:8001/api.json
+
+  ADDRESS | METHOD |                 ROUTE                  |                                 HANDLER                                  |    MIDDLEWARE      
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /*                                     | aiChat/internal/middleware.MiddlewareHandlerSession                      | GLOBAL MIDDLEWARE  
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/chat                  | aiChat/internal/controller/aiSearch.(*ControllerV1).Chat                 |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/configuration | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemConfiguration |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/delete        | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemDelete        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/list          | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemList          |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/session/detail        | aiChat/internal/controller/aiSearch.(*ControllerV1).SessionDetail        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/session/like          | aiChat/internal/controller/aiSearch.(*ControllerV1).LikeSession          |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | GET    | /aiChat/aiSearch/session/list          | aiChat/internal/controller/aiSearch.(*ControllerV1).HistorySsList        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | GET    | /aiChat/aiSearch/session/newCreate     | aiChat/internal/controller/aiSearch.(*ControllerV1).CreateNewSession     |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/chatHistory                    | aiChat/internal/controller.(*cChatHistory).Method                        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/evaluate                       | aiChat/internal/controller.(*cEvaluate).Method                           |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/findAnswer                     | aiChat/internal/controller.(*cFindAnswer).Method                         |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/usuallyProblem                 | aiChat/internal/controller.(*cUsuallyProblem).Method                     |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /aiChat/ws                             | aiChat/internal/controller.glob..func1                                   |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /api.json                              | github.com/gogf/gf/v2/net/ghttp.(*Server).openapiSpec                    |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /swagger/*                             | github.com/gogf/gf/v2/net/ghttp.(*Server).swaggerUI                      | HOOK_BEFORE_SERVE  
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+
+2025-02-25 19:00:07.887 [INFO] swagger ui is serving at address: http://127.0.0.1:8001/swagger/
+2025-02-25 19:00:07.887 [INFO] pid[20472]: http server started listening on [:8001]
+2025-02-25 19:00:07.890 [INFO] openapi specification is serving at address: http://127.0.0.1:8001/api.json
+
+  ADDRESS | METHOD |                 ROUTE                  |                                 HANDLER                                  |    MIDDLEWARE      
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /*                                     | aiChat/internal/middleware.MiddlewareHandlerSession                      | GLOBAL MIDDLEWARE  
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/chat                  | aiChat/internal/controller/aiSearch.(*ControllerV1).Chat                 |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/configuration | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemConfiguration |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/delete        | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemDelete        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/list          | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemList          |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/session/detail        | aiChat/internal/controller/aiSearch.(*ControllerV1).SessionDetail        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/session/like          | aiChat/internal/controller/aiSearch.(*ControllerV1).LikeSession          |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | GET    | /aiChat/aiSearch/session/list          | aiChat/internal/controller/aiSearch.(*ControllerV1).HistorySsList        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | GET    | /aiChat/aiSearch/session/newCreate     | aiChat/internal/controller/aiSearch.(*ControllerV1).CreateNewSession     |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/chatHistory                    | aiChat/internal/controller.(*cChatHistory).Method                        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/evaluate                       | aiChat/internal/controller.(*cEvaluate).Method                           |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/findAnswer                     | aiChat/internal/controller.(*cFindAnswer).Method                         |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/usuallyProblem                 | aiChat/internal/controller.(*cUsuallyProblem).Method                     |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /aiChat/ws                             | aiChat/internal/controller.glob..func1                                   |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /api.json                              | github.com/gogf/gf/v2/net/ghttp.(*Server).openapiSpec                    |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /swagger/*                             | github.com/gogf/gf/v2/net/ghttp.(*Server).swaggerUI                      | HOOK_BEFORE_SERVE  
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+
+2025-02-25 19:01:44.585 [INFO] swagger ui is serving at address: http://127.0.0.1:8001/swagger/
+2025-02-25 19:01:44.585 [INFO] pid[26588]: http server started listening on [:8001]
+2025-02-25 19:01:44.585 [INFO] openapi specification is serving at address: http://127.0.0.1:8001/api.json
+
+  ADDRESS | METHOD |                 ROUTE                  |                                 HANDLER                                  |    MIDDLEWARE      
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /*                                     | aiChat/internal/middleware.MiddlewareHandlerSession                      | GLOBAL MIDDLEWARE  
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/chat                  | aiChat/internal/controller/aiSearch.(*ControllerV1).Chat                 |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/configuration | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemConfiguration |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/delete        | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemDelete        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/list          | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemList          |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/session/detail        | aiChat/internal/controller/aiSearch.(*ControllerV1).SessionDetail        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/session/like          | aiChat/internal/controller/aiSearch.(*ControllerV1).LikeSession          |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | GET    | /aiChat/aiSearch/session/list          | aiChat/internal/controller/aiSearch.(*ControllerV1).HistorySsList        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | GET    | /aiChat/aiSearch/session/newCreate     | aiChat/internal/controller/aiSearch.(*ControllerV1).CreateNewSession     |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/chatHistory                    | aiChat/internal/controller.(*cChatHistory).Method                        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/evaluate                       | aiChat/internal/controller.(*cEvaluate).Method                           |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/findAnswer                     | aiChat/internal/controller.(*cFindAnswer).Method                         |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/usuallyProblem                 | aiChat/internal/controller.(*cUsuallyProblem).Method                     |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /aiChat/ws                             | aiChat/internal/controller.glob..func1                                   |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /api.json                              | github.com/gogf/gf/v2/net/ghttp.(*Server).openapiSpec                    |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /swagger/*                             | github.com/gogf/gf/v2/net/ghttp.(*Server).swaggerUI                      | HOOK_BEFORE_SERVE  
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+

+ 117 - 0
logs/server/2025-02-26.log

@@ -0,0 +1,117 @@
+2025-02-26 09:59:58.051 [INFO] pid[3576]: http server started listening on [:8001]
+2025-02-26 09:59:58.051 [INFO] swagger ui is serving at address: http://127.0.0.1:8001/swagger/
+2025-02-26 09:59:58.052 [INFO] openapi specification is serving at address: http://127.0.0.1:8001/api.json
+
+  ADDRESS | METHOD |                 ROUTE                  |                                 HANDLER                                  |    MIDDLEWARE      
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /*                                     | aiChat/internal/middleware.MiddlewareHandlerSession                      | GLOBAL MIDDLEWARE  
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/chat                  | aiChat/internal/controller/aiSearch.(*ControllerV1).Chat                 |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/configuration | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemConfiguration |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/delete        | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemDelete        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/list          | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemList          |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/session/detail        | aiChat/internal/controller/aiSearch.(*ControllerV1).SessionDetail        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/session/like          | aiChat/internal/controller/aiSearch.(*ControllerV1).LikeSession          |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | GET    | /aiChat/aiSearch/session/list          | aiChat/internal/controller/aiSearch.(*ControllerV1).HistorySsList        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | GET    | /aiChat/aiSearch/session/newCreate     | aiChat/internal/controller/aiSearch.(*ControllerV1).CreateNewSession     |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/chatHistory                    | aiChat/internal/controller.(*cChatHistory).Method                        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/evaluate                       | aiChat/internal/controller.(*cEvaluate).Method                           |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/findAnswer                     | aiChat/internal/controller.(*cFindAnswer).Method                         |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/usuallyProblem                 | aiChat/internal/controller.(*cUsuallyProblem).Method                     |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /aiChat/ws                             | aiChat/internal/controller.glob..func1                                   |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /api.json                              | github.com/gogf/gf/v2/net/ghttp.(*Server).openapiSpec                    |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /swagger/*                             | github.com/gogf/gf/v2/net/ghttp.(*Server).swaggerUI                      | HOOK_BEFORE_SERVE  
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+
+2025-02-26 10:01:31.609 [INFO] swagger ui is serving at address: http://127.0.0.1:8001/swagger/
+2025-02-26 10:01:31.609 [INFO] pid[7152]: http server started listening on [:8001]
+2025-02-26 10:01:31.610 [INFO] openapi specification is serving at address: http://127.0.0.1:8001/api.json
+
+  ADDRESS | METHOD |                 ROUTE                  |                                 HANDLER                                  |    MIDDLEWARE      
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /*                                     | aiChat/internal/middleware.MiddlewareHandlerSession                      | GLOBAL MIDDLEWARE  
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/chat                  | aiChat/internal/controller/aiSearch.(*ControllerV1).Chat                 |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/configuration | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemConfiguration |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/delete        | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemDelete        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/list          | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemList          |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/session/detail        | aiChat/internal/controller/aiSearch.(*ControllerV1).SessionDetail        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/session/like          | aiChat/internal/controller/aiSearch.(*ControllerV1).LikeSession          |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | GET    | /aiChat/aiSearch/session/list          | aiChat/internal/controller/aiSearch.(*ControllerV1).HistorySsList        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | GET    | /aiChat/aiSearch/session/newCreate     | aiChat/internal/controller/aiSearch.(*ControllerV1).CreateNewSession     |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/chatHistory                    | aiChat/internal/controller.(*cChatHistory).Method                        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/evaluate                       | aiChat/internal/controller.(*cEvaluate).Method                           |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/findAnswer                     | aiChat/internal/controller.(*cFindAnswer).Method                         |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/usuallyProblem                 | aiChat/internal/controller.(*cUsuallyProblem).Method                     |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /aiChat/ws                             | aiChat/internal/controller.glob..func1                                   |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /api.json                              | github.com/gogf/gf/v2/net/ghttp.(*Server).openapiSpec                    |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /swagger/*                             | github.com/gogf/gf/v2/net/ghttp.(*Server).swaggerUI                      | HOOK_BEFORE_SERVE  
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+
+2025-02-26 10:05:46.002 [INFO] swagger ui is serving at address: http://127.0.0.1:8001/swagger/
+2025-02-26 10:05:46.002 [INFO] pid[26292]: http server started listening on [:8001]
+2025-02-26 10:05:46.002 [INFO] openapi specification is serving at address: http://127.0.0.1:8001/api.json
+
+  ADDRESS | METHOD |                 ROUTE                  |                                 HANDLER                                  |    MIDDLEWARE      
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /*                                     | aiChat/internal/middleware.MiddlewareHandlerSession                      | GLOBAL MIDDLEWARE  
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/chat                  | aiChat/internal/controller/aiSearch.(*ControllerV1).Chat                 |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/configuration | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemConfiguration |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/delete        | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemDelete        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/problem/list          | aiChat/internal/controller/aiSearch.(*ControllerV1).ProblemList          |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/session/detail        | aiChat/internal/controller/aiSearch.(*ControllerV1).SessionDetail        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/aiSearch/session/like          | aiChat/internal/controller/aiSearch.(*ControllerV1).LikeSession          |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | GET    | /aiChat/aiSearch/session/list          | aiChat/internal/controller/aiSearch.(*ControllerV1).HistorySsList        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | GET    | /aiChat/aiSearch/session/newCreate     | aiChat/internal/controller/aiSearch.(*ControllerV1).CreateNewSession     |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/chatHistory                    | aiChat/internal/controller.(*cChatHistory).Method                        |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/evaluate                       | aiChat/internal/controller.(*cEvaluate).Method                           |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/findAnswer                     | aiChat/internal/controller.(*cFindAnswer).Method                         |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | POST   | /aiChat/usuallyProblem                 | aiChat/internal/controller.(*cUsuallyProblem).Method                     |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /aiChat/ws                             | aiChat/internal/controller.glob..func1                                   |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /api.json                              | github.com/gogf/gf/v2/net/ghttp.(*Server).openapiSpec                    |                    
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+  :8001   | ALL    | /swagger/*                             | github.com/gogf/gf/v2/net/ghttp.(*Server).swaggerUI                      | HOOK_BEFORE_SERVE  
+----------|--------|----------------------------------------|--------------------------------------------------------------------------|--------------------
+

+ 8 - 0
logs/server/access.20250225.log

@@ -0,0 +1,8 @@
+2025-02-25 18:51:09.324 {a8c37781f26d27186a229528f15626b2} 200 "POST http 127.0.0.1:8001 /aiChat/aiSearch/chat HTTP/1.1" 0.000, 127.0.0.1, "", "PostmanRuntime/7.43.0"
+2025-02-25 18:51:57.401 {4093c1abfd6d27186b229528222114ee} 200 "POST http 127.0.0.1:8001 /aiChat/aiSearch/chat HTTP/1.1" 0.123, 127.0.0.1, "", "PostmanRuntime/7.43.0"
+2025-02-25 18:54:37.914 {345f1f09236e271856d0361e9bc7f2e5} 200 "POST http 127.0.0.1:8001 /aiChat/aiSearch/chat HTTP/1.1" 0.156, 127.0.0.1, "", "PostmanRuntime/7.43.0"
+2025-02-25 18:55:51.387 {08146f24346e2718bd4bd55e960d831a} 200 "POST http 127.0.0.1:8001 /aiChat/aiSearch/chat HTTP/1.1" 0.156, 127.0.0.1, "", "PostmanRuntime/7.43.0"
+2025-02-25 18:57:11.797 {f89074e0466e27188a7fc45b89c0e98e} 200 "POST http 127.0.0.1:8001 /aiChat/aiSearch/chat HTTP/1.1" 0.102, 127.0.0.1, "", "PostmanRuntime/7.43.0"
+2025-02-25 18:58:16.903 {38930e09566e2718a6a39f69395152b2} 200 "POST http 127.0.0.1:8001 /aiChat/aiSearch/chat HTTP/1.1" 0.103, 127.0.0.1, "", "PostmanRuntime/7.43.0"
+2025-02-25 19:00:10.509 {8054ea7c706e2718565a8606591c1ac0} 500 "POST http 127.0.0.1:8001 /aiChat/aiSearch/chat HTTP/1.1" 0.095, 127.0.0.1, "", "PostmanRuntime/7.43.0"
+2025-02-25 19:01:48.250 {7861a43d876e27184513784878ef92f7} 200 "POST http 127.0.0.1:8001 /aiChat/aiSearch/chat HTTP/1.1" 0.114, 127.0.0.1, "", "PostmanRuntime/7.43.0"

+ 3 - 0
logs/server/access.20250226.log

@@ -0,0 +1,3 @@
+2025-02-26 10:00:15.331 {44a3b5728e9f27182275a941430261b5} 200 "POST http 127.0.0.1:8001 /aiChat/aiSearch/chat HTTP/1.1" 0.169, 127.0.0.1, "", "PostmanRuntime/7.43.0"
+2025-02-26 10:01:38.562 {50c6371da19f2718751a0f30685518c4} 200 "POST http 127.0.0.1:8001 /aiChat/aiSearch/chat HTTP/1.1" 3.232, 127.0.0.1, "", "PostmanRuntime/7.43.0"
+2025-02-26 10:05:49.022 {f4ef1e28dc9f271851e4c005301c4a7c} 200 "POST http 127.0.0.1:8001 /aiChat/aiSearch/chat HTTP/1.1" 0.105, 127.0.0.1, "", "PostmanRuntime/7.43.0"

+ 18 - 0
logs/server/error.20250225.log

@@ -0,0 +1,18 @@
+2025-02-25 18:51:09.323 {a8c37781f26d27186a229528f15626b2} 200 "POST http 127.0.0.1:8001 /aiChat/aiSearch/chat HTTP/1.1" 302.200, 127.0.0.1, "", "PostmanRuntime/7.43.0", 51, "Validation Failed", ""
+Stack:
+The SId field is required
+2025-02-25 19:00:10.508 {8054ea7c706e2718565a8606591c1ac0} 500 "POST http 127.0.0.1:8001 /aiChat/aiSearch/chat HTTP/1.1" 95485.000, 127.0.0.1, "", "PostmanRuntime/7.43.0", 68, "Internal Panic", ""
+Stack:
+1. exception recovered
+   1).  aiChat/internal/controller/aiSearch.(*ControllerV1).post
+        D:/workspace/go_project/SocialPlatform/aiChat/internal/controller/aiSearch/aiSearch_v1_chat.go:81
+   2).  aiChat/internal/controller/aiSearch.(*ControllerV1).doubao
+        D:/workspace/go_project/SocialPlatform/aiChat/internal/controller/aiSearch/aiSearch_v1_chat.go:47
+   3).  aiChat/internal/controller/aiSearch.(*ControllerV1).Chat
+        D:/workspace/go_project/SocialPlatform/aiChat/internal/controller/aiSearch/aiSearch_v1_chat.go:18
+   4).  aiChat/internal/middleware.MiddlewareHandlerSession
+        D:/workspace/go_project/SocialPlatform/aiChat/internal/middleware/sessionMiddleware.go:13
+   5).  aiChat/internal/middleware.MiddlewareHandlerResponse
+        D:/workspace/go_project/SocialPlatform/aiChat/internal/middleware/resMiddleware.go:25
+2. runtime error: invalid memory address or nil pointer dereference
+

+ 3 - 10
main.go

@@ -4,21 +4,14 @@ import (
 	"aiChat/internal/cmd"
 	_ "aiChat/utility"
 	"aiChat/utility/fsw"
+
+	"github.com/gogf/gf/v2/os/gctx"
+
 	_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
 	_ "github.com/gogf/gf/contrib/nosql/redis/v2"
-	"github.com/gogf/gf/v2/frame/g"
-	"github.com/gogf/gf/v2/os/gcfg"
-	"github.com/gogf/gf/v2/os/gctx"
-	"log"
 )
 
 func main() {
 	fsw.ReadFswDirDict("./manifest/fsw/")
 	cmd.Main.Run(gctx.New())
 }
-func init() {
-	g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetFileName("./manifest/config/ai_search.yaml")
-	var ctx = gctx.New()
-	log.Println(g.Cfg().MustGet(ctx, "aaa").Int64())
-	log.Println(g.Cfg().MustGet(ctx, "server.address").Strings())
-}

+ 33 - 1
manifest/config/ai_search.yaml

@@ -1 +1,33 @@
-aaa: 111
+aaa: 111
+timeout: 30000
+doubaoCallMax: 100
+zhipuCallMax: 100
+prompt: "######
+背景知识
+《剑鱼标讯检索系统》具备信息检索能力,提供的检索字段如下:
+1. 关键词 ,是用户希望搜索的关键词汇,需要从用户意图中提炼,可以是物品名称、服务名称、产品名称、工程名称,公司名称,一些相关的其他品牌,如果是品牌词,请提供中文和英文2套,仅品牌词支持英文,关键词全部是中文;可以有多组关键词,1组关键词之间可以用空格连接起来,实现逻辑and 且的匹配;多组关键词之间是 or 或者的逻辑关系。
+2. 发布时间范围, 信息发布时间范围,如:最近7天、最近30天、最近一年、最近三年、最近五年,自定义日期范围;若没有明确要求,可以选择“最近30天”
+3. 信息类型,有以下选项:
+3.1、信息一级分类:拟建项目,采购意向,招标预告,招标公告,招标结果,招标信用信息
+3.2、信息二级分类:预告,预审,预审结果,论证意见,需求公示,招标,邀标,询价,竞谈,变更,中标,成交,废标,流标,合同,验收,违规
+4. 地区,全国省、市县标签;若没有明确要求,可以选择“全国”
+5. 行业,有以下选项一级分类:【全部、建筑工程、水利水电、能源化工、弱电安防、信息技术、行政办公、机械设备、交通工程、医疗卫生、市政设施、服务采购、农林牧渔、其他】;二级分类【勘察设计,工程施工,监理咨询,材料设备,水电安装,水利工程,发电工程,航运工程、其他工程,原材料,仪表仪器,新能源,化工产品,设备,综合布线,智能家居,智能系统,系统集成及安全,软件开发,运维服务,办公家具,通用办公设备,专业设备,生活用品,办公用品,矿山机械,工程机械,机械零部件,机床相关,车辆,其他机械设备,道路,轨道,桥梁,隧道,设备,耗材,药品,道路,绿化,线路管网,综合项目,法律咨询,会计,物业,审计,安保,仓储物流,广告宣传印发,生产物资,生产设备,相关服务,其他】若没有明确要求,可以选择“全部”
+6. 金额,项目金额范围,如:0-10万,10-20万,20-50万,50-100万,100万-200万,200万-500万,500万-1000万,1000万以上,自定义范围。若没有明确要求,可以选择“不限”
+7.采购单位类型: 党政机关事业单位: ['人大', '政协', '党委办', '组织', '宣传', '统战', '纪委', '政府办', '发改', '财政', '教育', '科技', '工信', '民政', '民宗', '人社', '公安', '检察院', '法院', '司法', '应急管理', '军队', '自然资源', '生态环境', '住建', '市政', '城管', '交通', '水利', '农业', '气象', '文旅', '卫健委', '医疗', '学校', '档案', '体育', '政务中心', '机关事务', '国资委', '海关', '税务', '市场监管', '商务', '人行', '银保监', '证监', '审计', '出版广电', '统计', '公共资源交易', '社会团体'], 企业: ['传媒', '采矿业', '电信行业', '金融业', '建筑业', '能源化工', '农林牧渔', '批发零售', '信息技术', '运输物流', '制造业', '住宿餐饮'] ,若没有明确要求,可以选择“全部”
+######
+%s
+######
+输出要求,不需要说明,不需要解释,直接输出结果。以JSON格式输出《剑鱼标讯检索系统》各个字段应该填充值,并进行JSON格式化。
+例如:{“关键词”:[”考勤机 得力”,“考勤系统”],
+“发布时间范围”:”2022/01/01 - 2023/01/01”,
+“信息类型”:”全部”,
+“地区”:”全国”,
+”采购单位类型”:”信息技术”,
+”金额”:”不限”,
+“排除词”:“”,
+“采购单位联系方式”:“不限”,
+“中标单位联系方式”:“不限”,
+“采购单位”:“河南科技大学”,
+“中标企业”:“洛阳理工大学”,
+“招标代理”:“洛阳工程有线公司”
+}"

+ 8 - 8
manifest/config/config.yaml

@@ -27,31 +27,31 @@ chat:
 etcd:
   powerCheckCenter:
     hosts:
-      - 192.168.3.206:2379
+      - 172.31.31.203:2379
     powerCheckCenterKey: "powercheck.rpc" #权益校验中台
     userCenterKey: "usercenter.rpc" #用户中台rpc
 
 redis:
   session:
-    address: 192.168.3.149:1713
+    address: 172.20.45.129:1713
   main:
-    address: 192.168.3.149:1712
+    address: 172.20.45.129:1712
   black:
-    address: 192.168.3.149:1712
+    address: 172.20.45.129:1712
 
 mongodb:
-  address: "192.168.3.206:27002"
+  address: "172.20.45.130:27080"
   size: 5
   dbName: "qfw_data"
   replSet: ""
   collection: "bidding"
   collection_back": "bidding_back"
-  userName: "jyDevGroup"
-  password: "jy@DevGroup"
+  userName: ""
+  password: ""
 
 database:
   default:
-    link: "mysql:root:=PDT49#80Z!RVv52_z@tcp(192.168.3.217:4000)/base_service"
+    link: "mysql:root:=PDT49#80Z!RVv52_z@tcp(172.20.45.129:4000)/base_service"
     maxIdle: "5"
     maxOpen: "5"