Java Code Examples for org.jeecg.common.constant.CacheConstant#SYS_DICT_CACHE

The following examples show how to use org.jeecg.common.constant.CacheConstant#SYS_DICT_CACHE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SysDictItemController.java    From teaching with Apache License 2.0 6 votes vote down vote up
/**
 * @功能:删除字典数据
 * @param id
 * @return
 */
@RequestMapping(value = "/delete", method = RequestMethod.DELETE)
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
public Result<SysDictItem> delete(@RequestParam(name="id",required=true) String id) {
	Result<SysDictItem> result = new Result<SysDictItem>();
	SysDictItem joinSystem = sysDictItemService.getById(id);
	if(joinSystem==null) {
		result.error500("未找到对应实体");
	}else {
		boolean ok = sysDictItemService.removeById(id);
		if(ok) {
			result.success("删除成功!");
		}
	}
	return result;
}
 
Example 2
Source File: SysDictItemController.java    From teaching with Apache License 2.0 6 votes vote down vote up
/**
 * @功能:编辑
 * @param sysDictItem
 * @return
 */
@RequestMapping(value = "/edit", method = RequestMethod.PUT)
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
public Result<SysDictItem> edit(@RequestBody SysDictItem sysDictItem) {
	Result<SysDictItem> result = new Result<SysDictItem>();
	SysDictItem sysdict = sysDictItemService.getById(sysDictItem.getId());
	if(sysdict==null) {
		result.error500("未找到对应实体");
	}else {
		sysDictItem.setUpdateTime(new Date());
		boolean ok = sysDictItemService.updateById(sysDictItem);
		//TODO 返回false说明什么?
		if(ok) {
			result.success("编辑成功!");
		}
	}
	return result;
}
 
Example 3
Source File: SysDictItemController.java    From jeecg-boot-with-activiti with MIT License 6 votes vote down vote up
/**
 * @功能:编辑
 * @param sysDictItem
 * @return
 */
@RequestMapping(value = "/edit", method = RequestMethod.PUT)
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
public Result<SysDictItem> edit(@RequestBody SysDictItem sysDictItem) {
	Result<SysDictItem> result = new Result<SysDictItem>();
	SysDictItem sysdict = sysDictItemService.getById(sysDictItem.getId());
	if(sysdict==null) {
		result.error500("未找到对应实体");
	}else {
		sysDictItem.setUpdateTime(new Date());
		boolean ok = sysDictItemService.updateById(sysDictItem);
		//TODO 返回false说明什么?
		if(ok) {
			result.success("编辑成功!");
		}
	}
	return result;
}
 
Example 4
Source File: SysDictItemController.java    From jeecg-boot with Apache License 2.0 6 votes vote down vote up
/**
 * @功能:编辑
 * @param sysDictItem
 * @return
 */
@RequestMapping(value = "/edit", method = RequestMethod.PUT)
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
public Result<SysDictItem> edit(@RequestBody SysDictItem sysDictItem) {
	Result<SysDictItem> result = new Result<SysDictItem>();
	SysDictItem sysdict = sysDictItemService.getById(sysDictItem.getId());
	if(sysdict==null) {
		result.error500("未找到对应实体");
	}else {
		sysDictItem.setUpdateTime(new Date());
		boolean ok = sysDictItemService.updateById(sysDictItem);
		//TODO 返回false说明什么?
		if(ok) {
			result.success("编辑成功!");
		}
	}
	return result;
}
 
Example 5
Source File: SysDictController.java    From teaching with Apache License 2.0 5 votes vote down vote up
/**
 * @功能:删除
 * @param id
 * @return
 */
@RequestMapping(value = "/delete", method = RequestMethod.DELETE)
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
public Result<SysDict> delete(@RequestParam(name="id",required=true) String id) {
	Result<SysDict> result = new Result<SysDict>();
	boolean ok = sysDictService.removeById(id);
	if(ok) {
		result.success("删除成功!");
	}else{
		result.error500("删除失败!");
	}
	return result;
}
 
Example 6
Source File: SysDictItemController.java    From jeecg-cloud with Apache License 2.0 5 votes vote down vote up
/**
 * @功能:新增
 * @return
 */
