mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 05:00:25 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			29 lines
		
	
	
		
			665 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			665 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package db
 | 
						|
 | 
						|
import (
 | 
						|
	"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
 | 
						|
	"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
 | 
						|
	"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
 | 
						|
)
 | 
						|
 | 
						|
type TruncateTableAction struct {
 | 
						|
	actionutils.ParentAction
 | 
						|
}
 | 
						|
 | 
						|
func (this *TruncateTableAction) RunPost(params struct {
 | 
						|
	NodeId int64
 | 
						|
	Table  string
 | 
						|
}) {
 | 
						|
	defer this.CreateLogInfo(codes.DBNode_LogTruncateTable, params.NodeId, params.Table)
 | 
						|
 | 
						|
	_, err := this.RPC().DBNodeRPC().TruncateDBNodeTable(this.AdminContext(), &pb.TruncateDBNodeTableRequest{
 | 
						|
		DbNodeId:    params.NodeId,
 | 
						|
		DbNodeTable: params.Table,
 | 
						|
	})
 | 
						|
	if err != nil {
 | 
						|
		this.ErrorPage(err)
 | 
						|
		return
 | 
						|
	}
 | 
						|
	this.Success()
 | 
						|
}
 |