优化系统设置 API 参数解析,优化点卡扣费逻辑,没有回复答案不记扣费次数

This commit is contained in:
RockYang
2023-04-04 09:05:17 +08:00
parent 43e2743b9b
commit 65ad5fb632
4 changed files with 127 additions and 128 deletions

View File

@@ -81,7 +81,7 @@ func (s *Server) Run(webRoot embed.FS, path string, debug bool) {
engine.Use(AuthorizeMiddleware(s))
engine.Use(Recover)
engine.GET("/hello", Hello)
engine.POST("/test", s.TestHandle)
engine.GET("/api/session/get", s.GetSessionHandle)
engine.POST("/api/login", s.LoginHandle)
engine.Any("/api/chat", s.ChatHandle)
@@ -287,7 +287,3 @@ func (s *Server) LoginHandle(c *gin.Context) {
s.ChatSession[sessionId] = types.ChatSession{ClientIP: c.ClientIP(), Username: data.Token, SessionId: sessionId}
c.JSON(http.StatusOK, types.BizVo{Code: types.Success, Data: sessionId})
}
func Hello(c *gin.Context) {
c.JSON(http.StatusOK, types.BizVo{Code: types.Success, Message: "HELLO, ChatGPT !!!"})
}