数据库某些表可以手工清理

This commit is contained in:
GoEdgeLab
2021-01-19 16:14:09 +08:00
parent 14fc3d0659
commit 600caad2f8
8 changed files with 176 additions and 3 deletions

View File

@@ -0,0 +1,23 @@
package profile
import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
type TruncateTableAction struct {
actionutils.ParentAction
}
func (this *TruncateTableAction) RunPost(params struct {
Table string
}) {
defer this.CreateLogInfo("清空数据表 %s 数据", params.Table)
_, err := this.RPC().DBRPC().TruncateDBTable(this.AdminContext(), &pb.TruncateDBTableRequest{DbTable: params.Table})
if err != nil {
this.ErrorPage(err)
return
}
this.Success()
}