Browse Source

Merge branch 'feature/compapi'

* feature/compapi:
  恢复 fasgpt 相关接口

# Conflicts:
#	desc/all.api
#	internal/handler/routes.go
#	internal/types/types.go
boweniac 1 month ago
parent
commit
ffe2ca61c3
3 changed files with 25 additions and 1 deletions
  1. 2 1
      desc/all.api
  2. 16 0
      internal/handler/routes.go
  3. 7 0
      internal/types/types.go

+ 2 - 1
desc/all.api

@@ -44,4 +44,5 @@ import "./wechat/pay_recharge.api"
 import "./wechat/whatsapp.api"
 import "./wechat/whatsapp_channel.api"
 import "./wechat/api_key.api"
-import "./wechat/department.api"
+import "./wechat/department.api"
+import "./wechat/fastgpt.api"

+ 16 - 0
internal/handler/routes.go

@@ -35,6 +35,7 @@ import (
 	department "wechat-api/internal/handler/department"
 	employee "wechat-api/internal/handler/employee"
 	employee_config "wechat-api/internal/handler/employee_config"
+	fastgpt "wechat-api/internal/handler/fastgpt"
 	label "wechat-api/internal/handler/label"
 	label_relationship "wechat-api/internal/handler/label_relationship"
 	label_tagging "wechat-api/internal/handler/label_tagging"
@@ -2130,4 +2131,19 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 		),
 		rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
 	)
+
+	server.AddRoutes(
+		[]rest.Route{
+			{
+				Method:  http.MethodGet,
+				Path:    "/api/fastgpt/set_token",
+				Handler: fastgpt.SetTokenHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/api/fastgpt/create",
+				Handler: fastgpt.CreateFastgptHandler(serverCtx),
+			},
+		},
+	)
 }

+ 7 - 0
internal/types/types.go

@@ -4295,3 +4295,10 @@ type DepartmentInfoResp struct {
 	// Department information | 部门数据
 	Data DepartmentInfo `json:"data"`
 }
+// swagger:model CreateInfo
+type CreateInfo struct {
+	// Translated Name | 展示名称
+	UserName string `json:"username"`
+	// Name | 部门名称
+	Title *string `json:"title"`
+}