mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-10 01:10:29 +08:00
数据库某些表可以手工清理
This commit is contained in:
@@ -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()
|
||||
}
|
||||
Reference in New Issue
Block a user