package cn.stylefeng.workflow.instance.modular.mobile.controller;

import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
import cn.stylefeng.workflow.instance.modular.mobile.pojo.MobileNodeInfo;
import cn.stylefeng.workflow.instance.modular.mobile.pojo.MobileNodeRequest;
import cn.stylefeng.workflow.instance.modular.mobile.service.MobileFlowService;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@ApiResource(name = "移动端流程的控制器")
@RestController
public class MobileFlowController {

    @Resource
    private MobileFlowService mobileFlowService;

    @GetResource(name = "查看流程的所有审批和抄送节点列表", path = "/mobileFlowNode/getList")
    public ResponseData<List<MobileNodeInfo>> getList(@Validated(MobileNodeRequest.detail.class) MobileNodeRequest mobileNodeRequest) {
        List<MobileNodeInfo> list = mobileFlowService.getList(mobileNodeRequest);
        return new SuccessResponseData<>(list);
    }

}
