| @@ -41,12 +41,8 @@ public class WxGameController extends BaseController { | |||
| if (wxGame1 != null) { | |||
| WxGameTemplate gameTemplate = wxGameTemplateService.getById(wxGame1.getGameId()); | |||
| if (gameTemplate != null) { | |||
| Map map = new HashMap(); | |||
| map.put("id", wxGame1.getId()); | |||
| map.put("gameId", wxGame1.getGameId()); | |||
| map.put("imgUrl", gameTemplate.getImgUrl()); | |||
| map.put("url", gameTemplate.getUrl()); | |||
| return new ResultData(map); | |||
| wxGame1.setGameTemplate(gameTemplate); | |||
| return new ResultData(wxGame1); | |||
| } | |||
| } | |||
| @@ -55,7 +51,7 @@ public class WxGameController extends BaseController { | |||
| @ApiOperation("获取游戏参数(id,gameId必填)") | |||
| @GetMapping("getParams") | |||
| public ResultData getOne(@ModelAttribute WxGame wxGame) { | |||
| public ResultData getParams(@ModelAttribute WxGame wxGame) { | |||
| if (null == wxGame) wxGame = new WxGame(); | |||
| wxGame.setTenantId(getTenantId()); | |||
| wxGame.setStatus(EnumGameStatus.STATUS_THROW_IN.getCode()); | |||
| @@ -62,6 +62,128 @@ public class WxGame implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value = "已投放券信息") | |||
| protected List<Object> couponIdsList; // couponChannel | |||
| /**游戏名称*/ | |||
| @Transient | |||
| @io.swagger.annotations.ApiModelProperty(value="游戏名称",name="name") | |||
| private String name; | |||
| /**游戏链接*/ | |||
| @Transient | |||
| @io.swagger.annotations.ApiModelProperty(value="游戏链接",name="url") | |||
| private String url; | |||
| /**游戏logo,c端游戏入口使用*/ | |||
| @Transient | |||
| @io.swagger.annotations.ApiModelProperty(value="游戏logo,c端游戏入口使用",name="imgUrl") | |||
| private String imgUrl; | |||
| /**选项限制(-1:不做限制)*/ | |||
| @Transient | |||
| @io.swagger.annotations.ApiModelProperty(value="选项限制(-1:不做限制)",name="optionLimit") | |||
| private Integer optionLimit; | |||
| /**游戏规则说明*/ | |||
| @Transient | |||
| @io.swagger.annotations.ApiModelProperty(value="游戏规则说明",name="rules") | |||
| private String rules; | |||
| /**游戏类型(1:卡牌),目前无用*/ | |||
| @Transient | |||
| @io.swagger.annotations.ApiModelProperty(value="游戏类型(1:卡牌),目前无用",name="type") | |||
| private Integer type; | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public List<Long> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<Long> ids) { | |||
| this.ids = ids; | |||
| } | |||
| public String getSortColumns() { | |||
| return sortColumns; | |||
| } | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String tenantId) { | |||
| this.tenantId = tenantId; | |||
| } | |||
| public Long getGameId() { | |||
| return gameId; | |||
| } | |||
| public void setGameId(Long gameId) { | |||
| this.gameId = gameId; | |||
| } | |||
| public Integer getStatus() { | |||
| return status; | |||
| } | |||
| public void setStatus(Integer status) { | |||
| this.status = status; | |||
| } | |||
| public String getCouponIds() { | |||
| return couponIds; | |||
| } | |||
| public void setCouponIds(String couponIds) { | |||
| this.couponIds = couponIds; | |||
| } | |||
| public Date getValidStartDate() { | |||
| return validStartDate; | |||
| } | |||
| public void setValidStartDate(Date validStartDate) { | |||
| this.validStartDate = validStartDate; | |||
| } | |||
| public Date getValidEndDate() { | |||
| return validEndDate; | |||
| } | |||
| public void setValidEndDate(Date validEndDate) { | |||
| this.validEndDate = validEndDate; | |||
| } | |||
| public Integer getTriggleAction() { | |||
| return triggleAction; | |||
| } | |||
| public void setTriggleAction(Integer triggleAction) { | |||
| this.triggleAction = triggleAction; | |||
| } | |||
| public List<Object> getCouponIdsList() { | |||
| return couponIdsList; | |||
| } | |||
| public void setCouponIdsList(List<Object> couponIdsList) { | |||
| this.couponIdsList = couponIdsList; | |||
| } | |||
| public void setGameTemplate(WxGameTemplate gameTemplate) { | |||
| this.imgUrl = gameTemplate.getImgUrl(); | |||
| this.url = gameTemplate.getUrl(); | |||
| this.name = gameTemplate.getName(); | |||
| this.optionLimit = gameTemplate.getOptionLimit(); | |||
| this.rules = gameTemplate.getRules(); | |||
| this.type = gameTemplate.getType(); | |||
| } | |||
| public static enum Field { | |||
| Id_ASC("`id` ASC"), Id_DESC("`id` DESC") | |||
| , TenantId_ASC("`tenant_id` ASC"), TenantId_DESC("`tenant_id` DESC") | |||
| @@ -39,7 +39,73 @@ public class WxGameTemplate implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value="游戏类型(1:卡牌),目前无用",name="type") | |||
| private Integer type; | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public List<Long> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<Long> ids) { | |||
| this.ids = ids; | |||
| } | |||
| public String getSortColumns() { | |||
| return sortColumns; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| public String getUrl() { | |||
| return url; | |||
| } | |||
| public void setUrl(String url) { | |||
| this.url = url; | |||
| } | |||
| public String getImgUrl() { | |||
| return imgUrl; | |||
| } | |||
| public void setImgUrl(String imgUrl) { | |||
| this.imgUrl = imgUrl; | |||
| } | |||
| public Integer getOptionLimit() { | |||
| return optionLimit; | |||
| } | |||
| public void setOptionLimit(Integer optionLimit) { | |||
| this.optionLimit = optionLimit; | |||
| } | |||
| public String getRules() { | |||
| return rules; | |||
| } | |||
| public void setRules(String rules) { | |||
| this.rules = rules; | |||
| } | |||
| public Integer getType() { | |||
| return type; | |||
| } | |||
| public void setType(Integer type) { | |||
| this.type = type; | |||
| } | |||
| public static enum Field | |||
| { | |||
| @@ -15,6 +15,7 @@ import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxCouponChannelMapper; | |||
| import com.iformall.service.WxCouponChannelService; | |||
| import com.iformall.service.WxCouponService; | |||
| import com.iformall.service.WxGameTemplateService; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import java.util.*; | |||
| @@ -43,9 +44,18 @@ public class WxGameServiceImpl implements WxGameService { | |||
| @Autowired | |||
| WxCouponChannelService wxCouponChannelService; | |||
| @Autowired | |||
| WxGameTemplateService wxGameTemplateService; | |||
| @Override | |||
| public PageInfo<WxGame> listAsPage(WxGame record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxGameMapper.findList(record)); | |||
| PageInfo<WxGame> page = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxGameMapper.findList(record)); | |||
| if (page.getSize() > 0) { | |||
| for (WxGame game : page.getList()) { | |||
| game.setGameTemplate(wxGameTemplateService.getById(game.getGameId())); | |||
| } | |||
| } | |||
| return page; | |||
| } | |||
| @Override | |||