修正返回目录

This commit is contained in:
2023-09-28 08:40:43 +08:00
parent aedf61c31b
commit 70c35e0ce6
84 changed files with 3579 additions and 2007 deletions
+4 -393
View File
@@ -1,256 +1,13 @@
package userDoctorResponse
import (
"hospital-admin-api/api/dto"
"hospital-admin-api/api/model"
"hospital-admin-api/api/responses/doctorBankCardResponse"
"hospital-admin-api/api/responses/doctorExpertiseResponse"
"hospital-admin-api/api/responses/hospitalResponse"
"hospital-admin-api/api/responses/userDoctorInfoResponse"
"hospital-admin-api/api/responses/userResponse"
"hospital-admin-api/utils"
"strconv"
)
// getUserDoctorPage 获取医生列表-分页
type getUserDoctorPage struct {
DoctorID string `json:"doctor_id"` // 主键id
UserID string `json:"user_id"` // 用户id
UserName string `json:"user_name"` // 用户名称
Status int `json:"status"` // 状态(0:禁用 1:正常 2:删除)
IDCardStatus int `json:"idcard_status"` // 实名认证状态(0:未认证 1:认证通过 2:认证失败)
IdenAuthStatus int `json:"iden_auth_status"` // 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
IdenAuthTime model.LocalTime `json:"iden_auth_time"` // 审核时间
IdenAuthFailReason string `json:"iden_auth_fail_reason"` // 身份认证失败原因
MultiPointStatus int `json:"multi_point_status"` // 医生多点执业认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
MultiPointTime model.LocalTime `json:"multi_point_time"` // 审核时间
MultiPointFailReason string `json:"multi_point_fail_reason"` // 多点执业认证失败原因
IsBindBank int `json:"is_bind_bank"` // 是否已绑定结算银行卡(0:否 1:是)
IsRecommend int `json:"is_recommend"` // 是否首页推荐(0:否 1:是)
Avatar string `json:"avatar"` // 头像
DoctorTitle int `json:"doctor_title"` // 医生职称(1:主任医师 2:主任中医师 3:副主任医师 4:副主任中医师 5:主治医师 6:住院医师)
DepartmentCustomName string `json:"department_custom_name"` // 科室名称(如未自己输入,填入标准科室名称)
DepartmentCustomMobile string `json:"department_custom_mobile"` // 科室电话
HospitalID string `json:"hospital_id"` // 所属医院id
HospitalName string `json:"hospital_name"` // 医院名称
ServedPatientsNum int `json:"served_patients_num"` // 服务患者数量(订单结束时统计)
PraiseRate float64 `json:"praise_rate"` // 好评率(百分制。订单平均评价中超过4-5分的订单总数 / 总订单数 * 5)
AvgResponseTime float64 `json:"avg_response_time"` // 平均响应时间(分钟制)
NumberOfFans uint `json:"number_of_fans"` // 被关注数量
IsImgExpertReception int `json:"is_img_expert_reception"` // 是否参加专家图文接诊(0:否 1:是)
IsImgWelfareReception int `json:"is_img_welfare_reception"` // 是否参加公益图文问诊(0:否 1:是)
IsImgQuickReception int `json:"is_img_quick_reception"` // 是否参加快速图文接诊(0:否 1:是)
IsPlatformDeepCooperation int `json:"is_platform_deep_cooperation"` // 是否平台深度合作医生(0:否 1:是)
Mobile string `json:"mobile"` // 手机号
RegisterMethod int `json:"register_method"` // 注册方式(1:微信小程序
Age uint `json:"age"` // 年龄
Sex int `json:"sex"` // 性别(0:未知 1:男 2:女)
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
}
// GetUserDoctor 医生详情
type GetUserDoctor struct {
DoctorID string `json:"doctor_id"` // 主键id
UserID string `json:"user_id"` // 用户id
UserName string `json:"user_name"` // 用户名称
Status int `json:"status"` // 状态(0:禁用 1:正常 2:删除)
IDCardStatus int `json:"idcard_status"` // 实名认证状态(0:未认证 1:认证通过 2:认证失败)
IdenAuthStatus int `json:"iden_auth_status"` // 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
IdenAuthTime model.LocalTime `json:"iden_auth_time"` // 审核时间
IdenAuthFailReason string `json:"iden_auth_fail_reason"` // 身份认证失败原因
MultiPointStatus int `json:"multi_point_status"` // 医生多点执业认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
MultiPointTime model.LocalTime `json:"multi_point_time"` // 审核时间
MultiPointFailReason string `json:"multi_point_fail_reason"` // 多点执业认证失败原因
IsBindBank int `json:"is_bind_bank"` // 是否已绑定结算银行卡(0:否 1:是)
IsRecommend int `json:"is_recommend"` // 是否首页推荐(0:否 1:是)
Avatar string `json:"avatar"` // 头像
DoctorTitle int `json:"doctor_title"` // 医生职称(1:主任医师 2:主任中医师 3:副主任医师 4:副主任中医师 5:主治医师 6:住院医师)
DepartmentCustomID string `json:"department_custom_id"` // 科室id-自定义
DepartmentCustomName string `json:"department_custom_name"` // 科室名称(如未自己输入,填入标准科室名称)
DepartmentCustomMobile string `json:"department_custom_mobile"` // 科室电话
HospitalID string `json:"hospital_id"` // 所属医院id
ServedPatientsNum int `json:"served_patients_num"` // 服务患者数量(订单结束时统计)
PraiseRate float64 `json:"praise_rate"` // 好评率(百分制。订单平均评价中超过4-5分的订单总数 / 总订单数 * 5)
AvgResponseTime float64 `json:"avg_response_time"` // 平均响应时间(分钟制)
NumberOfFans uint `json:"number_of_fans"` // 被关注数量
IsOnline int `json:"is_online"` // 是否在线(0:不在线 1:在线)
IsImgExpertReception int `json:"is_img_expert_reception"` // 是否参加专家图文接诊(0:否 1:是)
IsImgWelfareReception int `json:"is_img_welfare_reception"` // 是否参加公益图文问诊(0:否 1:是)
IsImgQuickReception int `json:"is_img_quick_reception"` // 是否参加快速图文接诊(0:否 1:是)
IsPlatformDeepCooperation int `json:"is_platform_deep_cooperation"` // 是否平台深度合作医生(0:否 1:是)
IsEnterpriseDeepCooperation int `json:"is_enterprise_deep_cooperation"` // 是否企业深度合作医生(0:否 1:是)
IsSysDiagnoCooperation int `json:"is_sys_diagno_cooperation"` // 是否先思达合作医生(0:否 1:是)
QrCode string `json:"qr_code"` // 分享二维码
BeGoodAt string `json:"be_good_at"` // 擅长
BriefIntroduction string `json:"brief_introduction"` // 医生简介
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
User *userResponse.User `json:"user"` // 用户
Hospital *hospitalResponse.Hospital `json:"hospital"` // 医院
UserDoctorInfo *userDoctorInfoResponse.UserDoctorInfo `json:"user_doctor_info"` // 医生详情
DoctorExpertise []*doctorExpertiseResponse.DoctorExpertise `json:"doctor_expertise"` // 医生专长
DoctorBankCard doctorBankCardResponse.DoctorBankCard `json:"doctor_bank_card"` // 医生银行卡
}
// UserDoctor 医生详情
type UserDoctor struct {
DoctorID string `json:"doctor_id"` // 主键id
UserID string `json:"user_id"` // 用户id
UserName string `json:"user_name"` // 用户名称
Status int `json:"status"` // 状态(0:禁用 1:正常 2:删除)
IDCardStatus int `json:"idcard_status"` // 实名认证状态(0:未认证 1:认证通过 2:认证失败)
IdenAuthStatus int `json:"iden_auth_status"` // 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
IdenAuthTime model.LocalTime `json:"iden_auth_time"` // 审核时间
IdenAuthFailReason string `json:"iden_auth_fail_reason"` // 身份认证失败原因
MultiPointStatus int `json:"multi_point_status"` // 医生多点执业认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
MultiPointTime model.LocalTime `json:"multi_point_time"` // 审核时间
MultiPointFailReason string `json:"multi_point_fail_reason"` // 多点执业认证失败原因
IsBindBank int `json:"is_bind_bank"` // 是否已绑定结算银行卡(0:否 1:是)
IsRecommend int `json:"is_recommend"` // 是否首页推荐(0:否 1:是)
Avatar string `json:"avatar"` // 头像
DoctorTitle int `json:"doctor_title"` // 医生职称(1:主任医师 2:主任中医师 3:副主任医师 4:副主任中医师 5:主治医师 6:住院医师)
DepartmentCustomID string `json:"department_custom_id"` // 科室id-自定义
DepartmentCustomName string `json:"department_custom_name"` // 科室名称(如未自己输入,填入标准科室名称)
DepartmentCustomMobile string `json:"department_custom_mobile"` // 科室电话
HospitalID string `json:"hospital_id"` // 所属医院id
ServedPatientsNum int `json:"served_patients_num"` // 服务患者数量(订单结束时统计)
PraiseRate float64 `json:"praise_rate"` // 好评率(百分制。订单平均评价中超过4-5分的订单总数 / 总订单数 * 5)
AvgResponseTime float64 `json:"avg_response_time"` // 平均响应时间(分钟制)
NumberOfFans uint `json:"number_of_fans"` // 被关注数量
IsOnline int `json:"is_online"` // 是否在线(0:不在线 1:在线)
IsImgExpertReception int `json:"is_img_expert_reception"` // 是否参加专家图文接诊(0:否 1:是)
IsImgWelfareReception int `json:"is_img_welfare_reception"` // 是否参加公益图文问诊(0:否 1:是)
IsImgQuickReception int `json:"is_img_quick_reception"` // 是否参加快速图文接诊(0:否 1:是)
IsPlatformDeepCooperation int `json:"is_platform_deep_cooperation"` // 是否平台深度合作医生(0:否 1:是)
IsEnterpriseDeepCooperation int `json:"is_enterprise_deep_cooperation"` // 是否企业深度合作医生(0:否 1:是)
IsSysDiagnoCooperation int `json:"is_sys_diagno_cooperation"` // 是否先思达合作医生(0:否 1:是)
QrCode string `json:"qr_code"` // 分享二维码
BeGoodAt string `json:"be_good_at"` // 擅长
BriefIntroduction string `json:"brief_introduction"` // 医生简介
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
User *userResponse.User `json:"user"` // 用户
Hospital *hospitalResponse.Hospital `json:"hospital"` // 医院
UserDoctorInfo *userDoctorInfoResponse.UserDoctorInfo `json:"user_doctor_info"` // 医生详情
DoctorExpertise []*doctorExpertiseResponse.DoctorExpertise `json:"doctor_expertise"` // 医生专长
DoctorBankCard doctorBankCardResponse.DoctorBankCard `json:"doctor_bank_card"` // 医生银行卡
}
// getUserDoctorPendingPage 身份审核-获取医生列表-分页
type getUserDoctorPendingPage struct {
DoctorID string `json:"doctor_id"` // 主键id
UserID string `json:"user_id"` // 用户id
UserName string `json:"user_name"` // 用户名称
Status int `json:"status"` // 状态(0:禁用 1:正常 2:删除)
IDCardStatus int `json:"idcard_status"` // 实名认证状态(0:未认证 1:认证通过 2:认证失败)
IdenAuthStatus int `json:"iden_auth_status"` // 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
IdenAuthTime model.LocalTime `json:"iden_auth_time"` // 审核时间
IdenAuthFailReason string `json:"iden_auth_fail_reason"` // 身份认证失败原因
Avatar string `json:"avatar"` // 头像
DoctorTitle int `json:"doctor_title"` // 医生职称(1:主任医师 2:主任中医师 3:副主任医师 4:副主任中医师 5:主治医师 6:住院医师)
DepartmentCustomName string `json:"department_custom_name"` // 科室名称(如未自己输入,填入标准科室名称)
DepartmentCustomMobile string `json:"department_custom_mobile"` // 科室电话
HospitalID string `json:"hospital_id"` // 所属医院id
HospitalName string `json:"hospital_name"` // 医院名称
Mobile string `json:"mobile"` // 手机号
Age uint `json:"age"` // 年龄
Sex int `json:"sex"` // 性别(0:未知 1:男 2:女)
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
}
// GetMultiPage 多点-获取医生列表-分页
type GetMultiPage struct {
DoctorID string `json:"doctor_id"` // 主键id
UserID string `json:"user_id"` // 用户id
UserName string `json:"user_name"` // 用户名称
Status int `json:"status"` // 状态(0:禁用 1:正常 2:删除)
IDCardStatus int `json:"idcard_status"` // 实名认证状态(0:未认证 1:认证通过 2:认证失败)
MultiPointStatus int `json:"multi_point_status"` // 医生多点执业认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
MultiPointTime model.LocalTime `json:"multi_point_time"` // 审核时间
MultiPointFailReason string `json:"multi_point_fail_reason"` // 多点执业认证失败原因
Avatar string `json:"avatar"` // 头像
DoctorTitle int `json:"doctor_title"` // 医生职称(1:主任医师 2:主任中医师 3:副主任医师 4:副主任中医师 5:主治医师 6:住院医师)
DepartmentCustomName string `json:"department_custom_name"` // 科室名称(如未自己输入,填入标准科室名称)
DepartmentCustomMobile string `json:"department_custom_mobile"` // 科室电话
HospitalID string `json:"hospital_id"` // 所属医院id
HospitalName string `json:"hospital_name"` // 医院名称
Mobile string `json:"mobile"` // 手机号
Age uint `json:"age"` // 年龄
Sex int `json:"sex"` // 性别(0:未知 1:男 2:女)
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
}
// GetUserDoctorPending 身份审核-医生详情
type GetUserDoctorPending struct {
DoctorID string `json:"doctor_id"` // 主键id
UserID string `json:"user_id"` // 用户id
UserName string `json:"user_name"` // 用户名称
Status int `json:"status"` // 状态(0:禁用 1:正常 2:删除)
IDCardStatus int `json:"idcard_status"` // 实名认证状态(0:未认证 1:认证通过 2:认证失败)
IdenAuthStatus int `json:"iden_auth_status"` // 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
IdenAuthTime model.LocalTime `json:"iden_auth_time"` // 审核时间
IdenAuthFailReason *IdenAuthFailReason `json:"iden_auth_fail_reason"` // 身份认证失败原因
Avatar string `json:"avatar"` // 头像
DoctorTitle int `json:"doctor_title"` // 医生职称(1:主任医师 2:主任中医师 3:副主任医师 4:副主任中医师 5:主治医师 6:住院医师)
DepartmentCustomID string `json:"department_custom_id"` // 科室id-自定义
DepartmentCustomName string `json:"department_custom_name"` // 科室名称(如未自己输入,填入标准科室名称)
DepartmentCustomMobile string `json:"department_custom_mobile"` // 科室电话
HospitalID string `json:"hospital_id"` // 所属医院id
BeGoodAt string `json:"be_good_at"` // 擅长
BriefIntroduction string `json:"brief_introduction"` // 医生简介
IsPlatformDeepCooperation int `json:"is_platform_deep_cooperation"` // 是否平台深度合作医生(0:否 1:是)
IsEnterpriseDeepCooperation int `json:"is_enterprise_deep_cooperation"` // 是否企业深度合作医生(0:否 1:是)
IsSysDiagnoCooperation int `json:"is_sys_diagno_cooperation"` // 是否先思达合作医生(0:否 1:是)
IsRecommend int `json:"is_recommend"` // 是否首页推荐(0:否 1:是)
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
User *userResponse.User `json:"user"` // 用户
Hospital *hospitalResponse.Hospital `json:"hospital"` // 医院
UserDoctorInfo *userDoctorInfoResponse.UserDoctorInfo `json:"user_doctor_info"` // 医生详情
DoctorExpertise []*doctorExpertiseResponse.DoctorExpertise `json:"doctor_expertise"` // 医生专长
}
// IdenAuthFailReason 身份认证失败原因
type IdenAuthFailReason struct {
AvatarReason string `json:"avatar_reason"` // 头像失败原因
DepartmentCustomMobileReason string `json:"department_custom_mobile_reason"` // 科室电话失败原因
DepartmentCustomNameReason string `json:"department_custom_name_reason"` // 科室名称失败原因
BriefIntroductionReason string `json:"brief_introduction_reason"` // 医生简介失败原因
BeGoodAtReason string `json:"be_good_at_reason"` // 医生简介失败原因
LicenseCertReason string `json:"license_cert_reason"` // 医师执业证失败原因
QualificationCertReason string `json:"qualification_cert_reason"` // 医师资格证失败原因
WorkCertReason string `json:"work_cert_reason"` // 医师工作证失败原因
}
// GetMulti 多点-医生详情
type GetMulti struct {
DoctorID string `json:"doctor_id"` // 主键id
UserID string `json:"user_id"` // 用户id
UserName string `json:"user_name"` // 用户名称
Status int `json:"status"` // 状态(0:禁用 1:正常 2:删除)
IDCardStatus int `json:"idcard_status"` // 实名认证状态(0:未认证 1:认证通过 2:认证失败)
MultiPointStatus int `json:"multi_point_status"` // 医生多点执业认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
MultiPointTime model.LocalTime `json:"multi_point_time"` // 审核时间
MultiPointFailReason string `json:"multi_point_fail_reason"` // 多点执业认证失败原因
Avatar string `json:"avatar"` // 头像
DoctorTitle int `json:"doctor_title"` // 医生职称(1:主任医师 2:主任中医师 3:副主任医师 4:副主任中医师 5:主治医师 6:住院医师)
DepartmentCustomID string `json:"department_custom_id"` // 科室id-自定义
DepartmentCustomName string `json:"department_custom_name"` // 科室名称(如未自己输入,填入标准科室名称)
DepartmentCustomMobile string `json:"department_custom_mobile"` // 科室电话
HospitalID string `json:"hospital_id"` // 所属医院id
BeGoodAt string `json:"be_good_at"` // 擅长
BriefIntroduction string `json:"brief_introduction"` // 医生简介
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
User *userResponse.User `json:"user"` // 用户
Hospital *hospitalResponse.Hospital `json:"hospital"` // 医院
UserDoctorInfo *userDoctorInfoResponse.UserDoctorInfo `json:"user_doctor_info"` // 医生详情
}
// OrderInquiryUserDoctor 订单-医生详情
type OrderInquiryUserDoctor struct {
// GetUserDoctorById 医生详情-医生id
type GetUserDoctorById struct {
DoctorID string `json:"doctor_id"` // 主键id
UserID string `json:"user_id"` // 用户id
UserName string `json:"user_name"` // 用户名称
@@ -263,152 +20,6 @@ type OrderInquiryUserDoctor struct {
HospitalID string `json:"hospital_id"` // 所属医院id
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
Hospital *hospitalResponse.Hospital `json:"hospital"` // 医院
Hospital *dto.HospitalDto `json:"hospital"` // 医院
UserDoctorInfo *userDoctorInfoResponse.UserDoctorInfo `json:"user_doctor_info"` // 医生详情
}
// GetUserDoctorPageResponse 获取用户列表-分页
func GetUserDoctorPageResponse(userDoctor []*model.UserDoctor) []getUserDoctorPage {
// 处理返回值
getUserPageResponses := make([]getUserDoctorPage, len(userDoctor))
if len(userDoctor) > 0 {
for i, v := range userDoctor {
// 将原始结构体转换为新结构体
getUserDoctorPageResponse := getUserDoctorPage{
DoctorID: strconv.Itoa(int(v.DoctorId)),
UserID: strconv.Itoa(int(v.UserId)),
UserName: v.UserName,
Status: v.Status,
IDCardStatus: v.Status,
IdenAuthStatus: v.IdenAuthStatus,
IdenAuthTime: v.IdenAuthTime,
IdenAuthFailReason: v.IdenAuthFailReason,
MultiPointStatus: v.MultiPointStatus,
MultiPointTime: v.MultiPointTime,
MultiPointFailReason: v.MultiPointFailReason,
IsBindBank: v.IsBindBank,
IsRecommend: v.IsRecommend,
Avatar: utils.AddOssDomain(v.Avatar),
DoctorTitle: v.DoctorTitle,
DepartmentCustomName: v.DepartmentCustomName,
DepartmentCustomMobile: v.DepartmentCustomMobile,
HospitalID: strconv.Itoa(int(v.HospitalID)),
ServedPatientsNum: v.ServedPatientsNum,
PraiseRate: v.PraiseRate,
AvgResponseTime: v.AvgResponseTime,
NumberOfFans: v.NumberOfFans,
IsImgExpertReception: v.IsImgExpertReception,
IsImgWelfareReception: v.IsImgWelfareReception,
IsImgQuickReception: v.IsImgQuickReception,
IsPlatformDeepCooperation: v.IsPlatformDeepCooperation,
CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt,
}
if v.User != nil {
getUserDoctorPageResponse.Mobile = v.User.Mobile
getUserDoctorPageResponse.RegisterMethod = v.User.RegisterMethod
getUserDoctorPageResponse.Age = v.User.Age
getUserDoctorPageResponse.Sex = v.User.Sex
}
if v.Hospital != nil {
getUserDoctorPageResponse.HospitalName = v.Hospital.HospitalName
}
// 将转换后的结构体添加到新切片中
getUserPageResponses[i] = getUserDoctorPageResponse
}
}
return getUserPageResponses
}
// GetUserDoctorPendingPageResponse 身份审核-获取医生列表-分页
func GetUserDoctorPendingPageResponse(userDoctor []*model.UserDoctor) []getUserDoctorPendingPage {
// 处理返回值
getUserDoctorPendingPageResponses := make([]getUserDoctorPendingPage, len(userDoctor))
if len(userDoctor) > 0 {
for i, v := range userDoctor {
// 将原始结构体转换为新结构体
getUserDoctorPageResponse := getUserDoctorPendingPage{
DoctorID: strconv.Itoa(int(v.DoctorId)),
UserID: strconv.Itoa(int(v.UserId)),
UserName: v.UserName,
Status: v.Status,
IDCardStatus: v.Status,
IdenAuthStatus: v.IdenAuthStatus,
IdenAuthTime: v.IdenAuthTime,
IdenAuthFailReason: v.IdenAuthFailReason,
Avatar: utils.AddOssDomain(v.Avatar),
DoctorTitle: v.DoctorTitle,
DepartmentCustomName: v.DepartmentCustomName,
DepartmentCustomMobile: v.DepartmentCustomMobile,
HospitalID: strconv.Itoa(int(v.HospitalID)),
CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt,
}
if v.User != nil {
getUserDoctorPageResponse.Mobile = v.User.Mobile
getUserDoctorPageResponse.Age = v.User.Age
getUserDoctorPageResponse.Sex = v.User.Sex
}
if v.Hospital != nil {
getUserDoctorPageResponse.HospitalName = v.Hospital.HospitalName
}
// 将转换后的结构体添加到新切片中
getUserDoctorPendingPageResponses[i] = getUserDoctorPageResponse
}
}
return getUserDoctorPendingPageResponses
}
// GetMultiPageResponse 多点-获取医生列表-分页
func GetMultiPageResponse(userDoctor []*model.UserDoctor) []GetMultiPage {
// 处理返回值
r := make([]GetMultiPage, len(userDoctor))
if len(userDoctor) > 0 {
for i, v := range userDoctor {
// 将原始结构体转换为新结构体
g := GetMultiPage{
DoctorID: strconv.Itoa(int(v.DoctorId)),
UserID: strconv.Itoa(int(v.UserId)),
UserName: v.UserName,
Status: v.Status,
IDCardStatus: v.Status,
MultiPointStatus: v.MultiPointStatus,
MultiPointTime: v.MultiPointTime,
MultiPointFailReason: v.MultiPointFailReason,
Avatar: utils.AddOssDomain(v.Avatar),
DoctorTitle: v.DoctorTitle,
DepartmentCustomName: v.DepartmentCustomName,
DepartmentCustomMobile: v.DepartmentCustomMobile,
HospitalID: strconv.Itoa(int(v.HospitalID)),
CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt,
}
if v.User != nil {
g.Mobile = v.User.Mobile
g.Age = v.User.Age
g.Sex = v.User.Sex
}
if v.Hospital != nil {
g.HospitalName = v.Hospital.HospitalName
}
// 将转换后的结构体添加到新切片中
r[i] = g
}
}
return r
}