新增医生详情
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
package userDoctorInfoResponse
|
||||
|
||||
import (
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/config"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type UserDoctorInfo struct {
|
||||
DoctorInfoId string `json:"doctor_info_id"` // 主键
|
||||
UserId string `json:"user_id"` // 用户id
|
||||
DoctorId string `json:"doctor_id"` // 医生id
|
||||
CardType int `json:"card_type"` // 类型(1:身份证 2:护照 3:港澳通行证 4:台胞证);NOT NULL
|
||||
CardName string `json:"card_name"` // 证件姓名
|
||||
CardNameMask string `json:"card_name_mask"` // 证件姓名(掩码)
|
||||
CardNumMask string `json:"card_num_mask"` // 证件号码(掩码)
|
||||
LicenseCert []string `json:"license_cert"` // 医师执业证(逗号分隔)
|
||||
QualificationCert []string `json:"qualification_cert"` // 医师资格证(逗号分隔)
|
||||
QualificationCertNum string `json:"qualification_cert_num"` // 医师资格证号(逗号分隔)
|
||||
WorkCert []string `json:"work_cert"` // 医师工作证(逗号分隔)
|
||||
MultiPointImages []string `json:"multi_point_images"` // 多点执业备案信息(逗号分隔)
|
||||
IdCardFront string `json:"id_card_front"` // 身份证正面图片
|
||||
IdCardBack string `json:"id_card_back"` // 身份证背面图片
|
||||
SignImage string `json:"sign_image"` // 签名图片
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
}
|
||||
|
||||
// UserDoctorInfoResponse 医生详情
|
||||
func UserDoctorInfoResponse(userDoctorInfo *model.UserDoctorInfo) *UserDoctorInfo {
|
||||
var licenseCert []string
|
||||
if userDoctorInfo.LicenseCert != "" {
|
||||
result := strings.Split(userDoctorInfo.LicenseCert, ",")
|
||||
if len(result) > 0 {
|
||||
for _, v := range result {
|
||||
v = config.C.Oss.OssCustomDomainName + v
|
||||
licenseCert = append(licenseCert, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var qualificationCert []string
|
||||
if userDoctorInfo.QualificationCert != "" {
|
||||
result := strings.Split(userDoctorInfo.QualificationCert, ",")
|
||||
if len(result) > 0 {
|
||||
for _, v := range result {
|
||||
v = config.C.Oss.OssCustomDomainName + v
|
||||
qualificationCert = append(qualificationCert, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var workCert []string
|
||||
if userDoctorInfo.WorkCert != "" {
|
||||
result := strings.Split(userDoctorInfo.WorkCert, ",")
|
||||
if len(result) > 0 {
|
||||
for _, v := range result {
|
||||
v = config.C.Oss.OssCustomDomainName + v
|
||||
workCert = append(workCert, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var multiPointImages []string
|
||||
if userDoctorInfo.MultiPointImages != "" {
|
||||
result := strings.Split(userDoctorInfo.MultiPointImages, ",")
|
||||
if len(result) > 0 {
|
||||
for _, v := range result {
|
||||
multiPointImages = append(multiPointImages, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return &UserDoctorInfo{
|
||||
DoctorInfoId: strconv.FormatInt(userDoctorInfo.DoctorInfoId, 10),
|
||||
UserId: strconv.FormatInt(userDoctorInfo.UserId, 10),
|
||||
DoctorId: strconv.FormatInt(userDoctorInfo.DoctorId, 10),
|
||||
CardType: userDoctorInfo.CardType,
|
||||
CardName: userDoctorInfo.CardName,
|
||||
CardNameMask: userDoctorInfo.CardNameMask,
|
||||
CardNumMask: userDoctorInfo.CardNumMask,
|
||||
LicenseCert: licenseCert,
|
||||
QualificationCert: qualificationCert,
|
||||
QualificationCertNum: userDoctorInfo.QualificationCertNum,
|
||||
WorkCert: workCert,
|
||||
MultiPointImages: multiPointImages,
|
||||
IdCardFront: config.C.Oss.OssCustomDomainName + "/" + userDoctorInfo.IdCardFront,
|
||||
IdCardBack: config.C.Oss.OssCustomDomainName + "/" + userDoctorInfo.IdCardBack,
|
||||
SignImage: config.C.Oss.OssCustomDomainName + "/" + userDoctorInfo.SignImage,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user