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 javax.annotation.Resource;

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) {
        System.out.println(" Long id " + id);
        OrderProcessDO plateDO = orderProcessService.getOrderProcessByProcessGroupId(id);
        if (plateDO == null) {
            return success(false);
        }
        return success(true);
    }
}
