/**
 * 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.core.controller;

import com.crunii.micro.common.dto.Result;
import com.crunii.micro.platform.service.LogUrlService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <pre>
 * 针对这种内部调用的url，如果确实需要控制权限，可以配置basicAuthFilter拦截，
 * 一般来说不需要控制
 * </pre>
 *
 * @author 田平 create 2020年7月13日下午4:14:07
 */
@Api(tags = "配置需要记录操作日志的url,主要针对工作流外界项目判断url是否记录日志")
@RestController
@RequestMapping("/LogUrlCheckController")
public class LogUrlCheckController {

	@Autowired
	private LogUrlService logUrlService;

	@ApiOperation(value = "判断url是否需要记录日志")
	@RequestMapping(path = "/logUrlCheck", method = RequestMethod.POST)
	@ResponseBody
	public Result<Boolean> logUrlCheck(@RequestBody(required = false) String url) {
		Result<Boolean> result = new Result<Boolean>();
		result.setData(logUrlService.checkLogUrl(url));
		return result;
	}

}
