| @@ -50,6 +50,21 @@ public class WxGameController extends BaseController { | |||||
| return new ResultData(record); | return new ResultData(record); | ||||
| } | } | ||||
| @ApiOperation("获取游戏信息") | |||||
| @GetMapping("getOneGame") | |||||
| public ResultData getOneGame(@ModelAttribute WxGame wxGame) { | |||||
| if (wxGame == null) wxGame = new WxGame(); | |||||
| wxGame.setTenantId(getTenantId()); | |||||
| wxGame.setStatus(EnumGameStatus.STATUS_THROW_IN.getCode()); | |||||
| // 因为有算法要求,分成两步获取 | |||||
| WxGame record = wxGameService.getOne(wxGame); | |||||
| if (record == null) { | |||||
| return new ResultData(ErrorCode.GAME_NOT_FOUND); | |||||
| } | |||||
| return new ResultData(record); | |||||
| } | |||||
| @ApiOperation("添加游戏参与记录") | @ApiOperation("添加游戏参与记录") | ||||
| @PostMapping("addActionLog") | @PostMapping("addActionLog") | ||||
| @@ -52,10 +52,7 @@ public class WxGame implements Serializable { | |||||
| */ | */ | ||||
| @io.swagger.annotations.ApiModelProperty(value = "有效日期-结束", name = "validEndDate") | @io.swagger.annotations.ApiModelProperty(value = "有效日期-结束", name = "validEndDate") | ||||
| private Date validEndDate; | private Date validEndDate; | ||||
| /** | |||||
| * 触发条件(-1:不受限制,1:登录触发) | |||||
| */ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "触发条件(-1:不受限制,1:登录触发)", name = "triggleAction") | |||||
| @io.swagger.annotations.ApiModelProperty(value = "触发条件(-1:不受限制,1:登录触发, 2:主页固定入口,3:购买触发,4:核销触发,5:公众号链接触发,6:二维码触发)", name = "triggleAction") | |||||
| private Integer triggleAction; | private Integer triggleAction; | ||||
| /** | /** | ||||
| * 玩次数限制 | * 玩次数限制 | ||||
| @@ -24,6 +24,13 @@ public interface WxGameService { | |||||
| */ | */ | ||||
| WxGame getOne(WxGame record); | WxGame getOne(WxGame record); | ||||
| /** | |||||
| * 获取用户要玩的游戏信息 | |||||
| * @param record | |||||
| * @return | |||||
| */ | |||||
| WxGame getOneGame(WxGame record); | |||||
| ResultData addActionLog(Long userId, Long gameId, Long orderId); | ResultData addActionLog(Long userId, Long gameId, Long orderId); | ||||
| ResultData getCount(Long gameId, Long userId); | ResultData getCount(Long gameId, Long userId); | ||||
| @@ -84,6 +84,21 @@ public class WxGameServiceImpl implements WxGameService { | |||||
| return record; | return record; | ||||
| } | } | ||||
| @Override | |||||
| public WxGame getOneGame(WxGame wxGame) { | |||||
| try { | |||||
| WxGame record = wxGameMapper.selectOne(wxGame); | |||||
| if (record != null) { | |||||
| record.setGameTemplate(wxGameTemplateService.getById(record.getGameId())); | |||||
| record.setCouponIdsList(getParams(record)); | |||||
| } | |||||
| return record; | |||||
| } catch (Exception e) { | |||||
| logger.error("find game error: " + e.getMessage()); | |||||
| } | |||||
| return null; | |||||
| } | |||||
| @Override | @Override | ||||
| public ResultData addActionLog(Long userId, Long gameId, Long orderId) { | public ResultData addActionLog(Long userId, Long gameId, Long orderId) { | ||||