package logic import ( "context" "fmt" "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/entity" "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/rpc/medical/internal/svc" "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/rpc/medical/medical" "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service" "github.com/zeromicro/go-zero/core/logx" ) type GetNewMsgLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } func NewGetNewMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetNewMsgLogic { return &GetNewMsgLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } // 招标动态 func (l *GetNewMsgLogic) GetNewMsg(in *medical.GetNewMsgReq) (*medical.GetNewMsgResp, error) { resp := &medical.GetNewMsgResp{} portrait := service.NewPortrait(&entity.Conn{ Mysql: entity.Mysql, BaseMysql: entity.BaseMysql, CommonMysql: entity.CommonMysql, }) info, count, err := portrait.List(in.CompanyName, in.PageSize, in.PageNum) if err != nil || info == nil { l.Error(fmt.Sprintf("%+v", in), err.Error()) resp.ErrorMsg = err.Error() resp.ErrorCode = -1 } else { resp.Count = count for _, v := range *info { resp.List = append(resp.List, &medical.NewMsgList{ Area: v.Area, Bidstatus: v.Bidstatus, Firsttime: v.Firsttime, Id: v.Id, Title: v.Title, }) } } return resp, nil }