实现HTTP部分功能

This commit is contained in:
GoEdgeLab
2020-09-26 08:06:40 +08:00
parent 7581cf9f75
commit 16bbe7d380
45 changed files with 1117 additions and 456 deletions

View File

@@ -26,6 +26,20 @@ func NewHTTPCachePolicyDAO() *HTTPCachePolicyDAO {
var SharedHTTPCachePolicyDAO = NewHTTPCachePolicyDAO()
// 初始化
func (this *HTTPCachePolicyDAO) Init() {
this.DAOObject.Init()
this.DAOObject.OnUpdate(func() error {
return SharedSysEventDAO.CreateEvent(NewServerChangeEvent())
})
this.DAOObject.OnInsert(func() error {
return SharedSysEventDAO.CreateEvent(NewServerChangeEvent())
})
this.DAOObject.OnDelete(func() error {
return SharedSysEventDAO.CreateEvent(NewServerChangeEvent())
})
}
// 启用条目
func (this *HTTPCachePolicyDAO) EnableHTTPCachePolicy(id int64) error {
_, err := this.Query().