# README
数据处理
注意事项
- 开发过程中,saData包不能引用go-utils任何包
sa_check
-
支持的tag标签:
"> >= < <= <>" 长度校验:字符串,校验rune长度;整形则对比数值
"required" 必要参数
"enum(1:激活,2:废弃) in(1,2) in(ms,md)" 枚举
"phone" 校验手机格式 -
tag示例: type:"phone;required;in(ms,md);<=23"
# Functions
注意:只支持基础类型数据,会排除已存在的.
No description provided by the author
No description provided by the author
AryToIds fullComma为true时: []{1,2,3} => ,1,2,3, fullComma为false时: []{1,2,3} => 1,2,3.
No description provided by the author
No description provided by the author
No description provided by the author
下划线命名转化为小驼峰命名
xx_yy to xxYy */.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Fen2Yuan 解决精度丢失问题 例如:19.9 * 100 = 1889 提供四舍五入、上下取整方式 返回的元是2位小数.
No description provided by the author
FloatToInt 解决精度丢失问题 例如:19.9 * 100 = 1889 提供四舍五入、上下取整方式 digit是小数点后位数.
FormatIds 前后加逗号是为了方便SQL查询过滤 1,2,3 => ,1,2,3,.
No description provided by the author
No description provided by the author
No description provided by the author
IdsToAry 去零、去重 1,2,3 => []{1,2,3}.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
InArray 注意:只支持基础类型数据.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
IntToFloat 解决精度丢失问题 例如:19.9 * 100 = 1889 提供四舍五入、上下取整方式 digit是小数点后位数.
根据后缀判断是否是图片.
No description provided by the author
根据后缀判断是否是视频.
No description provided by the author
JoinString 字符串拼接 通过strings.Builder,效率更高.
rune长度,支持中文.
Li2Yuan 解决精度丢失问题 例如:19.9 * 100 = 1889 提供四舍五入、上下取整方式 返回的元是3位小数.
No description provided by the author
Md5 32位 lowercase = true 小写格式,否则大写.
No description provided by the author
Qian2Yuan 解决精度丢失问题 例如:19.9 * 100 = 1889 提供四舍五入、上下取整方式 返回的元是3位小数.
* 返回13位字符串 */.
No description provided by the author
No description provided by the author
RoundYuan 格式化,解决小数点问题 提供四舍五入、上下取整方式 返回的元是2位小数.
Sha256 lowercase = true 小写格式,否则大写.
下划线命名转为大驼峰命名
XxYy to xx_yy , XxYY to xx_yy */.
Split 去空、去重 1,2,3 => []{"1","2","3"}.
SQLColumn 删除字符串里有影响SQL的字符.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
rune长度.
通过内存操作,效率极高,但是有风险。只在数据量很大、效率要求高的场景使用.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ToIds fullComma为true时: []{1,2,3} => ,1,2,3, fullComma为false时: []{1,2,3} => 1,2,3 ary支持类型:[]string []int64 []int.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ToSQLIds
[]{'1','2','3'} => '1','2','3'.
No description provided by the author
No description provided by the author
No description provided by the author
去除字符串中H5的style、script;
将标签转换为回车,去除连续回车,去除每段开始、结尾空格
*/.
去除 ' ' '\n' '\r' '\t'前缀,如果有多个也会去除.
去除 ' ' '\n' '\r' '\t' 前缀和后缀.
去除所有 ' ' '\n' '\r' '\t'.
去除 ' ' '\n' '\r' '\t'后缀,如果有多个也会去除.
验证参数.
No description provided by the author
No description provided by the author
Yuan2Fen 解决精度丢失问题 例如:19.9 * 100 = 1889 提供四舍五入、上下取整方式.
Yuan2Li 解决精度丢失问题 例如:19.9 * 100 = 1889 提供四舍五入、上下取整方式.
Yuan2Qian 解决精度丢失问题 例如:19.9 * 100 = 1889 提供四舍五入、上下取整方式.
# Constants
四舍五入.
向下取整 取2位小数 如:1.234 => 1.23 1.238 => 1.23.
向上取整 取2位小数 如:1.234 => 1.24 1.238 => 1.24.
# Variables
方便给人识别的编码.
# Structs
No description provided by the author
No description provided by the author
No description provided by the author