Просмотр исходного кода

[游戏接口][新增]:根据ID获取game信息

release_toaliyun_real
Stormeye Wu 7 лет назад
Родитель
Сommit
f9c730e912
4 измененных файлов: 38 добавлений и 4 удалений
  1. +15
    -0
      mallinkCApi/src/main/java/com/iformall/controller/WxGameController.java
  2. +1
    -4
      mallinkService/src/main/java/com/iformall/domain/po/WxGame.java
  3. +7
    -0
      mallinkService/src/main/java/com/iformall/service/WxGameService.java
  4. +15
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java

+ 15
- 0
mallinkCApi/src/main/java/com/iformall/controller/WxGameController.java Просмотреть файл

@@ -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")


+ 1
- 4
mallinkService/src/main/java/com/iformall/domain/po/WxGame.java Просмотреть файл

@@ -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;
/** /**
* 玩次数限制 * 玩次数限制


+ 7
- 0
mallinkService/src/main/java/com/iformall/service/WxGameService.java Просмотреть файл

@@ -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);


+ 15
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java Просмотреть файл

@@ -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) {


Загрузка…
Отмена
Сохранить