- Add secretbox API schemas, handlers, and routes for all/showDetail/pon/multi - Load secretbox server data through the shared serverdata loader - Fix rarity mapping and pool rules for SR/SSR/UR special boxes - Implement thanks festival pool behavior, including UR guarantee and SSR/UR-only rates - Correct animation-related fields such as is_hit and lowest_rarity, and add rare UR promotion animation Signed-off-by: Sean Du <do4suki@gmail.com>
52 lines
995 B
Go
52 lines
995 B
Go
package banner
|
|
|
|
import (
|
|
apibanner "honoka-chan/internal/handler/api/banner"
|
|
"honoka-chan/internal/middleware"
|
|
"honoka-chan/internal/router"
|
|
"honoka-chan/internal/session"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type bannerResp struct {
|
|
ResponseData any `json:"response_data"`
|
|
ReleaseInfo []any `json:"release_info"`
|
|
StatusCode int `json:"status_code"`
|
|
}
|
|
|
|
func list(ctx *gin.Context) {
|
|
ss := session.Get(ctx)
|
|
defer ss.Finalize()
|
|
|
|
data, err := apibanner.BannerApi("bannerList")
|
|
if ss.CheckErr(err) {
|
|
return
|
|
}
|
|
|
|
resp, ok := data.(interface {
|
|
GetResult() any
|
|
})
|
|
_ = resp
|
|
_ = ok
|
|
|
|
ss.Respond(bannerResp{
|
|
ResponseData: extractBannerResult(data),
|
|
ReleaseInfo: []any{},
|
|
StatusCode: 200,
|
|
})
|
|
}
|
|
|
|
func extractBannerResult(data any) any {
|
|
if v, ok := data.(map[string]any); ok {
|
|
if result, ok := v["result"]; ok {
|
|
return result
|
|
}
|
|
}
|
|
return extractResultField(data)
|
|
}
|
|
|
|
func init() {
|
|
router.AddHandler("main.php", "POST", "/banner/bannerList", middleware.Common, list)
|
|
}
|