LogController.java
1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package com.bootdo.common.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import org.aspectj.weaver.tools.cache.AsynchronousFileCacheBacking.RemoveCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.bootdo.common.domain.LogDO;
import com.bootdo.common.domain.PageDO;
import com.bootdo.common.service.LogService;
import com.bootdo.common.utils.Query;
import com.bootdo.common.utils.R;
@RequestMapping("/common/log")
@Controller
public class LogController {
@Autowired
LogService logService;
String prefix = "common/log";
@GetMapping()
String log() {
return prefix + "/log";
}
@ResponseBody
@GetMapping("/list")
PageDO<LogDO> list(@RequestParam Map<String, Object> params) {
Query query = new Query(params);
PageDO<LogDO> page = logService.queryList(query);
return page;
}
@ResponseBody
@PostMapping("/remove")
R remove(Long id) {
if (logService.remove(id)>0) {
return R.ok();
}
return R.error();
}
@ResponseBody
@PostMapping("/batchRemove")
R batchRemove(@RequestParam("ids[]") Long[] ids) {
int r = logService.batchRemove(ids);
if (r > 0) {
return R.ok();
}
return R.error();
}
}