feat: migrate the chatgpt-plus-ext project code to this project

This commit is contained in:
RockYang
2023-09-27 18:14:07 +08:00
parent d51a724ade
commit 75c5ebbffa
30 changed files with 1675 additions and 854 deletions

View File

@@ -138,3 +138,15 @@ func IntValue(str string, defaultValue int) int {
}
return value
}
func ForceCovert(src any, dst interface{}) error {
bytes, err := json.Marshal(src)
if err != nil {
return err
}
err = json.Unmarshal(bytes, dst)
if err != nil {
return err
}
return nil
}