class EruptUserDataProxy implements DataProxy<EruptUser> {

    @Resource
    private EruptUserService eruptUserService;

    @Override
    public void beforeAdd(EruptUser eruptUser) {
        this.checkDataLegal(eruptUser);
        if (StringUtils.isBlank(eruptUser.getPasswordA())) {
            throw new EruptApiErrorTip(EruptApiModel.Status.WARNING, I18nTranslate.$translate("upms.pwd_required"), EruptApiModel.PromptWay.MESSAGE);
        }
        if (eruptUser.getPasswordA().equals(eruptUser.getPasswordB())) {
            if (eruptUser.getIsMd5()) {
                eruptUser.setPassword(MD5Util.digest(eruptUser.getPasswordA()));
            } else {
                eruptUser.setPassword(eruptUser.getPasswordA());
            }
        } else {
            throw new EruptWebApiRuntimeException(I18nTranslate.$translate("upms.pwd_two_inconsistent"));
        }
    }

    @Override
    public void beforeUpdate(EruptUser eruptUser) {
        this.checkDataLegal(eruptUser);
    }

    private void checkDataLegal(EruptUser eruptUser) {<FILL_FUNCTION_BODY>}
}

        if (eruptUser.getEruptPost() != null && eruptUser.getEruptOrg() == null)
            throw new EruptWebApiRuntimeException(I18nTranslate.$translate("upms.position_no_org"));
        EruptUser curr = eruptUserService.getCurrentEruptUser();
        if (eruptUser.getIsAdmin()) {
            if (null == curr.getIsAdmin() || !curr.getIsAdmin()) {
                throw new EruptWebApiRuntimeException(I18nTranslate.$translate("upms.not_super_admin-unable_add"));
            }
        }
    
<no_super_class>