```
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

feat(pet): 添加宠物自由状态管理功能

- 在ServiceList和ServicePage方法中添加WhereNot条件支持
- 将宠物销售状态改为自由状态,新增free字段来标识三种状态:
  0为放入仓库,1为放生,2为上架
- 修改PetInfo、UPdateFree、UPdatePrice等方法以支持新的状态逻辑
- 更新BuyPet方法中的验证逻辑
- 调整查询操作中的字段过滤条件
```
This commit is contained in:
昔念
2026-03-19 20:54:52 +08:00
parent 8929a17c97
commit 75c599b5b3
4 changed files with 22 additions and 21 deletions

View File

@@ -26,9 +26,9 @@ const TableNamePet = "player_pet"
type Pet struct {
Base
PlayerID uint32 `gorm:"not null;index:idx_pet_by_player_id;comment:'所属玩家ID'" json:"player_id"`
Free int `gorm:"not null;default:0;comment:'是否放生'" json:"free"` //"0为放入仓库1为放入背包
Free int `gorm:"not null;default:0;comment:'是否放生'" json:"free"` //"0为放入仓库1为放生,2为上架
CatchTime uint32 `gorm:"not null;comment:'捕捉时间'" json:"catch_time"` //唯一键
IsSale int `gorm:"not null;default:0;comment:'是否出售'" json:"is_sale"`
SalePrice uint32 `gorm:"not null;default:0;comment:'出售价格'" json:"sale_price"`
SaleCount uint32 `gorm:"not null;default:0;comment:'出售次数'" json:"sale_count"`
// Owner uint32 `struc:"skip"` //仅作为存储