提交 7a0ace4c 编写于 作者: 李光春

修复代码

上级 4719f211
## v1.0.13 / 2021-06-04
## v1.0.14 / 2021-06-04
- 优化
- 增加go.mod
- 修复代码
## v1.0.11 / 2021-05-31
......
......@@ -3,7 +3,7 @@ package http
import (
"encoding/json"
"github.com/bitly/go-simplejson"
"github.com/dtapps/GoLibrary/helper/request"
"github.com/dtapps/go-library/helper/request"
"gopkg.in/h2non/gentleman.v2"
"gopkg.in/h2non/gentleman.v2/plugins/body"
)
......
package string
import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
)
func HmacSha256Hex(key, strToSign string) string {
hasher := hmac.New(sha256.New, []byte(key))
hasher.Write([]byte(strToSign))
return hex.EncodeToString(hasher.Sum(nil))
}
......@@ -2,6 +2,15 @@ package time
import "time"
const (
RFC822Format = "Mon, 02 Jan 2006 15:04:05 MST"
ISO8601Format = "2006-01-02T15:04:05Z"
)
func NowUTCSeconds() int64 { return time.Now().UTC().Unix() }
func NowUTCNanoSeconds() int64 { return time.Now().UTC().UnixNano() }
// GetCurrentDate 获取当前的时间 - 字符串
func GetCurrentDate() string {
return time.Now().Format("2006/01/02 15:04:05")
......@@ -26,3 +35,8 @@ func GetCurrentNanoUnix() int64 {
func GetCurrentWjDate() string {
return time.Now().Format("20060102")
}
func FormatISO8601Date(timestamp_second int64) string {
tm := time.Unix(timestamp_second, 0).UTC()
return tm.Format(ISO8601Format)
}
......@@ -8,7 +8,7 @@ import (
"errors"
"fmt"
"github.com/bitly/go-simplejson"
"github.com/dtapps/GoLibrary/service"
"github.com/dtapps/go-library/service"
"github.com/nilorg/sdk/convert"
"io"
"io/ioutil"
......
......@@ -8,7 +8,7 @@ import (
"errors"
"fmt"
"github.com/bitly/go-simplejson"
"github.com/dtapps/GoLibrary/service"
"github.com/dtapps/go-library/service"
"github.com/nilorg/sdk/convert"
"io"
"io/ioutil"
......
......@@ -8,7 +8,7 @@ import (
"errors"
"fmt"
"github.com/bitly/go-simplejson"
"github.com/dtapps/GoLibrary/service"
"github.com/dtapps/go-library/service"
"github.com/nilorg/sdk/convert"
"io"
"io/ioutil"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册