Created by sang on 2017/12/19.
| 13 | * Created by sang on 2017/12/19. |
| 14 | */ |
| 15 | @Service |
| 16 | @Transactional |
| 17 | public class CategoryService { |
| 18 | @Autowired |
| 19 | CategoryMapper categoryMapper; |
| 20 | |
| 21 | public List<Category> getAllCategories() { |
| 22 | return categoryMapper.getAllCategories(); |
| 23 | } |
| 24 | |
| 25 | public boolean deleteCategoryByIds(String ids) { |
| 26 | String[] split = ids.split(","); |
| 27 | int result = categoryMapper.deleteCategoryByIds(split); |
| 28 | return result == split.length; |
| 29 | } |
| 30 | |
| 31 | public int updateCategoryById(Category category) { |
| 32 | return categoryMapper.updateCategoryById(category); |
| 33 | } |
| 34 | |
| 35 | public int addCategory(Category category) { |
| 36 | category.setDate(new Timestamp(System.currentTimeMillis())); |
| 37 | return categoryMapper.addCategory(category); |
| 38 | } |
| 39 | } |
nothing calls this directly
no outgoing calls
no test coverage detected