Commit 20d792f1 by 周君强

调整:

1.调整种植、园丁模块的确认、取消操作
parent e38da9ec
...@@ -36,6 +36,7 @@ public class InitSysServlet implements InitializingBean { ...@@ -36,6 +36,7 @@ public class InitSysServlet implements InitializingBean {
private GardenerSkillMapper gardenerSkillMapper; private GardenerSkillMapper gardenerSkillMapper;
private SkillResetCostMapper skillResetCostMapper; private SkillResetCostMapper skillResetCostMapper;
private ItemTypeMapper itemTypeMapper; private ItemTypeMapper itemTypeMapper;
private GoodsMapper goodsMapper;
@Autowired @Autowired
public void setNurseryMapper(NurseryMapper nurseryMapper) { public void setNurseryMapper(NurseryMapper nurseryMapper) {
...@@ -117,6 +118,11 @@ public class InitSysServlet implements InitializingBean { ...@@ -117,6 +118,11 @@ public class InitSysServlet implements InitializingBean {
this.itemTypeMapper = itemTypeMapper; this.itemTypeMapper = itemTypeMapper;
} }
@Autowired
public void setGoodsMapper(GoodsMapper goodsMapper) {
this.goodsMapper = goodsMapper;
}
/** /**
* 保存配置信息到缓存 * 保存配置信息到缓存
*/ */
...@@ -310,5 +316,15 @@ public class InitSysServlet implements InitializingBean { ...@@ -310,5 +316,15 @@ public class InitSysServlet implements InitializingBean {
TimingAcquisition.itemTypeMap.putAll(itemTypeMap); TimingAcquisition.itemTypeMap.putAll(itemTypeMap);
log.info("缓存中物品类型配置信息" + TimingAcquisition.itemTypeMap); log.info("缓存中物品类型配置信息" + TimingAcquisition.itemTypeMap);
log.info("物品类型配置信息缓存完成"); log.info("物品类型配置信息缓存完成");
//缓存商品配置信息
Map<Integer, GoodsPojo> goodsConfigMap = new ConcurrentHashMap<>();
List<GoodsPojo> goodsList = goodsMapper.findAll();
for (GoodsPojo goods : goodsList) {
goodsConfigMap.put(goods.getId(), goods);
}
TimingAcquisition.goodsConfigMap.putAll(goodsConfigMap);
log.info("缓存中商品配置信息" + TimingAcquisition.goodsConfigMap);
log.info("商品配置信息缓存完成");
} }
} }
...@@ -45,6 +45,10 @@ public class TimingAcquisition { ...@@ -45,6 +45,10 @@ public class TimingAcquisition {
*/ */
public volatile static Map<String, ShopDto> shopMap = new ConcurrentHashMap<>(); public volatile static Map<String, ShopDto> shopMap = new ConcurrentHashMap<>();
/** /**
* 商品配置信息
*/
public volatile static Map<Integer, GoodsPojo> goodsConfigMap = new ConcurrentHashMap<>();
/**
* 花园信息 * 花园信息
*/ */
public volatile static Map<String, GardenDto> gardenMap = new ConcurrentHashMap<>(); public volatile static Map<String, GardenDto> gardenMap = new ConcurrentHashMap<>();
...@@ -337,7 +341,7 @@ public class TimingAcquisition { ...@@ -337,7 +341,7 @@ public class TimingAcquisition {
return nursery.getId(); return nursery.getId();
} }
} }
return null; return -1;
} }
/** /**
...@@ -359,6 +363,24 @@ public class TimingAcquisition { ...@@ -359,6 +363,24 @@ public class TimingAcquisition {
} }
/** /**
* 根据技能名称获取植物id
* @param skillName
* @return Integer
*/
public static Integer getSkillIdByName(String skillName) {
Iterator<Map.Entry<Integer, GardenerSkillPojo>> iterator = gardenerSkillMap.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<Integer, GardenerSkillPojo> entry = iterator.next();
GardenerSkillPojo gardenerSkill = entry.getValue();
if (skillName.equals(gardenerSkill.getName())) {
return gardenerSkill.getId();
}
}
return -1;
}
/**
* 根据物品名称获取物品信息 * 根据物品名称获取物品信息
* @param itemName * @param itemName
* @return Integer * @return Integer
......
...@@ -57,6 +57,19 @@ public class RequestConversionUtil { ...@@ -57,6 +57,19 @@ public class RequestConversionUtil {
operationRequest.setPlantId(plantId); operationRequest.setPlantId(plantId);
} }
} }
//存在技能名称
String skillName = callRequest.get技能名称();
if (!StringUtils.isEmpty(skillName)) {
Integer skillId = TimingAcquisition.getSkillIdByName(skillName);
if (!StringUtils.isEmpty(skillId)) {
operationRequest.setSkillId(skillId);
}
}
//存在园丁名称
String rename = callRequest.get园丁名称();
if (!StringUtils.isEmpty(rename)) {
operationRequest.setRename(rename);
}
//存在物品名称 //存在物品名称
String itemName = callRequest.get物品名称(); String itemName = callRequest.get物品名称();
if (!StringUtils.isEmpty(itemName)) { if (!StringUtils.isEmpty(itemName)) {
...@@ -66,6 +79,11 @@ public class RequestConversionUtil { ...@@ -66,6 +79,11 @@ public class RequestConversionUtil {
operationRequest.setItemTypeId(item.getItemTypeId()); operationRequest.setItemTypeId(item.getItemTypeId());
} }
} }
//存在数量
String num = callRequest.get数量();
if (!StringUtils.isEmpty(num)) {
operationRequest.setNumber(Integer.parseInt(num));
}
//存在宠物名称 //存在宠物名称
String petName = callRequest.get宠物名称(); String petName = callRequest.get宠物名称();
if (!StringUtils.isEmpty(petName)) { if (!StringUtils.isEmpty(petName)) {
......
...@@ -40,14 +40,86 @@ public class CommonController { ...@@ -40,14 +40,86 @@ public class CommonController {
CommonResponse result = new CommonResponse(); CommonResponse result = new CommonResponse();
switch (commonRequest.getVars().get操作名()) { switch (commonRequest.getVars().get操作名()) {
case "种植": case "种植":
result = plantService.seedCheck(operationReq);
break;
case "确认种植":
result = plantService.seed(operationReq); result = plantService.seed(operationReq);
break; break;
case "检查种植": case "取消种植":
result = plantService.checkNursery(operationReq); result = plantService.seedCancel(operationReq);
break;
case "铲除植物":
result = plantService.clearPlantCheck(operationReq);
break;
case "收获并铲除植物":
result = plantService.clearAfterHarvest(operationReq);
break;
case "确认铲除植物":
result = plantService.clearPlant(operationReq);
break;
case "取消铲除植物":
result = plantService.clearPlantCancel(operationReq);
break;
case "查看花圃升级类型":
result = nurseryService.searchNurseryToType(operationReq);
break;
case "查看花圃升级条件":
result = nurseryService.searchUpgradeCondition(operationReq);
break;
case "升级花圃":
result = nurseryService.nurseryUpgrade(operationReq);
break;
case "取消升级花圃":
result = nurseryService.nurseryUpgradeCancel(operationReq);
break;
case "重置花圃":
result = nurseryService.NurseryResetCheck(operationReq);
break;
case "确认重置花圃":
result = nurseryService.nurseryReset(operationReq);
break;
case "取消重置花圃":
result = nurseryService.nurseryResetCancel(operationReq);
break; break;
case "查询花圃状态": case "查询花圃状态":
result = nurseryService.checkNurseryByNum(operationReq); result = nurseryService.checkNurseryByNum(operationReq);
break; break;
case "园丁升级":
result = gardenerService.gardenerUpgradeCheck(operationReq);
break;
case "确认园丁升级":
result = gardenerService.gardenerUpgrade(operationReq);
break;
case "取消园丁升级":
result = gardenerService.gardenerUpgradeCancel(operationReq);
break;
case "使用技能":
result = gardenerService.learnSkillCheck(operationReq);
break;
case "确认使用技能":
result = gardenerService.learnSkill(operationReq);
break;
case "取消使用技能":
result = gardenerService.learnSkillCancel(operationReq);
break;
case "重置技能":
result = gardenerService.resetSkillCheck(operationReq);
break;
case "确认重置技能":
result = gardenerService.resetSkill(operationReq);
break;
case "取消重置技能":
result = gardenerService.resetSkillCancel(operationReq);
break;
case "更改园丁姓名":
result = gardenerService.renameCheck(operationReq);
break;
case "确认更改园丁姓名":
result = gardenerService.rename(operationReq);
break;
case "取消更改园丁姓名":
result = gardenerService.renameCancel(operationReq);
break;
case "查看宠物": case "查看宠物":
result = petService.petView(operationReq); result = petService.petView(operationReq);
break; break;
......
...@@ -35,9 +35,9 @@ public class GardenerController { ...@@ -35,9 +35,9 @@ public class GardenerController {
return gardener; return gardener;
} }
@PostMapping(value = "/gardenerUpgradeCondition", produces = "application/json;charset=UTF-8") @PostMapping(value = "/gardenerUpgradeCheck", produces = "application/json;charset=UTF-8")
public CommonResponse gardenerUpgradeCondition(@RequestBody OperationRequest operationReq) { public CommonResponse gardenerUpgradeCheck(@RequestBody OperationRequest operationReq) {
CommonResponse goods = gardenerService.gardenerUpgradeCondition(operationReq); CommonResponse goods = gardenerService.gardenerUpgradeCheck(operationReq);
return goods; return goods;
} }
...@@ -53,9 +53,9 @@ public class GardenerController { ...@@ -53,9 +53,9 @@ public class GardenerController {
return goods; return goods;
} }
@PostMapping(value = "/searchSkillInfoLV", produces = "application/json;charset=UTF-8") @PostMapping(value = "/learnSkillCheck", produces = "application/json;charset=UTF-8")
public CommonResponse searchSkillInfoLV(@RequestBody OperationRequest operationReq) { public CommonResponse learnSkillCheck(@RequestBody OperationRequest operationReq) {
CommonResponse goods = gardenerService.searchSkillInfoLV(operationReq); CommonResponse goods = gardenerService.learnSkillCheck(operationReq);
return goods; return goods;
} }
...@@ -65,9 +65,9 @@ public class GardenerController { ...@@ -65,9 +65,9 @@ public class GardenerController {
return goods; return goods;
} }
@PostMapping(value = "/resetSkillCost", produces = "application/json;charset=UTF-8") @PostMapping(value = "/resetSkillCheck", produces = "application/json;charset=UTF-8")
public CommonResponse resetSkillCost(@RequestBody OperationRequest operationReq) { public CommonResponse resetSkillCheck(@RequestBody OperationRequest operationReq) {
CommonResponse goods = gardenerService.resetSkillCost(operationReq); CommonResponse goods = gardenerService.resetSkillCheck(operationReq);
return goods; return goods;
} }
...@@ -77,21 +77,15 @@ public class GardenerController { ...@@ -77,21 +77,15 @@ public class GardenerController {
return goods; return goods;
} }
@PostMapping(value = "/searchSkillBeforeLearn", produces = "application/json;charset=UTF-8") @PostMapping(value = "/resetSkillCancel", produces = "application/json;charset=UTF-8")
public CommonResponse searchSkillBeforeLearn(@RequestBody OperationRequest operationReq) { public CommonResponse resetSkillCancel(@RequestBody OperationRequest operationReq) {
CommonResponse goods = gardenerService.searchSkillBeforeLearn(operationReq); CommonResponse goods = gardenerService.resetSkillCancel(operationReq);
return goods; return goods;
} }
@PostMapping(value = "/cancelResetSkill", produces = "application/json;charset=UTF-8") @PostMapping(value = "/renameCheck", produces = "application/json;charset=UTF-8")
public CommonResponse cancelResetSkill(@RequestBody OperationRequest operationReq) { public CommonResponse renameCheck(@RequestBody OperationRequest operationReq) {
CommonResponse goods = gardenerService.cancelResetSkill(operationReq); CommonResponse goods = gardenerService.renameCheck(operationReq);
return goods;
}
@PostMapping(value = "/searchRenameCondition", produces = "application/json;charset=UTF-8")
public CommonResponse searchRenameCondition(@RequestBody OperationRequest operationReq) {
CommonResponse goods = gardenerService.searchRenameCondition(operationReq);
return goods; return goods;
} }
...@@ -109,7 +103,7 @@ public class GardenerController { ...@@ -109,7 +103,7 @@ public class GardenerController {
@PostMapping(value = "/seed", produces = "application/json;charset=UTF-8") @PostMapping(value = "/seed", produces = "application/json;charset=UTF-8")
public CommonResponse seed(@RequestBody OperationRequest operationReq) { public CommonResponse seed(@RequestBody OperationRequest operationReq) {
CommonResponse result = plantService.seed(operationReq); CommonResponse result = plantService.seedCheck(operationReq);
return result; return result;
} }
...@@ -119,21 +113,21 @@ public class GardenerController { ...@@ -119,21 +113,21 @@ public class GardenerController {
return result; return result;
} }
@PostMapping(value = "/checkNursery", produces = "application/json;charset=UTF-8") @PostMapping(value = "/clearPlantCheck", produces = "application/json;charset=UTF-8")
public CommonResponse checkNursery(@RequestBody OperationRequest operationReq) { public CommonResponse clearPlantCheck(@RequestBody OperationRequest operationReq) {
CommonResponse result = plantService.checkNursery(operationReq); CommonResponse result = plantService.clearPlantCheck(operationReq);
return result; return result;
} }
@PostMapping(value = "/cancelPlant", produces = "application/json;charset=UTF-8") @PostMapping(value = "/clearPlant", produces = "application/json;charset=UTF-8")
public CommonResponse cancelPlant(@RequestBody OperationRequest operationReq) { public CommonResponse clearPlant(@RequestBody OperationRequest operationReq) {
CommonResponse result = plantService.cancelPlant(operationReq); CommonResponse result = plantService.clearPlant(operationReq);
return result; return result;
} }
@PostMapping(value = "/cancelAfterHarvest", produces = "application/json;charset=UTF-8") @PostMapping(value = "/clearAfterHarvest", produces = "application/json;charset=UTF-8")
public CommonResponse cancelAfterHarvest(@RequestBody OperationRequest operationReq) { public CommonResponse clearAfterHarvest(@RequestBody OperationRequest operationReq) {
CommonResponse result = plantService.cancelAfterHarvest(operationReq); CommonResponse result = plantService.clearAfterHarvest(operationReq);
return result; return result;
} }
...@@ -185,9 +179,9 @@ public class GardenerController { ...@@ -185,9 +179,9 @@ public class GardenerController {
return result; return result;
} }
@PostMapping(value = "/NurseryResetCondition", produces = "application/json;charset=UTF-8") @PostMapping(value = "/NurseryResetCheck", produces = "application/json;charset=UTF-8")
public CommonResponse NurseryResetCondition(@RequestBody OperationRequest operationReq) { public CommonResponse NurseryResetCheck(@RequestBody OperationRequest operationReq) {
CommonResponse result = nurseryService.NurseryResetCondition(operationReq); CommonResponse result = nurseryService.NurseryResetCheck(operationReq);
return result; return result;
} }
......
package com.qiwuai.garden.dao;
import com.qiwuai.garden.pojo.GoodsPojo;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import java.util.List;
@Mapper
@Repository
public interface GoodsMapper {
List<GoodsPojo> findAll();
}
...@@ -29,6 +29,14 @@ public class CallRequest { ...@@ -29,6 +29,14 @@ public class CallRequest {
*/ */
private String 花圃类型; private String 花圃类型;
/** /**
* 技能名称
*/
private String 技能名称;
/**
* 园丁名称
*/
private String 园丁名称;
/**
* 宠物名称 * 宠物名称
*/ */
private String 宠物名称; private String 宠物名称;
...@@ -37,6 +45,10 @@ public class CallRequest { ...@@ -37,6 +45,10 @@ public class CallRequest {
*/ */
private String 物品名称; private String 物品名称;
/** /**
* 物品数量
*/
private String 数量;
/**
* 位置信息,宠物栏中宠物的位置 * 位置信息,宠物栏中宠物的位置
*/ */
private String 位置信息; private String 位置信息;
......
...@@ -13,6 +13,10 @@ public class OperationRequest { ...@@ -13,6 +13,10 @@ public class OperationRequest {
*/ */
private String rename; private String rename;
/** /**
* 园丁等级,用于学习技能
*/
private Integer level;
/**
* 物品id * 物品id
*/ */
private Integer itemId; private Integer itemId;
......
package com.qiwuai.garden.pojo;
import lombok.Data;
@Data
public class GoodsPojo {
/**
* 商品id
*/
private Integer id;
/**
* 商品名称,如果为空,则对应物品描述
*/
private String name;
/**
* 商品描述
*/
private String description;
/**
* 对应物品id
*/
private Integer itemId;
/**
* 商品定价
*/
private Integer price;
/**
* 折扣
*/
private Integer discount;
/**
* 折扣
*/
private Integer discountLimitTime;
/**
* 对应商店/园丁等级,在商店/园丁等级大于等于这里配置的等级时才可购买此物品
*/
private Integer level;
/**
* 创建时间
*/
private String createTime;
/**
* 更新时间
*/
private String updateTime;
}
...@@ -15,41 +15,53 @@ public interface GardenerService { ...@@ -15,41 +15,53 @@ public interface GardenerService {
*/ */
ApiResponse<GardenerDto> create(GardenerRequest gardenerRequest); ApiResponse<GardenerDto> create(GardenerRequest gardenerRequest);
/** /**
* 查询园丁升级条件 * 园丁升级,查询园丁升级条件
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse gardenerUpgradeCondition(OperationRequest operationReq); CommonResponse gardenerUpgradeCheck(OperationRequest operationReq);
/** /**
* 园丁升级 * 确认园丁升级
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse gardenerUpgrade(OperationRequest operationReq); CommonResponse gardenerUpgrade(OperationRequest operationReq);
/** /**
* 查看技能信息 * 取消园丁升级
* @param operationReq
* @return CommonResponse
*/
CommonResponse gardenerUpgradeCancel(OperationRequest operationReq);
/**
* 查看技能信息,查看当前等级可选择的所有技能信息
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse searchSkillInfo(OperationRequest operationReq); CommonResponse searchSkillInfo(OperationRequest operationReq);
/** /**
* 查看当前等级可选择的所有技能信息,取消使用技能 * 使用技能,根据技能名称查看技能信息
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse searchSkillInfoLV(OperationRequest operationReq); CommonResponse learnSkillCheck(OperationRequest operationReq);
/** /**
* 园丁升级完之后,学习新技能 * 确认使用技能,园丁升级完之后,学习新技能
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse learnSkill(OperationRequest operationReq); CommonResponse learnSkill(OperationRequest operationReq);
/** /**
* 取消使用技能
* @param operationReq
* @return CommonResponse
*/
CommonResponse learnSkillCancel(OperationRequest operationReq);
/**
* 查询重置园丁技能的开销,重置园丁 * 查询重置园丁技能的开销,重置园丁
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse resetSkillCost(OperationRequest operationReq); CommonResponse resetSkillCheck(OperationRequest operationReq);
/** /**
* 重置园丁技能,确认重置 * 重置园丁技能,确认重置
* @param operationReq * @param operationReq
...@@ -57,29 +69,29 @@ public interface GardenerService { ...@@ -57,29 +69,29 @@ public interface GardenerService {
*/ */
CommonResponse resetSkill(OperationRequest operationReq); CommonResponse resetSkill(OperationRequest operationReq);
/** /**
* 技能重置之后,学习新技能之前,查看哪些等级还没有学习技能,从等级2开始 * 取消重置技能
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse searchSkillBeforeLearn(OperationRequest operationReq); CommonResponse resetSkillCancel(OperationRequest operationReq);
/** /**
* 取消重置技能 * 更改园丁姓名
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse cancelResetSkill(OperationRequest operationReq); CommonResponse renameCheck(OperationRequest operationReq);
/** /**
* 园丁更名 * 确认更改园丁姓名
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse searchRenameCondition(OperationRequest operationReq); CommonResponse rename(OperationRequest operationReq);
/** /**
* 园丁更名 * 取消更改园丁姓名
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse rename(OperationRequest operationReq); CommonResponse renameCancel(OperationRequest operationReq);
/** /**
* 园丁采购 * 园丁采购
* @param operationReq * @param operationReq
......
...@@ -28,13 +28,13 @@ public interface NurseryService { ...@@ -28,13 +28,13 @@ public interface NurseryService {
*/ */
CommonResponse checkNurseryLevel(OperationRequest operationReq); CommonResponse checkNurseryLevel(OperationRequest operationReq);
/** /**
* 查询当前花圃升级可选择的花圃类型 * 查看花圃升级类型,查询当前花圃升级可选择的花圃类型
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse searchNurseryToType(OperationRequest operationReq); CommonResponse searchNurseryToType(OperationRequest operationReq);
/** /**
* 查询选择的花圃类型升级需要满足哪些条件 * 查看花圃升级条件,查询选择的花圃类型升级需要满足哪些条件
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
...@@ -46,6 +46,12 @@ public interface NurseryService { ...@@ -46,6 +46,12 @@ public interface NurseryService {
*/ */
CommonResponse nurseryUpgrade(OperationRequest operationReq); CommonResponse nurseryUpgrade(OperationRequest operationReq);
/** /**
* 取消升级花圃
* @param operationReq
* @return CommonResponse
*/
CommonResponse nurseryUpgradeCancel(OperationRequest operationReq);
/**
* 开垦/开启花圃 * 开垦/开启花圃
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
...@@ -58,15 +64,21 @@ public interface NurseryService { ...@@ -58,15 +64,21 @@ public interface NurseryService {
*/ */
CommonResponse searchNurseryReset(OperationRequest operationReq); CommonResponse searchNurseryReset(OperationRequest operationReq);
/** /**
* 查询重置花圃所需条件,根据有无植物情况返回 * 重置花圃,查询重置花圃所需条件,根据有无植物情况返回
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse NurseryResetCondition(OperationRequest operationReq); CommonResponse NurseryResetCheck(OperationRequest operationReq);
/** /**
* 重置花圃 * 确认重置花圃
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse nurseryReset(OperationRequest operationReq); CommonResponse nurseryReset(OperationRequest operationReq);
/**
* 取消重置花圃
* @param operationReq
* @return CommonResponse
*/
CommonResponse nurseryResetCancel(OperationRequest operationReq);
} }
...@@ -471,7 +471,7 @@ public class PetServiceImpl implements PetService { ...@@ -471,7 +471,7 @@ public class PetServiceImpl implements PetService {
OperationRequest lastReq = (OperationRequest) CacheUtil.get(uid); OperationRequest lastReq = (OperationRequest) CacheUtil.get(uid);
if (StringUtils.isEmpty(lastReq)) { if (StringUtils.isEmpty(lastReq)) {
commonResponse.setCode(0); commonResponse.setCode(0);
commonResponse.setMsg("失败,对话结束"); commonResponse.setMsg("失败,对话已结束");
return commonResponse; return commonResponse;
} }
//判断当前操作为上一轮的下一步 //判断当前操作为上一轮的下一步
...@@ -543,7 +543,7 @@ public class PetServiceImpl implements PetService { ...@@ -543,7 +543,7 @@ public class PetServiceImpl implements PetService {
OperationRequest lastReq = (OperationRequest) CacheUtil.get(uid); OperationRequest lastReq = (OperationRequest) CacheUtil.get(uid);
if (StringUtils.isEmpty(lastReq)) { if (StringUtils.isEmpty(lastReq)) {
commonResponse.setCode(0); commonResponse.setCode(0);
commonResponse.setMsg("失败,对话结束"); commonResponse.setMsg("失败,对话已结束");
return commonResponse; return commonResponse;
} }
//判断当前操作为上一轮的下一步 //判断当前操作为上一轮的下一步
......
...@@ -26,29 +26,47 @@ public interface PlantService { ...@@ -26,29 +26,47 @@ public interface PlantService {
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse seedCheck(OperationRequest operationReq);
/**
* 确认园丁播种
* @param operationReq
* @return CommonResponse
*/
CommonResponse seed(OperationRequest operationReq); CommonResponse seed(OperationRequest operationReq);
/** /**
* 取消园丁播种
* @param operationReq
* @return CommonResponse
*/
CommonResponse seedCancel(OperationRequest operationReq);
/**
* 园丁收获 * 园丁收获
* @param harvestRequest * @param harvestRequest
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse harvest(HarvestRequest harvestRequest); CommonResponse harvest(HarvestRequest harvestRequest);
/** /**
* 检查花圃种植情况 * 铲除植物,即检查花圃种植情况
* @param operationReq
* @return CommonResponse
*/
CommonResponse clearPlantCheck(OperationRequest operationReq);
/**
* 确认铲除植物
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse checkNursery(OperationRequest operationReq); CommonResponse clearPlant(OperationRequest operationReq);
/** /**
* 取消种植 * 收取并铲除植物
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse cancelPlant(OperationRequest operationReq); CommonResponse clearAfterHarvest(OperationRequest operationReq);
/** /**
* 收取后铲除植物 * 取消铲除植物
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse cancelAfterHarvest(OperationRequest operationReq); CommonResponse clearPlantCancel(OperationRequest operationReq);
} }
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qiwuai.garden.dao.GardenerUpgradeMapper"> <mapper namespace="com.qiwuai.garden.dao.GoodsMapper">
<select id="findAll" resultType="com.qiwuai.garden.pojo.GardenerUpgradePojo"> <select id="findAll" resultType="com.qiwuai.garden.pojo.GoodsPojo">
select select
id, seed_times, harvest_times, steal_success_times, help_times, cost_item_nums, create_time, update_time id, name, description, item_id, price, discount, discount_limit_time, level, create_time, update_time
from from
gardener_upgrade goods
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
<select id="findAll" resultType="com.qiwuai.garden.pojo.GardenerLevelPojo"> <select id="findAll" resultType="com.qiwuai.garden.pojo.GardenerLevelPojo">
select select
id, gardener_upgrade_id, gardener_skill_ids, id, task_ids, gardener_skill_ids, cost_item_nums,
nursery_num_max, pet_num_max, pet_field_max, steel_times_max, nursery_num_max, pet_num_max, pet_field_max, steel_times_max, price_add_prob,
create_time, update_time create_time, update_time
from from
gardener_level gardener_level
</select> </select>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<select id="searchAll" resultType="com.qiwuai.garden.pojo.ItemPojo"> <select id="searchAll" resultType="com.qiwuai.garden.pojo.ItemPojo">
select select
id, name, description, item_type_id, price, usable, create_time, update_time id, name, description, item_type_id, price, usable, salable, create_time, update_time
from from
item item
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment