修改医生详情接口返回数据

This commit is contained in:
2023-10-27 14:47:37 +08:00
parent cb7807801e
commit 5e70c638c6
5 changed files with 83 additions and 19 deletions
+45
View File
@@ -0,0 +1,45 @@
package dto
import (
"fmt"
"hospital-admin-api/api/model"
)
type UserCaCertDto struct {
CertId string `json:"cert_id"` // 主键id
UserId *string `json:"user_id"` // 用户id(系统证书时为null)
IsSystem int `json:"is_system"` // 是否系统证书(0:否 1:是)
IsLatest int `json:"is_latest"` // 是否最新(0:否 1:是)
Type int `json:"type"` // 证书类型(1:线下 2:线上)
CertBase64 string `json:"cert_base64"` // 签名值证书
CertChainP7 string `json:"cert_chain_p7"` // 证书链
CertSerialNumber string `json:"cert_serial_number"` // 证书序列号
CaPin string `json:"ca_pin"` // ca认证pin值
IsSignConfig int `json:"is_sign_config"` // 是否已添加签章配置(第一次需申请)
SignConfig string `json:"sign_config"` // 签章坐标配置
CertApplicationTime model.LocalTime `json:"cert_application_time"` // 证书申请时间
CertExpireTime model.LocalTime `json:"cert_expire_time"` // 证书过期时间
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
}
func GetUserCaCertDto(m *model.UserCaCert) *UserCaCertDto {
userId := fmt.Sprintf("%d", &m.UserId)
return &UserCaCertDto{
CertId: fmt.Sprintf("%d", m.CertId),
UserId: &userId,
IsSystem: m.IsSystem,
IsLatest: m.IsSystem,
Type: m.IsSystem,
CertBase64: m.CertBase64,
CertChainP7: m.CertChainP7,
CertSerialNumber: m.CertSerialNumber,
CaPin: m.CaPin,
IsSignConfig: m.IsSignConfig,
SignConfig: m.SignConfig,
CertApplicationTime: m.CertApplicationTime,
CertExpireTime: m.CertExpireTime,
CreatedAt: m.CreatedAt,
UpdatedAt: m.UpdatedAt,
}
}
+9
View File
@@ -54,6 +54,7 @@ type UserDoctorDto struct {
DoctorExpertise []*DoctorExpertiseDto `json:"doctor_expertise"` // 医生专长
DoctorBankCard *DoctorBankCardDto `json:"doctor_bank_card"` // 医生银行卡
InquiryType string `json:"inquiry_type"` // 服务类型
UserCaCert *UserCaCertDto `json:"user_ca_cert"` // ca监管证书
}
type UserDoctorPendingDto struct {
@@ -359,6 +360,14 @@ func (r *UserDoctorDto) LoadUserDoctorInfo(m *model.UserDoctorInfo) *UserDoctorD
return r
}
// LoadUserCaCert 加载医生云证书详情
func (r *UserDoctorDto) LoadUserCaCert(m *model.UserCaCert) *UserDoctorDto {
if m != nil {
r.UserCaCert = GetUserCaCertDto(m)
}
return r
}
// LoadUserDoctorInfo 加载医生详情
func (r *UserDoctorPendingDto) LoadUserDoctorInfo(m *model.UserDoctorInfo) *UserDoctorPendingDto {
if m != nil {