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

import com.cyksj.dto.Result;
import com.cyksj.enums.GatewayResponse;
import com.cyksj.model.views.NetflixErrorRecoverView;
import com.ejlchina.searcher.BeanSearcher;
import com.ejlchina.searcher.SearchResult;
import com.ejlchina.searcher.util.MapUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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;

/**
 * 项目名: yhlxj
 * 文件名: NetflixErrorRecoverController
 * 创建者: JavaZou
 * 创建时间:2025/6/24 13:41
 */
@Slf4j
@RequiredArgsConstructor
@RequestMapping("/manage/netflix")
@RestController
public class NetflixErrorRecoverController {
	private final BeanSearcher beanSearcher;

	private final HttpServletRequest request;

	/**
	 * 奈飞恢复列表
	 */
	@GetMapping("/get/recover/list")
	public Result<SearchResult<NetflixErrorRecoverView>> getRecoverList() {
		SearchResult<NetflixErrorRecoverView> search = beanSearcher.search(NetflixErrorRecoverView.class, MapUtils.flatBuilder(request.getParameterMap())
				.field(NetflixErrorRecoverView::getStatus, 0)
				.build());
		return GatewayResponse.SUCCESS.newBuilder().toResult(search);
	}
}
