/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved.
 * <a>http://www.crunii.com</a>
 */
package com.crunii.micro.service.sysmgr.controller;

import com.crunii.micro.common.dto.Result;
import com.crunii.micro.domain.dto.Worker;
import com.crunii.micro.service.sysmgr.dto.sysmgr.VisitLogReq;
import com.crunii.micro.service.sysmgr.service.VisitLogService;
import com.crunii.micro.web.mvc.CurrWorker;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
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.RestController;
import springfox.documentation.annotations.ApiIgnore;

import javax.servlet.http.HttpServletRequest;

/**
 * @author shenhs create 2023/7/15 15:27
 */
@Api(tags = "访问日志记录")
@RestController
@Slf4j
@RequestMapping("/auth/visitLogController")
public class VisitLogController {

	@Autowired
	private VisitLogService visitLogService;

	@PostMapping("/doVisitLog")
	public Result<?> doVisitLog(@CurrWorker @ApiIgnore Worker worker, @RequestBody VisitLogReq req, HttpServletRequest request){
		visitLogService.saveVisitLog(worker, req, request);
		return Result.ofSuccess();
	}

}
