mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-26 10:16:14 +00:00
提交锻造装备
This commit is contained in:
@@ -13,6 +13,7 @@ import cn.jisol.game.entity.data.GAttribute;
|
||||
import cn.jisol.game.entity.table.*;
|
||||
import cn.jisol.game.service.EquipForgingBenchService;
|
||||
import cn.jisol.game.service.PetEquipService;
|
||||
import cn.jisol.game.service.PlayerPetService;
|
||||
import cn.jisol.game.service.ResourceService;
|
||||
import cn.jisol.game.util.GRandomUtil;
|
||||
import cn.jisol.ngame.util.NewsContext;
|
||||
@@ -39,6 +40,8 @@ import java.util.stream.Collectors;
|
||||
@ResponseBody
|
||||
public class GPlayerEquipController {
|
||||
|
||||
@Autowired
|
||||
PlayerPetService playerPetService;
|
||||
@Autowired
|
||||
PetEquipService petEquipService;
|
||||
@Autowired
|
||||
@@ -171,32 +174,31 @@ public class GPlayerEquipController {
|
||||
|
||||
//获取装备信息
|
||||
PetEquip info = petEquipService.getById(equipId);
|
||||
//获取宠物信息
|
||||
PlayerPet pet = playerPetService.getById(petId);
|
||||
|
||||
|
||||
if(Objects.isNull(info)) NewsContext.onFail("背包里没有这个装备");
|
||||
if(!Objects.equals(info.getEquipPlayerId(), player.getPlayerId())) NewsContext.onFail("这个装备不是你的");
|
||||
if(Objects.isNull(pet)) NewsContext.onFail("没有找到这个宠物");
|
||||
if(!Objects.equals(pet.getPetPlayerId(), 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();
|
||||
before.setEquipPlayerId(0L);
|
||||
petEquipService.update(
|
||||
before,
|
||||
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);
|
||||
//
|
||||
// if(Objects.isNull(info)){
|
||||
// return NewsContext.onFail("没有找到锻造台");
|
||||
// }
|
||||
//
|
||||
// Equip equip1 = equipService.getById(equip);
|
||||
//
|
||||
// if(Objects.isNull(equip1))
|
||||
return NewsContext.onSuccess("");
|
||||
//穿上
|
||||
info.setEquipPetId(pet.getPetId());
|
||||
petEquipService.saveOrUpdate(info);
|
||||
//保存
|
||||
return NewsContext.onSuccess("穿戴成功",info);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -22,7 +22,7 @@ public class PetEquip {
|
||||
private Integer equipCfgId; //装备配置表Id
|
||||
private Long equipPlayerId; //装备的所属玩家Id
|
||||
private Integer equipLevel; //装备等级
|
||||
private Integer equipPetId; //当前装备穿戴的宠物Id
|
||||
private Long equipPetId; //当前装备穿戴的宠物Id
|
||||
private Integer equipPosition; //装备部位
|
||||
|
||||
@TableField(typeHandler = FastjsonTypeHandler.class)
|
||||
|
@@ -4,8 +4,8 @@ spring:
|
||||
datasource:
|
||||
username: pet_jisol_cn
|
||||
password: sThsBwjfDcaw2wJR
|
||||
url: jdbc:mysql://kyu.jisol.cn:3306/pet_jisol_cn?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&allowMultiQueries=true
|
||||
# url: jdbc:mysql://localhost:3306/pet_jisol_cn?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&allowMultiQueries=true
|
||||
# url: jdbc:mysql://kyu.jisol.cn:3306/pet_jisol_cn?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&allowMultiQueries=true
|
||||
url: jdbc:mysql://localhost:3306/pet_jisol_cn?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&allowMultiQueries=true
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
jackson:
|
||||
serialization:
|
||||
|
Reference in New Issue
Block a user