deletesinglemessagelogic.go 983 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/MessageCenter/rpc/messageclient"
  4. "app.yhyue.com/moapp/MessageCenter/service"
  5. "context"
  6. "app.yhyue.com/moapp/MessageCenter/rpc/internal/svc"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type DeleteSingleMessageLogic struct {
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. logx.Logger
  13. }
  14. func NewDeleteSingleMessageLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteSingleMessageLogic {
  15. return &DeleteSingleMessageLogic{
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. Logger: logx.WithContext(ctx),
  19. }
  20. }
  21. // 删除单一消息
  22. func (l *DeleteSingleMessageLogic) DeleteSingleMessage(in *messageclient.DeleteSingleMessageRequest) (*messageclient.Response, error) {
  23. // todo: add your logic here and delete this line
  24. m := &service.MessageService{}
  25. var idSlice []string
  26. idSlice = append(idSlice, in.Id)
  27. code, msg := m.DeleteMessage(idSlice, in.Appid)
  28. return &messageclient.Response{
  29. Code: code,
  30. Message: msg,
  31. }, nil
  32. }