jimmyyem преди 6 месеца
родител
ревизия
0b86acfc60

+ 1 - 0
desc/all.api

@@ -14,6 +14,7 @@ import "./wechat/chatroom_member.api"
 import "./wechat/user.api"
 import "./openapi/contact.api"
 import "./wechat/batch_msg.api"
+import "./wechat/msg.api"
 import "./wechat/agent.api"
 import "./wechat/employee.api"
 import "./wechat/work_experience.api"

+ 92 - 0
desc/wechat/msg.api

@@ -0,0 +1,92 @@
+import "../base.api"
+
+type (
+    // The data of msg information | Msg信息
+    MsgInfo {
+        BaseIDInfo
+
+        // Status 1: normal 2: ban | 状态 1 正常 2 禁用 
+        Status  *uint8 `json:"status,optional"`
+
+        // 发送方微信ID 
+        Fromwxid  *string `json:"fromwxid,optional"`
+
+        // 接收人微信ID/群ID 
+        Toid  *string `json:"toid,optional"`
+
+        // 消息类型 
+        Msgtype  *int32 `json:"msgtype,optional"`
+
+        // 消息 
+        Msg  *string `json:"msg,optional"`
+
+        // 批次号 
+        BatchNo  *string `json:"batchNo,optional"`
+    }
+
+    // The response data of msg list | Msg列表数据
+    MsgListResp {
+        BaseDataInfo
+
+        // Msg list data | Msg列表数据
+        Data MsgListInfo `json:"data"`
+    }
+
+    // Msg list data | Msg列表数据
+    MsgListInfo {
+        BaseListInfo
+
+        // The API list data | Msg列表数据
+        Data  []MsgInfo  `json:"data"`
+    }
+
+    // Get msg list request params | Msg列表请求参数
+    MsgListReq {
+        PageInfo
+
+        // 状态
+        Status  *uint8 `json:"status,optional"`
+
+        // 接收人微信ID/群ID 
+        Toid  *string `json:"toid,optional"`
+
+		// 群发消息ID
+		BatchId *uint64 `json:"batchId"`
+    }
+
+    // Msg information response | Msg信息返回体
+    MsgInfoResp {
+        BaseDataInfo
+
+        // Msg information | Msg数据
+        Data MsgInfo `json:"data"`
+    }
+)
+
+@server(
+    jwt: Auth
+    group: Msg
+    middleware: Authority
+)
+
+service Wechat {
+    // Create msg information | 创建Msg
+    @handler createMsg
+    post /msg/create (MsgInfo) returns (BaseMsgResp)
+
+    // Update msg information | 更新Msg
+    @handler updateMsg
+    post /msg/update (MsgInfo) returns (BaseMsgResp)
+
+    // Delete msg information | 删除Msg信息
+    @handler deleteMsg
+    post /msg/delete (IDsReq) returns (BaseMsgResp)
+
+    // Get msg list | 获取Msg列表
+    @handler getMsgList
+    post /msg/list (MsgListReq) returns (MsgListResp)
+
+    // Get msg by ID | 通过ID获取Msg
+    @handler getMsgById
+    post /msg (IDReq) returns (MsgInfoResp)
+}

+ 44 - 0
internal/handler/Msg/create_msg_handler.go

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

+ 44 - 0
internal/handler/Msg/delete_msg_handler.go

