mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-03 23:20:25 +08:00
增加IP动作
This commit is contained in:
25
internal/iplibrary/action_base.go
Normal file
25
internal/iplibrary/action_base.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package iplibrary
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
)
|
||||
|
||||
type BaseAction struct {
|
||||
}
|
||||
|
||||
func (this *BaseAction) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (this *BaseAction) convertParams(params maps.Map, ptr interface{}) error {
|
||||
data, err := json.Marshal(params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = json.Unmarshal(data, ptr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user