123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- package logic
- import (
- service "app.yhyue.com/moapp/MessageCenter/rpc/internal/common"
- "context"
- "github.com/gogf/gf/v2/util/gconv"
- "app.yhyue.com/moapp/MessageCenter/rpc/internal/svc"
- "app.yhyue.com/moapp/MessageCenter/rpc/type/message"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type MlDetailsLogic struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- logx.Logger
- }
- func NewMlDetailsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MlDetailsLogic {
- return &MlDetailsLogic{
- ctx: ctx,
- svcCtx: svcCtx,
- Logger: logx.WithContext(ctx),
- }
- }
- // 物料详情
- func (l *MlDetailsLogic) MlDetails(in *message.MaterialDetailReq) (*message.MaterialDetailResp, error) {
- // todo: add your logic here and delete this line
- //先查询详情
- data := service.MaterialDetail(in.MsgLogId, in.PositionId)
- if data != nil {
- return &message.MaterialDetailResp{
- Code: 1,
- Message: "获取详情成功",
- Data: &message.MaterialDetail{
- Id: gconv.Int64(data["id"]),
- Title: gconv.String(data["title"]),
- Content: gconv.String(data["content"]),
- Link: gconv.String(data["link"]),
- Createtime: gconv.String(data["createtime"]),
- IsRead: gconv.Int64(data["isRead"]),
- MsgType: gconv.Int64(data["msgType"]),
- TaskName: gconv.String(data["task_name"]),
- TaskDescription: gconv.String(data["task_description"]),
- MaterialContent: gconv.String(data["material_content"]),
- QrcodeUrl: gconv.String(data["qrcode_url"]),
- ReceiveUserName: gconv.String(data["receive_user_name"]),
- ReceiveUserId: gconv.String(data["receive_user_id"]),
- FileUrl: gconv.String(data["file_url"]),
- AttUrl: gconv.String(data["attUrl"]),
- },
- }, nil
- }
- return &message.MaterialDetailResp{
- Code: 1,
- Message: "获取详情成功",
- Data: nil,
- }, nil
- }
|