46 lines
2.1 KiB
Go
46 lines
2.1 KiB
Go
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,
|
||
}
|
||
}
|