修正返回目录
This commit is contained in:
@@ -4,10 +4,8 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"hospital-admin-api/api/dao"
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/api/dto"
|
||||
"hospital-admin-api/api/responses/patientFamilyResponse"
|
||||
"hospital-admin-api/api/responses/userResponse"
|
||||
"hospital-admin-api/utils"
|
||||
)
|
||||
|
||||
type PatientFamilyService struct {
|
||||
@@ -69,7 +67,7 @@ func (r *PatientFamilyService) GetPatientFamilyListByPatientId(patientId int64)
|
||||
}
|
||||
|
||||
// GetPatientFamily 家庭成员详情
|
||||
func (r *PatientFamilyService) GetPatientFamily(familyId int64) (getPatientFamilyResponse *patientFamilyResponse.GetPatientFamily, err error) {
|
||||
func (r *PatientFamilyService) GetPatientFamily(familyId int64) (g *dto.PatientFamilyDto, err error) {
|
||||
patientFamilyDao := dao.PatientFamilyDao{}
|
||||
patientFamily, err := patientFamilyDao.GetPatientFamilyById(familyId)
|
||||
if err != nil || patientFamily == nil {
|
||||
@@ -90,45 +88,11 @@ func (r *PatientFamilyService) GetPatientFamily(familyId int64) (getPatientFamil
|
||||
return nil, errors.New("用户错误")
|
||||
}
|
||||
|
||||
var userData *userResponse.User
|
||||
if userPatient.User != nil {
|
||||
userData = userResponse.UserResponse(user)
|
||||
// 处理返回数据
|
||||
g = dto.GetPatientFamilyDto(patientFamily)
|
||||
|
||||
// 加密患者手机号
|
||||
userData.Mobile = utils.MaskPhoneStr(userData.Mobile)
|
||||
userData.WxMobile = utils.MaskPhoneStr(userData.WxMobile)
|
||||
}
|
||||
// 加载用户数据-加密
|
||||
g.LoadMaskUser(user)
|
||||
|
||||
getPatientFamilyResponse = &patientFamilyResponse.GetPatientFamily{
|
||||
FamilyId: fmt.Sprintf("%d", patientFamily.FamilyId),
|
||||
PatientId: fmt.Sprintf("%d", patientFamily.PatientId),
|
||||
Relation: patientFamily.Relation,
|
||||
Status: &patientFamily.Status,
|
||||
IsDefault: &patientFamily.IsDefault,
|
||||
CardName: patientFamily.CardName,
|
||||
CardNameMask: patientFamily.CardNameMask,
|
||||
MobileMask: patientFamily.MobileMask,
|
||||
Type: &patientFamily.Type,
|
||||
IdNumberMask: patientFamily.IdNumberMask,
|
||||
Sex: &patientFamily.Sex,
|
||||
Age: patientFamily.Age,
|
||||
ProvinceId: fmt.Sprintf("%d", patientFamily.ProvinceId),
|
||||
Province: patientFamily.Province,
|
||||
CityId: fmt.Sprintf("%d", patientFamily.CityId),
|
||||
City: patientFamily.City,
|
||||
CountyId: fmt.Sprintf("%d", patientFamily.CountyId),
|
||||
County: patientFamily.County,
|
||||
Height: patientFamily.Height,
|
||||
Weight: patientFamily.Weight,
|
||||
MaritalStatus: &patientFamily.MaritalStatus,
|
||||
NationId: fmt.Sprintf("%d", patientFamily.NationId),
|
||||
NationName: patientFamily.NationName,
|
||||
JobId: fmt.Sprintf("%d", patientFamily.JobId),
|
||||
JobName: patientFamily.JobName,
|
||||
User: userData,
|
||||
CreatedAt: model.LocalTime{},
|
||||
UpdatedAt: model.LocalTime{},
|
||||
}
|
||||
|
||||
return getPatientFamilyResponse, nil
|
||||
return g, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user