package org.jeecg.module.custom.ocr.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.module.custom.ocr.api.entity.BaseResult;
import org.jeecg.module.custom.ocr.api.entity.FormConfigResult;
import org.jeecg.module.custom.ocr.controller.dto.FormSyncRequest;
import org.jeecg.module.custom.ocr.service.FormConfigService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "ocr_表单字段配置信息")
@Slf4j
@RestController
@RequestMapping("/form/config")
public class FormConfigController {

    @Resource
    private FormConfigService formConfigService;

    /**
     * 拉取无量云全量任务数据，根据业务主体
     *
     * @param request
     * @return
     */
    @ApiOperation(value = "同步配置", notes = "同步配置")
    @PostMapping("/sync")
    public BaseResult<FormConfigResult> sync(@RequestBody FormSyncRequest request) {
        return formConfigService.sync(request);
    }
}
