cl
4 小时以前 52e09a6b7b7054fc51b9d4bf5f1fbec0a57e60f1
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
package com.vincent.rsf.server.system.controller;
 
import com.vincent.rsf.framework.common.R;
import com.vincent.rsf.httpaudit.entity.HttpAuditLog;
import com.vincent.rsf.server.common.domain.BaseParam;
import com.vincent.rsf.server.common.domain.PageParam;
import com.vincent.rsf.server.system.service.HttpAuditLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
 
import java.util.Arrays;
import java.util.Map;
 
@RestController
public class HttpAuditLogController extends BaseController {
 
    @Autowired
    private HttpAuditLogService httpAuditLogService;
 
    @PreAuthorize("hasAuthority('system:httpAuditLog:list')")
    @PostMapping("/httpAuditLog/page")
    public R page(@RequestBody Map<String, Object> map) {
        BaseParam baseParam = buildParam(map, BaseParam.class);
        PageParam<HttpAuditLog, BaseParam> pageParam = new PageParam<>(baseParam, HttpAuditLog.class);
        return R.ok().add(httpAuditLogService.page(pageParam, pageParam.buildWrapper(true)));
    }
 
    @PreAuthorize("hasAuthority('system:httpAuditLog:list')")
    @GetMapping("/httpAuditLog/{id}")
    public R get(@PathVariable("id") Long id) {
        return R.ok().add(httpAuditLogService.getById(id));
    }
 
    @PreAuthorize("hasAuthority('system:httpAuditLog:remove')")
    @PostMapping("/httpAuditLog/remove/{ids}")
    public R remove(@PathVariable Long[] ids) {
        if (!httpAuditLogService.removeByIds(Arrays.asList(ids))) {
            return R.error("Delete Fail");
        }
        return R.ok("Delete Success");
    }
}