简化代码/增加HTTPPage服务

This commit is contained in:
刘祥超
2020-09-17 10:16:00 +08:00
parent 58bce36fb3
commit c1327e8ca8
22 changed files with 453 additions and 75 deletions

View File

@@ -0,0 +1,14 @@
package models
// 处理JSON字节Slice
func JSONBytes(data []byte) []byte {
if len(data) == 0 {
return []byte("null")
}
return data
}
// 判断JSON是否为空
func IsNotNull(data string) bool {
return len(data) > 0 && data != "null"
}