package com.fs.audit.utils;

import lombok.Data;

@Data
public  class AuditFlowUtils {
    public static Long parseFirstIdFromAuditUserIds(String auditUserIds) {
        if (auditUserIds == null) return null;
        String s = auditUserIds.trim();
        if (s.isEmpty()) return null;

        // 兼容："[1]" / "[1,2]" / "1" / "  [ 1 , 2 ]  "
        s = s.replace("[", "").replace("]", "").trim();
        if (s.isEmpty()) return null;

        String[] parts = s.split(",");
        if (parts.length == 0) return null;

        String first = parts[0].trim();
        if (first.isEmpty()) return null;

        try {
            return Long.valueOf(first);
        } catch (NumberFormatException e) {
            return null;
        }
    }

}
