mldetailslogic.go 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. ImgWebpage: gconv.String(data["img_webpage"]),
  48. },
  49. }, nil
  50. }
  51. return &message.MaterialDetailResp{
  52. Code: 1,
  53. Message: "获取详情成功",
  54. Data: nil,
  55. }, nil
  56. }