mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-22 14:30:25 +08:00
优化代码
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
var SharedCacheLocker = sync.RWMutex{}
|
||||
|
||||
// 处理JSON字节Slice
|
||||
// JSONBytes 处理JSON字节Slice
|
||||
func JSONBytes(data []byte) []byte {
|
||||
if len(data) == 0 {
|
||||
return []byte("null")
|
||||
@@ -15,12 +15,12 @@ func JSONBytes(data []byte) []byte {
|
||||
return data
|
||||
}
|
||||
|
||||
// 判断JSON是否不为空
|
||||
// IsNotNull 判断JSON是否不为空
|
||||
func IsNotNull(data string) bool {
|
||||
return len(data) > 0 && data != "null"
|
||||
}
|
||||
|
||||
// 构造Query
|
||||
// NewQuery 构造Query
|
||||
func NewQuery(tx *dbs.Tx, dao dbs.DAOWrapper, adminId int64, userId int64) *dbs.Query {
|
||||
query := dao.Object().Query(tx)
|
||||
if adminId > 0 {
|
||||
|
||||
Reference in New Issue
Block a user