整理控制器格式规范,统一修改以/view开头

pull/65/head
fengshuonan 4 years ago
parent e567f77da7
commit 08d6bfb0bf

3
.gitignore vendored

@ -30,11 +30,10 @@ logs/
### NetBeans ###
nbproject/private/
build/
nbbuild/
dist/
nbdist/
.nb-gradle/
*.log
tmp/
tmp/

@ -1,63 +0,0 @@
package cn.stylefeng.guns.core.util;
import javax.servlet.http.HttpServletRequest;
import java.net.InetAddress;
import java.net.UnknownHostException;
/**
* ip
*
* @author fengshuonan
* @Date 2018/9/27 10:47
*/
public class IpInfoUtils {
/**
* IP
*/
public static String getIpAddr(HttpServletRequest request) {
String ip = request.getHeader("x-forwarded-for");
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("WL-Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getRemoteAddr();
if (ip.equals("127.0.0.1")) {
//根据网卡取本机配置的IP
InetAddress inet = null;
try {
inet = InetAddress.getLocalHost();
} catch (UnknownHostException e) {
e.printStackTrace();
}
ip = inet.getHostAddress();
}
}
// 对于通过多个代理的情况第一个IP为客户端真实IP,多个IP按照','分割
if (ip != null && ip.length() > 15) {
if (ip.indexOf(",") > 0) {
ip = ip.substring(0, ip.indexOf(","));
}
}
if ("0:0:0:0:0:0:0:1".equals(ip)) {
ip = "127.0.0.1";
}
return ip;
}
/**
*
*/
public static String getHostName() {
try {
return InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
}
return "未知";
}
}

@ -8,14 +8,13 @@ import org.springframework.stereotype.Controller;
/**
*
*
* @author: jiawei
* @date: 2021/01/04 12:02
* @author jiawei
* @date 2021/1/10 14:28
*/
@Controller
@Slf4j
@ApiResource(name = "系统配置相关页面", path = "config")
@ApiResource(name = "系统配置相关页面")
public class ConfigViewController {
private String PREFIX = "/modular/sysConfig";
/**
* --
@ -23,9 +22,9 @@ public class ConfigViewController {
* @author jiawei
* @date 2021/1/4 13:33
*/
@GetResource(name = "系统配置-列表-视图", path = "", requiredPermission = false, requiredLogin = false)
@GetResource(name = "系统配置-列表-视图", path = "/view/config")
public String indexView() {
return PREFIX + "/sysConfig.html";
return "/modular/sysConfig/sysConfig.html";
}
/**
@ -33,11 +32,10 @@ public class ConfigViewController {
*
* @author jiawei
* @date 2021/1/4 13:34
* @param
*/
@GetResource(name = "系统配置—新增-视图", path = "/addView", requiredPermission = false, requiredLogin = false)
@GetResource(name = "系统配置—新增-视图", path = "/view/config/addView")
public String addView() {
return PREFIX + "/sysConfig_add.html";
return "/modular/sysConfig/sysConfig_add.html";
}
/**
@ -45,10 +43,10 @@ public class ConfigViewController {
*
* @author jiawei
* @date 2021/1/4 13:35
* @param
*/
@GetResource(name = "系统配置-修改-视图", path = "editView", requiredPermission = false, requiredLogin = false)
@GetResource(name = "系统配置-修改-视图", path = "/view/config/editView")
public String editView() {
return PREFIX + "/sysConfig_edit.html";
return "/modular/sysConfig/sysConfig_edit.html";
}
}

