@@ -1,13 +1,23 @@
|
||||
package stamp
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"honoka-chan/pkg/utils"
|
||||
stampapischema "honoka-chan/internal/schema/api/stamp"
|
||||
honokautils "honoka-chan/internal/utils"
|
||||
"time"
|
||||
)
|
||||
|
||||
func stampInfo() (res any, err error) {
|
||||
stampResp := utils.ReadAllText("assets/serverdata/stamp.json")
|
||||
err = json.Unmarshal([]byte(stampResp), &res)
|
||||
stampData, err := honokautils.LoadServerData[stampapischema.InfoData]("stamp_data.json")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
res = stampapischema.InfoResp{
|
||||
Result: stampData,
|
||||
Status: 200,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
return res, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user