package cn.autoform.bean.power;
|
|
import cn.autoform.db.entity.CustomButtonEntity;
|
import cn.autoform.db.entity.FormsettingEntity;
|
import lombok.AllArgsConstructor;
|
import lombok.Data;
|
import lombok.NoArgsConstructor;
|
import lombok.extern.slf4j.Slf4j;
|
|
import java.lang.reflect.Field;
|
import java.util.List;
|
|
@Data
|
@AllArgsConstructor
|
@NoArgsConstructor
|
@Slf4j
|
public class AutoPowerButton {
|
|
private List<CustomButtonEntity> show;
|
|
private List<String> hide;
|
|
public void hide(FormsettingEntity result) {
|
hide.stream().forEach(hideName->{
|
try {
|
Field field = result.getClass().getDeclaredField(hideName);
|
field.setAccessible(true);
|
field.set(result, "0");
|
} catch (NoSuchFieldException|IllegalAccessException e) {
|
log.error(e.getMessage(), e);
|
}
|
});
|
}
|
}
|