1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- package logic
- import (
- "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/service"
- "context"
- "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/internal/svc"
- "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/messagecenter"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type SaveAutoReplyMsgLogic struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- logx.Logger
- }
- func NewSaveAutoReplyMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SaveAutoReplyMsgLogic {
- return &SaveAutoReplyMsgLogic{
- ctx: ctx,
- svcCtx: svcCtx,
- Logger: logx.WithContext(ctx),
- }
- }
- // 创建会话并且保存信息
- func (l *SaveAutoReplyMsgLogic) SaveAutoReplyMsg(in *messagecenter.SaveAutoReplyReq) (*messagecenter.MessageResp, error) {
- // todo: add your logic here and delete this line
- m := service.MessaggeService{}
- error_code := m.SaveAutoReplyMsg(in.UserType, in.EntId, in.EntUserId, in.UserId, in.Content, in.AppId, in.NowFormat)
- error_message := "保存失败"
- if error_code {
- return &messagecenter.MessageResp{
- ErrorCode: 0,
- ErrorMsg: error_message,
- }, nil
- } else {
- return &messagecenter.MessageResp{
- ErrorCode: 1,
- ErrorMsg: "保存失败",
- }, nil
- }
- }
|