package com.dsk.web.controller.dsk;


import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.R;
import com.dsk.common.core.domain.model.*;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.system.dskService.EnterpriseCreditService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
*@Description: 央企经营管理系统企业风险相关
*@Author: zhangyi
*@date: 2023/5/17 9:03
*/
@Slf4j
@RestController
@RequestMapping(value = "/enterpriseCredit")
public class EnterpriseCreditController {
    @Autowired
    EnterpriseCreditService enterpriseCreditService;

    @RequestMapping(value = "/penalizePage", method = RequestMethod.POST)
    @ApiOperation(value = "行政处罚列表（openApi）")
    public TableDataInfo penalizePage(@RequestBody @Valid EnterpriseCreditPenalizePageBody body) throws Exception {
        return enterpriseCreditService.penalizePage(body);
    }

    @RequestMapping(value = "/penalizeReasonType", method = RequestMethod.POST)
    @ApiOperation(value = "行政处罚类型（openApi）")
    public R penalizeReasonType(@RequestBody @Valid EnterpriseCreditPenalizeReasonTypeBody body) throws Exception {
        return enterpriseCreditService.penalizeReasonType(body);
    }

    @RequestMapping(value = "/abnormalPage", method = RequestMethod.POST)
    @ApiOperation(value = "经营异常列表（openApi）")
    public TableDataInfo abnormalPage(@RequestBody @Valid EnterpriseCreditAbnormalPageBody body) throws Exception {
        return enterpriseCreditService.abnormalPage(body);
    }

    @RequestMapping(value = "/abnormalYears", method = RequestMethod.POST)
    @ApiOperation(value = "经营异常年份（openApi）")
    public R abnormalYears(@RequestBody @Valid EnterpriseCreditAbnormalYearsBody body) throws Exception {
        return enterpriseCreditService.abnormalYears(body);
    }

    @RequestMapping(value = "/executedPersonsPage", method = RequestMethod.POST)
    @ApiOperation(value = "被执行人列表（openApi）")
    public TableDataInfo executedPersonsPage(@RequestBody @Valid EnterpriseCreditExecutedPersonsPageBody body) throws Exception {
        return enterpriseCreditService.executedPersonsPage(body);
    }

    @RequestMapping(value = "/executedPage", method = RequestMethod.POST)
    @ApiOperation(value = "失信被执行人列表（openApi）")
    public TableDataInfo executedPage(@RequestBody @Valid EnterpriseCreditExecutedPageBody body) throws Exception {
        return enterpriseCreditService.executedPage(body);
    }

    @RequestMapping(value = "/lawsuitsPage", method = RequestMethod.POST)
    @ApiOperation(value = "裁判文书列表（openApi）")
    public TableDataInfo lawsuitsPage(@RequestBody @Valid EnterpriseCreditLawsuitsPageBody body) throws Exception {
        return enterpriseCreditService.lawsuitsPage(body);
    }

    @RequestMapping(value = "/lawsuitsCauseAction", method = RequestMethod.POST)
    @ApiOperation(value = "裁判文书案由（openApi）")
    public R lawsuitsCauseAction(@RequestBody @Valid EnterpriseCreditLawsuitsCauseActionBody body) throws Exception {
        return enterpriseCreditService.lawsuitsCauseAction(body);
    }

    @RequestMapping(value = "/lawsuitsRole", method = RequestMethod.POST)
    @ApiOperation(value = "裁判文书身份（openApi）")
    public R lawsuitsRole(@RequestBody @Valid EnterpriseCreditLawsuitsRoleBody body) throws Exception {
        return enterpriseCreditService.lawsuitsRole(body);
    }

    @RequestMapping(value = "/noticesPage", method = RequestMethod.POST)
    @ApiOperation(value = "法院公告列表（openApi）")
    public TableDataInfo noticesPage(@RequestBody @Valid EnterpriseCreditNoticePageBody body) throws Exception {
        return enterpriseCreditService.noticesPage(body);
    }

    @RequestMapping(value = "/noticesType", method = RequestMethod.POST)
    @ApiOperation(value = "法院公告类型（openApi）")
    public R noticesType(@RequestBody @Valid EnterpriseCreditNoticeTypeBody body) throws Exception {
        return enterpriseCreditService.noticesType(body);
    }

    @RequestMapping(value = "/noticesRole", method = RequestMethod.POST)
    @ApiOperation(value = "法院公告身份（openApi）")
    public R noticesRole(@RequestBody @Valid EnterpriseCreditNoticeRoleBody body) throws Exception {
        return enterpriseCreditService.noticesRole(body);
    }

    @RequestMapping(value = "/noticesCaseReason", method = RequestMethod.POST)
    @ApiOperation(value = "法院公告案由（openApi）")
    public R noticesCaseReason(@RequestBody @Valid EnterpriseCreditNoticeCaseReasonBody body) throws Exception {
        return enterpriseCreditService.noticesCaseReason(body);
    }

    @RequestMapping(value = "/kaitingPage", method = RequestMethod.POST)
    @ApiOperation(value = "开庭公告列表（openApi）")
    public TableDataInfo kaitingPage(@RequestBody @Valid EnterpriseCreditKaitingPageBody body) throws Exception {
        return enterpriseCreditService.kaitingPage(body);
    }

    @RequestMapping(value = "/kaitingCauseAction", method = RequestMethod.POST)
    @ApiOperation(value = "开庭公告案由（openApi）")
    public R kaitingCauseAction(@RequestBody @Valid EnterpriseCreditKaitingCauseActionBody body) throws Exception {
        return enterpriseCreditService.kaitingCauseAction(body);
    }

    @RequestMapping(value = "/kaitingPureRole", method = RequestMethod.POST)
    @ApiOperation(value = "开庭公告当事人身份（openApi）")
    public R kaitingPureRole(@RequestBody @Valid EnterpriseCreditKaitingPureRoleBody body) throws Exception {
        return enterpriseCreditService.kaitingPureRole(body);
    }

}
