[SSL证书]实现对ACME任务的增删改查

This commit is contained in:
刘祥超
2020-11-25 21:19:22 +08:00
parent 6e6083d6af
commit 4142fae762
22 changed files with 862 additions and 180 deletions

View File

@@ -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
}