123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- 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 PortraitLogic struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- logx.Logger
- }
- func NewPortraitLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PortraitLogic {
- return &PortraitLogic{
- ctx: ctx,
- svcCtx: svcCtx,
- Logger: logx.WithContext(ctx),
- }
- }
- // 医疗机构画像
- func (l *PortraitLogic) Portrait(in *medical.PortraitReq) (*medical.PortraitResp, error) {
- // todo: add your logic here and delete this line
- resp := &medical.PortraitResp{}
- portrait := service.NewPortrait(&entity.Conn{
- Mysql: entity.Mysql,
- BaseMysql: entity.BaseMysql,
- CommonMysql: entity.CommonMysql,
- })
- info, err := portrait.Info(in.CompanyId, in.UserId)
- if err != nil || info == nil {
- l.Error(fmt.Sprintf("%+v", in), err.Error())
- resp.ErrorMsg = err.Error()
- resp.ErrorCode = -1
- } else {
- resp.Address = info.Address
- resp.Area = info.Area
- resp.Beds = info.Beds
- resp.BusinessType = info.BusinessType
- resp.CompanyName = info.CompanyName
- resp.Departnames = info.Departnames
- resp.Doctorsnum = info.Doctorsnum
- resp.Equipment = info.Equipment
- resp.EstablishDate = info.EstablishDate
- resp.Follow = info.Follow
- resp.Level = info.Level
- resp.MiType = info.MiType
- resp.VisitPerday = info.VisitPerday
- resp.Website = info.Website
- resp.City = info.City
- resp.District = info.District
- }
- return resp, nil
- }
|