|
|
@@ -0,0 +1,64 @@
|
|
|
+package com.fdkankan.manage.controller;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.fdkankan.common.response.ResultData;
|
|
|
+import com.fdkankan.manage.bean.MenuBean;
|
|
|
+import com.fdkankan.manage.entity.Agent;
|
|
|
+import com.fdkankan.manage.entity.OperLog;
|
|
|
+import com.fdkankan.manage.service.IAgentService;
|
|
|
+import com.fdkankan.redis.constant.RedisKey;
|
|
|
+import com.fdkankan.redis.util.RedisUtil;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.domain.PageRequest;
|
|
|
+import org.springframework.data.domain.Pageable;
|
|
|
+import org.springframework.data.domain.Sort;
|
|
|
+import org.springframework.data.domain.Sort.Direction;
|
|
|
+import org.springframework.data.mongodb.core.MongoTemplate;
|
|
|
+import org.springframework.data.mongodb.core.query.Query;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * TODO
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author dengsixing
|
|
|
+ * @since 2022/5/27
|
|
|
+ **/
|
|
|
+@RestController
|
|
|
+@RequestMapping("/service/manage/operLog")
|
|
|
+public class OperLogController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ MongoTemplate mongoTemplate;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ RedisUtil redisUtil;
|
|
|
+
|
|
|
+ @GetMapping("/pageOperLog")
|
|
|
+ public ResultData pageOperLog(){
|
|
|
+
|
|
|
+ Pageable pageable_new = PageRequest
|
|
|
+ .of(1, 3, Sort.by(Direction.DESC, "requestTime"));
|
|
|
+ Sort sort = pageable_new.getSort();
|
|
|
+ Query query = new Query();
|
|
|
+ query.skip(0).limit(3);
|
|
|
+ query.with(sort);
|
|
|
+ List<OperLog> operLogs = mongoTemplate.find(query, OperLog.class);
|
|
|
+
|
|
|
+ return ResultData.ok(operLogs);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|