| | |
| | | import java.util.UUID; |
| | | |
| | | public class ModelAdapter implements Serializable { |
| | | static int __id = 0; |
| | | public Map<String, Object> model = new HashMap<>(); |
| | | |
| | | // public static Map<String, String> modelAdapterCreateMap = new HashMap<>(); |
| | | |
| | | public ModelAdapter() { |
| | | setString(Model.__id, __id + ""); |
| | | // modelAdapterCreateMap.put(__id+"", FrameUtil.getFrames()+""); |
| | | __id++; |
| | | } |
| | | |
| | | public ModelAdapter(String id) { |
| | |
| | | byte[] bytes = new byte[]{1, 2, 3, 4, 5, 6}; |
| | | String str = Base64.encodeToString(bytes, Base64.NO_WRAP); |
| | | byte[] bytes1 = Base64.decode(str, Base64.NO_WRAP); |
| | | System.out.println("hello"); |
| | | System1.out.println("hello"); |
| | | } |
| | | |
| | | public static String getAttachmentPath(String id, String key, String table) { |
| | |
| | | |
| | | public ModelAdapter setString(String key, String value) { |
| | | model.put(key, value); |
| | | if (Person.id_card_number.equals(key)) { |
| | | if (Constants.TRUE.equals(getString(Model.debug))) { |
| | | // System.out.println("FaceDetailFragment.savePerson 3 key=" + key + " value=" + value + " __id=" + getString(Model.__id) + " debug=" + Constants.TRUE.equals(getString(Model.debug)) + " " + FrameUtil.getFrames()); |
| | | } |
| | | } |
| | | return this; |
| | | } |
| | | |
| | |
| | | if (table == null) { |
| | | table = ""; |
| | | } |
| | | if ("camera_image_feature".equals(key)) { |
| | | if ("camera_image_feature".equals(key) || PersonA.faceFeature.equals(key)) { |
| | | return Base64Util.featureBase642Bytes((String) this.model.get(key)); |
| | | } else { |
| | | File attachFile = new File(getAttachmentPath(getId(), key, table)); |
| | |
| | | } |
| | | } |
| | | } catch (IOException e) { |
| | | System.out.println("ModelAdapter:getBlob exception=" + e.getLocalizedMessage()); |
| | | System1.out.println("ModelAdapter:getBlob exception=" + e.getLocalizedMessage()); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | return modelAdapter; |
| | | } |
| | | |
| | | // public void setObject(String key, Bitmap value) { |
| | | // model.put(key, value); |
| | | // } |
| | | // |
| | | // public Object getObject(String key) { |
| | | // return model.get(key); |
| | | // } |
| | | public void setObject(String key, Object value) { |
| | | model.put(key, value); |
| | | } |
| | | |
| | | public Object getObject(String key) { |
| | | return model.get(key); |
| | | } |
| | | |
| | | public void setTrueOne(String key, boolean value) { |
| | | model.put(key, value ? "1" : "0"); |
| | | } |