Unify error handling and HTTP statuses
Signed-off-by: Sean Du <do4suki@gmail.com>
This commit is contained in:
@@ -2,6 +2,7 @@ package reward
|
||||
|
||||
import (
|
||||
rewardapischema "honoka-chan/internal/schema/api/reward"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -12,7 +13,7 @@ func rewardHistory() (res any, err error) {
|
||||
Limit: 20,
|
||||
History: []any{},
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package reward
|
||||
|
||||
import (
|
||||
rewardapischema "honoka-chan/internal/schema/api/reward"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -13,7 +14,7 @@ func rewardList() (res any, err error) {
|
||||
Order: 0,
|
||||
Items: []any{},
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user