package com.xhpc.activity.controller;


import com.xhpc.common.core.utils.SecurityUtils;
import com.xhpc.common.core.web.controller.BaseController;
import com.xhpc.common.core.web.page.TableDataInfo;
import com.xhpc.activity.service.SystemLogService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * 系统操作日志
 */
@RestController
@RequestMapping("/log/system")
public class SystemLogController extends BaseController {


    @Resource
    SystemLogService systemLogService;


    @GetMapping("/oper/getPage")
    public TableDataInfo getPage(@RequestParam(required = false) String tenantId,
                                 @RequestParam(required = false) Integer number){
        startPage();
        Map<String, Object> params = new HashMap<>();
        params.put("operName", SecurityUtils.getUsername());
        params.put("tenantId", tenantId);
        return getDataTable(systemLogService.getPage(params));
    }
}
