|
@@ -18,8 +18,8 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
-* controller类
|
|
|
|
|
-*/
|
|
|
|
|
|
|
+ * controller类
|
|
|
|
|
+ */
|
|
|
@Controller
|
|
@Controller
|
|
|
@RequestMapping("/gameInfo")
|
|
@RequestMapping("/gameInfo")
|
|
|
public class GameInfoController {
|
|
public class GameInfoController {
|
|
@@ -28,8 +28,8 @@ public class GameInfoController {
|
|
|
private GameInfoService gameInfoService;
|
|
private GameInfoService gameInfoService;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * <p>获取全部记录。</p>
|
|
|
|
|
- */
|
|
|
|
|
|
|
+ * <p>获取全部记录。</p>
|
|
|
|
|
+ */
|
|
|
@RequiresAuthentication
|
|
@RequiresAuthentication
|
|
|
@RequestMapping(value = "/all", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/all", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@@ -39,8 +39,8 @@ public class GameInfoController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * <p>根据Id。</p>
|
|
|
|
|
- */
|
|
|
|
|
|
|
+ * <p>根据Id。</p>
|
|
|
|
|
+ */
|
|
|
@RequestMapping(value = "/getGameInfo", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/getGameInfo", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public Result getGameInfo(@RequestParam(required = false, value = "id") String id) {
|
|
public Result getGameInfo(@RequestParam(required = false, value = "id") String id) {
|
|
@@ -49,8 +49,8 @@ public class GameInfoController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * <p>根据条件获取。</p>
|
|
|
|
|
- */
|
|
|
|
|
|
|
+ * <p>根据条件获取。</p>
|
|
|
|
|
+ */
|
|
|
@RequestMapping(value = "/getOne", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/getOne", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public Result getOne(GameInfo record) {
|
|
public Result getOne(GameInfo record) {
|
|
@@ -60,14 +60,14 @@ public class GameInfoController {
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * <p>分页查询。</p>
|
|
|
|
|
- */
|
|
|
|
|
|
|
+ * <p>分页查询。</p>
|
|
|
|
|
+ */
|
|
|
@RequestMapping(value = "/page", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/page", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public Result page(Page page, GameInfo record) {
|
|
public Result page(Page page, GameInfo record) {
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
|
|
|
|
|
- List<GameInfo> pp =gameInfoService.getGameInfoByPage(page, record);
|
|
|
|
|
|
|
+ List<GameInfo> pp = gameInfoService.getGameInfoByPage(page, record);
|
|
|
|
|
|
|
|
result.put(AppConstant.PAGE, page);
|
|
result.put(AppConstant.PAGE, page);
|
|
|
result.put("pp", pp);
|
|
result.put("pp", pp);
|
|
@@ -76,88 +76,97 @@ public class GameInfoController {
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * <p>保存。</p>
|
|
|
|
|
- */
|
|
|
|
|
|
|
+ * <p>保存。</p>
|
|
|
|
|
+ */
|
|
|
@RequestMapping(value = "/save", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/save", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public Result save(GameInfo record) {
|
|
public Result save(GameInfo record) {
|
|
|
boolean num = gameInfoService.createGameInfo(record);
|
|
boolean num = gameInfoService.createGameInfo(record);
|
|
|
if (num) {
|
|
if (num) {
|
|
|
- return new Result(true, record.getId());
|
|
|
|
|
|
|
+ return new Result(true, record.getId());
|
|
|
}
|
|
}
|
|
|
return new Result(false, "保存异常");
|
|
return new Result(false, "保存异常");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * <p>更新信息。</p>
|
|
|
|
|
- */
|
|
|
|
|
|
|
+ * <p>更新信息。</p>
|
|
|
|
|
+ */
|
|
|
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public Result updateGameInfo(GameInfo record) {
|
|
public Result updateGameInfo(GameInfo record) {
|
|
|
boolean num = gameInfoService.updateGameInfo(record);
|
|
boolean num = gameInfoService.updateGameInfo(record);
|
|
|
if (num) {
|
|
if (num) {
|
|
|
- return new Result(true, "保存成功");
|
|
|
|
|
|
|
+ return new Result(true, "保存成功");
|
|
|
}
|
|
}
|
|
|
return new Result(false, "保存异常");
|
|
return new Result(false, "保存异常");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * <p>删除。</p>
|
|
|
|
|
- */
|
|
|
|
|
|
|
+ * <p>删除。</p>
|
|
|
|
|
+ */
|
|
|
@RequestMapping(value = "/del", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/del", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public Result deleteGameInfo(GameInfo record) {
|
|
public Result deleteGameInfo(GameInfo record) {
|
|
|
|
|
|
|
|
boolean num = gameInfoService.deleteGameInfo(record);
|
|
boolean num = gameInfoService.deleteGameInfo(record);
|
|
|
if (num) {
|
|
if (num) {
|
|
|
- return new Result(true, "删除成功");
|
|
|
|
|
|
|
+ return new Result(true, "删除成功");
|
|
|
}
|
|
}
|
|
|
return new Result(false, "删除异常");
|
|
return new Result(false, "删除异常");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 导出Excel
|
|
|
|
|
- * @param request
|
|
|
|
|
- * @param response
|
|
|
|
|
- * @param record
|
|
|
|
|
- * @throws Exception
|
|
|
|
|
- */
|
|
|
|
|
|
|
+ * 导出Excel
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param request
|
|
|
|
|
+ * @param response
|
|
|
|
|
+ * @param record
|
|
|
|
|
+ * @throws Exception
|
|
|
|
|
+ */
|
|
|
@RequestMapping(value = "/exportExcel", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/exportExcel", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public void exportExcel(HttpServletRequest request, HttpServletResponse response, GameInfo record) throws Exception {
|
|
public void exportExcel(HttpServletRequest request, HttpServletResponse response, GameInfo record) throws Exception {
|
|
|
|
|
|
|
|
- List<GameInfo> gameInfos = gameInfoService.getGameInfoList(record);
|
|
|
|
|
|
|
+ List<GameInfo> gameInfos = gameInfoService.getGameInfoList(record);
|
|
|
|
|
|
|
|
|
|
|
|
|
String sheetName = "game_info";
|
|
String sheetName = "game_info";
|
|
|
String titleName = "游戏数据表";
|
|
String titleName = "游戏数据表";
|
|
|
String fileName = "游戏表";
|
|
String fileName = "游戏表";
|
|
|
int columnNumber = 12;
|
|
int columnNumber = 12;
|
|
|
- int[] columnWidth = { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 };
|
|
|
|
|
- String[] columnName = { "ID" , "删除标识" , "更新时间" , "更新人" , "创建时间" , "创建人" , "游戏名" , "类型" , "图标" , "排序" , "备注" , "可用" };
|
|
|
|
|
|
|
+ int[] columnWidth = {20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20};
|
|
|
|
|
+ String[] columnName = {"ID", "删除标识", "更新时间", "更新人", "创建时间", "创建人", "游戏名", "类型", "图标", "排序", "备注", "可用"};
|
|
|
String[][] dataList = new String[gameInfos.size()][12];
|
|
String[][] dataList = new String[gameInfos.size()][12];
|
|
|
|
|
|
|
|
for (int i = 0; i < gameInfos.size(); i++) {
|
|
for (int i = 0; i < gameInfos.size(); i++) {
|
|
|
|
|
|
|
|
- dataList[i][0] = String.valueOf(gameInfos.get(i).getId());
|
|
|
|
|
- dataList[i][1] = String.valueOf(gameInfos.get(i).getDelFlag());
|
|
|
|
|
- dataList[i][2] = String.valueOf(gameInfos.get(i).getUpdateTime());
|
|
|
|
|
- dataList[i][3] = String.valueOf(gameInfos.get(i).getUpdateUser());
|
|
|
|
|
- dataList[i][4] = String.valueOf(gameInfos.get(i).getCreateTime());
|
|
|
|
|
- dataList[i][5] = String.valueOf(gameInfos.get(i).getCreateUser());
|
|
|
|
|
- dataList[i][6] = String.valueOf(gameInfos.get(i).getGameName());
|
|
|
|
|
- dataList[i][7] = String.valueOf(gameInfos.get(i).getTypeFlag());
|
|
|
|
|
- dataList[i][8] = String.valueOf(gameInfos.get(i).getIcon());
|
|
|
|
|
- dataList[i][9] = String.valueOf(gameInfos.get(i).getRank());
|
|
|
|
|
- dataList[i][10] = String.valueOf(gameInfos.get(i).getRemark());
|
|
|
|
|
- dataList[i][11] = String.valueOf(gameInfos.get(i).getUseFlag());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ dataList[i][0] = String.valueOf(gameInfos.get(i).getId());
|
|
|
|
|
+ dataList[i][1] = String.valueOf(gameInfos.get(i).getDelFlag());
|
|
|
|
|
+ dataList[i][2] = String.valueOf(gameInfos.get(i).getUpdateTime());
|
|
|
|
|
+ dataList[i][3] = String.valueOf(gameInfos.get(i).getUpdateUser());
|
|
|
|
|
+ dataList[i][4] = String.valueOf(gameInfos.get(i).getCreateTime());
|
|
|
|
|
+ dataList[i][5] = String.valueOf(gameInfos.get(i).getCreateUser());
|
|
|
|
|
+ dataList[i][6] = String.valueOf(gameInfos.get(i).getGameName());
|
|
|
|
|
+ dataList[i][7] = String.valueOf(gameInfos.get(i).getTypeFlag());
|
|
|
|
|
+ dataList[i][8] = String.valueOf(gameInfos.get(i).getIcon());
|
|
|
|
|
+ dataList[i][9] = String.valueOf(gameInfos.get(i).getRank());
|
|
|
|
|
+ dataList[i][10] = String.valueOf(gameInfos.get(i).getRemark());
|
|
|
|
|
+ dataList[i][11] = String.valueOf(gameInfos.get(i).getUseFlag());
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
ExportExcelUtil.ExportWithResponse(sheetName, titleName, fileName,
|
|
ExportExcelUtil.ExportWithResponse(sheetName, titleName, fileName,
|
|
|
- columnNumber, columnWidth, columnName, dataList, response);
|
|
|
|
|
|
|
+ columnNumber, columnWidth, columnName, dataList, response);
|
|
|
|
|
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @RequestMapping(value = "/seasons", method = RequestMethod.GET)
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ public Result seasons(GameInfo record) {
|
|
|
|
|
+ List<GameInfo> pp = gameInfoService.getGameInfoSeasonsList(record);
|
|
|
|
|
+ return new Result(true, pp);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|