@RequestMapping(value = "/add", method = RequestMethod.POST)
@CacheEvict(value= CacheConstant.SYS_DICT_CACHE, allEntries=true)
public Result<SysDictItem> add(@RequestBody SysDictItem sysDictItem) {
	Result<SysDictItem> result = new Result<SysDictItem>();
	try {
		sysDictItem.setCreateTime(new Date());
		sysDictItemService.save(sysDictItem);
		result.success("保存成功!");
	} catch (Exception e) {
		log.error(e.getMessage(),e);
		result.error500("操作失败");
	}
	return result;
}
 
Example 7
Source File: SysDictItemController.java    From teaching with Apache License 2.0 5 votes vote down vote up
/**
 * @功能:批量删除字典数据
 * @param ids
 * @return
 */
@RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
public Result<SysDictItem> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
	Result<SysDictItem> result = new Result<SysDictItem>();
	if(ids==null || "".equals(ids.trim())) {
		result.error500("参数不识别!");
	}else {
		this.sysDictItemService.removeByIds(Arrays.asList(ids.split(",")));
		result.success("删除成功!");
	}
	return result;
}
 
Example 8
Source File: SysDictController.java    From teaching with Apache License 2.0 5 votes vote down vote up
/**
 * @功能:批量删除
 * @param ids
 * @return
 */
@RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
@CacheEvict(value= CacheConstant.SYS_DICT_CACHE, allEntries=true)
public Result<SysDict> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
	Result<SysDict> result = new Result<SysDict>();
	if(oConvertUtils.isEmpty(ids)) {
		result.error500("参数不识别!");
	}else {
		sysDictService.removeByIds(Arrays.asList(ids.split(",")));
		result.success("删除成功!");
	}
	return result;
}
 
Example 9
Source File: SysDictServiceImpl.java    From jeecg-boot-with-activiti with MIT License 5 votes vote down vote up
/**
 * 通过查询指定code 获取字典
 * @param code
 * @return
 */
@Override
@Cacheable(value = CacheConstant.SYS_DICT_CACHE,key = "#code")
public List<DictModel> queryDictItemsByCode(String code) {
	log.info("无缓存dictCache的时候调用这里!");
	return sysDictMapper.queryDictItemsByCode(code);
}
 
Example 10
Source File: SysDictServiceImpl.java    From jeecg-boot with Apache License 2.0 5 votes vote down vote up
/**
 * 通过查询指定code 获取字典
 * @param code
 * @return
 */
@Override
@Cacheable(value = CacheConstant.SYS_DICT_CACHE,key = "#code")
public List<DictModel> queryDictItemsByCode(String code) {
	log.info("无缓存dictCache的时候调用这里!");
	return sysDictMapper.queryDictItemsByCode(code);
}
 
Example 11
Source File: SysDictController.java    From jeecg-boot-with-activiti with MIT License 5 votes vote down vote up
/**
 * @功能:删除
 * @param id
 * @return
 */
@RequestMapping(value = "/delete", method = RequestMethod.DELETE)
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
public Result<SysDict> delete(@RequestParam(name="id",required=true) String id) {
	Result<SysDict> result = new Result<SysDict>();
	boolean ok = sysDictService.removeById(id);
	if(ok) {
		result.success("删除成功!");
	}else{
		result.error500("删除失败!");
	}
	return result;
}
 
Example 12
Source File: SysDictItemController.java    From jeecg-boot with Apache License 2.0 5 votes vote down vote up
/**
 * @功能:批量删除字典数据
 * @param ids
 * @return
 */
@RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
public Result<SysDictItem> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
	Result<SysDictItem> result = new Result<SysDictItem>();
	if(ids==null || "".equals(ids.trim())) {
		result.error500("参数不识别!");
	}else {
		this.sysDictItemService.removeByIds(Arrays.asList(ids.split(",")));
		result.success("删除成功!");
	}
	return result;
}
 
Example 13
Source File: SysDictItemController.java    From jeecg-boot-with-activiti with MIT License 5 votes vote down vote up
/**
 * @功能:新增
 * @param sysDict
 * @return
 */
