package service import ( "context" v1 "epic/api/hero/v1" "epic/internal/model/entity" ) // HeroService 定义了英雄相关的业务接口 type HeroService interface { // GetHeroByCode 根据 code 查询角色信息 GetHeroByCode(ctx context.Context, code string) (*entity.EpicHeroInfo, error) GetHeroList(ctx context.Context) ([]*v1.EpicHeroVO, error) GetHeroDetailByCode(ctx context.Context, code string) (*v1.HeroDetailVO, error) // ClearHeroCache 清理英雄相关缓存 ClearHeroCache(ctx context.Context, code string) error } var heroService HeroService // Hero 返回 HeroService 的实例 func Hero() HeroService { if heroService == nil { panic("implement not found for interface HeroService") } return heroService } // SetHero 注册 HeroService 实现 func SetHero(s HeroService) { heroService = s }