package com.cf.imes.module.executor.api.orderProcess;


import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.module.executor.dal.dataobject.process.OrderProcessDO;
import com.cf.imes.module.executor.service.process.OrderProcessService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

import jakarta.annotation.Resource;

import java.util.List;

import static com.cf.imes.framework.common.pojo.CommonResult.success;

@RestController // 提供 RESTful API 接口，给 Feign 调用
@Validated
public class OrderProcessApiImpl implements OrderProcessApi{

    @Resource
    private OrderProcessService orderProcessService;

    @Override
    public CommonResult<Boolean> getOrderProcessByProcessGroupId(Long id) {
        List<OrderProcessDO> plateDOS = orderProcessService.getOrderProcessByProcessGroupId(id);
        if (plateDOS.size() == 0) {
            return success(false);
        }
        return success(true);
    }
}
