package logic import ( quitl "app.yhyue.com/moapp/jybase/common" "app.yhyue.com/moapp/jybase/encrypt" util "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/entity" "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/internal/svc" "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/messagecenter" "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/service" "context" "github.com/zeromicro/go-zero/core/logx" ) type CreateChatSessionLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } func NewCreateChatSessionLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateChatSessionLogic { return &CreateChatSessionLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } // 会话创建 func (l *CreateChatSessionLogic) CreateChatSession(in *messagecenter.ChatSessionReq) (*messagecenter.ChatSessionResp, error) { // todo: add your logic here and delete this line m := service.MessaggeService{} fool, sessionId := m.CreateChatSession(in) error_message := "" error_code := util.SUCCESS_CODE if fool { error_code = util.SUCCESS_CODE error_message = "" } else { error_code = util.ERROR_CODE error_message = "修改失败" } return &messagecenter.ChatSessionResp{ ErrorCode: error_code, ErrorMsg: error_message, SessionId: encrypt.SE.Encode2Hex(quitl.InterfaceToStr(sessionId)), }, nil }