Documentation
¶
Index ¶
- Constants
- Variables
- func AppendSignDataString(method string, accept string, contentMD5 string, contentType string, ...) string
- func CountFileMd5(filePath string) (string, int64)
- func DoSignatureBase64(message string, secret string) string
- func DohashMd5(body string) (md5Str string)
- func F10进制转62进制(num int) string
- func F62转int64(str string) int64
- func F62进制转10进制(num string) int
- func Fint64进制转62进制(num int64) string
- func F上传合同(filepath string)
- func F两个时间切割并转换成时间戳(str string) (start, end int64)
- func F创建图片验证码() (id, b64s, answer string, err error)
- func F初始化信息加密(args ...string)
- func F判断时间戳是否在多少天内(ti int64, day int) bool
- func F判断是否为脱敏手机号(str string) (b bool)
- func F判断目录是否存在不存在则创建(dirPath string) (err error)
- func F判断身份证号是否异常(sfz string) bool
- func F单独压缩一个文件(pat string)
- func F发送请求(apiUrl string, data string, method string, headers map[string]string) (by []byte, err error)
- func F图片地址转base64(path string) (baseImg string, err error)
- func F字符串转int8(str string) int8
- func F年月日转时间戳(s string) int64
- func F开始到结束每天时间戳(s, e int64) []string
- func F打包目录(src_dir string, zip_file_name string)
- func F拼接参数(inter ...interface{}) (key string)
- func F接口转数字(i interface{}) int64
- func F数据脱敏(str string) (result string)
- func F新打包目录(src_dir string, pathname string, 是否铺平 ...int)
- func F时间戳格式化(i int64, s ...string) (ss string)
- func F时间戳转年月日(ti ...int64) string
- func F时间戳转年月日时分秒(ti ...int64) string
- func F时间戳转时间(i int64) string
- func F时间按格式转成时间戳(str ...string) int64
- func F生日转年龄(birthday string) (age int)
- func F获取七牛云etag(r io.Reader, fsize int64) (etag string, err error)
- func F获取三天后的几个月后日期(num int) (i int64)
- func F获取以多少天为单位间隔日期(day int, num int) (itm []int64)
- func F获取几个月后的当天(num, 延后时间 int) (i int64)
- func F获取几天前日期时间戳(i int) int64
- func F获取前端文件etag(file *multipart.FileHeader) (etag string, err error)
- func F获取多少天前到今天24点的时间戳(i int64) (start, end int64)
- func F获取多少天前到多少天后的时间戳(i, e int64) (start, end int64)
- func F获取多少月前当天0点时间戳(m, d int) int64
- func F获取多少月前当天23点时间戳(m, d int) int64
- func F获取当天24小时时间戳() (start, end int64)
- func F获取指定月后会员时间(ti int64, nmon int) (rti int64)
- func F获取文件路径的etag(path string) (etag string, err error)
- func F获取时间(i ...int) int64
- func F获取时间戳后的几个月时间(timestmap int64, num int) int64
- func F获取时间戳字符串() string
- func F获取是第几个月(ti int64) (i int8)
- func F获取每个月当天时间(num int) (times []time.Time)
- func F获取每个月的当天时间(num int) (nums []int64)
- func F获取随机字符串(length int) string
- func F随机一个小数(args ...float64) float64
- func F随机一个数字(args ...int) int
- func F随机字符串(l int) string
- func F随机生成验证码(width int) string
- func F验证验证码(id string, capt string) bool
- func GetMonth(i int) int64
- func GetTimeStampString() string
- func IntToString(n int) string
- func InterToStr(i interface{}) string
- func IsDir(path string) bool
- func StrToInt(s string) int
- func StrToInt64(s string) int64
- func StrToUint(s string) uint
- func StrToUint64(s string) int64
- func Substr2(str string, start int, end int) string
- func UintToString(n uint) string
- func UrlEncode(str string) string
- type AlipayApp
- type BaiduCard
- type BaiduToken
- type Base天地图
- type CMsg
- type CardQuality
- type Copier
- type CreateOrganizationsByThirdPartyUserIdInfo
- type DdAt
- type DdMsg
- type DdText
- type Doc
- type Esign
- func (e *Esign) F创建个人账号(idc, name, phone, email string) (inte *S创建个人信息返回, err error)
- func (e *Esign) F创建企业认证(orgName, orgIDCardNum string) (err error)
- func (e *Esign) F文件上传地址获取(文件地址, filename string) (inte *S文件上传返回, err error)
- func (e *Esign) F查询企业认证(orgName, orgIDCardNum string) (err error)
- func (e *Esign) F查询签署情况(flowid string) (resp *S查询签署返回, err error)
- func (e *Esign) F获取头部参数(contentMD5 string, reqSignature string) (header map[string]string)
- func (e *Esign) F获取文件位置(fileid string, keyword []string) (resp *S查找关键词返回, err error)
- func (e *Esign) F获取签署链接(signFlowId, psnacc string) (inte *S签署链接返回, err error)
- func (e *Esign) F通过文件发起签署(fileid, phone, name, idcard string) (inte *S签署信息返回, err error)
- func (e *Esign) SendCommHttp(apiUrl string, dataJsonStr interface{}, method string, inter interface{}) (by []byte, err error)
- type EsignAttachment
- type EsignNotify
- type FBaidu
- type GetFileUploadUrlInfo
- type Location
- type Logger
- type NormalSignFieldConfig
- type OrgInfo
- type OrgSignerInfo
- type PosBean
- type PsnInfo
- type PsnSignerInfo
- type RedirectConfig
- type ReqMsg
- type SignConfig
- type SignDateBean
- type SignFieldPosition
- type SignFlowConfig
- type SignerAccount
- type Signers
- type Signfield
- type Snow
- type S关键词信息
- type S关键词坐标
- type S关键词页面信息
- type S创建个人信息
- type S创建个人信息返回
- type S发起签署
- type S地理编码查询
- type S地理编码查询结果
- type S天地图
- type S定位详细信息
- type S定时任务
- type S布尔
- func (a *S布尔) F个人认证(id, name, phone string) (by []byte, err error)
- func (a *S布尔) F企业认证(id, name, phone string) (by []byte, err error)
- func (a *S布尔) F发送请求(bm ltool.BodyMap, url string) (bs []byte, err error)
- func (a *S布尔) F查询星耀报告(id, name, phone, 完整路径 string) (by []byte, err error)
- func (a *S布尔) F获取biz数据(bm ltool.BodyMap) (biz string)
- type S快递100
- type S手机信息
- type S文件上传
- type S文件上传结果
- type S文件上传返回
- type S易签宝基础
- type S查找关键词
- type S查找关键词返回
- type S查询签署
- type S查询签署返回
- type S签署信息
- type S签署信息返回
- type S签署链接
- type S签署链接返回
- type S身份证信息
- type S逆地理编码查询
- type S逆地理编码查询结果
- type S钉钉通知类型
- type S钉钉链接
- type UserCard
- type V支付结构
- type WordsResult
Constants ¶
View Source
const ( BLOCK_BITS = 22 // Indicate that the blocksize is 4M BLOCK_SIZE = 1 << BLOCK_BITS )
View Source
const ( V请求域名_沙箱 = "http://sit-shouwei.shouxin168.com/sandbox" //测试 V请求域名_正式 = "https://shouwei.shouxin168.com/api" //正式 V天狼星报告星耀版 = "/lightning/product/query" V统一接口地址 = "/lightning/product/query" V合同上传地址 = "/contract/file/upload" )
View Source
const ( Host = "https://openapi.esign.cn" TestHost = "https://smlopenapi.esign.cn" V合同上传接口 = "/v3/files/file-upload-url" V发起签署 = "/v3/sign-flow/create-by-file" V签署流程_结束 = "SIGN_FLOW_COMPLETE" )
View Source
const ( V身份证签发日期 = "签发日期" V身份证失效日期 = "失效日期" V身份证签发机关 = "签发机关" V身份证姓名 = "姓名" V身份证民族 = "民族" V身份证住址 = "住址" V身份证身份号 = "公民身份号码" V身份证生日 = "出生" V身份证性别 = "性别" )
View Source
const (
TimeDifference = 28800 //相差8小时的这个秒数
)
View Source
const (
V默认密钥 = "V默认密钥"
)
Variables ¶
View Source
var S加解密 encrypt.S加解密接口
Functions ¶
func AppendSignDataString ¶
func AppendSignDataString(method string, accept string, contentMD5 string, contentType string, date string, headers string, url string) string
拼接请求参数
func CountFileMd5 ¶
func Fint64进制转62进制 ¶
func F两个时间切割并转换成时间戳 ¶
func F判断时间戳是否在多少天内 ¶
func F判断是否为脱敏手机号 ¶
func F判断目录是否存在不存在则创建 ¶
func F判断身份证号是否异常 ¶
func F图片地址转base64 ¶
func F开始到结束每天时间戳 ¶
func F时间戳转年月日时分秒 ¶
func F时间按格式转成时间戳 ¶
func F获取三天后的几个月后日期 ¶
func F获取以多少天为单位间隔日期 ¶
func F获取几个月后的当天 ¶
1-12,所以添加的日期需要-1,如果日期为31,那么判断是否为1,3,5,7,8,10,12,否则就是30(2,4,6,9,11)
func F获取前端文件etag ¶
func F获取前端文件etag(file *multipart.FileHeader) (etag string, err error)
func F获取多少天前到今天24点的时间戳 ¶
func F获取多少天前到多少天后的时间戳 ¶
func F获取多少月前当天0点时间戳 ¶
func F获取多少月前当天23点时间戳 ¶
func F获取当天24小时时间戳 ¶
func F获取当天24小时时间戳() (start, end int64)
func F获取指定月后会员时间 ¶
func F获取文件路径的etag ¶
func F获取时间戳后的几个月时间 ¶
func F获取每个月当天时间 ¶
func F获取每个月的当天时间 ¶
func IntToString ¶
func InterToStr ¶
func InterToStr(i interface{}) string
func StrToInt64 ¶
func StrToUint64 ¶
Types ¶
type AlipayApp ¶
type AlipayApp struct { Id int64 `gorm:"primarykey" json:"id" form:"id"` CreatedAt int64 `gorm:"autoCreateTime" json:"created_at" form:"created_at"` Aid int64 `gorm:"size:32;comment:归属id" json:"aid" form:"aid"` //归属id Name string `gorm:"type:varchar(25);comment:支付渠道名" json:"name,omitempty"` //支付宝应用私钥 Zappid string `gorm:"type:varchar(25);comment:子商户号,mid" json:"zappid,omitempty"` //支付宝应用私钥,,银商是mid Appid string `gorm:"index;type:varchar(18);comment:appid,tid" json:"appid,omitempty"` //银盛是商户id,银商是tid AliPrivateKey string `gorm:"type:varchar(2000);comment:支付宝应用私钥,key" json:"ali_private_key,omitempty"` //支付宝应用私钥 AliPubKey string `gorm:"type:varchar(500);comment:支付宝应用公钥,额度" json:"ali_pub_key,omitempty"` //支付宝应用私钥,基本固定长度392 AliContentKey string `gorm:"type:varchar(25);comment:支付宝应用私钥,前缀" json:"ali_content_key,omitempty"` //支付宝应用私钥 Pwd string `gorm:"type:varchar(25);comment:证书密码,第几轮" json:"pwd,omitempty"` //支付宝应用私钥 Pfx string `gorm:"type:varchar(56);comment:pfx证书" json:"pfx,omitempty"` //银盛的pfx证书 AliRas2 string `gorm:"type:varchar(56);comment:应用公钥证书alipayCertPublicKey_RSA2,appid" json:"ali_ras2,omitempty"` //应用公钥证书alipayCertPublicKey_RSA2 AliPublicCer string `gorm:"type:varchar(56);comment:支付宝公钥证书PublicKey_202100" json:"ali_public_cer,omitempty"` //支付宝公钥证书PublicKey_202100 AliRootCer string `gorm:"type:varchar(56);comment:支付宝根证书!文件名一般为alipayRootCert" json:"ali_root_cer,omitempty"` //支付宝根证书!文件名一般为alipayRootCert.crt Istest int8 `gorm:"comment:'istest';" json:"istest" form:"istest"` //是否为测试模式,如果为测试,只给0.1元 //AliPayeeUserId string `gorm:"type:varchar(32);comment:'收款账户的支付宝用户号。'" json:"ali_payee_user_id,omitempty"` //收款账户的支付宝用户号。 AliPublicCerValue []byte `gorm:"-" json:"-"` //支付宝应用私钥文件里的内容 AliRas2Value []byte `gorm:"-" json:"-"` //应用公钥证书alipayCertPublicKey_RSA2文件里的内容 AliRootCerValue []byte `gorm:"-" json:"-"` //应用公钥证书alipayCertPublicKey_RSA2文件里的内容 Domain string `gorm:"-" json:"domain,omitempty"` Ali *alipay.Client `gorm:"-" json:"-"` }
type BaiduCard ¶
type BaiduCard struct { ImageStatus string ` json:"image_status" form:"image_status"` //图片状态 ErrorCode int ` json:"error_code" form:"error_code"` //图片状态 RiskType string ` json:"risk_type" form:"risk_type"` //风险类型 EditTool string ` json:"edit_tool" form:"edit_tool"` //用啥软件编辑过图片 WordsResult map[string]WordsResult ` json:"words_result" form:"words_result"` //风险类型 CardQuality CardQuality ` json:"card_quality" form:"card_quality"` //风险类型 }
type BaiduToken ¶
type CMsg ¶
type CMsg struct { Msgtype S钉钉通知类型 `gorm:"-" json:"msgtype" form:"msgtype"` Token string `gorm:"-" json:"token" form:"token"` //Token string `gorm:"-" json:"token,omitempty" form:"token"` Text DdText `gorm:"-" json:"text" form:"text"` DdAt DdAt `gorm:"-" json:"at" form:"at"` }
发送的结构体
type CardQuality ¶
type CardQuality struct { IsClear_propobility float64 ` json:"IsClear_propobility" form:"IsClear_propobility"` IsClear float64 ` json:"IsClear" form:"IsClear"` //是否清晰 IsNoCover_propobility float64 ` json:"IsNoCover_propobility" form:"IsNoCover_propobility"` IsNoCover float64 ` json:"IsNoCover" form:"IsNoCover"` //是否边框/四角完整 IsComplete_propobility float64 ` json:"IsComplete_propobility" form:"IsComplete_propobility"` IsComplete float64 ` json:"IsComplete" form:"IsComplete"` //是否头像、关键字段无遮挡/马赛克 }
type CreateOrganizationsByThirdPartyUserIdInfo ¶
type CreateOrganizationsByThirdPartyUserIdInfo struct { ThirdPartyUserId string `json:"thirdPartyUserId,omitempty"` Creator string `json:"creator,omitempty"` Name string `json:"name,omitempty"` IdType string `json:"idType,omitempty"` IdNumber string `json:"idNumber,omitempty"` OrgLegalIdNumber string `json:"orgLegalIdNumber,omitempty"` OrgLegalName string `json:"orgLegalName,omitempty"` }
创建企业账号json信息配置
type DdMsg ¶
type DdMsg struct { Id int64 `gorm:"primarykey" json:"id" form:"id"` Msgtype string `gorm:"type:varchar(16);comment:'消息类型'" json:"msgtype" form:"msgtype"` Body string `gorm:"type:varchar(1280);comment:'消息的内容'" json:"body" form:"body"` AtMobiles string `gorm:"type:varchar(256);comment:'通知的人'" json:"atMobiles" form:"atMobiles"` IsAtAll int8 `gorm:"comment:'是否通知全部'" json:"isAtAll" form:"isAtAll"` }
type Esign ¶
type Esign struct { ProjectId string //易签宝id ProjectScert string //易签宝密钥 CompanyName string `gorm:"type:varchar(24);comment:'e签宝应用公司名'" json:"company_name,omitempty"` CompanyNum string `gorm:"type:varchar(24);comment:'e签宝应用公司号'" json:"company_num,omitempty"` NotifyUrl string RedirectUrl string Orgid string `gorm:"type:varchar(46);comment:'e签宝生成的公司id'" json:"orgid,omitempty"` Istest bool }
type EsignAttachment ¶
type EsignAttachment struct { FileId string `json:"fileId,omitempty"` AttachmentName string `json:"attachmentName,omitempty"` }
e签宝的附件?
type EsignNotify ¶
type EsignNotify struct { Action string `json:"action" form:"action"` FlowId string `json:"flowId" form:"flowId"` SignFlowId string `json:"signFlowId" form:"signFlowId"` SignTime string `json:"signTime" form:"signTime"` SignOrder int32 `json:"signOrder,omitempty"` Order int `json:"order" form:"order"` Timestamp int64 `json:"timestamp" form:"timestamp"` SignResult int `json:"signResult" form:"signResult"` ThirdOrderNo string `json:"thirdOrderNo" form:"thirdOrderNo"` ResultDescription string `json:"resultDescription" form:"resultDescription"` ThirdPartyUserId string `json:"thirdPartyUserId" form:"thirdPartyUserId"` }
type FBaidu ¶
func (*FBaidu) F获取缓存token ¶
type GetFileUploadUrlInfo ¶
type GetFileUploadUrlInfo struct { ContentMd5 string `json:"contentMd5,omitempty"` ContentType string `json:"contentType,omitempty"` Convert2Pdf bool `json:"convert2Pdf,omitempty"` FileName string `json:"fileName,omitempty"` FileSize int64 `json:"fileSize,omitempty"` }
获取文件上传地址json信息配置
type NormalSignFieldConfig ¶
type NormalSignFieldConfig struct { FreeMode bool `json:"freeMode,omitempty"` AutoSign bool `json:"autoSign,omitempty"` SignFieldStyle int32 `json:"signFieldStyle,omitempty"` AssignedSealId string `json:"assignedSealId,omitempty"` SignFieldPosition SignFieldPosition `json:"signFieldPosition,omitempty"` }
type OrgSignerInfo ¶
type PsnSignerInfo ¶
type RedirectConfig ¶
type RedirectConfig struct { RedirectUrl string `json:"redirectUrl,omitempty"` RedirectDelayTime int64 `json:"redirectDelayTime,omitempty"` }
创建个人账号json信息配置
type SignConfig ¶
type SignConfig struct {
SignOrder int32 `json:"signOrder,omitempty"`
}
type SignDateBean ¶
type SignFieldPosition ¶
type SignFlowConfig ¶
type SignFlowConfig struct { SignFlowTitle string `json:"signFlowTitle,omitempty"` //签署流程主题 SignFlowExpireTime int64 `json:"signFlowExpireTime,omitempty"` //签署截止时间,默认在签署流程创建后的90天时截止 AutoStart bool `json:"autoStart,omitempty"` //自动开启签署流程,默认值 true AutoFinish bool `json:"autoFinish,omitempty"` //所有签署方签署完成后流程自动完结,默认值 false IdentityVerify bool `json:"identityVerify,omitempty"` //身份校验配置项(当开发者指定的签署人信息与该签署人在e签宝已有的身份信息不一致时如何处理) NotifyUrl string `json:"notifyUrl,omitempty"` //回调Url RedirectConfig RedirectConfig `json:"redirectConfig,omitempty"` //回调Url }
type SignerAccount ¶
type Signers ¶
type Signers struct { SignerType int32 `json:"signerType"` SignFields []Signfield `json:"signFields,omitempty"` PsnSignerInfo *PsnSignerInfo `json:"psnSignerInfo,omitempty"` //个人签署方信息 OrgSignerInfo *OrgSignerInfo `json:"orgSignerInfo,omitempty"` //机构签署方信息 SignConfig *SignConfig `json:"signConfig,omitempty"` //机构签署方信息 }
type Signfield ¶
type Signfield struct { FileId string `json:"fileId,omitempty"` SignFieldType int32 `json:"signFieldType,omitempty"` NormalSignFieldConfig NormalSignFieldConfig `json:"normalSignFieldConfig,omitempty"` }
type S发起签署 ¶
type S发起签署 struct { Docs []*Doc `json:"docs,omitempty"` SignFlowConfig *SignFlowConfig `json:"signFlowConfig,omitempty"` Signers []*Signers `json:"signers,omitempty"` }
type S定位详细信息 ¶
type S定位详细信息 struct { Address string `json:"address,omitempty"` City string `json:"city,omitempty"` Town string `json:"town,omitempty"` TownCode string `json:"town_code,omitempty"` County string `json:"county,omitempty"` CountyCode string `json:"county_code,omitempty"` ProvinceCode string `json:"province_code,omitempty"` Nation string `json:"nation,omitempty"` Road string `json:"road,omitempty"` PoiPosition string `json:"poi_position,omitempty"` AddressPosition string `json:"address_position,omitempty"` RoadDistance int `json:"road_distance,omitempty"` Poi string `json:"poi,omitempty"` PoiDistance int `json:"poi_distance,omitempty"` AddressDistance int `json:"address_distance,omitempty"` }
type S定时任务 ¶
type S定时任务 struct {
C *cron.Cron
}
func (*S定时任务) F添加任务 ¶
func aa() { // 新建一个定时任务对象,根据cron表达式进行时间调度,cron可以精确到秒,大部分表达式格式也是从秒开始 // 默认从分开始进行时间调度 // cronTab := cron.New() // 精确到秒 cronTab := cron.New(cron.WithSeconds()) // 定义定时器调用的任务函数 task := func() { fmt.Println("hello world", time.Now()) } // 定时任务,cron表达式,每五秒一次 spec := `* /5 * * * * ?` // 添加定时任务 cronTab.AddFunc(spec, task) // 启动定时器 cronTab.Start() // 阻塞主线程停止 select {} }
type S布尔 ¶
type S布尔 struct { PrivateKey *rsa.PrivateKey Iid string //id AES_KEY string //加密解密的 Notifiy string //密钥 Mode string //密钥 V沙箱 bool Desc encrypt.S加解密接口 }
var (
V布尔链接 *S布尔
)
type S快递100 ¶
type S手机信息 ¶
type S逆地理编码查询结果 ¶
type UserCard ¶
type UserCard struct { Name string `gorm:"type:varchar(8);comment:'真实姓名'" json:"name" form:"name"` FacadeUrl string `gorm:"type:varchar(128);comment:'身份证正面地址'" json:"facade_url,omitempty" form:"facade_url"` BackUrl string `gorm:"type:varchar(128);comment:'身份证反面地址'" json:"back_url,omitempty" form:"back_url"` Cardid string `gorm:"type:char(18);comment:'身份证号';index" json:"cardid" form:"cardid"` //身份证号 Md5cardid string `gorm:"-" json:"-" form:"-"` //身份证号 Address string `gorm:"type:varchar(26);comment:'住址'" json:"address" form:"address"` //住址 Birthday string `gorm:"type:char(8);comment:'出生'" json:"birthday" form:"birthday"` //生日 Sex string `gorm:"type:char(1);comment:'性别'" json:"sex" form:"sex"` //性别 Nation string `gorm:"type:varchar(5);comment:'民族'" json:"nation" form:"nation"` //民族 Issue string `gorm:"type:char(8);comment:'签发日期'" json:"issue" form:"issue"` //签发日期 Invalid string `gorm:"type:char(8);comment:'失效日期'" json:"invalid" form:"invalid"` //失效日期 Section string `gorm:"type:varchar(16);comment:'签发机关'" json:"section" form:"section"` //签发机关 Age uint8 `gorm:"comment:'年龄'" json:"age" form:"age"` //失效日期 Surface string `gorm:"-" json:"-" form:"-"` //是正面还是反面 }
type WordsResult ¶
Click to show internal directories.
Click to hide internal directories.