Files
honoka-chan/internal/handler/banner/helpers.go
T
YumeMichi 750c2cf3d0 Implement secretbox handlers and align gacha behavior
- 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>
2026-06-05 21:57:04 +08:00

27 lines
430 B
Go

package banner
import "reflect"
func extractResultField(data any) any {
if data == nil {
return nil
}
value := reflect.ValueOf(data)
if value.Kind() == reflect.Pointer {
if value.IsNil() {
return nil
}
value = value.Elem()
}
if value.Kind() != reflect.Struct {
return data
}
field := value.FieldByName("Result")
if !field.IsValid() || !field.CanInterface() {
return data
}
return field.Interface()
}