Commit 05beecd0 authored by Huang's avatar Huang
Browse files

no commit message

parent bc5dd330
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/JeeSpring">JeeSpring</a> All rights reserved..
*/
package com.jeespring.modules.server.rest;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jeespring.modules.server.service.ISysServerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.jeespring.common.persistence.Page;
import com.jeespring.common.web.AbstractBaseController;
import com.jeespring.common.utils.StringUtils;
import com.jeespring.modules.server.entity.SysServer;
import com.jeespring.modules.server.service.SysServerService;
import org.springframework.web.bind.annotation.RestController;
import com.jeespring.common.web.Result;
import com.jeespring.common.web.ResultFactory;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
/**
* 服务器监控Controller
* @author JeeSpring
* @version 2018-08-20
*/
@RestController
@RequestMapping(value = "/rest/sys/sysServer")
@Api(value="服务器监控接口", description="服务器监控接口")
public class SysServerRestController extends AbstractBaseController {
@Autowired
private ISysServerService sysServerService;
@RequestMapping(value = {"run"},method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="服务器运行状态(Content-Type为text/html)", notes="服务器运行状态(Content-Type为text/html)")
public String run() {
return "OK";
}
/**
* 服务器监控信息
*/
@RequestMapping(value = {"get"},method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="服务器监控信息(Content-Type为text/html)", notes="服务器监控信息(Content-Type为text/html)")
@ApiImplicitParam(name = "id", value = "服务器监控id", required = false, dataType = "String",paramType="query")
public Result getRequestParam(@RequestParam(required=false) String id) {
return get(id);
}
@RequestMapping(value = {"get/json"},method ={RequestMethod.POST})
@ApiOperation(value="服务器监控信息(Content-Type为application/json)", notes="服务器监控信息(Content-Type为application/json)")
@ApiImplicitParam(name = "id", value = "服务器监控id", required = false, dataType = "String",paramType="body")
public Result getRequestBody(@RequestBody(required=false) String id) {
return get(id);
}
private Result get(String id) {
SysServer entity = null;
if (StringUtils.isNotBlank(id)){
entity = sysServerService.getCache(id);
//entity = sysServerService.get(id);
}
if (entity == null){
entity = new SysServer();
}
Result result = ResultFactory.getSuccessResult();
result.setResultObject(entity);
return result;
}
/**
* 服务器监控列表(不包含页信息)
*/
//RequiresPermissions("sys:sysServer:findList")
@RequestMapping(value = {"findList"},method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="服务器监控列表(不包含页信息)(Content-Type为text/html)", notes="服务器监控列表(不包含页信息)(Content-Type为text/html)")
@ApiImplicitParam(name = "sysServer", value = "服务器监控", dataType = "SysServer",paramType="query")
public Result findListRequestParam(SysServer sysServer, HttpServletRequest request, HttpServletResponse response, Model model) {
return findList( sysServer,model);
}
@RequestMapping(value = {"findList/json"},method ={RequestMethod.POST})
@ApiOperation(value="服务器监控列表(不包含页信息)(Content-Type为application/json)", notes="服务器监控列表(不包含页信息)(Content-Type为application/json)")
@ApiImplicitParam(name = "sysServer", value = "服务器监控", dataType = "SysServer",paramType="body")
public Result findListRequestBody(@RequestBody SysServer sysServer, Model model) {
return findList( sysServer,model);
}
private Result findList(SysServer sysServer, Model model) {
List<SysServer> list = sysServerService.findListCache(sysServer);
//List<SysServer> list = sysServerService.findList(sysServer);
Result result = ResultFactory.getSuccessResult();
result.setResultObject(list);
return result;
}
/**
* 服务器监控列表(包含页信息)
*/
//RequiresPermissions("sys:sysServer:list")
@RequestMapping(value = {"list"},method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="服务器监控列表(包含页信息)(Content-Type为text/html)", notes="服务器监控列表(包含页信息)(Content-Type为text/html)")
@ApiImplicitParam(name = "sysServer", value = "服务器监控", dataType = "SysServer",paramType="query")
public Result listRequestParam(SysServer sysServer, HttpServletRequest request, HttpServletResponse response, Model model) {
return list(sysServer,model);
}
@RequestMapping(value = {"list/json"},method ={RequestMethod.POST})
@ApiOperation(value="服务器监控列表(包含页信息)(Content-Type为application/json)", notes="服务器监控列表(包含页信息)(Content-Type为application/json)")
@ApiImplicitParam(name = "sysServer", value = "服务器监控", dataType = "SysServer",paramType="body")
public Result listRequestBody(@RequestBody SysServer sysServer, Model model) {
return list(sysServer,model);
}
private Result list(SysServer sysServer, Model model) {
Page<SysServer> page = sysServerService.findPageCache(new Page<SysServer>(sysServer.getPageNo(),sysServer.getPageSize(),sysServer.getOrderBy()), sysServer);
//Page<SysServer> page = sysServerService.findPage(new Page<SysServer>(sysServer.getPageNo(),sysServer.getPageSize(),sysServer.getOrderBy()), sysServer);
Result result = ResultFactory.getSuccessResult();
result.setResultObject(page);
return result;
}
/**
* 服务器监控获取列表第一条记录
*/
//RequiresPermissions("sys:sysServer:listFrist")
@RequestMapping(value = {"listFrist"},method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="服务器监控获取列表第一条记录(Content-Type为text/html)", notes="服务器监控获取列表第一条记录(Content-Type为text/html)")
@ApiImplicitParam(name = "sysServer", value = "服务器监控", dataType = "SysServer",paramType="query")
public Result listFristRequestParam(SysServer sysServer, HttpServletRequest request, HttpServletResponse response, Model model) {
return listFrist(sysServer,model);
}
@RequestMapping(value = {"listFrist/json"},method ={RequestMethod.POST})
@ApiOperation(value="服务器监控获取列表第一条记录(Content-Type为application/json)", notes="服务器监控获取列表第一条记录(Content-Type为application/json)")
@ApiImplicitParam(name = "sysServer", value = "服务器监控", dataType = "SysServer",paramType="body")
public Result listFristRequestBody(@RequestBody SysServer sysServer, Model model) {
return listFrist(sysServer,model);
}
private Result listFrist(SysServer sysServer, Model model) {
Page<SysServer> page = sysServerService.findPageCache(new Page<SysServer>(sysServer.getPageNo(),sysServer.getPageSize(),sysServer.getOrderBy()), sysServer);
//Page<SysServer> page = sysServerService.findPage(new Page<SysServer>(sysServer.getPageNo(),sysServer.getPageSize(),sysServer.getOrderBy()), sysServer);
Result result = ResultFactory.getSuccessResult();
if(page.getList().size()>0){
result.setResultObject(page.getList().get(0));
}else{
result=ResultFactory.getErrorResult("没有记录!");
}
return result;
}
/**
* 保存服务器监控
*/
//RequiresPermissions(value={"sys:sysServer:add","sys:sysServer:edit"},logical=Logical.OR)
@RequestMapping(value = "save",method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="保存服务器监控(Content-Type为text/html)", notes="保存服务器监控(Content-Type为text/html)")
@ApiImplicitParam(name = "sysServer", value = "服务器监控", dataType = "SysServer",paramType="query")
public Result saveRequestParam(SysServer sysServer, Model model, RedirectAttributes redirectAttributes) {
return save(sysServer,model,redirectAttributes);
}
@RequestMapping(value = "save/json",method ={RequestMethod.POST})
@ApiOperation(value="保存服务器监控(Content-Type为application/json)", notes="保存服务器监控(Content-Type为application/json)")
@ApiImplicitParam(name = "sysServer", value = "服务器监控", dataType = "SysServer",paramType="body")
public Result saveRequestBody(@RequestBody SysServer sysServer, Model model, RedirectAttributes redirectAttributes) {
return save(sysServer,model,redirectAttributes);
}
private Result save(SysServer sysServer, Model model, RedirectAttributes redirectAttributes) {
if (!beanValidator(model, sysServer)){
Result result = ResultFactory.getErrorResult("数据验证失败");
}
sysServerService.save(sysServer);
Result result = ResultFactory.getSuccessResult("保存服务器监控成功");
return result;
}
/**
* 删除服务器监控
*/
//RequiresPermissions("sys:sysServer:del")
@RequestMapping(value = "delete",method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="删除服务器监控(Content-Type为text/html)", notes="删除服务器监控(Content-Type为text/html)")
@ApiImplicitParam(name = "sysServer", value = "服务器监控", dataType = "SysServer",paramType="query")
public Result deleteRequestParam(SysServer sysServer, RedirectAttributes redirectAttributes) {
return delete(sysServer,redirectAttributes);
}
@RequestMapping(value = "delete/json",method ={RequestMethod.POST})
@ApiOperation(value="删除服务器监控(Content-Type为application/json)", notes="删除服务器监控(Content-Type为application/json)")
@ApiImplicitParam(name = "sysServer", value = "服务器监控", dataType = "SysServer",paramType="body")
public Result deleteRequestBody(@RequestBody SysServer sysServer, RedirectAttributes redirectAttributes) {
return delete(sysServer,redirectAttributes);
}
private Result delete(SysServer sysServer, RedirectAttributes redirectAttributes) {
sysServerService.delete(sysServer);
Result result = ResultFactory.getSuccessResult("删除服务器监控成功");
return result;
}
/**
* 删除服务器监控(逻辑删除,更新del_flag字段为1,在表包含字段del_flag时,可以调用此方法,将数据隐藏)
*/
@RequestMapping(value = "deleteByLogic",method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="逻辑删除服务器监控(Content-Type为text/html)", notes="逻辑删除服务器监控(Content-Type为text/html)")
@ApiImplicitParam(name = "sysServer", value = "服务器监控", dataType = "SysServer",paramType="query")
public Result deleteByLogicRequestParam(SysServer sysServer, RedirectAttributes redirectAttributes) {
return deleteByLogic(sysServer,redirectAttributes);
}
/**
* 删除服务器监控(逻辑删除,更新del_flag字段为1,在表包含字段del_flag时,可以调用此方法,将数据隐藏)
*/
@RequestMapping(value = "deleteByLogic/json",method ={RequestMethod.POST})
@ApiOperation(value="逻辑删除服务器监控(Content-Type为application/json)", notes="逻辑删除服务器监控(Content-Type为application/json)")
@ApiImplicitParam(name = "sysServer", value = "服务器监控", dataType = "SysServer",paramType="body")
public Result deleteByLogicRequestBody(@RequestBody SysServer sysServer, RedirectAttributes redirectAttributes) {
return deleteByLogic(sysServer,redirectAttributes);
}
private Result deleteByLogic(SysServer sysServer, RedirectAttributes redirectAttributes) {
sysServerService.deleteByLogic(sysServer);
Result result = ResultFactory.getSuccessResult("删除服务器监控成功");
return result;
}
/**
* 批量删除服务器监控
*/
//RequiresPermissions("sys:sysServer:del")
@RequestMapping(value = "deleteAll",method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="批量删除服务器监控(Content-Type为text/html)", notes="批量删除服务器监控(Content-Type为text/html)")
@ApiImplicitParam(name = "ids", value = "服务器监控ids,用,隔开", required = false, dataType = "String",paramType="query")
public Result deleteAllRequestParam(String ids, RedirectAttributes redirectAttributes) {
return deleteAll(ids,redirectAttributes);
}
@RequestMapping(value = "deleteAll/json",method ={RequestMethod.POST})
@ApiOperation(value="批量删除服务器监控(Content-Type为application/json)", notes="批量删除服务器监控(Content-Type为application/json)")
@ApiImplicitParam(name = "ids", value = "服务器监控ids,用,隔开", required = false, dataType = "String",paramType="body")
public Result deleteAllRequestBody(@RequestBody String ids, RedirectAttributes redirectAttributes) {
return deleteAll(ids,redirectAttributes);
}
private Result deleteAll(String ids, RedirectAttributes redirectAttributes) {
String[] idArray = ids.split(",");
for(String id : idArray){
sysServerService.delete(sysServerService.get(id));
}
Result result = ResultFactory.getSuccessResult("删除服务器监控成功");
return result;
}
/**
* 批量删除服务器监控(逻辑删除,更新del_flag字段为1,在表包含字段del_flag时,可以调用此方法,将数据隐藏)
*/
@RequestMapping(value = "deleteAllByLogic",method ={RequestMethod.POST,RequestMethod.GET})
@ApiOperation(value="逻辑批量删除服务器监控(Content-Type为text/html)", notes="逻辑批量删除服务器监控(Content-Type为text/html)")
@ApiImplicitParam(name = "ids", value = "服务器监控ids,用,隔开", required = false, dataType = "String",paramType="query")
public Result deleteAllByLogicRequestParam(String ids, RedirectAttributes redirectAttributes) {
return deleteAllByLogic(ids,redirectAttributes);
}
/**
* 批量删除服务器监控(逻辑删除,更新del_flag字段为1,在表包含字段del_flag时,可以调用此方法,将数据隐藏)
*/
@RequestMapping(value = "deleteAllByLogic/json",method ={RequestMethod.POST})
@ApiOperation(value="逻辑批量删除服务器监控(Content-Type为application/json)", notes="逻辑批量删除服务器监控(Content-Type为application/json)")
@ApiImplicitParam(name = "ids", value = "服务器监控ids,用,隔开", required = false, dataType = "String",paramType="body")
public Result deleteAllByLogicRequestBody(@RequestBody String ids, RedirectAttributes redirectAttributes) {
return deleteAllByLogic(ids,redirectAttributes);
}
private Result deleteAllByLogic(String ids, RedirectAttributes redirectAttributes) {
String[] idArray = ids.split(",");
for(String id : idArray){
sysServerService.deleteByLogic(sysServerService.get(id));
}
Result result = ResultFactory.getSuccessResult("删除服务器监控成功");
return result;
}
}
\ No newline at end of file
package com.jeespring.modules.server.service;
import com.jeespring.common.persistence.InterfaceBaseDao;
import com.jeespring.common.persistence.InterfaceBaseService;
import com.jeespring.modules.server.entity.SysServer;
public interface ISysServerService extends InterfaceBaseService<SysServer> {
}
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/JeeSpring">JeeSpring</a> All rights reserved..
*/
package com.jeespring.modules.server.service;
import java.util.List;
//import org.springframework.stereotype.Service;
import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import com.jeespring.common.persistence.Page;
import com.jeespring.common.service.AbstractBaseService;
import com.jeespring.modules.server.entity.SysServer;
import com.jeespring.modules.server.dao.SysServerDao;
import com.alibaba.fastjson.JSON;
import com.jeespring.common.redis.RedisUtils;
import com.alibaba.dubbo.config.annotation.Service;
/**
* 服务器监控Service
* @author JeeSpring
* @version 2018-08-20
*/
//启用dubbo服务器时,要去掉下面注解
//com.alibaba.dubbo.config.annotation.Service(interfaceClass = ISysServerService.class,version = "1.0.0", timeout = 60000)
@org.springframework.stereotype.Service
@Transactional(readOnly = true)
public class SysServerService extends AbstractBaseService<SysServerDao, SysServer> implements ISysServerService{
/**
* redis caches
*/
@Autowired
private RedisUtils redisUtils;
@Override
public SysServer get(String id) {
//获取数据库数据
SysServer sysServer=super.get(id);
return sysServer;
}
@Override
public SysServer getCache(String id) {
//获取缓存数据
SysServer sysServer=(SysServer)redisUtils.get(RedisUtils.getIdKey(SysServerService.class.getName(),id));
if( sysServer!=null) {
return sysServer;
}
//获取数据库数据
sysServer=super.get(id);
//设置缓存数据
redisUtils.set(RedisUtils.getIdKey(SysServerService.class.getName(),id),sysServer);
return sysServer;
}
@Override
public List<SysServer> total(SysServer sysServer) {
//获取数据库数据
List<SysServer> sysServerList=super.total(sysServer);
return sysServerList;
}
@Override
public List<SysServer> totalCache(SysServer sysServer) {
//获取缓存数据
String totalKey = RedisUtils.getTotalKey(SysServerService.class.getName(),JSON.toJSONString(sysServer));
List<SysServer> sysServerList=(List<SysServer>)redisUtils.get(totalKey);
if(sysServerList!=null) {
return sysServerList;
}
//获取数据库数据
sysServerList=super.total(sysServer);
//设置缓存数据
redisUtils.set(totalKey,sysServerList);
return sysServerList;
}
@Override
public List<SysServer> findList(SysServer sysServer) {
//获取数据库数据
List<SysServer> sysServerList=super.findList(sysServer);
//设置缓存数据
return sysServerList;
}
@Override
public List<SysServer> findListCache(SysServer sysServer) {
//获取缓存数据
String findListKey = RedisUtils.getFindListKey(SysServerService.class.getName(),JSON.toJSONString(sysServer));
List<SysServer> sysServerList=(List<SysServer>)redisUtils.get(findListKey);
if(sysServerList!=null) {
return sysServerList;
}
//获取数据库数据
sysServerList=super.findList(sysServer);
//设置缓存数据
redisUtils.set(findListKey,sysServerList);
return sysServerList;
}
public SysServer findListFirst(SysServer sysServer) {;
//获取数据库数据
List<SysServer> sysServerList=super.findList(sysServer);
if(sysServerList.size()>0) {
sysServer = sysServerList.get(0);
}
return sysServer;
}
public SysServer findListFirstCache(SysServer sysServer) {
//获取缓存数据
String findListFirstKey = RedisUtils.getFindListFirstKey(SysServerService.class.getName(),JSON.toJSONString(sysServer));
SysServer sysServerRedis=(SysServer)redisUtils.get(findListFirstKey);
if(sysServerRedis!=null) {
return sysServerRedis;
}
//获取数据库数据
List<SysServer> sysServerList=super.findList(sysServer);
if(sysServerList.size()>0) {
sysServer = sysServerList.get(0);
} else {
sysServer = new SysServer();
}
//设置缓存数据
redisUtils.set(findListFirstKey,sysServer);
return sysServer;
}
@Override
public Page<SysServer> findPage(Page<SysServer> page, SysServer sysServer) {
//获取数据库数据
Page<SysServer> pageReuslt=super.findPage(page, sysServer);
return pageReuslt;
}
@Override
public Page<SysServer> findPageCache(Page<SysServer> page, SysServer sysServer) {
//获取缓存数据
String findPageKey = RedisUtils.getFindPageKey(SysServerService.class.getName(),JSON.toJSONString(page)+JSON.toJSONString(sysServer));
Page<SysServer> pageReuslt=(Page<SysServer>)redisUtils.get(findPageKey);
if(pageReuslt!=null) {
return pageReuslt;
}
//获取数据库数据
pageReuslt=super.findPage(page, sysServer);
//设置缓存数据
redisUtils.set(findPageKey,pageReuslt);
return pageReuslt;
}
@Override
@Transactional(readOnly = false)
public void save(SysServer sysServer) {
//保存数据库记录
super.save(sysServer);
//设置清除缓存数据
redisUtils.remove(RedisUtils.getIdKey(SysServerService.class.getName(),sysServer.getId()));
//清除列表和页面缓存数据
redisUtils.removePattern(RedisUtils.getFindListKeyPattern(SysServerService.class.getName()));
redisUtils.removePattern(RedisUtils.getFinPageKeyPattern(SysServerService.class.getName()));
}
@Override
@Transactional(readOnly = false)
public void delete(SysServer sysServer) {
//清除记录缓存数据
redisUtils.remove(RedisUtils.getIdKey(SysServerService.class.getName(),sysServer.getId()));
//删除数据库记录
super.delete(sysServer);
//清除列表和页面缓存数据
redisUtils.removePattern(RedisUtils.getFindListKeyPattern(SysServerService.class.getName()));
redisUtils.removePattern(RedisUtils.getFinPageKeyPattern(SysServerService.class.getName()));
}
@Override
@Transactional(readOnly = false)
public void deleteByLogic(SysServer sysServer) {
//清除记录缓存数据
redisUtils.remove(RedisUtils.getIdKey(SysServerService.class.getName(),sysServer.getId()));
//逻辑删除数据库记录
super.deleteByLogic(sysServer);
//清除列表和页面缓存数据
redisUtils.removePattern(RedisUtils.getFindListKeyPattern(SysServerService.class.getName()));
redisUtils.removePattern(RedisUtils.getFinPageKeyPattern(SysServerService.class.getName()));
}
}
\ No newline at end of file
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/JeeSpring">JeeSpring</a> All rights reserved..
*/
package com.jeespring.modules.server.web;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jeespring.modules.server.service.ISysServerService;
import com.jeespring.modules.sys.service.SysConfigService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.google.common.collect.Lists;
import com.jeespring.common.utils.DateUtils;
import com.jeespring.common.config.Global;
import com.jeespring.common.persistence.Page;
import com.jeespring.common.web.AbstractBaseController;
import com.jeespring.common.utils.StringUtils;
import com.jeespring.common.utils.excel.ExportExcel;
import com.jeespring.common.utils.excel.ImportExcel;
import com.jeespring.modules.server.entity.SysServer;
import com.jeespring.modules.server.service.SysServerService;
import com.alibaba.dubbo.config.annotation.Reference;
/**
* 服务器监控Controller
* @author JeeSpring
* @version 2018-08-20
*/
@Controller
@RequestMapping(value = "${adminPath}/sys/sysServer")
public class SysServerController extends AbstractBaseController {
//调用dubbo服务器是,要去掉下面注解
//@Reference(version = "1.0.0")
@Autowired
private ISysServerService sysServerService;
@Autowired
private SysConfigService sysConfigService;
@ModelAttribute
public SysServer get(@RequestParam(required=false) String id) {
SysServer entity = null;
if (StringUtils.isNotBlank(id)){
entity = sysServerService.getCache(id);
//entity = sysServerService.get(id);
}
if (entity == null){
entity = new SysServer();
}
return entity;
}
/**
* 服务器监控统计页面
*/
@RequiresPermissions("sys:sysServer:total")
@RequestMapping(value = {"total"})
public String totalView(SysServer sysServer, HttpServletRequest request, HttpServletResponse response, Model model) {
total(sysServer,request,response,model);
return "modules/sys/sysServerTotal";
}
private void total(SysServer sysServer, HttpServletRequest request, HttpServletResponse response, Model model) {
if(StringUtils.isEmpty(sysServer.getTotalType())){
sysServer.setTotalType("%Y-%m-%d");
}
//X轴的数据
List<String> xAxisData= new ArrayList<String>();
//Y轴的数据
Map<String,List<Double>> yAxisData = new HashMap<String,List<Double>>();
List<Double> countList = new ArrayList<Double>();
List<Double> sumList = new ArrayList<Double>();
if(sysServer.getOrderBy()==""){
sysServer.setOrderBy("totalDate");
}
List<SysServer> list = sysServerService.totalCache(sysServer);
//List<SysServer> list = sysServerService.total(sysServer);
model.addAttribute("list", list);
for(SysServer sysServerItem:list){
//x轴数据
xAxisData.add( sysServerItem.getTotalDate());
countList.add(Double.valueOf(sysServerItem.getTotalCount()));
}
yAxisData.put("数量", countList);
request.setAttribute("xAxisData", xAxisData);
request.setAttribute("yAxisData", yAxisData);
model.addAttribute("sumTotalCount", list.stream().mapToInt(SysServer::getTotalCount).sum());
//饼图数据
Map<String,Object> orientData= new HashMap<String,Object>();
for(SysServer sysServerItem:list){
orientData.put(sysServerItem.getTotalDate(), sysServerItem.getTotalCount());
}
model.addAttribute("orientData", orientData);
}
@RequiresPermissions("sys:sysServer:total")
@RequestMapping(value = {"totalMap"})
public String totalMap(SysServer sysServer, HttpServletRequest request, HttpServletResponse response, Model model) {
if(StringUtils.isEmpty(sysServer.getTotalType())){
sysServer.setTotalType("%Y-%m-%d");
}
List<SysServer> list = sysServerService.totalCache(sysServer);
//List<SysServer> list = sysServerService.total(sysServer);
model.addAttribute("sumTotalCount", list.stream().mapToInt(SysServer::getTotalCount).sum());
model.addAttribute("list", list);
return "modules/sys/sysServerTotalMap";
}
/**
* 服务器监控列表页面
*/
@RequiresPermissions("sys:sysServer:list")
@RequestMapping(value = {"list", ""})
public String list(SysServer sysServer, HttpServletRequest request, HttpServletResponse response, Model model) {
Page<SysServer> page = sysServerService.findPageCache(new Page<SysServer>(request, response), sysServer);
//Page<SysServer> page = sysServerService.findPage(new Page<SysServer>(request, response), sysServer);
model.addAttribute("page", page);
sysServer.setOrderBy("totalDate");
total(sysServer,request,response,model);
return "modules/sys/sysServerList";
}
/**
* 服务器监控列表页面
*/
@RequiresPermissions("sys:sysServer:list")
@RequestMapping(value = {"listVue"})
public String listVue(SysServer sysServer, HttpServletRequest request, HttpServletResponse response, Model model) {
Page<SysServer> page = sysServerService.findPageCache(new Page<SysServer>(request, response), sysServer);
//Page<SysServer> page = sysServerService.findPage(new Page<SysServer>(request, response), sysServer);
model.addAttribute("page", page);
return "modules/sys/sysServerListVue";
}
/**
* 服务器监控列表页面
*/
//RequiresPermissions("sys:sysServer:select")
@RequestMapping(value = {"select"})
public String select(SysServer sysServer, HttpServletRequest request, HttpServletResponse response, Model model) {
Page<SysServer> page = sysServerService.findPageCache(new Page<SysServer>(request, response), sysServer);
//Page<SysServer> page = sysServerService.findPage(new Page<SysServer>(request, response), sysServer);
model.addAttribute("page", page);
return "modules/sys/sysServerSelect";
}
/**
* 查看,增加,编辑服务器监控表单页面
*/
@RequiresPermissions(value={"sys:sysServer:view","sys:sysServer:add","sys:sysServer:edit"},logical=Logical.OR)
@RequestMapping(value = "form")
public String form(SysServer sysServer, Model model, HttpServletRequest request, HttpServletResponse response) {
model.addAttribute("action", request.getParameter("action"));
model.addAttribute("sysServer", sysServer);
if(request.getParameter("ViewFormType")!=null && "FormTwo".equals(request.getParameter("ViewFormType"))) {
return "modules/sys/sysServerFormTwo";
}
return "modules/sys/sysServerForm";
}
/**
* 保存服务器监控
*/
@RequiresPermissions(value={"sys:sysServer:add","sys:sysServer:edit"},logical=Logical.OR)
@RequestMapping(value = "save")
public String save(SysServer sysServer, Model model, RedirectAttributes redirectAttributes, HttpServletRequest request, HttpServletResponse response) {
if(sysConfigService.isDemoMode()){
addMessage(redirectAttributes, sysConfigService.isDemoModeDescription());
return "redirect:" + adminPath + "/sys/sysServer/?repage";
}
if (!beanValidator(model, sysServer)){
return form(sysServer, model,request,response);
}
sysServerService.save(sysServer);
addMessage(redirectAttributes, "保存服务器监控成功");
return "redirect:"+Global.getAdminPath()+"/sys/sysServer/?repage";
}
/**
* 删除服务器监控
*/
@RequiresPermissions("sys:sysServer:del")
@RequestMapping(value = "delete")
public String delete(SysServer sysServer, RedirectAttributes redirectAttributes) {
if(sysConfigService.isDemoMode()){
addMessage(redirectAttributes, sysConfigService.isDemoModeDescription());
return "redirect:" + adminPath + "/sys/sysServer/?repage";
}
sysServerService.delete(sysServer);
addMessage(redirectAttributes, "删除服务器监控成功");
return "redirect:"+Global.getAdminPath()+"/sys/sysServer/?repage";
}
/**
* 删除服务器监控(逻辑删除,更新del_flag字段为1,在表包含字段del_flag时,可以调用此方法,将数据隐藏)
*/
@RequiresPermissions(value={"sys:sysServer:del","sys:sysServer:delByLogic"},logical=Logical.OR)
@RequestMapping(value = "deleteByLogic")
public String deleteByLogic(SysServer sysServer, RedirectAttributes redirectAttributes) {
if(sysConfigService.isDemoMode()){
addMessage(redirectAttributes, sysConfigService.isDemoModeDescription());
return "redirect:" + adminPath + "/sys/sysServer/?repage";
}
sysServerService.deleteByLogic(sysServer);
addMessage(redirectAttributes, "逻辑删除服务器监控成功");
return "redirect:"+Global.getAdminPath()+"/sys/sysServer/?repage";
}
/**
* 批量删除服务器监控
*/
@RequiresPermissions("sys:sysServer:del")
@RequestMapping(value = "deleteAll")
public String deleteAll(String ids, RedirectAttributes redirectAttributes) {
if(sysConfigService.isDemoMode()){
addMessage(redirectAttributes, sysConfigService.isDemoModeDescription());
return "redirect:" + adminPath + "/sys/sysServer/?repage";
}
String[] idArray = ids.split(",");
for(String id : idArray){
sysServerService.delete(sysServerService.get(id));
}
addMessage(redirectAttributes, "删除服务器监控成功");
return "redirect:"+Global.getAdminPath()+"/sys/sysServer/?repage";
}
/**
* 批量删除服务器监控(逻辑删除,更新del_flag字段为1,在表包含字段del_flag时,可以调用此方法,将数据隐藏)
*/
@RequiresPermissions(value={"sys:sysServer:del","sys:sysServer:delByLogic"},logical=Logical.OR)
@RequestMapping(value = "deleteAllByLogic")
public String deleteAllByLogic(String ids, RedirectAttributes redirectAttributes) {
if(sysConfigService.isDemoMode()){
addMessage(redirectAttributes, sysConfigService.isDemoModeDescription());
return "redirect:" + adminPath + "/sys/sysServer/?repage";
}
String[] idArray = ids.split(",");
for(String id : idArray){
sysServerService.deleteByLogic(sysServerService.get(id));
}
addMessage(redirectAttributes, "删除服务器监控成功");
return "redirect:"+Global.getAdminPath()+"/sys/sysServer/?repage";
}
/**
* 导出excel文件
*/
@RequiresPermissions("sys:sysServer:export")
@RequestMapping(value = "export", method=RequestMethod.POST)
public String exportFile(SysServer sysServer, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
try {
String fileName = "服务器监控"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
Page<SysServer> page = sysServerService.findPage(new Page<SysServer>(request, response, -1), sysServer);
new ExportExcel("服务器监控", SysServer.class).setDataList(page.getList()).write(response, fileName).dispose();
return null;
} catch (Exception e) {
addMessage(redirectAttributes, "导出服务器监控记录失败!失败信息:"+e.getMessage());
}
return "redirect:"+Global.getAdminPath()+"/sys/sysServer/?repage";
}
/**
* 导入Excel数据
*/
@RequiresPermissions("sys:sysServer:import")
@RequestMapping(value = "import", method=RequestMethod.POST)
public String importFile(MultipartFile file, RedirectAttributes redirectAttributes) {
try {
int successNum = 0;
ImportExcel ei = new ImportExcel(file, 1, 0);
List<SysServer> list = ei.getDataList(SysServer.class);
for (SysServer sysServer : list){
sysServerService.save(sysServer);
}
addMessage(redirectAttributes, "已成功导入 "+successNum+" 条服务器监控记录");
} catch (Exception e) {
addMessage(redirectAttributes, "导入服务器监控失败!失败信息:"+e.getMessage());
}
return "redirect:"+Global.getAdminPath()+"/sys/sysServer/?repage";
}
/**
* 下载导入服务器监控数据模板
*/
@RequiresPermissions("sys:sysServer:import")
@RequestMapping(value = "import/template")
public String importFileTemplate(HttpServletResponse response, RedirectAttributes redirectAttributes) {
try {
String fileName = "服务器监控数据导入模板.xlsx";
List<SysServer> list = Lists.newArrayList();
new ExportExcel("服务器监控数据", SysServer.class, 1).setDataList(list).write(response, fileName).dispose();
return null;
} catch (Exception e) {
addMessage(redirectAttributes, "导入模板下载失败!失败信息:"+e.getMessage());
}
return "redirect:"+Global.getAdminPath()+"/sys/sysServer/?repage";
}
}
\ No newline at end of file
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/JeeSpring">JeeSpring</a> All rights reserved..
*/
package com.jeespring.modules.sys.dao;
import com.jeespring.common.persistence.TreeDao;
import org.apache.ibatis.annotations.Mapper;
import com.jeespring.modules.sys.entity.Area;
/**
* 区域DAO接口
* @author 黄炳桂 516821420@qq.com
* @version 2014-05-16
*/
@Mapper
public interface AreaDao extends TreeDao<Area> {
}
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/JeeSpring">JeeSpring</a> All rights reserved..
*/
package com.jeespring.modules.sys.dao;
import java.util.List;
import com.jeespring.common.persistence.InterfaceBaseDao;
import org.apache.ibatis.annotations.Mapper;
import com.jeespring.modules.sys.entity.Dict;
/**
* 字典DAO接口
* @author 黄炳桂 516821420@qq.com
* @version 2014-05-16
*/
@Mapper
public interface DictDao extends InterfaceBaseDao<Dict> {
List<String> findTypeList(Dict dict);
}
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/JeeSpring">JeeSpring</a> All rights reserved..
*/
package com.jeespring.modules.sys.dao;
import org.apache.ibatis.annotations.Mapper;
import com.jeespring.common.persistence.InterfaceBaseDao;
import com.jeespring.modules.sys.entity.Log;
/**
* 日志DAO接口
* @author 黄炳桂 516821420@qq.com
* @version 2014-05-16
*/
@Mapper
public interface LogDao extends InterfaceBaseDao<Log> {
void empty();
}
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/JeeSpring">JeeSpring</a> All rights reserved..
*/
package com.jeespring.modules.sys.dao;
import java.util.List;
import com.jeespring.common.persistence.InterfaceBaseDao;
import com.jeespring.modules.sys.entity.Menu;
import org.apache.ibatis.annotations.Mapper;
/**
* 菜单DAO接口
* @author 黄炳桂 516821420@qq.com
* @version 2014-05-16
*/
@Mapper
public interface MenuDao extends InterfaceBaseDao<Menu> {
List<Menu> findByParentIdsLike(Menu menu);
List<Menu> findByUserId(Menu menu);
int updateParentIds(Menu menu);
int updateSort(Menu menu);
}
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/JeeSpring">JeeSpring</a> All rights reserved..
*/
package com.jeespring.modules.sys.dao;
import com.jeespring.common.persistence.TreeDao;
import com.jeespring.modules.sys.entity.Office;
import org.apache.ibatis.annotations.Mapper;
/**
* 机构DAO接口
* @author 黄炳桂 516821420@qq.com
* @version 2014-05-16
*/
@Mapper
public interface OfficeDao extends TreeDao<Office> {
Office getByCode(String code);
}
package com.jeespring.modules.sys.dao;
import com.jeespring.modules.monitor.entity.OnlineSession;
import com.jeespring.modules.sys.entity.SysUserOnline;
import com.jeespring.modules.sys.service.SysUserOnlineService;
import org.apache.shiro.session.Session;
import org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import java.io.Serializable;
import java.util.Date;
/**
* 针对自定义的ShiroSession的db操作
*
* @author JeeSpring
*/
@Service
public class OnlineSessionDAO extends EnterpriseCacheSessionDAO
{
/**
* 同步session到数据库的周期 单位为毫秒(默认1分钟)
*/
@Value("${shiro.session.dbSyncPeriod}")
private int dbSyncPeriod=1;
/**
* 上次同步数据库的时间戳
*/
private static final String LAST_SYNC_DB_TIMESTAMP = OnlineSessionDAO.class.getName() + "LAST_SYNC_DB_TIMESTAMP";
@Autowired
private SysUserOnlineService sysUserOnlineService;
@Autowired
private OnlineSessionFactory onlineSessionFactory;
public OnlineSessionDAO()
{
super();
}
public OnlineSessionDAO(long expireTime)
{
super();
}
/**
* 根据会话ID获取会话
*
* @param sessionId 会话ID
* @return ShiroSession
*/
@Override
protected Session doReadSession(Serializable sessionId)
{
SysUserOnline sysUserOnline=new SysUserOnline();
if(sysUserOnlineService==null ){
sysUserOnline.setId(String.valueOf(sessionId));
}else{
sysUserOnline = sysUserOnlineService.get(String.valueOf(sessionId));
}
if (sysUserOnline == null)
{
return null;
}
return onlineSessionFactory.createSession(sysUserOnline);
}
/**
* 当会话过期/停止(如用户退出时)属性等会调用
*/
@Override
protected void doDelete(Session session)
{
OnlineSession onlineSession = (OnlineSession) session;
if (null == onlineSession)
{
return;
}
onlineSession.setStatus(OnlineSession.OnlineStatus.off_line);
SysUserOnline sysUserOnline=new SysUserOnline();
sysUserOnline.setId(String.valueOf(onlineSession.getId()));
sysUserOnlineService.delete(sysUserOnline);
}
}
package com.jeespring.modules.sys.dao;
import com.jeespring.modules.monitor.entity.OnlineSession;
import com.jeespring.modules.sys.entity.SysUserOnline;
import eu.bitwalker.useragentutils.UserAgent;
import org.apache.shiro.session.Session;
import org.apache.shiro.session.mgt.SessionContext;
import org.apache.shiro.session.mgt.SessionFactory;
import org.apache.shiro.web.session.mgt.WebSessionContext;
import org.springframework.stereotype.Component;
import com.jeespring.common.utils.StringUtils;
import com.jeespring.common.utils.ServletUtils;
import com.jeespring.common.utils.IpUtils;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
/**
* 自定义sessionFactory会话
*
* @author JeeSpring
*/
@Service
public class OnlineSessionFactory implements SessionFactory
{
public Session createSession(SysUserOnline userOnline)
{
OnlineSession onlineSession = userOnline.getSession();
if (StringUtils.isNotNull(onlineSession) && onlineSession.getId() == null)
{
onlineSession.setId(userOnline.getId());
}
return userOnline.getSession();
}
@Override
public Session createSession(SessionContext initData)
{
OnlineSession session = new OnlineSession();
if (initData != null && initData instanceof WebSessionContext)
{
WebSessionContext sessionContext = (WebSessionContext) initData;
HttpServletRequest request = (HttpServletRequest) sessionContext.getServletRequest();
if (request != null)
{
UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
// 获取客户端操作系统
String os = userAgent.getOperatingSystem().getName();
// 获取客户端浏览器
String browser = userAgent.getBrowser().getName();
session.setHost(IpUtils.getIpAddr(request));
session.setBrowser(browser);
session.setOs(os);
}
}
return session;
}
}
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/JeeSpring">JeeSpring</a> All rights reserved..
*/
package com.jeespring.modules.sys.dao;
import org.apache.ibatis.annotations.Mapper;
import com.jeespring.common.persistence.InterfaceBaseDao;
import com.jeespring.modules.sys.entity.Role;
/**
* 角色DAO接口
* @author 黄炳桂 516821420@qq.com
* @version 2013-12-05
*/
@Mapper
public interface RoleDao extends InterfaceBaseDao<Role> {
Role getByName(Role role);
Role getByEnname(Role role);
/**
* 维护角色与菜单权限关系
* @param role
* @return
*/
int deleteRoleMenu(Role role);
int insertRoleMenu(Role role);
/**
* 维护角色与公司部门关系
* @param role
* @return
*/
int deleteRoleOffice(Role role);
int insertRoleOffice(Role role);
}
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/JeeSpring">JeeSpring</a> All rights reserved..
*/
package com.jeespring.modules.sys.dao;
import com.jeespring.common.persistence.InterfaceBaseDao;
import org.apache.ibatis.annotations.Mapper;
import com.jeespring.modules.sys.entity.SysConfig;
/**
* 系统配置DAO接口
* @author 黄炳桂 516821420@qq.com
* @version 2017-11-17
*/
@Mapper
public interface SysConfigDao extends InterfaceBaseDao<SysConfig> {
}
\ No newline at end of file
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/JeeSpring">JeeSpring</a> All rights reserved..
*/
package com.jeespring.modules.sys.dao;
import com.jeespring.common.persistence.TreeDao;
import com.jeespring.common.persistence.annotation.MyBatisDao;
import org.apache.ibatis.annotations.Mapper;
import com.jeespring.modules.sys.entity.SysConfigTree;
/**
* 系统配置DAO接口
* @author JeeSpring
* @version 2018-08-22
*/
@Mapper
public interface SysConfigTreeDao extends TreeDao<SysConfigTree> {
}
\ No newline at end of file
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/JeeSpring">JeeSpring</a> All rights reserved..
*/
package com.jeespring.modules.sys.dao;
import com.jeespring.common.persistence.TreeDao;
import com.jeespring.common.persistence.annotation.MyBatisDao;
import org.apache.ibatis.annotations.Mapper;
import com.jeespring.modules.sys.entity.SysDictTree;
/**
* 数据字典DAO接口
* @author JeeSpring
* @version 2018-08-22
*/
@Mapper
public interface SysDictTreeDao extends TreeDao<SysDictTree> {
}
\ No newline at end of file
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/JeeSpring">JeeSpring</a> All rights reserved..
*/
package com.jeespring.modules.sys.dao;
import com.jeespring.common.persistence.InterfaceBaseDao;
import org.apache.ibatis.annotations.Mapper;
import com.jeespring.modules.sys.entity.SysUserOnline;
/**
* 在线用户记录DAO接口
* @author JeeSpring
* @version 2018-08-16
*/
@Mapper
public interface SysUserOnlineDao extends InterfaceBaseDao<SysUserOnline> {
}
\ No newline at end of file
/**
* Copyright &copy; 2015-2020 <a href="http://www.jeespring.org/">JeeSpring</a> All rights reserved.
*/
package com.jeespring.modules.sys.dao;
import com.jeespring.common.persistence.InterfaceBaseDao;
import com.jeespring.modules.sys.entity.SystemConfig;
import org.apache.ibatis.annotations.Mapper;
/**
* 系统配置DAO接口
* @author liugf
* @version 2016-02-07
*/
@Mapper
public interface SystemConfigDao extends InterfaceBaseDao<SystemConfig> {
}
\ No newline at end of file
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/JeeSpring">JeeSpring</a> All rights reserved..
*/
package com.jeespring.modules.sys.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.jeespring.common.persistence.InterfaceBaseDao;
import com.jeespring.modules.sys.entity.User;
/**
* 用户DAO接口
* @author 黄炳桂 516821420@qq.com
* @version 2014-05-16
*/
@Mapper
public interface UserDao extends InterfaceBaseDao<User> {
/**
* 根据登录名称查询用户
* @param loginName
* @return
*/
User getByLoginName(User user);
/**
* 通过OfficeId获取用户列表,仅返回用户id和name(树查询用户时用)
* @param user
* @return
*/
List<User> findUserByOfficeId(User user);
/**
* 查询全部用户数目
* @return
*/
long findAllCount(User user);
/**
* 更新用户密码
* @param user
* @return
*/
int updatePasswordById(User user);
/**
* 更新登录信息,如:登录IP、登录时间
* @param user
* @return
*/
int updateLoginInfo(User user);
/**
* 删除用户角色关联数据
* @param user
* @return
*/
int deleteUserRole(User user);
/**
* 插入用户角色关联数据
* @param user
* @return
*/
int insertUserRole(User user);
/**
* 更新用户信息
* @param user
* @return
*/
int updateUserInfo(User user);
/**
* 插入好友
*/
int insertFriend(@Param("id") String id, @Param("userId") String userId, @Param("friendId") String friendId);
/**
* 查找好友
*/
User findFriend(@Param("userId") String userId, @Param("friendId") String friendId);
/**
* 删除好友
*/
void deleteFriend(@Param("userId") String userId, @Param("friendId") String friendId);
/**
*
* 获取我的好友列表
*
*/
List<User> findFriends(User currentUser);
/**
*
* 查询用户-->用来添加到常用联系人
*
*/
List<User> searchUsers(User user);
/**
*
*/
List<User> findListByOffice(User user);
}
/**
* * Copyright &copy; 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/JeeSpring">JeeSpring</a> All rights reserved..
*/
package com.jeespring.modules.sys.entity;
import org.hibernate.validator.constraints.Length;
import com.jeespring.common.persistence.TreeEntity;
/**
* 区域Entity
* @author 黄炳桂 516821420@qq.com
* @version 2013-05-15
*/
public class Area extends TreeEntity<Area> {
private static final long serialVersionUID = 1L;
// private Area parent; // 父级编号
// private String parentIds; // 所有父级编号
private String code; // 区域编码
// private String name; // 区域名称
// private Integer sort; // 排序
private String type; // 区域类型(1:国家;2:省份、直辖市;3:地市;4:区县)
public Area(){
super();
this.sort = 30;
}
public Area(String id){
super(id);
}
// @JsonBackReference
// @NotNull
@Override
public Area getParent() {
return parent;
}
@Override
public void setParent(Area parent) {
this.parent = parent;
}
//
// @Length(min=1, max=2000)
// public String getParentIds() {
// return parentIds;
// }
//
// public void setParentIds(String parentIds) {
// this.parentIds = parentIds;
// }
//
// @Length(min=1, max=100)
// public String getName() {
// return name;
// }
//
// public void setName(String name) {
// this.name = name;
// }
//
// public Integer getSort() {
// return sort;
// }
//
// public void setSort(Integer sort) {
// this.sort = sort;
// }
@Length(min=1, max=1)
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Length(min=0, max=100)
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
//
// public String getParentId() {
// return parent != null && parent.getId() != null ? parent.getId() : "0";
// }
@Override
public String toString() {
return name;
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment