From 75b628dd4956cfa249b0260f9ccb1071e0ca3906 Mon Sep 17 00:00:00 2001 From: "@t2652009480" <2652009480@qq.com> Date: Fri, 11 Aug 2023 17:41:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=94=E7=94=A8=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 6 +- .../controller/AcademicController.java | 2 +- .../zhiyun03/academic/entity/Academic.java | 4 +- .../zhiyun03/academic/vo/AcademicVo.java | 2 +- .../controller/ApplicationController.java | 6 +- .../application/entity/Application.java | 4 +- .../application/vo/ApplicationVo.java | 2 +- .../com/zhiyun/zhiyun03/game/entity/Game.java | 4 +- .../com/zhiyun/zhiyun03/game/vo/GameVo.java | 2 +- .../controller/KnowledgeController.java | 2 +- .../zhiyun03/utils/common/JsonResult.java | 5 + .../templates/layui-v2.6.8/academicList.html | 115 +++++++++++++++ .../layui-v2.6.8/applicationList.html | 38 +++-- .../templates/layui-v2.6.8/gameList.html | 115 +++++++++++++++ .../templates/layui-v2.6.8/index.html | 10 +- .../templates/layui-v2.6.8/knowledgeList.html | 114 +++++++++++++++ .../templates/layui-v2.6.8/textualList.html | 136 ++++++++++++++++++ 17 files changed, 541 insertions(+), 26 deletions(-) create mode 100644 src/main/resources/templates/layui-v2.6.8/academicList.html create mode 100644 src/main/resources/templates/layui-v2.6.8/gameList.html create mode 100644 src/main/resources/templates/layui-v2.6.8/knowledgeList.html create mode 100644 src/main/resources/templates/layui-v2.6.8/textualList.html diff --git a/pom.xml b/pom.xml index 398067b..c2fb84c 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,11 @@ test - + + com.alibaba.fastjson2 + fastjson2 + 2.0.25 + com.alibaba diff --git a/src/main/java/com/zhiyun/zhiyun03/academic/controller/AcademicController.java b/src/main/java/com/zhiyun/zhiyun03/academic/controller/AcademicController.java index f4b068a..795034b 100644 --- a/src/main/java/com/zhiyun/zhiyun03/academic/controller/AcademicController.java +++ b/src/main/java/com/zhiyun/zhiyun03/academic/controller/AcademicController.java @@ -27,7 +27,7 @@ public class AcademicController { public JsonResult queryAcademic(@RequestParam(name="page") Integer page, @RequestParam(name="limit") Integer limit){ Page academicVoPage = academicService.queryAcademic(page,limit); - return JsonResult.success(academicVoPage); + return JsonResult.success(academicVoPage).setCount(academicVoPage.getTotal()); } @RequestMapping("/addAcademic") diff --git a/src/main/java/com/zhiyun/zhiyun03/academic/entity/Academic.java b/src/main/java/com/zhiyun/zhiyun03/academic/entity/Academic.java index 610e76d..9eabb20 100644 --- a/src/main/java/com/zhiyun/zhiyun03/academic/entity/Academic.java +++ b/src/main/java/com/zhiyun/zhiyun03/academic/entity/Academic.java @@ -32,8 +32,8 @@ public class Academic { /** * 学术简介 */ - @TableField(value = "academic_biref") - private String academicBiref; + @TableField(value = "academic_brief") + private String academicBrief; /** * 学术链接 diff --git a/src/main/java/com/zhiyun/zhiyun03/academic/vo/AcademicVo.java b/src/main/java/com/zhiyun/zhiyun03/academic/vo/AcademicVo.java index 2d0097a..fd5b198 100644 --- a/src/main/java/com/zhiyun/zhiyun03/academic/vo/AcademicVo.java +++ b/src/main/java/com/zhiyun/zhiyun03/academic/vo/AcademicVo.java @@ -24,7 +24,7 @@ public class AcademicVo { /** * 学术简介 */ - private String academicBiref; + private String academicBrief; /** * 学术链接 diff --git a/src/main/java/com/zhiyun/zhiyun03/application/controller/ApplicationController.java b/src/main/java/com/zhiyun/zhiyun03/application/controller/ApplicationController.java index ab394a5..8b4103a 100644 --- a/src/main/java/com/zhiyun/zhiyun03/application/controller/ApplicationController.java +++ b/src/main/java/com/zhiyun/zhiyun03/application/controller/ApplicationController.java @@ -12,10 +12,13 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; import org.springframework.web.context.annotation.ApplicationScope; +import springfox.documentation.spring.web.json.Json; import javax.annotation.Resource; import java.util.List; +import static com.alibaba.druid.sql.ast.TDDLHint.Type.JSON; + @Api("应用中心") @RestController @RequestMapping("/application") @@ -29,7 +32,8 @@ public class ApplicationController { public JsonResult queryApplication(@RequestParam(name="page") Integer page, @RequestParam(name="limit") Integer limit){ Page list = applicationService.queryApplication(page,limit); - return JsonResult.success(list); + + return JsonResult.success(list).setCount(list.getTotal()); } @RequestMapping("/queryDir") diff --git a/src/main/java/com/zhiyun/zhiyun03/application/entity/Application.java b/src/main/java/com/zhiyun/zhiyun03/application/entity/Application.java index 37e2779..55a08d7 100644 --- a/src/main/java/com/zhiyun/zhiyun03/application/entity/Application.java +++ b/src/main/java/com/zhiyun/zhiyun03/application/entity/Application.java @@ -34,8 +34,8 @@ public class Application { /** * 应用简介 */ - @TableField(value = "app_biref") - private String appBiref; + @TableField(value = "app_brief") + private String appBrief; /** * 链接 diff --git a/src/main/java/com/zhiyun/zhiyun03/application/vo/ApplicationVo.java b/src/main/java/com/zhiyun/zhiyun03/application/vo/ApplicationVo.java index 8a3199e..24070e5 100644 --- a/src/main/java/com/zhiyun/zhiyun03/application/vo/ApplicationVo.java +++ b/src/main/java/com/zhiyun/zhiyun03/application/vo/ApplicationVo.java @@ -11,7 +11,7 @@ public class ApplicationVo { private String appName; - private String appBiref; + private String appBrief; private String appUrl; diff --git a/src/main/java/com/zhiyun/zhiyun03/game/entity/Game.java b/src/main/java/com/zhiyun/zhiyun03/game/entity/Game.java index 9c8b00c..bd3b0b4 100644 --- a/src/main/java/com/zhiyun/zhiyun03/game/entity/Game.java +++ b/src/main/java/com/zhiyun/zhiyun03/game/entity/Game.java @@ -32,8 +32,8 @@ public class Game { /** * 大赛简介 */ - @TableField(value = "game_biref") - private String gameBiref; + @TableField(value = "game_brief") + private String gameBrief; /** * 大赛链接 diff --git a/src/main/java/com/zhiyun/zhiyun03/game/vo/GameVo.java b/src/main/java/com/zhiyun/zhiyun03/game/vo/GameVo.java index 0b43c49..c6e6978 100644 --- a/src/main/java/com/zhiyun/zhiyun03/game/vo/GameVo.java +++ b/src/main/java/com/zhiyun/zhiyun03/game/vo/GameVo.java @@ -30,7 +30,7 @@ public class GameVo { /** * 大赛简介 */ - private String gameBiref; + private String gameBrief; /** * 大赛链接 diff --git a/src/main/java/com/zhiyun/zhiyun03/knowledge/controller/KnowledgeController.java b/src/main/java/com/zhiyun/zhiyun03/knowledge/controller/KnowledgeController.java index 229eb77..5c2d3aa 100644 --- a/src/main/java/com/zhiyun/zhiyun03/knowledge/controller/KnowledgeController.java +++ b/src/main/java/com/zhiyun/zhiyun03/knowledge/controller/KnowledgeController.java @@ -26,7 +26,7 @@ public class KnowledgeController { public JsonResult queryKnowledge(@RequestParam(name="page") Integer page, @RequestParam(name="limit") Integer limit){ Page knowledge = knowledgeService.queryKnowledge(page,limit); - return JsonResult.success(knowledge); + return JsonResult.success(knowledge).setCount(knowledge.getTotal()); } @RequestMapping("/addKnowledge") diff --git a/src/main/java/com/zhiyun/zhiyun03/utils/common/JsonResult.java b/src/main/java/com/zhiyun/zhiyun03/utils/common/JsonResult.java index d702d29..76dfe07 100644 --- a/src/main/java/com/zhiyun/zhiyun03/utils/common/JsonResult.java +++ b/src/main/java/com/zhiyun/zhiyun03/utils/common/JsonResult.java @@ -1,8 +1,13 @@ package com.zhiyun.zhiyun03.utils.common; import lombok.Data; +import lombok.experimental.Accessors; +import springfox.documentation.spring.web.json.Json; + +import static com.alibaba.druid.sql.ast.TDDLHint.Type.JSON; @Data +@Accessors(chain = true) public class JsonResult { private String code; diff --git a/src/main/resources/templates/layui-v2.6.8/academicList.html b/src/main/resources/templates/layui-v2.6.8/academicList.html new file mode 100644 index 0000000..3c075fe --- /dev/null +++ b/src/main/resources/templates/layui-v2.6.8/academicList.html @@ -0,0 +1,115 @@ + + + + + Layui + + + + + + + + +
+ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/layui-v2.6.8/applicationList.html b/src/main/resources/templates/layui-v2.6.8/applicationList.html index c8d8be7..97c6f93 100644 --- a/src/main/resources/templates/layui-v2.6.8/applicationList.html +++ b/src/main/resources/templates/layui-v2.6.8/applicationList.html @@ -44,26 +44,26 @@ ,title: '应用中心' ,totalRow: true ,parseData: function(res){ + // var parse = JSON.parse(res.data.data); console.log('data',res) return { "code" : res.code, //解析接口状态 "count":res.count, //解析总页数 "msg" : res.msg, //解析提示文本 - "data" : res.data.data //解析数据列表 + "data" : res.data.records //解析数据列表 }; + } ,response:{ - statusName:'code', //规定返回的状态码字段为code statusCode:200 //规定成功的状态码为200 } ,cols: [[ {type: 'checkbox', fixed: 'left'} - ,{field:'id', title:'编号', width:120, sort: true, } - ,{field:'appName', title:'应用名称', width:120} - ,{field:'appBiref', title:'应用简介', width:120} - ,{field:'appUrl', title:'超链接', width:120} - ,{field:'dirName', title:'归属目录', width:120} - // ,{field:'courseIcon', title:'编号', width:120} + ,{field:'id', title:'编号', width:250, sort: true, } + ,{field:'appName', title:'应用名称', width:250} + ,{field:'appBrief', title:'应用简介', width:250} + ,{field:'appUrl', title:'超链接', width:250} + ,{field:'dirName', title:'归属目录', width:250} ,{fixed: 'right', title:'操作', toolbar: '#barDemo', width:150} ]] ,page: true @@ -86,6 +86,28 @@ break; }; }); + //监听行工具事件 + table.on('tool(test)', function(obj){ + var data = obj.data; + //console.log(obj) + if(obj.event === 'del'){ + layer.confirm('真的删除行么', function(index){ + //obj.del();//删除表结构 + layer.close(index); + + //获取要删除的服务的id + var deleteApplication = data.id; + + //发送Ajax到后台,进行删除操作 + $.get("http://localhost:8080/application/deleteApplication", { "id": deleteApplication}, + function(data){ + if("success" == data.msg){ + location.reload();//重新加载当前页面 + } + }); + }); + } + }); }); diff --git a/src/main/resources/templates/layui-v2.6.8/gameList.html b/src/main/resources/templates/layui-v2.6.8/gameList.html new file mode 100644 index 0000000..2b0b35b --- /dev/null +++ b/src/main/resources/templates/layui-v2.6.8/gameList.html @@ -0,0 +1,115 @@ + + + + + Layui + + + + + + + + +
+ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/layui-v2.6.8/index.html b/src/main/resources/templates/layui-v2.6.8/index.html index fc35088..9f92820 100644 --- a/src/main/resources/templates/layui-v2.6.8/index.html +++ b/src/main/resources/templates/layui-v2.6.8/index.html @@ -57,17 +57,17 @@ 课程中心
  • - 应用中心 + 应用中心
  • -
  • 大赛中心
  • -
  • 考证中心
  • -
  • 学术中心
  • -
  • 知识分享
  • +
  • 大赛中心
  • +
  • 考证中心
  • +
  • 学术中心
  • +
  • 知识分享
  • 下载中心
  • 就业中心
  • 服务相关
  • diff --git a/src/main/resources/templates/layui-v2.6.8/knowledgeList.html b/src/main/resources/templates/layui-v2.6.8/knowledgeList.html new file mode 100644 index 0000000..ac50485 --- /dev/null +++ b/src/main/resources/templates/layui-v2.6.8/knowledgeList.html @@ -0,0 +1,114 @@ + + + + + Layui + + + + + + + + +
    + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/layui-v2.6.8/textualList.html b/src/main/resources/templates/layui-v2.6.8/textualList.html new file mode 100644 index 0000000..283aef9 --- /dev/null +++ b/src/main/resources/templates/layui-v2.6.8/textualList.html @@ -0,0 +1,136 @@ + + + + + Layui + + + + + + + + +
    + + + + + + + + + + + + + + \ No newline at end of file