mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-26 10:16:14 +00:00
提交
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package cn.jisol.game.controller.game;
|
||||
|
||||
import cn.jisol.game.controller.argsresolver.CurrentPlayer;
|
||||
import cn.jisol.game.entity.table.Player;
|
||||
import cn.jisol.game.entity.table.PlayerPet;
|
||||
import cn.jisol.game.entity.table.Resource;
|
||||
import cn.jisol.game.service.ResourceService;
|
||||
import cn.jisol.game.vo.news.NewsResource;
|
||||
import cn.jisol.game.vo.news.ov.ResourceUpdateOV;
|
||||
import cn.jisol.ngame.util.NewsContext;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@Api(value = "JNGameDemo - API", tags = {"Debugger - API"})
|
||||
@RestController
|
||||
@RequestMapping("/debugger")
|
||||
@ResponseBody
|
||||
public class GDebuggerController {
|
||||
|
||||
@Autowired
|
||||
ResourceService resourceService;
|
||||
|
||||
//添加指定资源
|
||||
@ApiImplicitParams({})
|
||||
@ApiOperation(value = "添加指定资源")
|
||||
@PostMapping("/add/resource/{type}/{value}")
|
||||
public NewsResource<Boolean> addResource(@PathVariable Integer type, @PathVariable long value, @CurrentPlayer Player player){
|
||||
return NewsResource.onSuccess("添加成功",true,ResourceUpdateOV.onUpdate(resourceService.addResourceValue(player.getPlayerId(), type, value)));
|
||||
}
|
||||
|
||||
}
|
@@ -163,5 +163,31 @@ public class GPlayerEquipController {
|
||||
|
||||
}
|
||||
|
||||
//穿戴装备
|
||||
@ApiImplicitParams({})
|
||||
@ApiOperation(value = "穿戴装备")
|
||||
@PostMapping("/wear/{petId}/{equipId}")
|
||||
public NewsContext<PetEquip> wear(@CurrentPlayer Player player, @PathVariable Integer petId, @PathVariable Integer equipId){
|
||||
|
||||
// //脱掉之前的部位装备
|
||||
// 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("没有找到锻造台");
|
||||
// }
|
||||
//
|
||||
// Equip equip1 = equipService.getById(equip);
|
||||
//
|
||||
// if(Objects.isNull(equip1))
|
||||
return NewsContext.onSuccess("");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ public class PetEquip {
|
||||
private Integer equipCfgId; //装备配置表Id
|
||||
private Long equipPlayerId; //装备的所属玩家Id
|
||||
private Integer equipLevel; //装备等级
|
||||
private Integer equipWear; //当前装备穿戴的宠物Id
|
||||
private Integer equipPetId; //当前装备穿戴的宠物Id
|
||||
private Integer equipPosition; //装备部位
|
||||
|
||||
@TableField(typeHandler = FastjsonTypeHandler.class)
|
||||
|
@@ -36,7 +36,7 @@ public class ResourceServiceImpl extends ServiceImpl<ResourceMapper, Resource> i
|
||||
.eq(Resource::getResourceTbId, type);//资源
|
||||
|
||||
if(value < 0) {
|
||||
eq.gt(Resource::getResourceValue,Math.abs(value));
|
||||
eq.ge(Resource::getResourceValue,Math.abs(value));
|
||||
}
|
||||
|
||||
//执行SQL
|
||||
|
Reference in New Issue
Block a user