CTBService.java 984 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package edu.nju.service;
  2. import java.util.List;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.stereotype.Service;
  5. import edu.nju.dao.CTBDao;
  6. @Service
  7. public class CTBService {
  8. @Autowired
  9. CTBDao ctbdao;
  10. public boolean save(String useCase, String bug_id, String case_take_id, String report_id) {
  11. try {
  12. // System.out.println(useCase);
  13. ctbdao.save(useCase, bug_id, case_take_id, report_id);
  14. return true;
  15. } catch (Exception e) {
  16. return false;
  17. }
  18. }
  19. public List<String> findById(String useCase) {
  20. List<String> lists = ctbdao.findById(useCase);
  21. if(lists == null) {return null;}
  22. return lists;
  23. }
  24. public boolean remove(String useCase, String bug_id) {
  25. try {
  26. ctbdao.remove(useCase, bug_id);
  27. return true;
  28. } catch (Exception e) {
  29. return false;
  30. }
  31. }
  32. public boolean removeAll(String useCase) {
  33. try {
  34. ctbdao.remove(useCase);
  35. return true;
  36. } catch (Exception e) {
  37. return false;
  38. }
  39. }
  40. }