github.com/qiniu/go-sdk/v7@v7.27.0/sms/enums.go (about)

     1  package sms
     2  
     3  // SignatureSrcType 签名类型
     4  type SignatureSrcType string
     5  
     6  const (
     7  	// EnterprisesAndInstitutions 企事业单位的全称或简称
     8  	EnterprisesAndInstitutions SignatureSrcType = "enterprises_and_institutions"
     9  
    10  	// Website 工信部备案网站的全称或简称
    11  	Website SignatureSrcType = "website"
    12  
    13  	// APP APP应用的全称或简称
    14  	APP SignatureSrcType = "app"
    15  
    16  	// PublicNumberOrSmallProgram 公众号或小程序的全称或简称
    17  	PublicNumberOrSmallProgram SignatureSrcType = "public_number_or_small_program"
    18  
    19  	// StoreName 电商平台店铺名的全称或简称
    20  	StoreName SignatureSrcType = "store_name"
    21  
    22  	// TradeName 商标名的全称或简称
    23  	TradeName SignatureSrcType = "trade_name"
    24  )
    25  
    26  // IsValid 验证
    27  func (s SignatureSrcType) IsValid() bool {
    28  	switch s {
    29  	case EnterprisesAndInstitutions, Website, APP, PublicNumberOrSmallProgram, StoreName, TradeName:
    30  		return true
    31  	}
    32  	return false
    33  }
    34  
    35  func (s SignatureSrcType) String() string {
    36  	return string(s)
    37  }
    38  
    39  // TemplateType 模版类型
    40  type TemplateType string
    41  
    42  const (
    43  	// NotificationType 通知类短信
    44  	NotificationType TemplateType = "notification"
    45  
    46  	// VerificationType 验证码短信
    47  	VerificationType TemplateType = "verification"
    48  
    49  	// MarketingType 营销类短信
    50  	MarketingType TemplateType = "marketing"
    51  
    52  	// VoiceType 语音短信
    53  	VoiceType TemplateType = "voice"
    54  )
    55  
    56  // IsValid 是否合法Template类型
    57  func (t TemplateType) IsValid() bool {
    58  	switch t {
    59  	case NotificationType, VerificationType, MarketingType, VoiceType:
    60  		return true
    61  	}
    62  	return false
    63  }
    64  
    65  // String to string
    66  func (t TemplateType) String() string {
    67  	return string(t)
    68  }
    69  
    70  // AuditStatus 审核状态
    71  type AuditStatus string
    72  
    73  const (
    74  	// AuditStatusPassed 通过
    75  	AuditStatusPassed AuditStatus = "passed"
    76  
    77  	// AuditStatusReject 未通过
    78  	AuditStatusReject AuditStatus = "rejected"
    79  
    80  	// AuditStatusReviewing 审核中
    81  	AuditStatusReviewing AuditStatus = "reviewing"
    82  )
    83  
    84  // IsValid 验证
    85  func (a AuditStatus) IsValid() bool {
    86  	switch a {
    87  	case AuditStatusPassed, AuditStatusReject, AuditStatusReviewing:
    88  		return true
    89  	}
    90  	return false
    91  }
    92  
    93  func (a AuditStatus) String() string {
    94  	return string(a)
    95  }