package org.springblade.command.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.command.pojo.vo.FzyjVO;
import org.springblade.command.service.IFzyjService;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
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 java.util.Map;

/**
 * 反诈预警 控制器
 *
 * @author wth
 * @since 2024-07-12
 */
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/fzyj")
@Tag(name = "反诈预警接口", description = "反诈预警接口")
public class FzyjController extends BladeController {

	private final IFzyjService fzyjService;

	/**
	 * 预警列表
	 */
	@GetMapping("/pageByDept")
	@ApiOperationSupport(order = 1)
	@Operation(summary = "预警列表", description = "")
	public R pageByDept(@RequestParam Map<String, Object> params, Query query) {
		params.put("userId", AuthUtil.getUserId());
		IPage<FzyjVO> pages = fzyjService.pageByDept(Condition.getPage(query), params);
		return R.data(pages);
	}

}
