Unify error handling and HTTP statuses
Signed-off-by: Sean Du <do4suki@gmail.com>
This commit is contained in:
@@ -3,6 +3,7 @@ package achievement
|
||||
import (
|
||||
achievementapischema "honoka-chan/internal/schema/api/achievement"
|
||||
"honoka-chan/internal/session"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -37,7 +38,7 @@ func initialAccomplishedList(ctx *gin.Context) (res any, err error) {
|
||||
|
||||
return achievementapischema.UnaccomplishListResp{
|
||||
Result: listData,
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}, nil
|
||||
|
||||
@@ -2,6 +2,7 @@ package achievement
|
||||
|
||||
import (
|
||||
achievementapischema "honoka-chan/internal/schema/api/achievement"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -18,7 +19,7 @@ func unaccomplishList() (res any, err error) {
|
||||
|
||||
res = achievementapischema.UnaccomplishListResp{
|
||||
Result: listData,
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package album
|
||||
import (
|
||||
albumapischema "honoka-chan/internal/schema/api/album"
|
||||
"honoka-chan/internal/session"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -61,7 +62,7 @@ func albumAll(ctx *gin.Context) (res any, err error) {
|
||||
|
||||
res = albumapischema.AllResp{
|
||||
Result: albumLists,
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"honoka-chan/internal/constant"
|
||||
"honoka-chan/internal/handler/api/achievement"
|
||||
"honoka-chan/internal/handler/api/album"
|
||||
"honoka-chan/internal/handler/api/award"
|
||||
@@ -33,10 +32,9 @@ import (
|
||||
"honoka-chan/internal/middleware"
|
||||
"honoka-chan/internal/router"
|
||||
apischema "honoka-chan/internal/schema/api"
|
||||
commonschema "honoka-chan/internal/schema/common"
|
||||
"honoka-chan/internal/session"
|
||||
honokautils "honoka-chan/internal/utils"
|
||||
"time"
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
@@ -117,15 +115,8 @@ func api(ctx *gin.Context) {
|
||||
}
|
||||
|
||||
if honokautils.IsUnimplementedError(err) {
|
||||
results = append(results, commonschema.ApiErrorResp{
|
||||
Result: commonschema.ErrorData{
|
||||
ErrorCode: constant.ErrorCodeUnknown,
|
||||
},
|
||||
Status: 600,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
})
|
||||
continue
|
||||
ss.AbortWithStatus(http.StatusNotFound, honokautils.NewDetailContent(err.Error()))
|
||||
return
|
||||
}
|
||||
if ss.CheckErr(err) {
|
||||
return
|
||||
@@ -136,7 +127,7 @@ func api(ctx *gin.Context) {
|
||||
apiResp := apischema.ApiResp{
|
||||
ResponseData: results,
|
||||
ReleaseInfo: []any{},
|
||||
StatusCode: 200,
|
||||
StatusCode: http.StatusOK,
|
||||
}
|
||||
|
||||
ss.Respond(apiResp)
|
||||
|
||||
@@ -3,6 +3,7 @@ package award
|
||||
import (
|
||||
awardapischema "honoka-chan/internal/schema/api/award"
|
||||
"honoka-chan/internal/session"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -40,7 +41,7 @@ func awardInfo(ctx *gin.Context) (res any, err error) {
|
||||
Result: awardapischema.InfoData{
|
||||
AwardInfo: awardsList,
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package background
|
||||
import (
|
||||
backgroundapischema "honoka-chan/internal/schema/api/background"
|
||||
"honoka-chan/internal/session"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -40,7 +41,7 @@ func backgroundInfo(ctx *gin.Context) (res any, err error) {
|
||||
Result: backgroundapischema.InfoData{
|
||||
BackgroundInfo: backgroundsList,
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package banner
|
||||
|
||||
import (
|
||||
bannerapischema "honoka-chan/internal/schema/api/banner"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -63,7 +64,7 @@ func bannerList() (res any, err error) {
|
||||
},
|
||||
},
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -2,13 +2,14 @@ package challenge
|
||||
|
||||
import (
|
||||
challengeapischema "honoka-chan/internal/schema/api/challenge"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
func challengeInfo() (res any, err error) {
|
||||
res = challengeapischema.InfoResp{
|
||||
Result: []any{},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package costume
|
||||
|
||||
import (
|
||||
costumeapischema "honoka-chan/internal/schema/api/costume"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -10,7 +11,7 @@ func costumeList() (res any, err error) {
|
||||
Result: costumeapischema.ListData{
|
||||
CostumeList: []costumeapischema.CostumeList{},
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
eventscenarioapischema "honoka-chan/internal/schema/api/eventscenario"
|
||||
"honoka-chan/internal/session"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -71,7 +72,7 @@ func eventScenarioStatus(ctx *gin.Context) (res any, err error) {
|
||||
Result: eventscenarioapischema.StatusData{
|
||||
EventScenarioList: eventsList,
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package exchange
|
||||
import (
|
||||
exchangeapischema "honoka-chan/internal/schema/api/exchange"
|
||||
"honoka-chan/internal/session"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -28,7 +29,7 @@ func owningPoint(ctx *gin.Context) (res any, err error) {
|
||||
Result: exchangeapischema.OwningPointData{
|
||||
ExchangePointList: exPointsList,
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package item
|
||||
import (
|
||||
itemapischema "honoka-chan/internal/schema/api/item"
|
||||
honokautils "honoka-chan/internal/utils"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -14,7 +15,7 @@ func itemList() (res any, err error) {
|
||||
|
||||
res = itemapischema.ListResp{
|
||||
Result: itemData,
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package live
|
||||
import (
|
||||
liveapischema "honoka-chan/internal/schema/api/live"
|
||||
"honoka-chan/internal/session"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -36,7 +37,7 @@ func liveSchedule(ctx *gin.Context) (res any, err error) {
|
||||
FreeLiveList: []any{},
|
||||
TrainingLiveList: []liveapischema.TrainingLiveList{},
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package live
|
||||
import (
|
||||
liveapischema "honoka-chan/internal/schema/api/live"
|
||||
"honoka-chan/internal/session"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -46,7 +47,7 @@ func liveStatus(ctx *gin.Context) (res any, err error) {
|
||||
FreeLiveStatusList: []any{},
|
||||
CanResumeLive: true,
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package liveicon
|
||||
|
||||
import (
|
||||
liveiconapischema "honoka-chan/internal/schema/api/liveicon"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -10,7 +11,7 @@ func liveIconInfo() (res any, err error) {
|
||||
Result: liveiconapischema.InfoData{
|
||||
LiveNotesIconList: []int{1, 2, 3},
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package livese
|
||||
|
||||
import (
|
||||
liveseapischema "honoka-chan/internal/schema/api/livese"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -10,7 +11,7 @@ func LiveSeInfo() (res any, err error) {
|
||||
Result: liveseapischema.InfoData{
|
||||
LiveSeList: []int{1, 2, 3},
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
usermodel "honoka-chan/internal/model/user"
|
||||
loginapischema "honoka-chan/internal/schema/api/login"
|
||||
"honoka-chan/internal/session"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -68,7 +69,7 @@ func loginTopInfo(ctx *gin.Context) (res any, err error) {
|
||||
AdFlag: false,
|
||||
HasAdReward: false,
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: now.Unix(),
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package login
|
||||
import (
|
||||
loginapischema "honoka-chan/internal/schema/api/login"
|
||||
"honoka-chan/internal/session"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -36,7 +37,7 @@ func loginTopInfoOnce(ctx *gin.Context) (res any, err error) {
|
||||
ArenaSiSkillUniqueCheck: true,
|
||||
OpenV98: true,
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -2,13 +2,14 @@ package marathon
|
||||
|
||||
import (
|
||||
marathonapischema "honoka-chan/internal/schema/api/marathon"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
func marathonInfo() (res any, err error) {
|
||||
res = marathonapischema.InfoResp{
|
||||
Result: []any{},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package multiunit
|
||||
import (
|
||||
multiunitapischema "honoka-chan/internal/schema/api/multiunit"
|
||||
"honoka-chan/internal/session"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -53,7 +54,7 @@ func MultiUnitScenarioStatus(ctx *gin.Context) (res any, err error) {
|
||||
MultiUnitScenarioStatusList: multiUnitsList,
|
||||
UnlockedMultiUnitScenarioIds: []any{},
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package museum
|
||||
import (
|
||||
museumapischema "honoka-chan/internal/schema/api/museum"
|
||||
"honoka-chan/internal/session"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -42,7 +43,7 @@ func museumInfo(ctx *gin.Context) (res any, err error) {
|
||||
ContentsIDList: museumID,
|
||||
},
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package navigation
|
||||
|
||||
import (
|
||||
navigationapischema "honoka-chan/internal/schema/api/navigation"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -10,7 +11,7 @@ func SpecialCutin() (res any, err error) {
|
||||
Result: navigationapischema.SpecialCutinData{
|
||||
SpecialCutinList: []any{},
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package notice
|
||||
|
||||
import (
|
||||
noticeapischema "honoka-chan/internal/schema/api/notice"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -11,7 +12,7 @@ func noticeMarquee() (res any, err error) {
|
||||
ItemCount: 0,
|
||||
MarqueeList: []any{},
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package payment
|
||||
import (
|
||||
paymentapischema "honoka-chan/internal/schema/api/payment"
|
||||
"honoka-chan/internal/session"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -27,7 +28,7 @@ func productList(ctx *gin.Context) (res any, err error) {
|
||||
SubscriptionList: []paymentapischema.Subscription{},
|
||||
ShowPointShop: false,
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package profile
|
||||
import (
|
||||
profileapischema "honoka-chan/internal/schema/api/profile"
|
||||
honokautils "honoka-chan/internal/utils"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -14,7 +15,7 @@ func cardRanking() (res any, err error) {
|
||||
|
||||
res = profileapischema.CardRankingResp{
|
||||
Result: cardRankingData,
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
usermodel "honoka-chan/internal/model/user"
|
||||
profileapischema "honoka-chan/internal/schema/api/profile"
|
||||
"honoka-chan/internal/session"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
@@ -89,7 +90,7 @@ func profileInfo(ctx *gin.Context, targetUserID int) (res any, err error) {
|
||||
SettingAwardID: targetPref.AwardID,
|
||||
SettingBackgroundID: targetPref.BackgroundID,
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
usermodel "honoka-chan/internal/model/user"
|
||||
profileapischema "honoka-chan/internal/schema/api/profile"
|
||||
"honoka-chan/internal/session"
|
||||
"net/http"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
@@ -82,7 +83,7 @@ func liveCnt(ctx *gin.Context, targetUserID int) (res any, err error) {
|
||||
|
||||
res = profileapischema.LiveCntResp{
|
||||
Result: result,
|
||||
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"
|
||||
)
|
||||
|
||||
@@ -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(),
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package scenario
|
||||
import (
|
||||
scenarioapischema "honoka-chan/internal/schema/api/scenario"
|
||||
"honoka-chan/internal/session"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -28,7 +29,7 @@ func scenarioStatus(ctx *gin.Context) (res any, err error) {
|
||||
Result: scenarioapischema.StatusData{
|
||||
ScenarioStatusList: scenarioLists,
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package secretbox
|
||||
import (
|
||||
secretboxapischema "honoka-chan/internal/schema/api/secretbox"
|
||||
honokautils "honoka-chan/internal/utils"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -35,7 +36,7 @@ func all() (res any, err error) {
|
||||
|
||||
res = secretboxapischema.AllResp{
|
||||
Result: secretBoxData,
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package stamp
|
||||
import (
|
||||
stampapischema "honoka-chan/internal/schema/api/stamp"
|
||||
honokautils "honoka-chan/internal/utils"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -14,7 +15,7 @@ func stampInfo() (res any, err error) {
|
||||
|
||||
res = stampapischema.InfoResp{
|
||||
Result: stampData,
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package subscenario
|
||||
import (
|
||||
subscenarioapischema "honoka-chan/internal/schema/api/subscenario"
|
||||
"honoka-chan/internal/session"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -29,7 +30,7 @@ func subscenarioStatus(ctx *gin.Context) (res any, err error) {
|
||||
SubscenarioStatusList: subScenarioLists,
|
||||
UnlockedSubscenarioIds: []any{},
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package unit
|
||||
import (
|
||||
unitapischema "honoka-chan/internal/schema/api/unit"
|
||||
"honoka-chan/internal/session"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -34,7 +35,7 @@ func unitAccessoryAll(ctx *gin.Context) (res any, err error) {
|
||||
WearingInfo: wearingInfo,
|
||||
EspecialCreateFlag: false,
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -2,13 +2,14 @@ package unit
|
||||
|
||||
import (
|
||||
unitapischema "honoka-chan/internal/schema/api/unit"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
func unitAccessoryMaterialAll() (res any, err error) {
|
||||
res = unitapischema.AccessoryMaterialAllResp{
|
||||
Result: unitapischema.AccessoryMaterialAllData{},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package unit
|
||||
import (
|
||||
unitapischema "honoka-chan/internal/schema/api/unit"
|
||||
honokautils "honoka-chan/internal/utils"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -16,7 +17,7 @@ func unitAccessoryTab() (res any, err error) {
|
||||
Result: unitapischema.AccessoryTabData{
|
||||
TabList: tabList,
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
unitmodel "honoka-chan/internal/model/unit"
|
||||
unitapischema "honoka-chan/internal/schema/api/unit"
|
||||
"honoka-chan/internal/session"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -55,7 +56,7 @@ func unitAll(ctx *gin.Context) (res any, err error) {
|
||||
Active: unitsData,
|
||||
Waiting: []unitapischema.Waiting{},
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package unit
|
||||
import (
|
||||
unitapischema "honoka-chan/internal/schema/api/unit"
|
||||
"honoka-chan/internal/session"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -46,7 +47,7 @@ func unitDeckInfo(ctx *gin.Context) (res any, err error) {
|
||||
}
|
||||
res = unitapischema.DeckInfoResp{
|
||||
Result: unitDeckInfo,
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package unit
|
||||
import (
|
||||
unitapischema "honoka-chan/internal/schema/api/unit"
|
||||
"honoka-chan/internal/session"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -67,7 +68,7 @@ func unitRemovableSkillInfo(ctx *gin.Context) (res any, err error) {
|
||||
OwningInfo: owingInfo,
|
||||
EquipmentInfo: equipInfo,
|
||||
}, // 宝石
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package unit
|
||||
|
||||
import (
|
||||
unitapischema "honoka-chan/internal/schema/api/unit"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -10,7 +11,7 @@ func unitSupporterAll() (res any, err error) {
|
||||
Result: unitapischema.SupporterAllData{
|
||||
UnitSupportList: []unitapischema.SupporterList{},
|
||||
}, // 练习道具
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package user
|
||||
import (
|
||||
userapischema "honoka-chan/internal/schema/api/user"
|
||||
"honoka-chan/internal/session"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -24,7 +25,7 @@ func userGetNavi(ctx *gin.Context) (res any, err error) {
|
||||
UnitOwningUserID: oID,
|
||||
},
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
userapischema "honoka-chan/internal/schema/api/user"
|
||||
userschema "honoka-chan/internal/schema/user"
|
||||
"honoka-chan/internal/session"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -20,7 +21,7 @@ func userInfo(ctx *gin.Context) (res any, err error) {
|
||||
BirthDay: ss.UserPref.EffectiveBirthDay(),
|
||||
},
|
||||
},
|
||||
Status: 200,
|
||||
Status: http.StatusOK,
|
||||
CommandNum: false,
|
||||
TimeStamp: time.Now().Unix(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user