jimmyyem 1 kuukausi sitten
vanhempi
commit
d0016e3080

+ 3 - 1
desc/all.api

@@ -45,4 +45,6 @@ import "./wechat/whatsapp.api"
 import "./wechat/whatsapp_channel.api"
 import "./wechat/fastgpt.api"
 import "./wechat/department.api"
-import "./wechat/api_key.api"
+import "./wechat/api_key.api"
+import "./wechat/xunji.api"
+import "./wechat/xunji_service.api"

+ 104 - 0
desc/wechat/xunji.api

@@ -0,0 +1,104 @@
+import "../base.api"
+
+type (
+    // The data of xunji information | Xunji信息
+    XunjiInfo {
+        BaseIDInfo
+
+        // Status 1: normal 2: ban | 状态 1 正常 2 禁用 
+        Status  *uint8 `json:"status,optional"`
+
+        // AppKey 
+        AppKey  *string `json:"appKey,optional"`
+
+        // AppSecret 
+        AppSecret  *string `json:"appSecret,optional"`
+
+        // Token 
+        Token  *string `json:"token,optional"`
+
+        // 加密key 
+        EncodingKey  *string `json:"encodingKey,optional"`
+
+        // 角色ID 
+        AgentId  *uint64 `json:"agentId,optional"`
+
+        // organization_id | 租户ID 
+        OrganizationId  *uint64 `json:"organizationId,optional"`
+
+        // 微信ID 
+        Wxid  *string `json:"wxid,optional"`
+
+        // 大模型服务地址 
+        ApiBase  *string `json:"apiBase,optional"`
+
+        // 大模型服务密钥 
+        ApiKey  *string `json:"apiKey,optional"`
+    }
+
+    // The response data of xunji list | Xunji列表数据
+    XunjiListResp {
+        BaseDataInfo
+
+        // Xunji list data | Xunji列表数据
+        Data XunjiListInfo `json:"data"`
+    }
+
+    // Xunji list data | Xunji列表数据
+    XunjiListInfo {
+        BaseListInfo
+
+        // The API list data | Xunji列表数据
+        Data  []XunjiInfo  `json:"data"`
+    }
+
+    // Get xunji list request params | Xunji列表请求参数
+    XunjiListReq {
+        PageInfo
+
+        // AppKey 
+        AppKey  *string `json:"appKey,optional"`
+
+        // AppSecret 
+        AppSecret  *string `json:"appSecret,optional"`
+
+        // Token 
+        Token  *string `json:"token,optional"`
+    }
+
+    // Xunji information response | Xunji信息返回体
+    XunjiInfoResp {
+        BaseDataInfo
+
+        // Xunji information | Xunji数据
+        Data XunjiInfo `json:"data"`
+    }
+)
+
+@server(
+    jwt: Auth
+    group: xunji
+    middleware: Authority
+)
+
+service Wechat {
+    // Create xunji information | 创建Xunji
+    @handler createXunji
+    post /xunji/create (XunjiInfo) returns (BaseMsgResp)
+
+    // Update xunji information | 更新Xunji
+    @handler updateXunji
+    post /xunji/update (XunjiInfo) returns (BaseMsgResp)
+
+    // Delete xunji information | 删除Xunji信息
+    @handler deleteXunji
+    post /xunji/delete (IDsReq) returns (BaseMsgResp)
+
+    // Get xunji list | 获取Xunji列表
+    @handler getXunjiList
+    post /xunji/list (XunjiListReq) returns (XunjiListResp)
+
+    // Get xunji by ID | 通过ID获取Xunji
+    @handler getXunjiById
+    post /xunji (IDReq) returns (XunjiInfoResp)
+}

+ 92 - 0
desc/wechat/xunji_service.api

