@Test public void testListMedicineByType() throws Exception { }
@Override public CommonResult listMedicineByType(Integer type){ List<Medicine> medicineList; if(type == 0) medicineList = medicineMapper.listTraditionalMedicine(); else if (type == 1) medicineList = medicineMapper.listModernMedicine(); else return CommonResult.fail(ResultCode.E_801); JSONObject jsonObject = new JSONObject(); jsonObject.put("medicines", medicineList); return CommonResult.success(medicineList); }
MedicineManagementImpl implements MedicineManagementService { @Override public CommonResult listMedicineByType(Integer type){ List<Medicine> medicineList; if(type == 0) medicineList = medicineMapper.listTraditionalMedicine(); else if (type == 1) medicineList = medicineMapper.listModernMedicine(); else return CommonResult.fail(ResultCode.E_801); JSONObject jsonObject = new JSONObject(); jsonObject.put("medicines", medicineList); return CommonResult.success(medicineList); } }
MedicineManagementImpl implements MedicineManagementService { @Override public CommonResult listMedicineByType(Integer type){ List<Medicine> medicineList; if(type == 0) medicineList = medicineMapper.listTraditionalMedicine(); else if (type == 1) medicineList = medicineMapper.listModernMedicine(); else return CommonResult.fail(ResultCode.E_801); JSONObject jsonObject = new JSONObject(); jsonObject.put("medicines", medicineList); return CommonResult.success(medicineList); }  }
MedicineManagementImpl implements MedicineManagementService { @Override public CommonResult listMedicineByType(Integer type){ List<Medicine> medicineList; if(type == 0) medicineList = medicineMapper.listTraditionalMedicine(); else if (type == 1) medicineList = medicineMapper.listModernMedicine(); else return CommonResult.fail(ResultCode.E_801); JSONObject jsonObject = new JSONObject(); jsonObject.put("medicines", medicineList); return CommonResult.success(medicineList); }  @Override CommonResult getMedicineById(Short id); @Override CommonResult insertMedicine(Medicine medicine); @Override CommonResult updateMedicineById(Medicine medicine); @Override CommonResult deleteMedicineById(Short id); @Override CommonResult listAllMedicines(); @Override CommonResult listMedicineByType(Integer type); }
MedicineManagementImpl implements MedicineManagementService { @Override public CommonResult listMedicineByType(Integer type){ List<Medicine> medicineList; if(type == 0) medicineList = medicineMapper.listTraditionalMedicine(); else if (type == 1) medicineList = medicineMapper.listModernMedicine(); else return CommonResult.fail(ResultCode.E_801); JSONObject jsonObject = new JSONObject(); jsonObject.put("medicines", medicineList); return CommonResult.success(medicineList); }  @Override CommonResult getMedicineById(Short id); @Override CommonResult insertMedicine(Medicine medicine); @Override CommonResult updateMedicineById(Medicine medicine); @Override CommonResult deleteMedicineById(Short id); @Override CommonResult listAllMedicines(); @Override CommonResult listMedicineByType(Integer type);  }