mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-28 02:40:25 +08:00
[SSL证书]实现对ACME任务的增删改查
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package models
|
||||
|
||||
import "github.com/iwind/TeaGo/dbs"
|
||||
|
||||
// 处理JSON字节Slice
|
||||
func JSONBytes(data []byte) []byte {
|
||||
if len(data) == 0 {
|
||||
@@ -12,3 +14,15 @@ func JSONBytes(data []byte) []byte {
|
||||
func IsNotNull(data string) bool {
|
||||
return len(data) > 0 && data != "null"
|
||||
}
|
||||
|
||||
// 构造Query
|
||||
func NewQuery(dao dbs.DAOWrapper, adminId int64, userId int64) *dbs.Query {
|
||||
query := dao.Object().Query()
|
||||
if adminId > 0 {
|
||||
query.Attr("adminId", adminId)
|
||||
}
|
||||
if userId > 0 {
|
||||
query.Attr("userId", userId)
|
||||
}
|
||||
return query
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user