| | |
| | | private MemberDao memberDao; |
| | | @Autowired |
| | | private YunDingProducter yunDingProducter; |
| | | @Autowired |
| | | private RedisUtils redisUtils; |
| | | |
| | | @Override |
| | | public Result findAllInfo() { |
| | |
| | | YdProductEntity ydProductEntity = ydProductDao.selectById(id); |
| | | if(ObjectUtil.isEmpty(ydProductEntity)){ |
| | | return Result.fail("请重新选择产品"); |
| | | } |
| | | |
| | | Integer status = ydProductEntity.getStatus(); |
| | | if(YdProductEntity.STATUE_WORK != status){ |
| | | if(YdProductEntity.STATUE_END == status){ |
| | | return Result.fail("产品已售罄"); |
| | | } |
| | | if(YdProductEntity.STATUE_READY == status){ |
| | | return Result.fail("产品未开售"); |
| | | } |
| | | } |
| | | |
| | | //限购总量 |
| | |
| | | return Result.ok("购买成功"); |
| | | } |
| | | |
| | | @Override |
| | | public Result getXchPrice() { |
| | | log.info("获取XCH当前价"); |
| | | String xchNewPrice = redisUtils.getString("XCH_NEW_PRICE"); |
| | | return Result.ok(xchNewPrice); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 去加减币币账户余额,减少产品的剩余数目 |