新增数据库主键处理
This commit is contained in:
@@ -92,7 +92,7 @@ type GetUserDoctor struct {
|
||||
DoctorBankCard *doctorBankCardResponse.DoctorBankCard `json:"doctor_bank_card"` // 医生银行卡
|
||||
}
|
||||
|
||||
// getUserDoctorPendingPage 审核-获取医生列表-分页
|
||||
// getUserDoctorPendingPage 身份审核-获取医生列表-分页
|
||||
type getUserDoctorPendingPage struct {
|
||||
DoctorID string `json:"doctor_id"` // 主键id
|
||||
UserID string `json:"user_id"` // 用户id
|
||||
@@ -115,7 +115,30 @@ type getUserDoctorPendingPage struct {
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
}
|
||||
|
||||
// GetUserDoctorPending 审核-医生详情
|
||||
// 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
|
||||
@@ -153,6 +176,32 @@ type IdenAuthFailReason struct {
|
||||
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"` // 医生详情
|
||||
DoctorExpertise []*doctorExpertiseResponse.DoctorExpertise `json:"doctor_expertise"` // 医生专长
|
||||
}
|
||||
|
||||
// GetUserDoctorPageResponse 获取用户列表-分页
|
||||
func GetUserDoctorPageResponse(userDoctor []*model.UserDoctor) []getUserDoctorPage {
|
||||
// 处理返回值
|
||||
@@ -211,7 +260,7 @@ func GetUserDoctorPageResponse(userDoctor []*model.UserDoctor) []getUserDoctorPa
|
||||
return getUserPageResponses
|
||||
}
|
||||
|
||||
// GetUserDoctorPendingPageResponse 审核-获取医生列表-分页
|
||||
// GetUserDoctorPendingPageResponse 身份审核-获取医生列表-分页
|
||||
func GetUserDoctorPendingPageResponse(userDoctor []*model.UserDoctor) []getUserDoctorPendingPage {
|
||||
// 处理返回值
|
||||
getUserDoctorPendingPageResponses := make([]getUserDoctorPendingPage, len(userDoctor))
|
||||
@@ -254,3 +303,47 @@ func GetUserDoctorPendingPageResponse(userDoctor []*model.UserDoctor) []getUserD
|
||||
|
||||
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: config.C.Oss.OssCustomDomainName + "/" + 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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user