package com.cyksj.web.controller.manage.cms;

import com.cyksj.dto.Result;
import com.cyksj.enums.GatewayResponse;
import com.cyksj.model.entity.SysLog;
import com.ejlchina.searcher.BeanSearcher;
import com.ejlchina.searcher.SearchResult;
import com.ejlchina.searcher.util.MapUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/*
 *项目名: netflix
 *文件名: CmsSysController
 *创建者: JavaZou
 *创建时间:2023/3/9 10:44
 */
@RestController
@RequestMapping("/manage/sysLog")
@RequiredArgsConstructor
public class CmsSysController {
	private final BeanSearcher beanSearcher;

	private final HttpServletRequest request;

	@GetMapping
	public Result<SearchResult<SysLog>> sysLogListByCondition(){
		SearchResult<SysLog> search = beanSearcher.search(SysLog.class, MapUtils.flatBuilder(request.getParameterMap()).build());
		return GatewayResponse.SUCCESS.newBuilder().toResult(search);
	}
}
