mldetailslogic.go 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. package logic
  2. import (
  3. service "app.yhyue.com/moapp/MessageCenter/rpc/internal/common"
  4. "context"
  5. "github.com/gogf/gf/v2/util/gconv"
  6. "app.yhyue.com/moapp/MessageCenter/rpc/internal/svc"
  7. "app.yhyue.com/moapp/MessageCenter/rpc/type/message"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type MlDetailsLogic struct {
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. logx.Logger
  14. }
  15. func NewMlDetailsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MlDetailsLogic {
  16. return &MlDetailsLogic{
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. Logger: logx.WithContext(ctx),
  20. }
  21. }
  22. // 物料详情
  23. func (l *MlDetailsLogic) MlDetails(in *message.MaterialDetailReq) (*message.MaterialDetailResp, error) {
  24. // todo: add your logic here and delete this line
  25. //先查询详情
  26. data := service.MaterialDetail(in.MsgLogId, in.PositionId)
  27. if data != nil {
  28. return &message.MaterialDetailResp{
  29. Code: 1,
  30. Message: "获取详情成功",
  31. Data: &message.MaterialDetail{
  32. Id: gconv.Int64(data["id"]),
  33. Title: gconv.String(data["title"]),
  34. Content: gconv.String(data["content"]),
  35. Link: gconv.String(data["link"]),
  36. Createtime: gconv.String(data["createtime"]),
  37. IsRead: gconv.Int64(data["isRead"]),
  38. MsgType: gconv.Int64(data["msgType"]),
  39. TaskName: gconv.String(data["task_name"]),
  40. TaskDescription: gconv.String(data["task_description"]),
  41. MaterialContent: gconv.String(data["material_content"]),
  42. QrcodeUrl: gconv.String(data["qrcode_url"]),
  43. ReceiveUserName: gconv.String(data["receive_user_name"]),
  44. ReceiveUserId: gconv.String(data["receive_user_id"]),
  45. FileUrl: gconv.String(data["file_url"]),
  46. AttUrl: gconv.String(data["attUrl"]),
  47. },
  48. }, nil
  49. }
  50. return &message.MaterialDetailResp{
  51. Code: 1,
  52. Message: "获取详情成功",
  53. Data: nil,
  54. }, nil
  55. }