2025-07-13 16:36:20 +08:00
|
|
|
|
package commands
|
|
|
|
|
|
|
2025-07-21 15:13:26 +08:00
|
|
|
|
import (
|
|
|
|
|
|
"tyapi-server/internal/domains/certification/enums"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// CreateCertificationCommand 创建认证申请命令
|
|
|
|
|
|
type CreateCertificationCommand struct {
|
|
|
|
|
|
UserID string `json:"-"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ApplyContractCommand 申请合同命令
|
|
|
|
|
|
type ApplyContractCommand struct {
|
|
|
|
|
|
UserID string `json:"user_id" validate:"required"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// RetryOperationCommand 重试操作命令
|
|
|
|
|
|
type RetryOperationCommand struct {
|
|
|
|
|
|
CertificationID string `json:"certification_id" validate:"required"`
|
|
|
|
|
|
UserID string `json:"user_id" validate:"required"`
|
|
|
|
|
|
Operation string `json:"operation" validate:"required,oneof=enterprise_verification contract_application"`
|
|
|
|
|
|
Reason string `json:"reason,omitempty"`
|
2025-07-13 16:36:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-07-21 15:13:26 +08:00
|
|
|
|
// EsignCallbackCommand e签宝回调命令
|
|
|
|
|
|
type EsignCallbackCommand struct {
|
2025-07-28 01:46:39 +08:00
|
|
|
|
Data *EsignCallbackData `json:"data"`
|
|
|
|
|
|
Headers map[string]string `json:"headers"`
|
|
|
|
|
|
QueryParams map[string]string `json:"query_params"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// EsignCallbackData e签宝回调数据结构
|
|
|
|
|
|
type EsignCallbackData struct {
|
|
|
|
|
|
Action string `json:"action"`
|
|
|
|
|
|
Timestamp int64 `json:"timestamp"`
|
|
|
|
|
|
AuthFlowId string `json:"authFlowId,omitempty"`
|
|
|
|
|
|
SignFlowId string `json:"signFlowId,omitempty"`
|
|
|
|
|
|
CustomBizNum string `json:"customBizNum,omitempty"`
|
|
|
|
|
|
SignOrder int `json:"signOrder,omitempty"`
|
|
|
|
|
|
OperateTime int64 `json:"operateTime,omitempty"`
|
|
|
|
|
|
SignResult int `json:"signResult,omitempty"`
|
|
|
|
|
|
ResultDescription string `json:"resultDescription,omitempty"`
|
|
|
|
|
|
AuthType string `json:"authType,omitempty"`
|
|
|
|
|
|
SignFlowStatus string `json:"signFlowStatus,omitempty"`
|
|
|
|
|
|
Operator *EsignOperator `json:"operator,omitempty"`
|
|
|
|
|
|
PsnInfo *EsignPsnInfo `json:"psnInfo,omitempty"`
|
|
|
|
|
|
Organization *EsignOrganization `json:"organization,omitempty"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// EsignOperator 签署人信息
|
|
|
|
|
|
type EsignOperator struct {
|
|
|
|
|
|
PsnId string `json:"psnId"`
|
|
|
|
|
|
PsnAccount *EsignPsnAccount `json:"psnAccount"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// EsignPsnInfo 个人认证信息
|
|
|
|
|
|
type EsignPsnInfo struct {
|
|
|
|
|
|
PsnId string `json:"psnId"`
|
|
|
|
|
|
PsnAccount *EsignPsnAccount `json:"psnAccount"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// EsignPsnAccount 个人账户信息
|
|
|
|
|
|
type EsignPsnAccount struct {
|
|
|
|
|
|
AccountMobile string `json:"accountMobile"`
|
|
|
|
|
|
AccountEmail string `json:"accountEmail"`
|
2025-07-21 15:13:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-07-28 01:46:39 +08:00
|
|
|
|
// EsignOrganization 企业信息
|
|
|
|
|
|
type EsignOrganization struct {
|
|
|
|
|
|
OrgName string `json:"orgName"`
|
|
|
|
|
|
// 可以根据需要添加更多企业信息字段
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-21 15:13:26 +08:00
|
|
|
|
// ForceTransitionStatusCommand 强制状态转换命令(管理员)
|
|
|
|
|
|
type ForceTransitionStatusCommand struct {
|
|
|
|
|
|
CertificationID string `json:"certification_id" validate:"required"`
|
|
|
|
|
|
AdminID string `json:"admin_id" validate:"required"`
|
|
|
|
|
|
TargetStatus enums.CertificationStatus `json:"target_status" validate:"required"`
|
|
|
|
|
|
Reason string `json:"reason" validate:"required"`
|
|
|
|
|
|
Force bool `json:"force,omitempty"` // 是否强制执行,跳过业务规则验证
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// SubmitEnterpriseInfoCommand 提交企业信息命令
|
|
|
|
|
|
type SubmitEnterpriseInfoCommand struct {
|
2025-07-28 01:46:39 +08:00
|
|
|
|
UserID string `json:"-" comment:"用户唯一标识,从JWT token获取,不在JSON中暴露"`
|
|
|
|
|
|
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"`
|
|
|
|
|
|
EnterpriseAddress string `json:"enterprise_address" binding:"required,enterprise_address" comment:"企业地址,如:北京市海淀区"`
|
|
|
|
|
|
VerificationCode string `json:"verification_code" binding:"required,len=6" comment:"验证码"`
|
2025-07-13 16:36:20 +08:00
|
|
|
|
}
|