Ai
15 Star 47 Fork 8

zhangchenghui/wxpay

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
params.go 577 Bytes
一键复制 编辑 原始数据 按行查看 历史
zhangchenghui 提交于 2018-08-06 20:37 +08:00 . no message
package wxpay
import "strconv"
type Params map[string]string
// map本来已经是引用类型了,所以不需要 *Params
func (p Params) SetString(k, s string) Params {
p[k] = s
return p
}
func (p Params) GetString(k string) string {
s, _ := p[k]
return s
}
func (p Params) SetInt64(k string, i int64) Params {
p[k] = strconv.FormatInt(i, 10)
return p
}
func (p Params) GetInt64(k string) int64 {
i, _ := strconv.ParseInt(p.GetString(k), 10, 64)
return i
}
// 判断key是否存在
func (p Params) ContainsKey(key string) bool {
_, ok := p[key]
return ok
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/objcoding/wxpay.git
git@gitee.com:objcoding/wxpay.git
objcoding
wxpay
wxpay
master

搜索帮助