@@ -0,0 +1,92 @@
+import "../base.api"
+import "./agent.api"
+
+type (
+    // The data of xunji service information | XunjiService信息
+    XunjiServiceInfo {
+        BaseIDInfo
+
+        // Status 1: normal 2: ban | 状态 1 正常 2 禁用 
+        Status  *uint8 `json:"status,optional"`
+
+        // Xunji表ID 
+        XunjiId  *uint64 `json:"xunjiId,optional"`
+
+        // 智能体ID 
+        AgentId  *uint64 `json:"agentId,optional"`
+
+		// 模式信息
+		AgentInfo *AgentInfo `json:"agentInfo,optional"`
+
+        // organization_id | 租户ID 
+        OrganizationId  *uint64 `json:"organizationId,optional"`
+
+        // 微信ID 
+        Wxid  *string `json:"wxid,optional"`
+
+        // 大模型服务地址 
+        ApiBase  *string `json:"apiBase,optional"`
+
+        // 大模型服务密钥 
+        ApiKey  *string `json:"apiKey,optional"`
+    }
+
+    // The response data of xunji service list | XunjiService列表数据
+    XunjiServiceListResp {
+        BaseDataInfo
+
+        // XunjiService list data | XunjiService列表数据
+        Data XunjiServiceListInfo `json:"data"`
+    }
+
+    // XunjiService list data | XunjiService列表数据
+    XunjiServiceListInfo {
+        BaseListInfo
+
+        // The API list data | XunjiService列表数据
+        Data  []XunjiServiceInfo  `json:"data"`
+    }
+
+    // Get xunji service list request params | XunjiService列表请求参数
+    XunjiServiceListReq {
+        PageInfo
+
+        XunjiID *uint64 `json:"configId,optional"`
+    }
+
+    // XunjiService information response | XunjiService信息返回体
+    XunjiServiceInfoResp {
+        BaseDataInfo
+
+        // XunjiService information | XunjiService数据
+        Data XunjiServiceInfo `json:"data"`
+    }
+)
+
+@server(
+    jwt: Auth
+    group: xunji_service
+    middleware: Authority
+)
+
+service Wechat {
+    // Create xunji service information | 创建XunjiService
+    @handler createXunjiService
+    post /xunji_service/create (XunjiServiceInfo) returns (BaseMsgResp)
+
+    // Update xunji service information | 更新XunjiService
+    @handler updateXunjiService
+    post /xunji_service/update (XunjiServiceInfo) returns (BaseMsgResp)
+
+    // Delete xunji service information | 删除XunjiService信息
+    @handler deleteXunjiService
+    post /xunji_service/delete (IDsReq) returns (BaseMsgResp)
+
+    // Get xunji service list | 获取XunjiService列表
+    @handler getXunjiServiceList
+    post /xunji_service/list (XunjiServiceListReq) returns (XunjiServiceListResp)
+
+    // Get xunji service by ID | 通过ID获取XunjiService
+    @handler getXunjiServiceById
+    post /xunji_service (IDReq) returns (XunjiServiceInfoResp)
+}

+ 70 - 0
internal/handler/routes.go

@@ -54,6 +54,8 @@ import (
 	wxcarduser "wechat-api/internal/handler/wxcarduser"
 	wxcardvisit "wechat-api/internal/handler/wxcardvisit"
 	xiaoice "wechat-api/internal/handler/xiaoice"
+	xunji "wechat-api/internal/handler/xunji"
+	xunji_service "wechat-api/internal/handler/xunji_service"
 	"wechat-api/internal/svc"
 
 	"github.com/zeromicro/go-zero/rest"
@@ -2180,4 +2182,72 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 		),
 		rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
 	)
