package com.mosty.operation.log.controller.provider;

import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.entity.log.SysOperLog;
import com.mosty.operation.log.BaseController;
import com.mosty.operation.log.service.SysOperLogService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * 操作日志记录
 * 
 * @author ruoyi
 */
@RestController
@Api(tags = "操作日志 for Feign调用")
@RequestMapping("/provider/monitor/operateLog")
public class SysOperlogProviderController extends BaseController {

    private String prefix = "monitor/operlog";

    @Autowired
    private SysOperLogService operLogService;

    // 添加操作日志
    @PostMapping("/save")
    public ResponseResult<Boolean> save(@RequestBody SysOperLog sysOperLog) {
        operLogService.insertOperlog(sysOperLog);
        return ResponseResult.success();
    }

    @GetMapping()
    public String operlog(){
        return prefix + "/operlog";
    }
}