saveautoreplymsglogic.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package logic
  2. import (
  3. "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/service"
  4. "context"
  5. "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/internal/svc"
  6. "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/messagecenter"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type SaveAutoReplyMsgLogic struct {
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. logx.Logger
  13. }
  14. func NewSaveAutoReplyMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SaveAutoReplyMsgLogic {
  15. return &SaveAutoReplyMsgLogic{
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. Logger: logx.WithContext(ctx),
  19. }
  20. }
  21. // 创建会话并且保存信息
  22. func (l *SaveAutoReplyMsgLogic) SaveAutoReplyMsg(in *messagecenter.SaveAutoReplyReq) (*messagecenter.MessageResp, error) {
  23. // todo: add your logic here and delete this line
  24. m := service.MessaggeService{}
  25. error_code := m.SaveAutoReplyMsg(in.UserType, in.EntId, in.EntUserId, in.UserId, in.Content, in.AppId, in.NowFormat)
  26. error_message := "保存失败"
  27. if error_code {
  28. return &messagecenter.MessageResp{
  29. ErrorCode: 0,
  30. ErrorMsg: error_message,
  31. }, nil
  32. } else {
  33. return &messagecenter.MessageResp{
  34. ErrorCode: 1,
  35. ErrorMsg: "保存失败",
  36. }, nil
  37. }
  38. }