@Test public void appendCategory() { Assert.assertNotNull(categoryService.appendCategory(getUser().getId(), RandomUtil.randomString(6))); }
@Override @LogMethod("添加收益分类") public Category appendCategory(String userId, String name) { AssertUtils.throwIf(exists(userId, name), BeeErrorConsts.CATEGORY_EXISTS); Category category = new Category(); category.setCreateTime(System.currentTimeMillis()); category.setId(IdUtil.simpleUUID()); category.setName(name); category.setUserId(userId); return categoryDAO.save(category); }
CategoryServiceImpl implements CategoryService { @Override @LogMethod("添加收益分类") public Category appendCategory(String userId, String name) { AssertUtils.throwIf(exists(userId, name), BeeErrorConsts.CATEGORY_EXISTS); Category category = new Category(); category.setCreateTime(System.currentTimeMillis()); category.setId(IdUtil.simpleUUID()); category.setName(name); category.setUserId(userId); return categoryDAO.save(category); } }
CategoryServiceImpl implements CategoryService { @Override @LogMethod("添加收益分类") public Category appendCategory(String userId, String name) { AssertUtils.throwIf(exists(userId, name), BeeErrorConsts.CATEGORY_EXISTS); Category category = new Category(); category.setCreateTime(System.currentTimeMillis()); category.setId(IdUtil.simpleUUID()); category.setName(name); category.setUserId(userId); return categoryDAO.save(category); } @Autowired  CategoryServiceImpl(CategoryDAO categoryDAO); }
CategoryServiceImpl implements CategoryService { @Override @LogMethod("添加收益分类") public Category appendCategory(String userId, String name) { AssertUtils.throwIf(exists(userId, name), BeeErrorConsts.CATEGORY_EXISTS); Category category = new Category(); category.setCreateTime(System.currentTimeMillis()); category.setId(IdUtil.simpleUUID()); category.setName(name); category.setUserId(userId); return categoryDAO.save(category); } @Autowired  CategoryServiceImpl(CategoryDAO categoryDAO); @Override void updateCategory(String categoryId, String userId, String name); @Override void removeCategory(String categoryId); @Override @LogMethod("检查分类是否存在") boolean exists(String userId, String name); @Override @LogMethod("列出分类") List<Category> listCategory(String userId); @Override @LogMethod("添加收益分类") Category appendCategory(String userId, String name); }
CategoryServiceImpl implements CategoryService { @Override @LogMethod("添加收益分类") public Category appendCategory(String userId, String name) { AssertUtils.throwIf(exists(userId, name), BeeErrorConsts.CATEGORY_EXISTS); Category category = new Category(); category.setCreateTime(System.currentTimeMillis()); category.setId(IdUtil.simpleUUID()); category.setName(name); category.setUserId(userId); return categoryDAO.save(category); } @Autowired  CategoryServiceImpl(CategoryDAO categoryDAO); @Override void updateCategory(String categoryId, String userId, String name); @Override void removeCategory(String categoryId); @Override @LogMethod("检查分类是否存在") boolean exists(String userId, String name); @Override @LogMethod("列出分类") List<Category> listCategory(String userId); @Override @LogMethod("添加收益分类") Category appendCategory(String userId, String name);  }