package com.bcxin.ars.strategy.ministerial;


import com.abcxin.smart.validator.annotation.MinisterialAttr;

import java.lang.reflect.Field;

/**
 * 是否服兵役
 * @author linqinglin
 * @date 2021/03/06 0006 13:20
 */
public class EnrolledMinDataFormatStrategy implements MinDataFormatStrategy {

    @Override
    public String format(Field columnField, Object data) {
        if(data == null){
            MinisterialAttr resource = columnField.getAnnotation(MinisterialAttr.class);
            return resource.defaultValue();
        }
        if(data.toString().equals("1")){
            return "1";
        }
        return "0";
    }
}
