feat: 新增繁殖和融合查询命令
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-03-24 01:12:06 +08:00
committed by cnb
parent 133d15e392
commit 707142bd49
5 changed files with 91 additions and 1 deletions

View File

@@ -56,3 +56,13 @@ func (s *EggService) GetResult(m, f, level uint32) (uint32, bool) {
return 0, false
}
func (s *EggService) All() []model.Egg {
//cacheKey := strings.Join([]string{fmt.Sprintf("%d", p1), fmt.Sprintf("%d", p2)}, ":")
m := dbm_enable(s.Model)
var pet []model.Egg //一个特性应该是唯一的,但是我们要获取默认随机特性
m.Scan(&pet)
return pet
}

View File

@@ -77,3 +77,10 @@ func (s *PetFusionService) def() []model.PetFusion {
// return ret.Interface().([]model.PetFusion)
}
func (s *PetFusionService) All() []model.PetFusion {
var pets []model.PetFusion
dbm_enable(s.Model).Where("is_default", 0).Scan(&pets)
return pets
}