temp
This commit is contained in:
@@ -1,62 +1,21 @@
|
||||
package commands
|
||||
|
||||
// CreateCertificationCommand 创建认证申请命令
|
||||
// 用于用户发起企业认证流程的初始请求
|
||||
type CreateCertificationCommand struct {
|
||||
UserID string `json:"user_id" binding:"required" comment:"用户唯一标识,从JWT token获取"`
|
||||
}
|
||||
|
||||
// UploadLicenseCommand 上传营业执照命令
|
||||
// 用于处理营业执照文件上传的业务逻辑
|
||||
type UploadLicenseCommand struct {
|
||||
UserID string `json:"-" comment:"用户唯一标识,从JWT token获取,不在JSON中暴露"`
|
||||
FileBytes []byte `json:"-" comment:"营业执照文件的二进制内容,从multipart/form-data获取"`
|
||||
FileName string `json:"-" comment:"营业执照文件的原始文件名,从multipart/form-data获取"`
|
||||
FileSize int64 `json:"-" comment:"营业执照文件的大小(字节),从multipart/form-data获取"`
|
||||
}
|
||||
|
||||
// SubmitEnterpriseInfoCommand 提交企业信息命令
|
||||
// 用于用户提交企业四要素信息,完成企业信息验证
|
||||
// 如果用户没有认证申请,系统会自动创建
|
||||
type SubmitEnterpriseInfoCommand struct {
|
||||
UserID string `json:"-" comment:"用户唯一标识,从JWT token获取,不在JSON中暴露"`
|
||||
CertificationID string `json:"-" comment:"认证申请唯一标识,从URL路径获取,不在JSON中暴露"`
|
||||
CompanyName string `json:"company_name" binding:"required" comment:"企业名称,如:北京科技有限公司"`
|
||||
UnifiedSocialCode string `json:"unified_social_code" binding:"required" comment:"统一社会信用代码,18位企业唯一标识,如:91110000123456789X"`
|
||||
LegalPersonName string `json:"legal_person_name" binding:"required" comment:"法定代表人姓名,如:张三"`
|
||||
LegalPersonID string `json:"legal_person_id" binding:"required" comment:"法定代表人身份证号码,18位,如:110101199001011234"`
|
||||
LicenseUploadRecordID string `json:"license_upload_record_id" binding:"required" comment:"营业执照上传记录唯一标识,关联已上传的营业执照文件"`
|
||||
}
|
||||
|
||||
// InitiateFaceVerifyCommand 初始化人脸识别命令
|
||||
// 用于发起人脸识别验证流程,验证法定代表人身份
|
||||
type InitiateFaceVerifyCommand struct {
|
||||
CertificationID string `json:"-" comment:"认证申请唯一标识,从URL路径获取,不在JSON中暴露"`
|
||||
RealName string `json:"real_name" binding:"required" comment:"真实姓名,必须与营业执照上的法定代表人姓名一致"`
|
||||
IDCardNumber string `json:"id_card_number" binding:"required" comment:"身份证号码,18位,用于人脸识别身份验证"`
|
||||
ReturnURL string `json:"return_url" binding:"required" comment:"人脸识别完成后的回调地址,用于跳转回应用"`
|
||||
}
|
||||
|
||||
// ApplyContractCommand 申请合同命令
|
||||
// 用于用户申请电子合同,进入合同签署流程
|
||||
type ApplyContractCommand struct {
|
||||
CertificationID string `json:"-" comment:"认证申请唯一标识,从URL路径获取,不在JSON中暴露"`
|
||||
}
|
||||
|
||||
// RetryStepCommand 重试认证步骤命令
|
||||
// 用于用户重试失败的认证步骤,如人脸识别失败后的重试
|
||||
type RetryStepCommand struct {
|
||||
UserID string `json:"-" comment:"用户唯一标识,从JWT token获取,不在JSON中暴露"`
|
||||
CertificationID string `json:"-" comment:"认证申请唯一标识,从URL路径获取,不在JSON中暴露"`
|
||||
Step string `json:"step" binding:"required" comment:"重试的步骤名称,如:face_verify(人脸识别)、contract_sign(合同签署)"`
|
||||
}
|
||||
|
||||
// CreateEnterpriseInfoCommand 创建企业信息命令
|
||||
// 用于创建企业基本信息,通常在企业认证流程中使用
|
||||
// @Description 创建企业信息请求参数
|
||||
type CreateEnterpriseInfoCommand struct {
|
||||
UserID string `json:"-" comment:"用户唯一标识,从JWT token获取,不在JSON中暴露"`
|
||||
CompanyName string `json:"company_name" binding:"required" example:"示例企业有限公司" comment:"企业名称,如:示例企业有限公司"`
|
||||
UnifiedSocialCode string `json:"unified_social_code" binding:"required" example:"91110000123456789X" comment:"统一社会信用代码,18位企业唯一标识,如:91110000123456789X"`
|
||||
LegalPersonName string `json:"legal_person_name" binding:"required" example:"张三" comment:"法定代表人姓名,如:张三"`
|
||||
LegalPersonID string `json:"legal_person_id" binding:"required" example:"110101199001011234" comment:"法定代表人身份证号码,18位,如:110101199001011234"`
|
||||
CompanyName string `json:"company_name" binding:"required,min=2,max=100" comment:"企业名称,如:北京科技有限公司"`
|
||||
UnifiedSocialCode string `json:"unified_social_code" binding:"required,social_credit_code" comment:"统一社会信用代码,18位企业唯一标识,如:91110000123456789X"`
|
||||
LegalPersonName string `json:"legal_person_name" binding:"required,min=2,max=20" comment:"法定代表人姓名,如:张三"`
|
||||
LegalPersonID string `json:"legal_person_id" binding:"required,id_card" comment:"法定代表人身份证号码,18位,如:110101199001011234"`
|
||||
LegalPersonPhone string `json:"legal_person_phone" binding:"required,phone" comment:"法定代表人手机号,11位,如:13800138000"`
|
||||
VerificationCode string `json:"verification_code" binding:"required,len=6" comment:"验证码"`
|
||||
}
|
||||
|
||||
// CompleteContractSignCommand 完成合同签署命令
|
||||
// 用于用户完成合同签署,提交合同URL
|
||||
type CompleteContractSignCommand struct {
|
||||
UserID string `json:"-" comment:"用户唯一标识,从JWT token获取,不在JSON中暴露"`
|
||||
ContractURL string `json:"contract_url" binding:"required,url,min=10,max=500" comment:"合同签署后的URL地址"`
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
package commands
|
||||
|
||||
// GetContractSignURLCommand 获取合同签署链接命令
|
||||
type GetContractSignURLCommand struct {
|
||||
UserID string `json:"user_id" binding:"required,uuid" comment:"用户ID"`
|
||||
}
|
||||
@@ -3,11 +3,11 @@ package queries
|
||||
// GetCertificationStatusQuery 获取认证状态查询
|
||||
// 用于查询用户当前认证申请的进度状态
|
||||
type GetCertificationStatusQuery struct {
|
||||
UserID string `json:"user_id" binding:"required" comment:"用户唯一标识,用于查询该用户的认证申请状态"`
|
||||
UserID string `json:"user_id" binding:"required,uuid" comment:"用户唯一标识,用于查询该用户的认证申请状态"`
|
||||
}
|
||||
|
||||
// GetCertificationDetailsQuery 获取认证详情查询
|
||||
// 用于查询用户认证申请的详细信息,包括所有相关记录
|
||||
type GetCertificationDetailsQuery struct {
|
||||
UserID string `json:"user_id" binding:"required" comment:"用户唯一标识,用于查询该用户的认证申请详细信息"`
|
||||
UserID string `json:"user_id" binding:"required,uuid" comment:"用户唯一标识,用于查询该用户的认证申请详细信息"`
|
||||
}
|
||||
|
||||
@@ -8,59 +8,38 @@ import (
|
||||
|
||||
// CertificationResponse 认证响应
|
||||
type CertificationResponse struct {
|
||||
ID string `json:"id"`
|
||||
UserID string `json:"user_id"`
|
||||
Status enums.CertificationStatus `json:"status"`
|
||||
StatusName string `json:"status_name"`
|
||||
Progress int `json:"progress"`
|
||||
IsUserActionRequired bool `json:"is_user_action_required"`
|
||||
IsAdminActionRequired bool `json:"is_admin_action_required"`
|
||||
InfoSubmittedAt *time.Time `json:"info_submitted_at,omitempty"`
|
||||
FaceVerifiedAt *time.Time `json:"face_verified_at,omitempty"`
|
||||
ContractAppliedAt *time.Time `json:"contract_applied_at,omitempty"`
|
||||
ContractApprovedAt *time.Time `json:"contract_approved_at,omitempty"`
|
||||
ContractSignedAt *time.Time `json:"contract_signed_at,omitempty"`
|
||||
CompletedAt *time.Time `json:"completed_at,omitempty"`
|
||||
Enterprise *EnterpriseInfoResponse `json:"enterprise,omitempty"`
|
||||
ContractURL string `json:"contract_url,omitempty"`
|
||||
SigningURL string `json:"signing_url,omitempty"`
|
||||
RejectReason string `json:"reject_reason,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
ID string `json:"id"`
|
||||
UserID string `json:"user_id"`
|
||||
Status enums.CertificationStatus `json:"status"`
|
||||
StatusName string `json:"status_name"`
|
||||
Progress int `json:"progress"`
|
||||
IsUserActionRequired bool `json:"is_user_action_required"`
|
||||
InfoSubmittedAt *time.Time `json:"info_submitted_at,omitempty"`
|
||||
EnterpriseVerifiedAt *time.Time `json:"enterprise_verified_at,omitempty"`
|
||||
ContractAppliedAt *time.Time `json:"contract_applied_at,omitempty"`
|
||||
ContractSignedAt *time.Time `json:"contract_signed_at,omitempty"`
|
||||
CompletedAt *time.Time `json:"completed_at,omitempty"`
|
||||
Enterprise *EnterpriseInfoResponse `json:"enterprise,omitempty"`
|
||||
ContractURL string `json:"contract_url,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// EnterpriseInfoResponse 企业信息响应
|
||||
type EnterpriseInfoResponse struct {
|
||||
ID string `json:"id"`
|
||||
CertificationID string `json:"certification_id"`
|
||||
CompanyName string `json:"company_name"`
|
||||
UnifiedSocialCode string `json:"unified_social_code"`
|
||||
LegalPersonName string `json:"legal_person_name"`
|
||||
LegalPersonID string `json:"legal_person_id"`
|
||||
LicenseUploadRecordID string `json:"license_upload_record_id"`
|
||||
IsOCRVerified bool `json:"is_ocr_verified"`
|
||||
IsFaceVerified bool `json:"is_face_verified"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
ID string `json:"id"`
|
||||
CompanyName string `json:"company_name"`
|
||||
UnifiedSocialCode string `json:"unified_social_code"`
|
||||
LegalPersonName string `json:"legal_person_name"`
|
||||
LegalPersonID string `json:"legal_person_id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// UploadLicenseResponse 上传营业执照响应
|
||||
type UploadLicenseResponse struct {
|
||||
UploadRecordID string `json:"upload_record_id"`
|
||||
FileURL string `json:"file_url"`
|
||||
OCRProcessed bool `json:"ocr_processed"`
|
||||
OCRSuccess bool `json:"ocr_success"`
|
||||
// OCR识别结果(如果成功)
|
||||
EnterpriseName string `json:"enterprise_name,omitempty"`
|
||||
CreditCode string `json:"credit_code,omitempty"`
|
||||
LegalPerson string `json:"legal_person,omitempty"`
|
||||
OCRConfidence float64 `json:"ocr_confidence,omitempty"`
|
||||
OCRErrorMessage string `json:"ocr_error_message,omitempty"`
|
||||
}
|
||||
|
||||
// FaceVerifyResponse 人脸识别响应
|
||||
type FaceVerifyResponse struct {
|
||||
CertifyID string `json:"certify_id"`
|
||||
VerifyURL string `json:"verify_url"`
|
||||
ExpiresAt time.Time `json:"expires_at"`
|
||||
// EnterpriseAuthURLResponse 企业认证链接响应
|
||||
type EnterpriseAuthURLResponse struct {
|
||||
EsignFlowID string `json:"esign_flow_id"` // e签宝认证流程ID
|
||||
AuthURL string `json:"auth_url"` // 认证链接
|
||||
ShortURL string `json:"short_url"` // 短链接
|
||||
ExpireAt string `json:"expire_at"` // 过期时间
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package responses
|
||||
|
||||
// ContractSignURLResponse 合同签署链接响应
|
||||
type ContractSignURLResponse struct {
|
||||
SignURL string `json:"sign_url"` // 签署链接
|
||||
ShortURL string `json:"short_url"` // 短链接
|
||||
SignFlowID string `json:"sign_flow_id"` // 签署流程ID
|
||||
ExpireAt string `json:"expire_at"` // 过期时间
|
||||
}
|
||||
Reference in New Issue
Block a user