@ -8,29 +8,23 @@ import org.springframework.stereotype.Controller;
/**
*
*
* @param
* @return
* @author TSQ
* @date 2021/1/5 14:44
*/
@Controller
@Slf4j
@ApiResource(name = "操作日志管理相关的界面渲染", path = "/view/log")
@ApiResource(name = "操作日志管理相关的界面渲染")
public class LogViewController {
private String PREFIX = "/modular/system/log";
/**
*
*
* @param
* @return
* @author TSQ
* @date 2021/1/5 15:18
*/
@GetResource(name="操作日志管理列表", path ="", requiredPermission = false, requiredLogin = false)
public String indexView(){
return PREFIX + "/log.html";
@GetResource(name = "操作日志管理列表", path = "/view/log")
public String indexView() {
return "/modular/system/log/log.html";
}
}

@ -8,29 +8,23 @@ import org.springframework.stereotype.Controller;
/**
*
*
* @param
* @return
* @author TSQ
* @date 2021/1/5 14:42
*/
@Controller
@Slf4j
@ApiResource(name = "登陆日志管理相关的界面渲染", path = "loginLog")
@ApiResource(name = "登陆日志管理相关的界面渲染")
public class LoginLogViewController {
private String PREFIX = "/modular/system/log";
/**
*
*
* @param
* @return
*
* @author TSQ
* @date 2021/1/5 15:17
*/
@GetResource(name="登陆日志管理列表" , path = "", requiredPermission = false ,requiredLogin = false)
public String indexView(){
return PREFIX + "/login_log.html";
@GetResource(name = "登陆日志管理列表", path = "/view/loginLog")
public String indexView() {
return "/modular/system/log/login_log.html";
}
}

@ -6,27 +6,25 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
/**
*
*
*
* @author chenjinlong
* @date 2020/12/28 9:28
*/
@Controller
@Slf4j
@ApiResource(name = "职位管理相关的界面渲染", path = "/view/organization")
@ApiResource(name = "组织机构管理控制器界面")
public class OrganizationViewController {
private String PREFIX = "/modular/system/organization";
/**
* --
*
* @author chenjinlong
* @date 2020/11/04 11:07
*/
@GetResource(name = "机构管理-首页-视图", path = "")
@GetResource(name = "机构管理-首页-视图", path = "/view/organization")
public String indexView() {
return PREFIX + "/organization.html";
return "/modular/system/organization/organization.html";
}
/**
@ -35,9 +33,9 @@ public class OrganizationViewController {
* @author chenjinlong
* @date 2020/11/04 11:07
*/
@GetResource(name = "机构管理—新增-视图", path = "/addView")
@GetResource(name = "机构管理—新增-视图", path = "/view/organization/addView")
public String addView() {
return PREFIX + "/organization_add.html";
return "/modular/system/organization/organization_add.html";
}
/**
@ -46,8 +44,9 @@ public class OrganizationViewController {
* @author chenjinlong
* @date 2020/11/04 11:07
*/
@GetResource(name = "机构管理-修改-视图", path = "editView")
@GetResource(name = "机构管理-修改-视图", path = "/view/organization/editView")
public String editView() {
return PREFIX + "/organization_edit.html";
return "/modular/system/organization/organization_edit.html";
}
}

@ -13,20 +13,18 @@ import org.springframework.stereotype.Controller;
*/
@Controller
@Slf4j
@ApiResource(name = "职位管理相关的界面渲染", path = "/view/position")
@ApiResource(name = "职位管理相关的界面渲染")
public class PositionViewController {
private String PREFIX = "/modular/system/position";
/**
* --
*
* @author chenjinlong
* @date 2020/11/04 11:07
*/
@GetResource(name = "职位管理-首页-视图", path = "")
@GetResource(name = "职位管理-首页-视图", path = "/view/position")
public String indexView() {
return PREFIX + "/position.html";
return "/modular/system/position/position.html";
}
/**
@ -35,9 +33,9 @@ public class PositionViewController {
* @author chenjinlong
* @date 2020/11/04 11:07
*/
@GetResource(name = "职位管理-首页-视图", path = "/addView")
@GetResource(name = "职位管理-首页-视图", path = "/view/position/addView")
public String addView() {
return PREFIX + "/position_add.html";
return "/modular/system/position/position_add.html";
}
/**
@ -46,8 +44,9 @@ public class PositionViewController {
* @author chenjinlong
* @date 2020/11/04 11:07
*/
@GetResource(name = "职位管理-首页-视图", path = "editView")
@GetResource(name = "职位管理-首页-视图", path = "/view/position/editView")
public String editView() {
return PREFIX + "/position_edit.html";
return "/modular/system/position/position_edit.html";
}
}

@ -1,6 +1,6 @@
package cn.stylefeng.guns.modular.system.controller;
import cn.stylefeng.guns.modular.system.warpper.SystemHardwareWarpper;
import cn.stylefeng.guns.modular.system.warpper.SystemHardwareWrapper;
import cn.stylefeng.roses.kernel.resource.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.resource.api.annotation.GetResource;
import lombok.extern.slf4j.Slf4j;
@ -12,15 +12,13 @@ import org.springframework.ui.Model;
*
*
* @author chenli
* @Date 2020/12/30 16:40
* @date 2020/12/30 16:40
*/
@Controller
@Slf4j
@ApiResource(name = "项目监控")
public class MonitorController {
private String PREFIX = "/modular/frame";
@Value("${server.port}")
private String port;
@ -28,26 +26,26 @@ public class MonitorController {
*
*
* @author fengshuonan
* @Date 2018/12/24 22:43
* @date 2021/1/10 19:09
*/
@GetResource(name = "服务器监控", path = "/monitor/systemInfo", requiredPermission = false)
@GetResource(name = "服务器监控", path = "/view/monitor/systemInfo")
public String systemInfo(Model model) {
SystemHardwareWarpper systemHardwareWarpper = new SystemHardwareWarpper();
systemHardwareWarpper.copyTo();
model.addAttribute("server",systemHardwareWarpper);
return PREFIX+"/systemInfo.html";
SystemHardwareWrapper systemHardwareWrapper = new SystemHardwareWrapper();
systemHardwareWrapper.copyTo();
model.addAttribute("server", systemHardwareWrapper);
return "/modular/frame/systemInfo.html";
}
/**
* durid sql
* druid sql
*
* @author chenli
* @Date 2021/1/4 16:32
* @date 2021/1/4 16:32
*/
@GetResource(name = "SQL监控", path = "/monitor/druid", requiredPermission = false,requiredLogin = false)
public String duridInfo(Model model){
model.addAttribute("port",port);
return PREFIX+"/druid.html";
@GetResource(name = "SQL监控", path = "/view/monitor/druid")
public String druidInfo(Model model) {
model.addAttribute("port", port);
return "/modular/frame/druid.html";
}
}

@ -7,7 +7,7 @@ import lombok.Setter;
* CPU
*
* @author fengshuonan
* @Date 2019-07-13 13:42
* @date 2019-07-13 13:42
*/
@Setter
public class CpuInfo {

@ -12,10 +12,11 @@ import java.util.Date;
* JVM
*
* @author fengshuonan
* @Date 2019-07-13 13:42
* @date 2019-07-13 13:42
*/
@Setter
public class JvmInfo {
/**
* JVM(M)
*/

@ -7,10 +7,11 @@ import lombok.Setter;
*
*
* @author fengshuonan
* @Date 2019-07-13 13:42
* @date 2019-07-13 13:42
*/
@Setter
public class MemInfo {
/**
*
*/
@ -34,7 +35,6 @@ public class MemInfo {
return NumberUtil.div(used, (1024 * 1024 * 1024), 2);
}
public double getFree() {
return NumberUtil.div(free, (1024 * 1024 * 1024), 2);
}

@ -6,7 +6,7 @@ import lombok.Data;
*
*
* @author fengshuonan
* @Date 2019-07-13 13:42
* @date 2019-07-13 13:42
*/
@Data
public class SysFileInfo {

@ -6,7 +6,7 @@ import lombok.Data;
*
*
* @author fengshuonan
* @Date 2019-07-13 13:42
* @date 2019-07-13 13:42
*/
@Data
public class SysInfo {

@ -2,8 +2,8 @@ package cn.stylefeng.guns.modular.system.warpper;
import cn.hutool.core.net.NetUtil;
import cn.hutool.core.util.NumberUtil;
import cn.stylefeng.guns.core.util.IpInfoUtils;
import cn.stylefeng.guns.modular.system.model.*;
import cn.stylefeng.roses.kernel.rule.util.IpInfoUtils;
import lombok.Data;
import oshi.SystemInfo;
import oshi.hardware.CentralProcessor;
@ -23,10 +23,10 @@ import java.util.Properties;
*
*
* @author fengshuonan
* @Date 2019-07-13 13:42
* @date 2019-07-13 13:42
*/
@Data
public class SystemHardwareWarpper {
public class SystemHardwareWrapper {
private static final int OSHI_WAIT_SECOND = 1000;

@ -13,20 +13,18 @@ import org.springframework.stereotype.Controller;
*/
@Controller
@Slf4j
@ApiResource(name = "定时管理相关的界面渲染", path = "/sysTimers")
@ApiResource(name = "定时管理相关的界面渲染")
public class TimersViewController {
private String PREFIX = "/modular/system/timers";
/**
* --
*
* @author youyongkun
* @date 2021/1/6 4:28
*/
@GetResource(name = "定时管理-首页-视图", path = "", requiredPermission = false, requiredLogin = false)
@GetResource(name = "定时管理-首页-视图", path = "/view/sysTimers")
public String indexView() {
return PREFIX + "/timers.html";
return "/modular/system/timers/timers.html";
}
/**
@ -35,9 +33,9 @@ public class TimersViewController {
* @author youyongkun
* @date 2021/1/6 4:28
*/
@GetResource(name = "定时管理-添加-视图", path = "/addView", requiredPermission = false, requiredLogin = false)
@GetResource(name = "定时管理-添加-视图", path = "/view/sysTimers/addView")
public String addView() {
return PREFIX + "/timers_add.html";
return "/modular/system/timers/timers_add.html";
}
/**
@ -46,8 +44,8 @@ public class TimersViewController {
* @author youyongkun
* @date 2021/1/6 4:28
*/
@GetResource(name = "定时管理-修改-视图", path = "editView", requiredPermission = false, requiredLogin = false)
@GetResource(name = "定时管理-修改-视图", path = "/view/sysTimers/editView")
public String editView() {
return PREFIX + "/timers_edit.html";
return "/modular/system/timers/timers_edit.html";
}
}

@ -13,20 +13,18 @@ import org.springframework.stereotype.Controller;
*/
@Controller
@Slf4j
@ApiResource(name = "用户管理界面渲染", path = "/view/user")
@ApiResource(name = "用户管理界面渲染")
public class UserViewController {
private String PREFIX = "/modular/system/user";
/**
* --
*
* @author chenjinlong
* @date 2021/1/7 19:09
*/
@GetResource(name = "用户管理-首页-视图", path = "")
@GetResource(name = "用户管理-首页-视图", path = "/view/user")
public String indexView() {
return PREFIX + "/user.html";
return "/modular/system/user/user.html";
}
/**
@ -35,9 +33,9 @@ public class UserViewController {
* @author chenjinlong
* @date 2021/1/7 19:09
*/
@GetResource(name = "用户管理—新增-视图", path = "/addView")
@GetResource(name = "用户管理—新增-视图", path = "/view/user/addView")
public String addView() {
return PREFIX + "/user_add.html";
return "/modular/system/user/user_add.html";
}
/**
@ -46,8 +44,9 @@ public class UserViewController {
* @author chenjinlong
* @date 2021/1/7 19:09
*/
@GetResource(name = "用户管理-修改-视图", path = "editView")
@GetResource(name = "用户管理-修改-视图", path = "/view/user/editView")
public String editView() {
return PREFIX + "/user_edit.html";
return "/modular/system/user/user_edit.html";
}
}

@ -20,10 +20,10 @@ spring:
locale: zh_CN
serialization:
indent_output: false
main:
allow-bean-definition-overriding: true
scanner:
open: true
sys-log:
# db-数据库file-文件
type: db

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -18,4 +18,5 @@ layui.use(['element'], function () {
$(this).prev().find('.message-btn-more').remove();
$(this).prev().find('.message-list-empty').css('display', 'block');
});
});
});

@ -1,10 +1,8 @@
layui.use(['table', 'admin','func', 'HttpRequest', 'util'], function () {
layui.use(['table', 'func', 'HttpRequest'], function () {
var $ = layui.$;
var table = layui.table;
var func = layui.func;
var HttpRequest = layui.HttpRequest;
var admin = layui.admin;
var util = layui.util;
/**
* 参数配置管理
@ -48,7 +46,7 @@ layui.use(['table', 'admin','func', 'HttpRequest', 'util'], function () {
func.open({
height: 800,
title: '添加系统配置',
content: Feng.ctxPath + '/config/addView',
content: Feng.ctxPath + '/view/config/addView',
tableId: SysConfig.tableId
});
};
@ -74,7 +72,7 @@ layui.use(['table', 'admin','func', 'HttpRequest', 'util'], function () {
func.open({
height: 800,
title: '修改系统配置',
content: Feng.ctxPath + '/config/editView?configId=' + data.configId,
content: Feng.ctxPath + '/view/config/editView?configId=' + data.configId,
tableId: SysConfig.tableId
});
};
@ -86,7 +84,7 @@ layui.use(['table', 'admin','func', 'HttpRequest', 'util'], function () {
*/
SysConfig.onDeleteItem = function (data) {
var operation = function () {
var httpRequest = new HttpRequest(Feng.ctxPath + "/sysConfig/delete",'post', function (data) {
var httpRequest = new HttpRequest(Feng.ctxPath + "/sysConfig/delete", 'post', function (data) {
Feng.success("删除成功!");
table.reload(SysConfig.tableId);
}, function (data) {

@ -15,35 +15,26 @@ layui.use(['form', 'admin', 'HttpRequest'], function () {
var activeDictSelect = function () {
$("#groupCode").html('<option value="">请选择所属分类</option>');
// var httpRequest = new HttpRequest(Feng.ctxPath + "/dictType/dropDown", function (data) {
// var dictTypeList = res.data;
// dictTypeList.forEach(function (v, i) {
// $("#groupCode").append('<option value="' + v.dictCode+ '">' + v.dictName + '</option>');
// })
// form.render();
//
// }, function (data) {
// });
// httpRequest.start();
//要删掉
$("#groupCode").append('<option value="sys_config">' + '默认常量' + '</option>');
form.render();
};
//表单提交事件
form.on('submit(btnSubmit)', function (data) {
SysConfigInfoDlg.data = $.extend({"sysFlag":data.field.sysFlag?data.field.sysFlag:'N'},data.field)
SysConfigInfoDlg.data = $.extend({"sysFlag": data.field.sysFlag ? data.field.sysFlag : 'N'}, data.field)
var groupCode = $("#groupCode").find("option:selected").val()
if(!groupCode){
if (!groupCode) {
Feng.error("所属分类不能为空")
return false;
}
SysConfigInfoDlg.data = $.extend({"groupCode":groupCode},data.field)
SysConfigInfoDlg.data = $.extend({"groupCode": groupCode}, data.field)
var httpRequest = new HttpRequest(Feng.ctxPath + "/sysConfig/add",'post', function (data) {
var httpRequest = new HttpRequest(Feng.ctxPath + "/sysConfig/add", 'post', function (data) {
admin.closeThisDialog();
Feng.success("添加成功!");
admin.putTempData('formOk', true);
@ -58,4 +49,4 @@ layui.use(['form', 'admin', 'HttpRequest'], function () {
// 常量所属分类动态赋值
activeDictSelect();
});
});

@ -5,7 +5,7 @@ var SysConfigInfoDlg = {
data: {}
};
layui.use(['form', 'admin','selectPlus', 'HttpRequest'], function () {
layui.use(['form', 'admin', 'selectPlus', 'HttpRequest'], function () {
var $ = layui.jquery;
var form = layui.form;
var admin = layui.admin;
@ -13,22 +13,22 @@ layui.use(['form', 'admin','selectPlus', 'HttpRequest'], function () {
var HttpRequest = layui.HttpRequest;
// 获取详情信息,填充表单
var httpRequest = new HttpRequest(Feng.ctxPath + "/sysConfig/detail?configId=" + Feng.getUrlParam("configId"),'get');
var httpRequest = new HttpRequest(Feng.ctxPath + "/sysConfig/detail?configId=" + Feng.getUrlParam("configId"), 'get');
var result = httpRequest.start();
form.val('sysConfigForm', result.data);
// 系统参数样式
if(result.data){
if (result.data) {
var mData = result.data;
if(mData.sysFlag == 'Y'){
if (mData.sysFlag == 'Y') {
$('input[name="sysFlag"]').attr('checked', 'checked'); //改变开关为 开
}else{
} else {
$('input[name="sysFlag"]').removeAttr('checked'); //改变开关为 关
}
/*改变是否系统参数样式*/
$("input[name='sysFlag']").attr("disabled", "true"); form.render(); //系统参数禁用
$("input[name='sysFlag']").attr("disabled", "true");
form.render(); //系统参数禁用
$("input[name='sysFlag']").next().removeClass("layui-form-onswitch"); // 系统参数去掉样式
}
@ -36,37 +36,28 @@ layui.use(['form', 'admin','selectPlus', 'HttpRequest'], function () {
var activeDictSelect = function () {
$("#groupCode").html('<option value="">请选择所属分类</option>');
// var httpRequest = new HttpRequest(Feng.ctxPath + "/dictType/dropDown", function (data) {
// var dictTypeList = res.data;
// dictTypeList.forEach(function (v, i) {
// $("#groupCode").append('<option value="' + v.dictCode+ '">' + v.dictName + '</option>');
// })
// form.render();
//
// }, function (data) {
// });
// httpRequest.start();
//要删掉
$("#groupCode").append('<option value="sys_config">' + '默认常量' + '</option>');
$("#groupCode").val(result.data.groupCode);
form.render();
};
//表单提交事件
form.on('submit(btnSubmit)', function (data) {
SysConfigInfoDlg.data = $.extend({"sysFlag":data.field.sysFlag?data.field.sysFlag:'N'},data.field)
SysConfigInfoDlg.data = $.extend({"sysFlag": data.field.sysFlag ? data.field.sysFlag : 'N'}, data.field)
var groupCode = $("#groupCode").find("option:selected").val()
if(!groupCode){
if (!groupCode) {
Feng.error("所属分类不能为空")
return false;
}
SysConfigInfoDlg.data = $.extend({"groupCode":groupCode},data.field)
SysConfigInfoDlg.data = $.extend({"groupCode": groupCode}, data.field)
var httpRequest = new HttpRequest(Feng.ctxPath + "/sysConfig/edit",'post', function (data) {
var httpRequest = new HttpRequest(Feng.ctxPath + "/sysConfig/edit", 'post', function (data) {
admin.closeThisDialog();
Feng.success("修改成功!");
admin.putTempData('formOk', true);
@ -81,4 +72,4 @@ layui.use(['form', 'admin','selectPlus', 'HttpRequest'], function () {
// 常量所属分类动态赋值
activeDictSelect();
});
});

@ -45,7 +45,7 @@ layui.use(['table', 'admin', 'form', 'func', 'HttpRequest', 'dropdown'], functio
func.open({
height: 800,
title: '添加定时任务',
content: Feng.ctxPath + '/sysTimers/addView',
content: Feng.ctxPath + '/view/sysTimers/addView',
tableId: Position.tableId
});
};
@ -55,7 +55,7 @@ layui.use(['table', 'admin', 'form', 'func', 'HttpRequest', 'dropdown'], functio
func.open({
height: 800,
title: '修改定时任务',
content: Feng.ctxPath + '/sysTimers/editView?timerId=' + data.timerId,
content: Feng.ctxPath + '/view/sysTimers/editView?timerId=' + data.timerId,
tableId: Position.tableId
});
};

@ -13,7 +13,7 @@
<div class="layui-fluid">
<div class="layui-row layui-col-space15" >
<div class="layui-col-lg12">
<iframe id="iframe" src="http://localhost:${port}/druid/index.html" frameborder="no" width="100%" scrolling="auto" ></iframe>
<iframe id="iframe" src="${ctxPath}/druid/index.html" frameborder="no" width="100%" scrolling="auto" ></iframe>
</div>
</div>
</div>
@ -29,4 +29,4 @@
<script type="text/javascript" src="${ctxPath}/assets/common/libs/layui/layui.js?v=${constants.getReleaseVersion()}"></script>
<script type="text/javascript" src="${ctxPath}/assets/common/js/common.js?v=${constants.getReleaseVersion()}"></script>
</body>
</html>
</html>

Loading…
Cancel
Save