+
+	server.AddRoutes(
+		rest.WithMiddlewares(
+			[]rest.Middleware{serverCtx.Authority},
+			[]rest.Route{
+				{
+					Method:  http.MethodPost,
+					Path:    "/xunji/create",
+					Handler: xunji.CreateXunjiHandler(serverCtx),
+				},
+				{
+					Method:  http.MethodPost,
+					Path:    "/xunji/update",
+					Handler: xunji.UpdateXunjiHandler(serverCtx),
+				},
+				{
+					Method:  http.MethodPost,
+					Path:    "/xunji/delete",
+					Handler: xunji.DeleteXunjiHandler(serverCtx),
+				},
+				{
+					Method:  http.MethodPost,
+					Path:    "/xunji/list",
+					Handler: xunji.GetXunjiListHandler(serverCtx),
+				},
+				{
+					Method:  http.MethodPost,
+					Path:    "/xunji",
+					Handler: xunji.GetXunjiByIdHandler(serverCtx),
+				},
+			}...,
+		),
+		rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
+	)
+
+	server.AddRoutes(
+		rest.WithMiddlewares(
+			[]rest.Middleware{serverCtx.Authority},
+			[]rest.Route{
+				{
+					Method:  http.MethodPost,
+					Path:    "/xunji_service/create",
+					Handler: xunji_service.CreateXunjiServiceHandler(serverCtx),
+				},
+				{
+					Method:  http.MethodPost,
+					Path:    "/xunji_service/update",
+					Handler: xunji_service.UpdateXunjiServiceHandler(serverCtx),
+				},
+				{
+					Method:  http.MethodPost,
+					Path:    "/xunji_service/delete",
+					Handler: xunji_service.DeleteXunjiServiceHandler(serverCtx),
+				},
+				{
+					Method:  http.MethodPost,
+					Path:    "/xunji_service/list",
+					Handler: xunji_service.GetXunjiServiceListHandler(serverCtx),
+				},
+				{
+					Method:  http.MethodPost,
+					Path:    "/xunji_service",
+					Handler: xunji_service.GetXunjiServiceByIdHandler(serverCtx),
+				},
+			}...,
+		),
+		rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
+	)
 }

+ 44 - 0
internal/handler/xunji/create_xunji_handler.go

