完成 Token 点卡功能

This commit is contained in:
RockYang
2023-03-28 10:17:36 +08:00
parent 5f702d92dc
commit d85e91a8da
7 changed files with 59 additions and 62 deletions

View File

@@ -28,19 +28,13 @@ func (db *LevelDB) Put(key string, value interface{}) error {
return db.driver.Put([]byte(key), bytes, nil)
}
func (db *LevelDB) Get(key string) (interface{}, error) {
func (db *LevelDB) Get(key string) ([]byte, error) {
bytes, err := db.driver.Get([]byte(key), nil)
if err != nil {
return nil, err
}
var value interface{}
err = json.Unmarshal(bytes, &value)
if err != nil {
return nil, err
}
return value, nil
return bytes, nil
}
func (db *LevelDB) Search(prefix string) []string {