package cn.stylefeng.team.form.api.parser;

import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum;
import cn.stylefeng.team.form.api.entity.FormItem;
import cn.stylefeng.team.form.api.parser.base.BaseFormFormat;

public class FormSwitchFormat implements BaseFormFormat {

    @Override
    public Object formatProcess(FormItem formItem, Object originValue) {
        if (originValue == null) {
            return "否";
        }

        if (YesOrNotEnum.Y.getCode().equals(originValue.toString())) {
            return "是";
        } else {
            return "否";
        }
    }

}
