mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 11:24:46 +00:00
提交
This commit is contained in:
parent
b2a5a6c491
commit
61767ea93f
@ -169,15 +169,25 @@ public class GPlayerEquipController {
|
||||
@PostMapping("/wear/{petId}/{equipId}")
|
||||
public NewsContext<PetEquip> wear(@CurrentPlayer Player player, @PathVariable Integer petId, @PathVariable Integer equipId){
|
||||
|
||||
//获取装备信息
|
||||
PetEquip info = petEquipService.getById(equipId);
|
||||
|
||||
if(Objects.isNull(info)) NewsContext.onFail("背包里没有这个装备");
|
||||
if(!Objects.equals(info.getEquipPlayerId(), player.getPlayerId())) NewsContext.onFail("这个装备不是你的");
|
||||
|
||||
//脱掉之前的部位装备
|
||||
petEquipService.update(Wrappers.lambdaQuery(PetEquip.class)
|
||||
.eq(PetEquip::getEquipPlayerId,player.getPlayerId())
|
||||
.eq(PetEquip::getEquipPetId,petId)
|
||||
.eq(PetEquip::getEquipPosition,info.getEquipPosition())
|
||||
);
|
||||
// PetEquip before = new PetEquip();
|
||||
|
||||
|
||||
// //脱掉之前的部位装备
|
||||
// PetEquip info = new PetEquip();
|
||||
// info.setEquipPlayerId(player.getPlayerId());
|
||||
// info.setEquipPetId(petId);
|
||||
// petEquipService.update(Wrappers.lambdaQuery(PetEquip.class).eq(
|
||||
// PetEquip::getEquipPlayerId,player.getPlayerId(),
|
||||
// PetEquip::getEquipPetId,petId,
|
||||
// PetEquip::getEquipPetId,petId,
|
||||
// );
|
||||
//
|
||||
// if(Objects.isNull(info)){
|
||||
// return NewsContext.onFail("没有找到锻造台");
|
||||
|
Loading…
x
Reference in New Issue
Block a user