package com.fkzy.warn.controller;

import com.fkzy.warn.common.constants.ResponseMsgConstants;
import com.fkzy.warn.common.response.ApiResponse;
import com.fkzy.warn.service.LawCaseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author zhangjing
 * @date 2024/05/21 11:22
 * @description
 */
@Api(tags = "数据相关")
@RestController
@RequestMapping("dataCenter/")
@Slf4j
public class DataCenterController {
    @Resource
    private LawCaseService lawCaseService;

    @RequestMapping(value = "judicialModelSave", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "司法模型")
    public ApiResponse judicialModelSave() {
        ApiResponse apiResponse = new ApiResponse();
        try {
            lawCaseService.judicialModelSave(null);
        } catch (Exception e) {
            log.error("查询错误,errMsg==={}", e.getMessage());
            e.printStackTrace();
            apiResponse.recordError(ResponseMsgConstants.OPERATE_FAIL);
        }
        return apiResponse;
    }

}