@@ -0,0 +1,44 @@
+package xunji
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/xunji"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /xunji/create xunji CreateXunji
+//
+// Create xunji information | 创建Xunji
+//
+// Create xunji information | 创建Xunji
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: XunjiInfo
+//
+// Responses:
+//  200: BaseMsgResp
+
+func CreateXunjiHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.XunjiInfo
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := xunji.NewCreateXunjiLogic(r.Context(), svcCtx)
+		resp, err := l.CreateXunji(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 44 - 0
internal/handler/xunji/delete_xunji_handler.go

@@ -0,0 +1,44 @@
+package xunji
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/xunji"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /xunji/delete xunji DeleteXunji
+//
+// Delete xunji information | 删除Xunji信息
+//
+// Delete xunji information | 删除Xunji信息
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: IDsReq
+//
+// Responses:
+//  200: BaseMsgResp
+
+func DeleteXunjiHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.IDsReq
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := xunji.NewDeleteXunjiLogic(r.Context(), svcCtx)
+		resp, err := l.DeleteXunji(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 44 - 0
internal/handler/xunji/get_xunji_by_id_handler.go

@@ -0,0 +1,44 @@
+package xunji
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/xunji"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /xunji xunji GetXunjiById
+//
+// Get xunji by ID | 通过ID获取Xunji
+//
+// Get xunji by ID | 通过ID获取Xunji
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: IDReq
+//
+// Responses:
+//  200: XunjiInfoResp
+
+func GetXunjiByIdHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.IDReq
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := xunji.NewGetXunjiByIdLogic(r.Context(), svcCtx)
+		resp, err := l.GetXunjiById(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 44 - 0
internal/handler/xunji/get_xunji_list_handler.go

@@ -0,0 +1,44 @@
+package xunji
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/xunji"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /xunji/list xunji GetXunjiList
+//
+// Get xunji list | 获取Xunji列表
+//
+// Get xunji list | 获取Xunji列表
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: XunjiListReq
+//
+// Responses:
+//  200: XunjiListResp
+
+func GetXunjiListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.XunjiListReq
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := xunji.NewGetXunjiListLogic(r.Context(), svcCtx)
+		resp, err := l.GetXunjiList(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 44 - 0
internal/handler/xunji/update_xunji_handler.go

@@ -0,0 +1,44 @@
+package xunji
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/xunji"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /xunji/update xunji UpdateXunji
+//
+// Update xunji information | 更新Xunji
+//
+// Update xunji information | 更新Xunji
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: XunjiInfo
+//
+// Responses:
+//  200: BaseMsgResp
+
+func UpdateXunjiHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.XunjiInfo
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := xunji.NewUpdateXunjiLogic(r.Context(), svcCtx)
+		resp, err := l.UpdateXunji(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 44 - 0
internal/handler/xunji_service/create_xunji_service_handler.go

@@ -0,0 +1,44 @@
+package xunji_service
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/xunji_service"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /xunji_service/create xunji_service CreateXunjiService
+//
+// Create xunji service information | 创建XunjiService
+//
+// Create xunji service information | 创建XunjiService
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: XunjiServiceInfo
+//
+// Responses:
+//  200: BaseMsgResp
+
+func CreateXunjiServiceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.XunjiServiceInfo
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := xunji_service.NewCreateXunjiServiceLogic(r.Context(), svcCtx)
+		resp, err := l.CreateXunjiService(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 44 - 0
internal/handler/xunji_service/delete_xunji_service_handler.go

@@ -0,0 +1,44 @@
+package xunji_service
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/xunji_service"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /xunji_service/delete xunji_service DeleteXunjiService
+//
+// Delete xunji service information | 删除XunjiService信息
+//
+// Delete xunji service information | 删除XunjiService信息
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: IDsReq
+//
+// Responses:
+//  200: BaseMsgResp
+
+func DeleteXunjiServiceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.IDsReq
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := xunji_service.NewDeleteXunjiServiceLogic(r.Context(), svcCtx)
+		resp, err := l.DeleteXunjiService(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 44 - 0
internal/handler/xunji_service/get_xunji_service_by_id_handler.go

@@ -0,0 +1,44 @@
+package xunji_service
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/xunji_service"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /xunji_service xunji_service GetXunjiServiceById
+//
+// Get xunji service by ID | 通过ID获取XunjiService
+//
+// Get xunji service by ID | 通过ID获取XunjiService
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: IDReq
+//
+// Responses:
+//  200: XunjiServiceInfoResp
+
+func GetXunjiServiceByIdHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.IDReq
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := xunji_service.NewGetXunjiServiceByIdLogic(r.Context(), svcCtx)
+		resp, err := l.GetXunjiServiceById(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 44 - 0
internal/handler/xunji_service/get_xunji_service_list_handler.go

@@ -0,0 +1,44 @@
+package xunji_service
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/xunji_service"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /xunji_service/list xunji_service GetXunjiServiceList
+//
+// Get xunji service list | 获取XunjiService列表
+//
+// Get xunji service list | 获取XunjiService列表
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: XunjiServiceListReq
+//
+// Responses:
+//  200: XunjiServiceListResp
+
+func GetXunjiServiceListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.XunjiServiceListReq
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := xunji_service.NewGetXunjiServiceListLogic(r.Context(), svcCtx)
+		resp, err := l.GetXunjiServiceList(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 44 - 0
internal/handler/xunji_service/update_xunji_service_handler.go

@@ -0,0 +1,44 @@
+package xunji_service
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/xunji_service"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /xunji_service/update xunji_service UpdateXunjiService
+//
+// Update xunji service information | 更新XunjiService
+//
+// Update xunji service information | 更新XunjiService
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: XunjiServiceInfo
+//
+// Responses:
+//  200: BaseMsgResp
+
+func UpdateXunjiServiceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.XunjiServiceInfo
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := xunji_service.NewUpdateXunjiServiceLogic(r.Context(), svcCtx)
+		resp, err := l.UpdateXunjiService(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 29 - 0
internal/logic/xunji/create_xunji_logic.go

@@ -0,0 +1,29 @@
+package xunji
+
+import (
+	"context"
+
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type CreateXunjiLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewCreateXunjiLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateXunjiLogic {
+	return &CreateXunjiLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx}
+}
+
+func (l *CreateXunjiLogic) CreateXunji(req *types.XunjiInfo) (resp *types.BaseMsgResp, err error) {
+	// todo: add your logic here and delete this line
+
+	return
+}

+ 29 - 0
internal/logic/xunji/delete_xunji_logic.go

@@ -0,0 +1,29 @@
+package xunji
+
+import (
+	"context"
+
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type DeleteXunjiLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewDeleteXunjiLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteXunjiLogic {
+	return &DeleteXunjiLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx}
+}
+
+func (l *DeleteXunjiLogic) DeleteXunji(req *types.IDsReq) (resp *types.BaseMsgResp, err error) {
+	// todo: add your logic here and delete this line
+
+	return
+}

+ 29 - 0
internal/logic/xunji/get_xunji_by_id_logic.go

@@ -0,0 +1,29 @@
+package xunji
+
+import (
+	"context"
+
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetXunjiByIdLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewGetXunjiByIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetXunjiByIdLogic {
+	return &GetXunjiByIdLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx}
+}
+
+func (l *GetXunjiByIdLogic) GetXunjiById(req *types.IDReq) (resp *types.XunjiInfoResp, err error) {
+	// todo: add your logic here and delete this line
+
+	return
+}

+ 29 - 0
internal/logic/xunji/get_xunji_list_logic.go

@@ -0,0 +1,29 @@
+package xunji
+
+import (
+	"context"
+
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetXunjiListLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewGetXunjiListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetXunjiListLogic {
+	return &GetXunjiListLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx}
+}
+
+func (l *GetXunjiListLogic) GetXunjiList(req *types.XunjiListReq) (resp *types.XunjiListResp, err error) {
+	// todo: add your logic here and delete this line
+
+	return
+}

+ 29 - 0
internal/logic/xunji/update_xunji_logic.go

@@ -0,0 +1,29 @@
+package xunji
+
+import (
+	"context"
+
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type UpdateXunjiLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewUpdateXunjiLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateXunjiLogic {
+	return &UpdateXunjiLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx}
+}
+
+func (l *UpdateXunjiLogic) UpdateXunji(req *types.XunjiInfo) (resp *types.BaseMsgResp, err error) {
+	// todo: add your logic here and delete this line
+
+	return
+}

+ 29 - 0
internal/logic/xunji_service/create_xunji_service_logic.go

@@ -0,0 +1,29 @@
+package xunji_service
+
+import (
+	"context"
+
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type CreateXunjiServiceLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewCreateXunjiServiceLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateXunjiServiceLogic {
+	return &CreateXunjiServiceLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx}
+}
+
+func (l *CreateXunjiServiceLogic) CreateXunjiService(req *types.XunjiServiceInfo) (resp *types.BaseMsgResp, err error) {
+	// todo: add your logic here and delete this line
+
+	return
+}

+ 29 - 0
internal/logic/xunji_service/delete_xunji_service_logic.go

@@ -0,0 +1,29 @@
+package xunji_service
+
+import (
+	"context"
+
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type DeleteXunjiServiceLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewDeleteXunjiServiceLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteXunjiServiceLogic {
+	return &DeleteXunjiServiceLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx}
+}
+
+func (l *DeleteXunjiServiceLogic) DeleteXunjiService(req *types.IDsReq) (resp *types.BaseMsgResp, err error) {
+	// todo: add your logic here and delete this line
+
+	return
+}

+ 29 - 0
internal/logic/xunji_service/get_xunji_service_by_id_logic.go

@@ -0,0 +1,29 @@
+package xunji_service
+
+import (
+	"context"
+
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetXunjiServiceByIdLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewGetXunjiServiceByIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetXunjiServiceByIdLogic {
+	return &GetXunjiServiceByIdLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx}
+}
+
+func (l *GetXunjiServiceByIdLogic) GetXunjiServiceById(req *types.IDReq) (resp *types.XunjiServiceInfoResp, err error) {
+	// todo: add your logic here and delete this line
+
+	return
+}

+ 29 - 0
internal/logic/xunji_service/get_xunji_service_list_logic.go

@@ -0,0 +1,29 @@
+package xunji_service
+
+import (
+	"context"
+
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetXunjiServiceListLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewGetXunjiServiceListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetXunjiServiceListLogic {
+	return &GetXunjiServiceListLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx}
+}
+
+func (l *GetXunjiServiceListLogic) GetXunjiServiceList(req *types.XunjiServiceListReq) (resp *types.XunjiServiceListResp, err error) {
+	// todo: add your logic here and delete this line
+
+	return
+}

+ 29 - 0
internal/logic/xunji_service/update_xunji_service_logic.go

@@ -0,0 +1,29 @@
+package xunji_service
+
+import (
+	"context"
+
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type UpdateXunjiServiceLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewUpdateXunjiServiceLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateXunjiServiceLogic {
+	return &UpdateXunjiServiceLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx}
+}
+
+func (l *UpdateXunjiServiceLogic) UpdateXunjiService(req *types.XunjiServiceInfo) (resp *types.BaseMsgResp, err error) {
+	// todo: add your logic here and delete this line
+
+	return
+}

+ 115 - 0
internal/types/types.go

@@ -4371,3 +4371,118 @@ type ApiKeyListReq struct {
 	Key            *string `json:"key,optional"`
 	OrganizationId *uint64 `json:"organization_id,optional"`
 }
+
+// The data of xunji information | Xunji信息
+// swagger:model XunjiInfo
+type XunjiInfo struct {
+	BaseIDInfo
+	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
+	Status *uint8 `json:"status,optional"`
+	// AppKey
+	AppKey *string `json:"appKey,optional"`
+	// AppSecret
+	AppSecret *string `json:"appSecret,optional"`
+	// Token
+	Token *string `json:"token,optional"`
+	// 加密key
+	EncodingKey *string `json:"encodingKey,optional"`
+	// 角色ID
+	AgentId *uint64 `json:"agentId,optional"`
+	// organization_id | 租户ID
+	OrganizationId *uint64 `json:"organizationId,optional"`
+	// 微信ID
+	Wxid *string `json:"wxid,optional"`
+	// 大模型服务地址
+	ApiBase *string `json:"apiBase,optional"`
+	// 大模型服务密钥
+	ApiKey *string `json:"apiKey,optional"`
+}
+
+// The response data of xunji list | Xunji列表数据
+// swagger:model XunjiListResp
+type XunjiListResp struct {
+	BaseDataInfo
+	// Xunji list data | Xunji列表数据
+	Data XunjiListInfo `json:"data"`
+}
+
+// Xunji list data | Xunji列表数据
+// swagger:model XunjiListInfo
+type XunjiListInfo struct {
+	BaseListInfo
+	// The API list data | Xunji列表数据
+	Data []XunjiInfo `json:"data"`
+}
+
+// Get xunji list request params | Xunji列表请求参数
+// swagger:model XunjiListReq
+type XunjiListReq struct {
+	PageInfo
+	// AppKey
+	AppKey *string `json:"appKey,optional"`
+	// AppSecret
+	AppSecret *string `json:"appSecret,optional"`
+	// Token
+	Token *string `json:"token,optional"`
+}
+
+// Xunji information response | Xunji信息返回体
+// swagger:model XunjiInfoResp
+type XunjiInfoResp struct {
+	BaseDataInfo
+	// Xunji information | Xunji数据
+	Data XunjiInfo `json:"data"`
+}
+
+// The data of xunji service information | XunjiService信息
+// swagger:model XunjiServiceInfo
+type XunjiServiceInfo struct {
+	BaseIDInfo
+	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
+	Status *uint8 `json:"status,optional"`
+	// Xunji表ID
+	XunjiId *uint64 `json:"xunjiId,optional"`
+	// 智能体ID
+	AgentId *uint64 `json:"agentId,optional"`
+	// 模式信息
+	AgentInfo *AgentInfo `json:"agentInfo,optional"`
+	// organization_id | 租户ID
+	OrganizationId *uint64 `json:"organizationId,optional"`
+	// 微信ID
+	Wxid *string `json:"wxid,optional"`
+	// 大模型服务地址
+	ApiBase *string `json:"apiBase,optional"`
+	// 大模型服务密钥
+	ApiKey *string `json:"apiKey,optional"`
+}
+
+// The response data of xunji service list | XunjiService列表数据
+// swagger:model XunjiServiceListResp
+type XunjiServiceListResp struct {
+	BaseDataInfo
+	// XunjiService list data | XunjiService列表数据
+	Data XunjiServiceListInfo `json:"data"`
+}
+
+// XunjiService list data | XunjiService列表数据
+// swagger:model XunjiServiceListInfo
+type XunjiServiceListInfo struct {
+	BaseListInfo
+	// The API list data | XunjiService列表数据
+	Data []XunjiServiceInfo `json:"data"`
+}
+
+// Get xunji service list request params | XunjiService列表请求参数
+// swagger:model XunjiServiceListReq
+type XunjiServiceListReq struct {
+	PageInfo
+	XunjiID *uint64 `json:"configId,optional"`
+}
+
+// XunjiService information response | XunjiService信息返回体
+// swagger:model XunjiServiceInfoResp
+type XunjiServiceInfoResp struct {
+	BaseDataInfo
+	// XunjiService information | XunjiService数据
+	Data XunjiServiceInfo `json:"data"`
+}