| @@ -31,6 +31,7 @@ public class WxGameController extends BaseController { | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | ||||
| public ResultData list(@ModelAttribute WxGame wxGame,Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxGame wxGame,Integer pageNum, Integer pageSize) { | ||||
| if (null == wxGame) wxGame = new WxGame(); | if (null == wxGame) wxGame = new WxGame(); | ||||
| wxGame.setTenantId(getTenantId()); | |||||
| final PageInfo<WxGame> page = wxGameService.listAsPage(wxGame, pageNum, pageSize); | final PageInfo<WxGame> page = wxGameService.listAsPage(wxGame, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -40,6 +41,7 @@ public class WxGameController extends BaseController { | |||||
| public ResultData add(@RequestBody WxGame wxGame) { | public ResultData add(@RequestBody WxGame wxGame) { | ||||
| //Assert.notNull(wxGame.getName(), "角色名不能为空"); | //Assert.notNull(wxGame.getName(), "角色名不能为空"); | ||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | ||||
| wxGame.setTenantId(getTenantId()); | |||||
| wxGameService.saveOrUpdate(wxGame); | wxGameService.saveOrUpdate(wxGame); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -47,6 +49,7 @@ public class WxGameController extends BaseController { | |||||
| @ApiOperation("根据id更新接口") | @ApiOperation("根据id更新接口") | ||||
| @PostMapping("update") | @PostMapping("update") | ||||
| public ResultData update(@RequestBody WxGame wxGame) { | public ResultData update(@RequestBody WxGame wxGame) { | ||||
| wxGame.setTenantId(getTenantId()); | |||||
| wxGameService.saveOrUpdate(wxGame); | wxGameService.saveOrUpdate(wxGame); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -13,6 +13,8 @@ import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import java.util.List; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxGameTemplate") | @RequestMapping("wxGameTemplate") | ||||
| public class WxGameTemplateController extends BaseController { | public class WxGameTemplateController extends BaseController { | ||||
| @@ -22,16 +24,24 @@ public class WxGameTemplateController extends BaseController { | |||||
| private WxGameTemplateService wxGameTemplateService; | private WxGameTemplateService wxGameTemplateService; | ||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | |||||
| @GetMapping("listPage") | |||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| public ResultData list(@ModelAttribute WxGameTemplate wxGameTemplate, Integer pageNum, Integer pageSize) { | |||||
| public ResultData listPage(@ModelAttribute WxGameTemplate wxGameTemplate, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxGameTemplate) wxGameTemplate = new WxGameTemplate(); | if (null == wxGameTemplate) wxGameTemplate = new WxGameTemplate(); | ||||
| final PageInfo<WxGameTemplate> page = wxGameTemplateService.listAsPage(wxGameTemplate, pageNum, pageSize); | final PageInfo<WxGameTemplate> page = wxGameTemplateService.listAsPage(wxGameTemplate, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("列表接口") | |||||
| @GetMapping("list") | |||||
| public ResultData list(@ModelAttribute WxGameTemplate wxGameTemplate) { | |||||
| if (null == wxGameTemplate) wxGameTemplate = new WxGameTemplate(); | |||||
| final List<WxGameTemplate> page = wxGameTemplateService.getList(wxGameTemplate); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增接口") | @ApiOperation("新增接口") | ||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxGameTemplate wxGameTemplate) { | public ResultData add(@RequestBody WxGameTemplate wxGameTemplate) { | ||||
| @@ -8,7 +8,6 @@ import javax.persistence.Transient; | |||||
| import java.io.Serializable; | import java.io.Serializable; | ||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | |||||
| @Table(name = "wx_game") | @Table(name = "wx_game") | ||||
| @Data | @Data | ||||
| @@ -60,7 +59,11 @@ public class WxGame implements Serializable { | |||||
| private Integer triggleAction; | private Integer triggleAction; | ||||
| @Transient | @Transient | ||||
| protected List<Object> CouponIdsList; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "已投放券信息") | |||||
| protected List<Object> couponIdsList; // couponChannel | |||||
| @Transient | |||||
| private List<Long> couponIdList; // couponId List, 前端选券使用 | |||||
| public static enum Field { | public static enum Field { | ||||
| Id_ASC("`id` ASC"), Id_DESC("`id` DESC"), TenantId_ASC("`tenant_id` ASC"), TenantId_DESC("`tenant_id` DESC"), GameId_ASC("`game_id` ASC"), GameId_DESC("`game_id` DESC"), Status_ASC("`status` ASC"), Status_DESC("`status` DESC"), ValidStartDate_ASC("`valid_start_date` ASC"), ValidStartDate_DESC("`valid_start_date` DESC"), ValidEndDate_ASC("`valid_end_date` ASC"), ValidEndDate_DESC("`valid_end_date` DESC"), TriggleAction_ASC("`triggle_action` ASC"), TriggleAction_DESC("`triggle_action` DESC"); | Id_ASC("`id` ASC"), Id_DESC("`id` DESC"), TenantId_ASC("`tenant_id` ASC"), TenantId_DESC("`tenant_id` DESC"), GameId_ASC("`game_id` ASC"), GameId_DESC("`game_id` DESC"), Status_ASC("`status` ASC"), Status_DESC("`status` DESC"), ValidStartDate_ASC("`valid_start_date` ASC"), ValidStartDate_DESC("`valid_start_date` DESC"), ValidEndDate_ASC("`valid_end_date` ASC"), ValidEndDate_DESC("`valid_end_date` DESC"), TriggleAction_ASC("`triggle_action` ASC"), TriggleAction_DESC("`triggle_action` DESC"); | ||||
| @@ -3,6 +3,8 @@ package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.WxGameTemplate; | import com.iformall.domain.po.WxGameTemplate; | ||||
| import java.util.List; | |||||
| public interface WxGameTemplateService { | public interface WxGameTemplateService { | ||||
| /** | /** | ||||
| @@ -14,6 +16,14 @@ public interface WxGameTemplateService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| PageInfo<WxGameTemplate> listAsPage(WxGameTemplate record, Integer pageIndex, Integer pageSize); | PageInfo<WxGameTemplate> listAsPage(WxGameTemplate record, Integer pageIndex, Integer pageSize); | ||||
| /** | |||||
| * 根据实体查询列表 | |||||
| * | |||||
| * @param record | |||||
| * @return | |||||
| */ | |||||
| List<WxGameTemplate> getList(WxGameTemplate record); | |||||
| /** | /** | ||||
| * 根据Id获得实体 | * 根据Id获得实体 | ||||
| @@ -11,6 +11,8 @@ import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import java.util.List; | |||||
| @Service | @Service | ||||
| public class WxGameTemplateServiceImpl implements WxGameTemplateService { | public class WxGameTemplateServiceImpl implements WxGameTemplateService { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @@ -24,6 +26,11 @@ public class WxGameTemplateServiceImpl implements WxGameTemplateService { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxGameTemplateMapper.findList(record)); | return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxGameTemplateMapper.findList(record)); | ||||
| } | } | ||||
| @Override | |||||
| public List<WxGameTemplate> getList(WxGameTemplate record) { | |||||
| return wxGameTemplateMapper.findList(record); | |||||
| } | |||||
| @Override | @Override | ||||
| public WxGameTemplate getById(Long id) { | public WxGameTemplate getById(Long id) { | ||||
| return wxGameTemplateMapper.selectByPrimaryKey(id); | return wxGameTemplateMapper.selectByPrimaryKey(id); | ||||