提供批量更新服务配置API(阶段性提交)

This commit is contained in:
刘祥超
2023-04-06 20:49:22 +08:00
parent 648fc2cac3
commit 199349084e
16 changed files with 680 additions and 8 deletions

View File

@@ -732,6 +732,32 @@ func (this *HTTPWebDAO) UpdateWebStat(tx *dbs.Tx, webId int64, statJSON []byte)
return this.NotifyUpdate(tx, webId)
}
// CopyWebStats 拷贝统计配置
func (this *HTTPWebDAO) CopyWebStats(tx *dbs.Tx, fromWebId int64, toWebIds []int64) error {
if fromWebId <= 0 || len(toWebIds) == 0 {
return nil
}
statJSON, err := this.Query(tx).
Pk(fromWebId).
Result("stat").
FindJSONCol()
if err != nil {
return err
}
// 暂时不处理
if len(statJSON) == 0 {
return nil
}
return this.Query(tx).
Pk(toWebIds).
Reuse(false).
Set("stat", statJSON).
UpdateQuickly()
}
// UpdateWebCache 更改缓存配置
func (this *HTTPWebDAO) UpdateWebCache(tx *dbs.Tx, webId int64, cacheJSON []byte) error {
if webId <= 0 {