@RequestMapping(value = "/add", method = RequestMethod.POST)
@CacheEvict(value= CacheConstant.SYS_DICT_CACHE, allEntries=true)
public Result<SysDictItem> add(@RequestBody SysDictItem sysDictItem) {
	Result<SysDictItem> result = new Result<SysDictItem>();
	try {
		sysDictItem.setCreateTime(new Date());
		sysDictItemService.save(sysDictItem);
		result.success("保存成功!");
	} catch (Exception e) {
		log.error(e.getMessage(),e);
		result.error500("操作失败");
	}
	return result;
}
 
Example 14
Source File: SysDictController.java    From jeecg-boot with Apache License 2.0 5 votes vote down vote up
/**
 * @功能:删除
 * @param id
 * @return
 */
//@RequiresRoles({"admin"})
@RequestMapping(value = "/delete", method = RequestMethod.DELETE)
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
public Result<SysDict> delete(@RequestParam(name="id",required=true) String id) {
	Result<SysDict> result = new Result<SysDict>();
	boolean ok = sysDictService.removeById(id);
	if(ok) {
		result.success("删除成功!");
	}else{
		result.error500("删除失败!");
	}
	return result;
}
 
Example 15
Source File: SysDictController.java    From jeecg-cloud with Apache License 2.0 5 votes vote down vote up
/**
 * @功能:删除
 * @param id
 * @return
 */
//@RequiresRoles({"admin"})
@RequestMapping(value = "/delete", method = RequestMethod.DELETE)
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
public Result<SysDict> delete(@RequestParam(name="id",required=true) String id) {
	Result<SysDict> result = new Result<SysDict>();
	boolean ok = sysDictService.removeById(id);
	if(ok) {
		result.success("删除成功!");
	}else{
		result.error500("删除失败!");
	}
	return result;
}
 
Example 16
Source File: SysDictItemController.java    From jeecg-cloud with Apache License 2.0 5 votes vote down vote up
/**
 * @功能:批量删除字典数据
 * @param ids
 * @return
 */
@RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
public Result<SysDictItem> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
	Result<SysDictItem> result = new Result<SysDictItem>();
	if(ids==null || "".equals(ids.trim())) {
		result.error500("参数不识别!");
	}else {
		this.sysDictItemService.removeByIds(Arrays.asList(ids.split(",")));
		result.success("删除成功!");
	}
	return result;
}
 
Example 17
Source File: SysDictController.java    From jeecg-boot with Apache License 2.0 5 votes vote down vote up
/**
 * @功能:批量删除
 * @param ids
 * @return
 */
//@RequiresRoles({"admin"})
@RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
@CacheEvict(value= CacheConstant.SYS_DICT_CACHE, allEntries=true)
public Result<SysDict> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
	Result<SysDict> result = new Result<SysDict>();
	if(oConvertUtils.isEmpty(ids)) {
		result.error500("参数不识别!");
	}else {
		sysDictService.removeByIds(Arrays.asList(ids.split(",")));
		result.success("删除成功!");
	}
	return result;
}
 
Example 18
Source File: SysDictServiceImpl.java    From teaching with Apache License 2.0 5 votes vote down vote up
/**
 * 通过查询指定code 获取字典
 * @param code
 * @return
 */
@Override
@Cacheable(value = CacheConstant.SYS_DICT_CACHE,key = "#code")
public List<DictModel> queryDictItemsByCode(String code) {
	log.info("无缓存dictCache的时候调用这里!");
	return sysDictMapper.queryDictItemsByCode(code);
}
 
Example 19
Source File: SysBaseApiImpl.java    From jeecg-cloud with Apache License 2.0 4 votes vote down vote up
@Override
@Cacheable(value = CacheConstant.SYS_DICT_CACHE,key = "#code")
public List<DictModel> queryDictItemsByCode(String code) {
	return sysDictService.queryDictItemsByCode(code);
}
 
Example 20
Source File: SysBaseApiImpl.java    From jeecg-boot with Apache License 2.0 4 votes vote down vote up
@Override
@Cacheable(value = CacheConstant.SYS_DICT_CACHE,key = "#code")
public List<DictModel> queryDictItemsByCode(String code) {
	return sysDictService.queryDictItemsByCode(code);
}