@@ -0,0 +1,44 @@
+package Msg
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/Msg"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /msg/delete Msg DeleteMsg
+//
+// Delete msg information | 删除Msg信息
+//
+// Delete msg information | 删除Msg信息
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: IDsReq
+//
+// Responses:
+//  200: BaseMsgResp
+
+func DeleteMsgHandler(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 := Msg.NewDeleteMsgLogic(r.Context(), svcCtx)
+		resp, err := l.DeleteMsg(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 44 - 0
internal/handler/Msg/get_msg_by_id_handler.go

@@ -0,0 +1,44 @@
+package Msg
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/Msg"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /msg Msg GetMsgById
+//
+// Get msg by ID | 通过ID获取Msg
+//
+// Get msg by ID | 通过ID获取Msg
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: IDReq
+//
+// Responses:
+//  200: MsgInfoResp
+
+func GetMsgByIdHandler(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 := Msg.NewGetMsgByIdLogic(r.Context(), svcCtx)
+		resp, err := l.GetMsgById(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 44 - 0
internal/handler/Msg/get_msg_list_handler.go

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

+ 44 - 0
internal/handler/Msg/update_msg_handler.go

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

+ 35 - 0
internal/handler/routes.go

@@ -6,6 +6,7 @@ import (
 
 	ChatRoomMember "wechat-api/internal/handler/ChatRoomMember"
 	Message "wechat-api/internal/handler/Message"
+	Msg "wechat-api/internal/handler/Msg"
 	User "wechat-api/internal/handler/User"
 	WechatServer "wechat-api/internal/handler/WechatServer"
 	Wx "wechat-api/internal/handler/Wx"
@@ -608,6 +609,40 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 			[]rest.Route{
 				{
 					Method:  http.MethodPost,
+					Path:    "/msg/create",
+					Handler: Msg.CreateMsgHandler(serverCtx),
+				},
+				{
+					Method:  http.MethodPost,
+					Path:    "/msg/update",
+					Handler: Msg.UpdateMsgHandler(serverCtx),
+				},
+				{
+					Method:  http.MethodPost,
+					Path:    "/msg/delete",
+					Handler: Msg.DeleteMsgHandler(serverCtx),
+				},
+				{
+					Method:  http.MethodPost,
+					Path:    "/msg/list",
+					Handler: Msg.GetMsgListHandler(serverCtx),
+				},
+				{
+					Method:  http.MethodPost,
+					Path:    "/msg",
+					Handler: Msg.GetMsgByIdHandler(serverCtx),
+				},
+			}...,
+		),
+		rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
+	)
+
+	server.AddRoutes(
+		rest.WithMiddlewares(
+			[]rest.Middleware{serverCtx.Authority},
+			[]rest.Route{
+				{
+					Method:  http.MethodPost,
 					Path:    "/employee/create",
 					Handler: employee.CreateEmployeeHandler(serverCtx),
 				},

+ 62 - 0
internal/logic/base/init_api_data.go

@@ -6,6 +6,68 @@ import (
 )
 
 func (l *InitDatabaseLogic) insertApiData() (err error) {
+	// Msg
+
+	_, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
+		ServiceName: pointy.GetPointer("Wechat"),
+		Path:        pointy.GetPointer("/msg/create"),
+		Description: pointy.GetPointer("apiDesc.createMsg"),
+		ApiGroup:    pointy.GetPointer("msg"),
+		Method:      pointy.GetPointer("POST"),
+	})
+
+	if err != nil {
+		return err
+	}
+
+	_, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
+		ServiceName: pointy.GetPointer("Wechat"),
+		Path:        pointy.GetPointer("/msg/update"),
+		Description: pointy.GetPointer("apiDesc.updateMsg"),
+		ApiGroup:    pointy.GetPointer("msg"),
+		Method:      pointy.GetPointer("POST"),
+	})
+
+	if err != nil {
+		return err
+	}
+
+	_, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
+		ServiceName: pointy.GetPointer("Wechat"),
+		Path:        pointy.GetPointer("/msg/delete"),
+		Description: pointy.GetPointer("apiDesc.deleteMsg"),
+		ApiGroup:    pointy.GetPointer("msg"),
+		Method:      pointy.GetPointer("POST"),
+	})
+
+	if err != nil {
+		return err
+	}
+
+	_, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
+		ServiceName: pointy.GetPointer("Wechat"),
+		Path:        pointy.GetPointer("/msg/list"),
+		Description: pointy.GetPointer("apiDesc.getMsgList"),
+		ApiGroup:    pointy.GetPointer("msg"),
+		Method:      pointy.GetPointer("POST"),
+	})
+
+	if err != nil {
+		return err
+	}
+
+	_, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
+		ServiceName: pointy.GetPointer("Wechat"),
+		Path:        pointy.GetPointer("/msg"),
+		Description: pointy.GetPointer("apiDesc.getMsgById"),
+		ApiGroup:    pointy.GetPointer("msg"),
+		Method:      pointy.GetPointer("POST"),
+	})
+
+	if err != nil {
+		return err
+	}
+
 	// Token
 
 	_, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{

+ 44 - 0
internal/logic/msg/create_msg_logic.go

@@ -0,0 +1,44 @@
+package Msg
+
+import (
+	"context"
+
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+	"wechat-api/internal/utils/dberrorhandler"
+
+    "github.com/suyuan32/simple-admin-common/msg/errormsg"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type CreateMsgLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewCreateMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateMsgLogic {
+	return &CreateMsgLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *CreateMsgLogic) CreateMsg(req *types.MsgInfo) (*types.BaseMsgResp, error) {
+    _, err := l.svcCtx.DB.Msg.Create().
+			SetNotNilStatus(req.Status).
+			SetNotNilFromwxid(req.Fromwxid).
+			SetNotNilToid(req.Toid).
+			SetNotNilMsgtype(req.Msgtype).
+			SetNotNilMsg(req.Msg).
+			SetNotNilBatchNo(req.BatchNo).
+			Save(l.ctx)
+
+    if err != nil {
+		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
+	}
+
+    return &types.BaseMsgResp{Msg: errormsg.CreateSuccess}, nil
+}

+ 37 - 0
internal/logic/msg/delete_msg_logic.go

@@ -0,0 +1,37 @@
+package Msg
+
+import (
+	"context"
+
+    "wechat-api/ent/msg"
+    "wechat-api/internal/svc"
+    "wechat-api/internal/types"
+    "wechat-api/internal/utils/dberrorhandler"
+
+    "github.com/suyuan32/simple-admin-common/msg/errormsg"
+    "github.com/zeromicro/go-zero/core/logx"
+)
+
+type DeleteMsgLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewDeleteMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteMsgLogic {
+	return &DeleteMsgLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *DeleteMsgLogic) DeleteMsg(req *types.IDsReq) (*types.BaseMsgResp, error) {
+	_, err := l.svcCtx.DB.Msg.Delete().Where(msg.IDIn(req.Ids...)).Exec(l.ctx)
+
+    if err != nil {
+		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
+	}
+
+    return &types.BaseMsgResp{Msg: errormsg.DeleteSuccess}, nil
+}

+ 56 - 0
internal/logic/msg/get_msg_by_id_logic.go

@@ -0,0 +1,56 @@
+package Msg
+
+import (
+	"context"
+
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+	"wechat-api/internal/utils/dberrorhandler"
+
+    "github.com/suyuan32/simple-admin-common/msg/errormsg"
+
+	"github.com/suyuan32/simple-admin-common/utils/pointy"
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetMsgByIdLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewGetMsgByIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetMsgByIdLogic {
+	return &GetMsgByIdLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *GetMsgByIdLogic) GetMsgById(req *types.IDReq) (*types.MsgInfoResp, error) {
+	data, err := l.svcCtx.DB.Msg.Get(l.ctx, req.Id)
+	if err != nil {
+		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
+	}
+
+	return &types.MsgInfoResp{
+	    BaseDataInfo: types.BaseDataInfo{
+            Code: 0,
+            Msg:  errormsg.Success,
+        },
+        Data: types.MsgInfo{
+            BaseIDInfo:    types.BaseIDInfo{
+				Id:          &data.ID,
+				CreatedAt:    pointy.GetPointer(data.CreatedAt.UnixMilli()),
+				UpdatedAt:    pointy.GetPointer(data.UpdatedAt.UnixMilli()),
+            },
+			Status:	&data.Status,
+			Fromwxid:	&data.Fromwxid,
+			Toid:	&data.Toid,
+			Msgtype:	&data.Msgtype,
+			Msg:	&data.Msg,
+			BatchNo:	&data.BatchNo,
+        },
+	}, nil
+}
+

+ 80 - 0
internal/logic/msg/get_msg_list_logic.go

@@ -0,0 +1,80 @@
+package Msg
+
+import (
+	"context"
+	"github.com/zeromicro/go-zero/core/errorx"
+	"wechat-api/ent"
+	"wechat-api/ent/batchmsg"
+
+	"wechat-api/ent/msg"
+	"wechat-api/ent/predicate"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+	"wechat-api/internal/utils/dberrorhandler"
+
+	"github.com/suyuan32/simple-admin-common/msg/errormsg"
+
+	"github.com/suyuan32/simple-admin-common/utils/pointy"
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetMsgListLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewGetMsgListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetMsgListLogic {
+	return &GetMsgListLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *GetMsgListLogic) GetMsgList(req *types.MsgListReq) (*types.MsgListResp, error) {
+	var predicates []predicate.Msg
+	batchMsg, err := l.svcCtx.DB.BatchMsg.Query().Where(batchmsg.IDEQ(*req.BatchId)).First(l.ctx)
+	if err != nil {
+		if ent.IsNotFound(err) {
+			return nil, errorx.NewInvalidArgumentError("群发消息不存在")
+		}
+		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
+	}
+
+	predicates = append(predicates, msg.BatchNo(batchMsg.BatchNo))
+	if req.Status != nil {
+		predicates = append(predicates, msg.StatusEQ(*req.Status))
+	}
+	if req.Toid != nil {
+		predicates = append(predicates, msg.ToidContains(*req.Toid))
+	}
+	data, err := l.svcCtx.DB.Msg.Query().Where(predicates...).Page(l.ctx, req.Page, req.PageSize)
+
+	if err != nil {
+		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
+	}
+
+	resp := &types.MsgListResp{}
+	resp.Msg = errormsg.Success
+	resp.Data.Total = data.PageDetails.Total
+
+	for _, v := range data.List {
+		resp.Data.Data = append(resp.Data.Data,
+			types.MsgInfo{
+				BaseIDInfo: types.BaseIDInfo{
+					Id:        &v.ID,
+					CreatedAt: pointy.GetPointer(v.CreatedAt.UnixMilli()),
+					UpdatedAt: pointy.GetPointer(v.UpdatedAt.UnixMilli()),
+				},
+				Status:   &v.Status,
+				Fromwxid: &v.Fromwxid,
+				Toid:     &v.Toid,
+				Msgtype:  &v.Msgtype,
+				Msg:      &v.Msg,
+				BatchNo:  &v.BatchNo,
+			})
+	}
+
+	return resp, nil
+}

+ 44 - 0
internal/logic/msg/update_msg_logic.go

@@ -0,0 +1,44 @@
+package Msg
+
+import (
+	"context"
+
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+	"wechat-api/internal/utils/dberrorhandler"
+
+
+	"github.com/suyuan32/simple-admin-common/msg/errormsg"
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type UpdateMsgLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewUpdateMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateMsgLogic {
+	return &UpdateMsgLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+func (l *UpdateMsgLogic) UpdateMsg(req *types.MsgInfo) (*types.BaseMsgResp, error) {
+    err := l.svcCtx.DB.Msg.UpdateOneID(*req.Id).
+			SetNotNilStatus(req.Status).
+			SetNotNilFromwxid(req.Fromwxid).
+			SetNotNilToid(req.Toid).
+			SetNotNilMsgtype(req.Msgtype).
+			SetNotNilMsg(req.Msg).
+			SetNotNilBatchNo(req.BatchNo).
+			Exec(l.ctx)
+
+    if err != nil {
+		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
+	}
+
+    return &types.BaseMsgResp{Msg: errormsg.UpdateSuccess}, nil
+}

+ 54 - 0
internal/types/types.go

@@ -1281,6 +1281,60 @@ type BatchMsgInfoResp struct {
 	Data BatchMsgInfo `json:"data"`
 }
 
+// The data of msg information | Msg信息
+// swagger:model MsgInfo
+type MsgInfo struct {
+	BaseIDInfo
+	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
+	Status *uint8 `json:"status,optional"`
+	// 发送方微信ID
+	Fromwxid *string `json:"fromwxid,optional"`
+	// 接收人微信ID/群ID
+	Toid *string `json:"toid,optional"`
+	// 消息类型
+	Msgtype *int32 `json:"msgtype,optional"`
+	// 消息
+	Msg *string `json:"msg,optional"`
+	// 批次号
+	BatchNo *string `json:"batchNo,optional"`
+}
+
+// The response data of msg list | Msg列表数据
+// swagger:model MsgListResp
+type MsgListResp struct {
+	BaseDataInfo
+	// Msg list data | Msg列表数据
+	Data MsgListInfo `json:"data"`
+}
+
+// Msg list data | Msg列表数据
+// swagger:model MsgListInfo
+type MsgListInfo struct {
+	BaseListInfo
+	// The API list data | Msg列表数据
+	Data []MsgInfo `json:"data"`
+}
+
+// Get msg list request params | Msg列表请求参数
+// swagger:model MsgListReq
+type MsgListReq struct {
+	PageInfo
+	// 状态
+	Status *uint8 `json:"status,optional"`
+	// 接收人微信ID/群ID
+	Toid *string `json:"toid,optional"`
+	// 群发消息ID
+	BatchId *uint64 `json:"batchId"`
+}
+
+// Msg information response | Msg信息返回体
+// swagger:model MsgInfoResp
+type MsgInfoResp struct {
+	BaseDataInfo
+	// Msg information | Msg数据
+	Data MsgInfo `json:"data"`
+}
+
 // The data of employee information | Employee信息
 // swagger:model EmployeeInfo
 type EmployeeInfo struct {