| | |
| | | package com.lf.server.service.all; |
| | | |
| | | import com.lf.server.entity.all.RedisCacheKey; |
| | | import com.lf.server.entity.sys.LoginEntity; |
| | | import com.lf.server.entity.sys.OperateEntity; |
| | | import com.lf.server.entity.sys.ResEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.FileHelper; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.service.sys.LoginService; |
| | | import com.lf.server.service.sys.OperateService; |
| | | import com.lf.server.service.sys.ResService; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | |
| | | public class ScheduleService { |
| | | @Autowired |
| | | private ResService resService; |
| | | |
| | | @Autowired |
| | | private LoginService loginService; |
| | | |
| | | @Autowired |
| | | private OperateService operateService; |
| | | |
| | | @Autowired |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | |
| | | |
| | | return jsonObject; |
| | | } |
| | | |
| | | /** |
| | | * 资源操作状态 |
| | | * |
| | | * @return |
| | | */ |
| | | |
| | | public JSONObject operateCount() { |
| | | List<OperateEntity> list = operateService.operateCount(); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | if (list.isEmpty()) { |
| | | return null; |
| | | } else { |
| | | List<JSONObject> lister = new ArrayList<JSONObject>(); |
| | | for (OperateEntity key : list) { |
| | | JSONObject map = new JSONObject(); |
| | | map.put("count", key.getCount()); |
| | | map.put("modular2", key.getModular2()); |
| | | lister.add(map); |
| | | } |
| | | jsonObject.put("operateCount", lister); |
| | | return jsonObject; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 用户登录状态 |
| | | * |
| | | * @return |
| | | */ |
| | | |
| | | public JSONObject userLoginCount() { |
| | | List<LoginEntity> list = loginService.selectLoginCounts(); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | if (list.isEmpty()) { |
| | | return null; |
| | | } else { |
| | | List<JSONObject> lister = new ArrayList<JSONObject>(); |
| | | for (LoginEntity key : list) { |
| | | JSONObject map = new JSONObject(); |
| | | map.put("count", key.getCount()); |
| | | map.put("optime", key.getOptime()); |
| | | lister.add(map); |
| | | } |
| | | jsonObject.put("userLoginCount", lister); |
| | | return jsonObject; |
| | | } |
| | | } |
| | | |
| | | } |