@@ -22,6 +22,7 @@ import (
|
||||
"honoka-chan/internal/handler/api/notice"
|
||||
"honoka-chan/internal/handler/api/payment"
|
||||
"honoka-chan/internal/handler/api/profile"
|
||||
"honoka-chan/internal/handler/api/reward"
|
||||
"honoka-chan/internal/handler/api/scenario"
|
||||
"honoka-chan/internal/handler/api/stamp"
|
||||
"honoka-chan/internal/handler/api/subscenario"
|
||||
@@ -91,6 +92,8 @@ func api(ctx *gin.Context) {
|
||||
result, err = payment.PaymentApi(ctx, v.Action)
|
||||
case "profile":
|
||||
result, err = profile.ProfileApi(ctx, v.Action, v.UserID)
|
||||
case "reward":
|
||||
result, err = reward.RewardApi(v.Action)
|
||||
case "scenario":
|
||||
result, err = scenario.ScenarioApi(ctx, v.Action)
|
||||
case "stamp":
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package reward
|
||||
|
||||
import (
|
||||
rewardapischema "honoka-chan/internal/schema/api/reward"
|
||||
"time"
|
||||
)
|
||||
|
||||
func rewardHistory() (res any, err error) {
|
||||
res = rewardapischema.HistoryResp{
|
||||
Result: rewardapischema.HistoryData{
|
||||
ItemCount: 0,
|
||||
Limit: 20,
|
||||
History: []any{},
|
||||
},
|
||||
Status: 200,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
return res, err
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package reward
|
||||
|
||||
import (
|
||||
rewardapischema "honoka-chan/internal/schema/api/reward"
|
||||
"time"
|
||||
)
|
||||
|
||||
func rewardList() (res any, err error) {
|
||||
res = rewardapischema.ListResp{
|
||||
Result: rewardapischema.ListData{
|
||||
ItemCount: 0,
|
||||
Limit: 20,
|
||||
Order: 0,
|
||||
Items: []any{},
|
||||
},
|
||||
Status: 200,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
return res, err
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package reward
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func RewardApi(action string) (res any, err error) {
|
||||
switch action {
|
||||
case "rewardList":
|
||||
res, err = rewardList()
|
||||
case "rewardHistory":
|
||||
res, err = rewardHistory()
|
||||
default:
|
||||
err = fmt.Errorf("unimplemented action: reward: %s", action)
|
||||
}
|
||||
return res, err
|
||||
}
|
||||
Reference in New Issue
Block a user