package com.ruoyi.system.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.ActMaterialModel;
import com.ruoyi.system.service.ActMaterialService;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.io.PipedReader;

/**
 * 2024/3/19
 */
@RestController
@RequestMapping("act/material")
public class ActMaterialController {
    private ActMaterialService actMaterialService;
    public ActMaterialController(ActMaterialService actMaterialService){
        this.actMaterialService = actMaterialService;
    }
    @PostMapping("/dateofid")
    public AjaxResult dateOfId(@RequestBody @Validated ActMaterialModel actMaterialModel, BindingResult bindingResult){
        if (bindingResult.hasErrors()){
            return AjaxResult.error(bindingResult.getFieldError().getDefaultMessage());
        }
        return actMaterialService.getDateOfId(actMaterialModel.getMineId());
    }
}
