org.jeecg.common.api.vo.Result Java Examples
The following examples show how to use
org.jeecg.common.api.vo.Result.
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: SysMessageTemplateController.java From teaching with Apache License 2.0 | 6 votes |
/** * 发送消息 */ @PostMapping(value = "/sendMsg") public Result<SysMessageTemplate> sendMessage(@RequestBody MsgParams msgParams) { Result<SysMessageTemplate> result = new Result<SysMessageTemplate>(); Map<String, String> map = null; try { map = (Map<String, String>) JSON.parse(msgParams.getTestData()); } catch (Exception e) { result.error500("解析Json出错!"); return result; } boolean is_sendSuccess = pushMsgUtil.sendMessage(msgParams.getMsgType(), msgParams.getTemplateCode(), map, msgParams.getReceiver()); if (is_sendSuccess) { result.success("发送消息任务添加成功!"); } else { result.error500("发送消息任务添加失败!"); } return result; }
Example #2
Source File: SysUserAgentController.java From jeecg-boot-with-activiti with MIT License | 6 votes |
/** * 编辑 * @param sysUserAgent * @return */ @PutMapping(value = "/edit") public Result<SysUserAgent> edit(@RequestBody SysUserAgent sysUserAgent) { Result<SysUserAgent> result = new Result<SysUserAgent>(); SysUserAgent sysUserAgentEntity = sysUserAgentService.getById(sysUserAgent.getId()); if(sysUserAgentEntity==null) { result.error500("未找到对应实体"); }else { boolean ok = sysUserAgentService.updateById(sysUserAgent); //TODO 返回false说明什么? if(ok) { result.success("代理人设置成功!"); } } return result; }
Example #3
Source File: SysUserController.java From teaching with Apache License 2.0 | 6 votes |
/** * 给指定部门添加对应的用户 */ @RequestMapping(value = "/editSysDepartWithUser", method = RequestMethod.POST) public Result<String> editSysDepartWithUser(@RequestBody SysDepartUsersVO sysDepartUsersVO) { Result<String> result = new Result<String>(); try { String sysDepId = sysDepartUsersVO.getDepId(); for(String sysUserId:sysDepartUsersVO.getUserIdList()) { SysUserDepart sysUserDepart = new SysUserDepart(null,sysUserId,sysDepId); QueryWrapper<SysUserDepart> queryWrapper = new QueryWrapper<SysUserDepart>(); queryWrapper.eq("dep_id", sysDepId).eq("user_id",sysUserId); SysUserDepart one = sysUserDepartService.getOne(queryWrapper); if(one==null){ sysUserDepartService.save(sysUserDepart); } } result.setMessage("添加成功!"); result.setSuccess(true); return result; }catch(Exception e) { log.error(e.getMessage(), e); result.setSuccess(false); result.setMessage("出错了: " + e.getMessage()); return result; } }
Example #4
Source File: JeecgDemoController.java From teaching with Apache License 2.0 | 6 votes |
/** * 分页列表查询 * * @param jeecgDemo * @param pageNo * @param pageSize * @param req * @return */ @ApiOperation(value = "获取Demo数据列表", notes = "获取所有Demo数据列表") @GetMapping(value = "/list") @PermissionData(pageComponent = "jeecg/JeecgDemoList") public Result<?> list(JeecgDemo jeecgDemo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { QueryWrapper<JeecgDemo> queryWrapper = QueryGenerator.initQueryWrapper(jeecgDemo, req.getParameterMap()); Page<JeecgDemo> page = new Page<JeecgDemo>(pageNo, pageSize); IPage<JeecgDemo> pageList = jeecgDemoService.page(page, queryWrapper); log.info("查询当前页:" + pageList.getCurrent()); log.info("查询当前页数量:" + pageList.getSize()); log.info("查询结果数量:" + pageList.getRecords().size()); log.info("数据总数:" + pageList.getTotal()); return Result.ok(pageList); }
Example #5
Source File: SysDepartController.java From jeecg-boot with Apache License 2.0 | 6 votes |
/** * 通过id删除 * @param id * @return */ //@RequiresRoles({"admin"}) @RequestMapping(value = "/delete", method = RequestMethod.DELETE) @CacheEvict(value= {CacheConstant.SYS_DEPARTS_CACHE,CacheConstant.SYS_DEPART_IDS_CACHE}, allEntries=true) public Result<SysDepart> delete(@RequestParam(name="id",required=true) String id) { Result<SysDepart> result = new Result<SysDepart>(); SysDepart sysDepart = sysDepartService.getById(id); if(sysDepart==null) { result.error500("未找到对应实体"); }else { boolean ok = sysDepartService.delete(id); if(ok) { //清除部门树内存 //FindsDepartsChildrenUtil.clearSysDepartTreeList(); // FindsDepartsChildrenUtil.clearDepartIdModel(); result.success("删除成功!"); } } return result; }
Example #6
Source File: SysRoleController.java From jeecg-boot with Apache License 2.0 | 6 votes |
/** * 用户角色授权功能,查询菜单权限树 * @param request * @return */ @RequestMapping(value = "/queryTreeList", method = RequestMethod.GET) public Result<Map<String,Object>> queryTreeList(HttpServletRequest request) { Result<Map<String,Object>> result = new Result<>(); //全部权限ids List<String> ids = new ArrayList<>(); try { LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<SysPermission>(); query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0); query.orderByAsc(SysPermission::getSortNo); List<SysPermission> list = sysPermissionService.list(query); for(SysPermission sysPer : list) { ids.add(sysPer.getId()); } List<TreeModel> treeList = new ArrayList<>(); getTreeModelList(treeList, list, null); Map<String,Object> resMap = new HashMap<String,Object>(); resMap.put("treeList", treeList); //全部树节点数据 resMap.put("ids", ids);//全部树ids result.setResult(resMap); result.setSuccess(true); } catch (Exception e) { log.error(e.getMessage(), e); } return result; }
Example #7
Source File: SysAnnouncementSendController.java From jeecg-boot with Apache License 2.0 | 6 votes |
/** * @功能:一键已读 * @return */ @PutMapping(value = "/readAll") public Result<SysAnnouncementSend> readAll() { Result<SysAnnouncementSend> result = new Result<SysAnnouncementSend>(); LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal(); String userId = sysUser.getId(); LambdaUpdateWrapper<SysAnnouncementSend> updateWrapper = new UpdateWrapper().lambda(); updateWrapper.set(SysAnnouncementSend::getReadFlag, CommonConstant.HAS_READ_FLAG); updateWrapper.set(SysAnnouncementSend::getReadTime, new Date()); updateWrapper.last("where user_id ='"+userId+"'"); SysAnnouncementSend announcementSend = new SysAnnouncementSend(); sysAnnouncementSendService.update(announcementSend, updateWrapper); result.setSuccess(true); result.setMessage("全部已读"); return result; }
Example #8
Source File: SysUserController.java From jeecg-boot with Apache License 2.0 | 6 votes |
/** * 冻结&解冻用户 * @param jsonObject * @return */ //@RequiresRoles({"admin"}) @RequestMapping(value = "/frozenBatch", method = RequestMethod.PUT) public Result<SysUser> frozenBatch(@RequestBody JSONObject jsonObject) { Result<SysUser> result = new Result<SysUser>(); try { String ids = jsonObject.getString("ids"); String status = jsonObject.getString("status"); String[] arr = ids.split(","); for (String id : arr) { if(oConvertUtils.isNotEmpty(id)) { this.sysUserService.update(new SysUser().setStatus(Integer.parseInt(status)), new UpdateWrapper<SysUser>().lambda().eq(SysUser::getId,id)); } } } catch (Exception e) { log.error(e.getMessage(), e); result.error500("操作失败"+e.getMessage()); } result.success("操作成功!"); return result; }
Example #9
Source File: SysDictController.java From jeecg-boot with Apache License 2.0 | 6 votes |
/** * @功能:新增 * @param sysDict * @return */ //@RequiresRoles({"admin"}) @RequestMapping(value = "/add", method = RequestMethod.POST) public Result<SysDict> add(@RequestBody SysDict sysDict) { Result<SysDict> result = new Result<SysDict>(); try { sysDict.setCreateTime(new Date()); sysDict.setDelFlag(CommonConstant.DEL_FLAG_0); sysDictService.save(sysDict); result.success("保存成功!"); } catch (Exception e) { log.error(e.getMessage(),e); result.error500("操作失败"); } return result; }
Example #10
Source File: SysUploadController.java From teaching with Apache License 2.0 | 6 votes |
/** * 上传 * @param request */ @PostMapping(value = "/uploadMinio") public Result<?> uploadMinio(HttpServletRequest request) { Result<?> result = new Result<>(); String bizPath = request.getParameter("biz"); if(oConvertUtils.isEmpty(bizPath)){ bizPath = ""; } MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; MultipartFile file = multipartRequest.getFile("file");// 获取上传文件对象 String orgName = file.getOriginalFilename();// 获取文件名 String file_url = MinioUtil.upload(file,bizPath); //保存文件信息 OSSFile minioFile = new OSSFile(); minioFile.setFileName(orgName); minioFile.setUrl(file_url); ossFileService.save(minioFile); result.setMessage(file_url); result.setSuccess(true); return result; }
Example #11
Source File: QuartzJobController.java From jeecg-boot with Apache License 2.0 | 6 votes |
/** * 暂停定时任务 * * @param jobClassName * @return */ //@RequiresRoles({"admin"}) @GetMapping(value = "/pause") @ApiOperation(value = "暂停定时任务") public Result<Object> pauseJob(@RequestParam(name = "jobClassName", required = true) String jobClassName) { QuartzJob job = null; try { job = quartzJobService.getOne(new LambdaQueryWrapper<QuartzJob>().eq(QuartzJob::getJobClassName, jobClassName)); if (job == null) { return Result.error("定时任务不存在!"); } scheduler.pauseJob(JobKey.jobKey(jobClassName.trim())); } catch (SchedulerException e) { throw new JeecgBootException("暂停定时任务失败"); } job.setStatus(CommonConstant.STATUS_DISABLE); quartzJobService.updateById(job); return Result.ok("暂停定时任务成功"); }
Example #12
Source File: SysMessageTemplateController.java From jeecg-boot-with-activiti with MIT License | 6 votes |
/** * 发送消息 */ @PostMapping(value = "/sendMsg") public Result<SysMessageTemplate> sendMessage(@RequestBody MsgParams msgParams) { Result<SysMessageTemplate> result = new Result<SysMessageTemplate>(); Map<String, String> map = null; try { map = (Map<String, String>) JSON.parse(msgParams.getTestData()); } catch (Exception e) { result.error500("解析Json出错!"); return result; } boolean is_sendSuccess = pushMsgUtil.sendMessage(msgParams.getMsgType(), msgParams.getTemplateCode(), map, msgParams.getReceiver()); if (is_sendSuccess) { result.success("发送消息任务添加成功!"); } else { result.error500("发送消息任务添加失败!"); } return result; }
Example #13
Source File: SysUserController.java From jeecg-boot with Apache License 2.0 | 6 votes |
@RequestMapping(value = "/add", method = RequestMethod.POST) //@RequiresPermissions("user:add") public Result<SysUser> add(@RequestBody JSONObject jsonObject) { Result<SysUser> result = new Result<SysUser>(); String selectedRoles = jsonObject.getString("selectedroles"); String selectedDeparts = jsonObject.getString("selecteddeparts"); try { SysUser user = JSON.parseObject(jsonObject.toJSONString(), SysUser.class); user.setCreateTime(new Date());//设置创建时间 String salt = oConvertUtils.randomGen(8); user.setSalt(salt); String passwordEncode = PasswordUtil.encrypt(user.getUsername(), user.getPassword(), salt); user.setPassword(passwordEncode); user.setStatus(1); user.setDelFlag(CommonConstant.DEL_FLAG_0); sysUserService.addUserWithRole(user, selectedRoles); sysUserService.addUserWithDepart(user, selectedDeparts); result.success("添加成功!"); } catch (Exception e) { log.error(e.getMessage(), e); result.error500("操作失败"); } return result; }
Example #14
Source File: JoaDemoController.java From teaching with Apache License 2.0 | 6 votes |
/** * 通过id删除 * @param id * @return */ @DeleteMapping(value = "/delete") public Result<JoaDemo> delete(@RequestParam(name="id",required=true) String id) { Result<JoaDemo> result = new Result<JoaDemo>(); JoaDemo joaDemo = joaDemoService.getById(id); if(joaDemo==null) { result.error500("未找到对应实体"); }else { boolean ok = joaDemoService.removeById(id); if(ok) { result.success("删除成功!"); } } return result; }
Example #15
Source File: SysUserController.java From jeecg-boot-with-activiti with MIT License | 6 votes |
/** * 校验用户账号是否唯一<br> * 可以校验其他 需要检验什么就传什么。。。 * * @param sysUser * @return */ @RequestMapping(value = "/checkOnlyUser", method = RequestMethod.GET) public Result<Boolean> checkOnlyUser(SysUser sysUser) { Result<Boolean> result = new Result<>(); //如果此参数为false则程序发生异常 result.setResult(true); try { //通过传入信息查询新的用户信息 SysUser user = sysUserService.getOne(new QueryWrapper<SysUser>(sysUser)); if (user != null) { result.setSuccess(false); result.setMessage("用户账号已存在"); return result; } } catch (Exception e) { result.setSuccess(false); result.setMessage(e.getMessage()); return result; } result.setSuccess(true); return result; }
Example #16
Source File: SysDictController.java From jeecg-boot-with-activiti with MIT License | 6 votes |
/** * 获取字典数据 * @param dictCode * @return */ @RequestMapping(value = "/getDictText/{dictCode}/{key}", method = RequestMethod.GET) public Result<String> getDictItems(@PathVariable("dictCode") String dictCode, @PathVariable("key") String key) { log.info(" dictCode : "+ dictCode); Result<String> result = new Result<String>(); String text = null; try { text = sysDictService.queryDictTextByKey(dictCode, key); result.setSuccess(true); result.setResult(text); } catch (Exception e) { log.error(e.getMessage(),e); result.error500("操作失败"); return result; } return result; }
Example #17
Source File: SysUserController.java From jeecg-boot with Apache License 2.0 | 6 votes |
/** * 查询指定用户和部门关联的数据 * * @param userId * @return */ @RequestMapping(value = "/userDepartList", method = RequestMethod.GET) public Result<List<DepartIdModel>> getUserDepartsList(@RequestParam(name = "userId", required = true) String userId) { Result<List<DepartIdModel>> result = new Result<>(); try { List<DepartIdModel> depIdModelList = this.sysUserDepartService.queryDepartIdsOfUser(userId); if (depIdModelList != null && depIdModelList.size() > 0) { result.setSuccess(true); result.setMessage("查找成功"); result.setResult(depIdModelList); } else { result.setSuccess(false); result.setMessage("查找失败"); } return result; } catch (Exception e) { log.error(e.getMessage(), e); result.setSuccess(false); result.setMessage("查找过程中出现了异常: " + e.getMessage()); return result; } }
Example #18
Source File: SysCategoryController.java From jeecg-boot with Apache License 2.0 | 6 votes |
/** * [列表页面]加载分类字典数据 用于值的替换 * @param code * @return */ @RequestMapping(value = "/loadAllData", method = RequestMethod.GET) public Result<List<DictModel>> loadAllData(@RequestParam(name="code",required = true) String code) { Result<List<DictModel>> result = new Result<List<DictModel>>(); LambdaQueryWrapper<SysCategory> query = new LambdaQueryWrapper<SysCategory>(); if(oConvertUtils.isNotEmpty(code) && !"0".equals(code)){ query.likeRight(SysCategory::getCode,code); } List<SysCategory> list = this.sysCategoryService.list(query); if(list==null || list.size()==0) { result.setMessage("无数据,参数有误.[code]"); result.setSuccess(false); return result; } List<DictModel> rdList = new ArrayList<DictModel>(); for (SysCategory c : list) { rdList.add(new DictModel(c.getId(),c.getName())); } result.setSuccess(true); result.setResult(rdList); return result; }
Example #19
Source File: SysFillRuleController.java From jeecg-boot with Apache License 2.0 | 6 votes |
/** * 批量通过 ruleCode 执行自定义填值规则 * * @param ruleData 要执行的填值规则JSON数组: * 示例: { "commonFormData": {}, rules: [ { "ruleCode": "xxx", "formData": null } ] } * @return 运行后的结果,返回示例: [{"ruleCode": "order_num_rule", "result": "CN2019111117212984"}] * */ @PutMapping("/executeRuleByCodeBatch") public Result executeByRuleCodeBatch(@RequestBody JSONObject ruleData) { JSONObject commonFormData = ruleData.getJSONObject("commonFormData"); JSONArray rules = ruleData.getJSONArray("rules"); // 遍历 rules ,批量执行规则 JSONArray results = new JSONArray(rules.size()); for (int i = 0; i < rules.size(); i++) { JSONObject rule = rules.getJSONObject(i); String ruleCode = rule.getString("ruleCode"); JSONObject formData = rule.getJSONObject("formData"); // 如果没有传递 formData,就用common的 if (formData == null) { formData = commonFormData; } // 执行填值规则 Object result = FillRuleUtil.executeRule(ruleCode, formData); JSONObject obj = new JSONObject(rules.size()); obj.put("ruleCode", ruleCode); obj.put("result", result); results.add(obj); } return Result.ok(results); }
Example #20
Source File: SysUserAgentController.java From teaching with Apache License 2.0 | 5 votes |
/** * 通过userName查询 * @param userName * @return */ @GetMapping(value = "/queryByUserName") public Result<SysUserAgent> queryByUserName(@RequestParam(name="userName",required=true) String userName) { Result<SysUserAgent> result = new Result<SysUserAgent>(); LambdaQueryWrapper<SysUserAgent> queryWrapper = new LambdaQueryWrapper<SysUserAgent>(); queryWrapper.eq(SysUserAgent::getUserName, userName); SysUserAgent sysUserAgent = sysUserAgentService.getOne(queryWrapper); if(sysUserAgent==null) { result.error500("未找到对应实体"); }else { result.setResult(sysUserAgent); result.setSuccess(true); } return result; }
Example #21
Source File: TeachingCourseUnitController.java From teaching with Apache License 2.0 | 5 votes |
/** * 分页列表查询 * * @param teachingCourseUnit * @param pageNo * @param pageSize * @param req * @return */ @AutoLog(value = "课程单元-分页列表查询") @ApiOperation(value="课程单元-分页列表查询", notes="课程单元-分页列表查询") @GetMapping(value = "/list") @PermissionData public Result<?> queryPageList(CourseUnitModel teachingCourseUnit, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) { QueryWrapper<CourseUnitModel> queryWrapper = QueryGenerator.initQueryWrapper(teachingCourseUnit, req.getParameterMap()); Page<CourseUnitModel> page = new Page<CourseUnitModel>(pageNo, pageSize); IPage<CourseUnitModel> pageList = teachingCourseUnitService.getCourseUnitList(page, queryWrapper); return Result.ok(pageList); }
Example #22
Source File: SysUserAgentController.java From jeecg-boot-with-activiti with MIT License | 5 votes |
/** * 批量删除 * @param ids * @return */ @DeleteMapping(value = "/deleteBatch") public Result<SysUserAgent> deleteBatch(@RequestParam(name="ids",required=true) String ids) { Result<SysUserAgent> result = new Result<SysUserAgent>(); if(ids==null || "".equals(ids.trim())) { result.error500("参数不识别!"); }else { this.sysUserAgentService.removeByIds(Arrays.asList(ids.split(","))); result.success("删除成功!"); } return result; }
Example #23
Source File: SysPositionController.java From teaching with Apache License 2.0 | 5 votes |
/** * 通过id删除 * * @param id * @return */ @AutoLog(value = "职务表-通过id删除") @ApiOperation(value = "职务表-通过id删除", notes = "职务表-通过id删除") @DeleteMapping(value = "/delete") public Result<?> delete(@RequestParam(name = "id", required = true) String id) { try { sysPositionService.removeById(id); } catch (Exception e) { log.error("删除失败", e.getMessage()); return Result.error("删除失败!"); } return Result.ok("删除成功!"); }
Example #24
Source File: SysAnnouncementController.java From jeecg-boot with Apache License 2.0 | 5 votes |
/** * 分页列表查询 * @param sysAnnouncement * @param pageNo * @param pageSize * @param req * @return */ @RequestMapping(value = "/list", method = RequestMethod.GET) public Result<IPage<SysAnnouncement>> queryPageList(SysAnnouncement sysAnnouncement, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) { Result<IPage<SysAnnouncement>> result = new Result<IPage<SysAnnouncement>>(); sysAnnouncement.setDelFlag(CommonConstant.DEL_FLAG_0.toString()); QueryWrapper<SysAnnouncement> queryWrapper = new QueryWrapper<SysAnnouncement>(sysAnnouncement); Page<SysAnnouncement> page = new Page<SysAnnouncement>(pageNo,pageSize); //排序逻辑 处理 String column = req.getParameter("column"); String order = req.getParameter("order"); if(oConvertUtils.isNotEmpty(column) && oConvertUtils.isNotEmpty(order)) { if("asc".equals(order)) { queryWrapper.orderByAsc(oConvertUtils.camelToUnderline(column)); }else { queryWrapper.orderByDesc(oConvertUtils.camelToUnderline(column)); } } IPage<SysAnnouncement> pageList = sysAnnouncementService.page(page, queryWrapper); log.info("查询当前页:"+pageList.getCurrent()); log.info("查询当前页数量:"+pageList.getSize()); log.info("查询结果数量:"+pageList.getRecords().size()); log.info("数据总数:"+pageList.getTotal()); result.setSuccess(true); result.setResult(pageList); return result; }
Example #25
Source File: SysRoleController.java From jeecg-boot-with-activiti with MIT License | 5 votes |
/** * 分页列表查询 * @param role * @param pageNo * @param pageSize * @param req * @return */ @RequestMapping(value = "/list", method = RequestMethod.GET) public Result<IPage<SysRole>> queryPageList(SysRole role, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) { Result<IPage<SysRole>> result = new Result<IPage<SysRole>>(); QueryWrapper<SysRole> queryWrapper = QueryGenerator.initQueryWrapper(role, req.getParameterMap()); Page<SysRole> page = new Page<SysRole>(pageNo, pageSize); IPage<SysRole> pageList = sysRoleService.page(page, queryWrapper); result.setSuccess(true); result.setResult(pageList); return result; }
Example #26
Source File: SysDictController.java From jeecg-cloud with Apache License 2.0 | 5 votes |
/** * 【APP接口】根据字典配置查询表字典数据 * @param query * @param pageNo * @param pageSize * @return */ @GetMapping("/queryTableData") public Result<List<DictModel>> queryTableData(DictQuery query, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, @RequestParam(value = "sign",required = false) String sign,HttpServletRequest request){ Result<List<DictModel>> res = new Result<List<DictModel>>(); // SQL注入漏洞 sign签名校验 String dictCode = query.getTable()+","+query.getText()+","+query.getCode(); List<DictModel> ls = this.sysDictService.queryDictTablePageList(query,pageSize,pageNo); res.setResult(ls); res.setSuccess(true); return res; }
Example #27
Source File: SysDepartRoleController.java From jeecg-boot with Apache License 2.0 | 5 votes |
/** * 设置 * @param json * @return */ @RequestMapping(value = "/deptRoleUserAdd", method = RequestMethod.POST) public Result<?> deptRoleAdd(@RequestBody JSONObject json) { String newRoleId = json.getString("newRoleId"); String oldRoleId = json.getString("oldRoleId"); String userId = json.getString("userId"); departRoleUserService.deptRoleUserAdd(userId,newRoleId,oldRoleId); return Result.ok("添加成功!"); }
Example #28
Source File: QuartzJobController.java From jeecg-cloud with Apache License 2.0 | 5 votes |
/** * 添加定时任务 * * @param quartzJob * @return */ //@RequiresRoles({"admin"}) @RequestMapping(value = "/add", method = RequestMethod.POST) public Result<?> add(@RequestBody QuartzJob quartzJob) { List<QuartzJob> list = quartzJobService.findByJobClassName(quartzJob.getJobClassName()); if (list != null && list.size() > 0) { return Result.error("该定时任务类名已存在"); } quartzJobService.saveAndScheduleJob(quartzJob); return Result.ok("创建定时任务成功"); }
Example #29
Source File: SysUserController.java From jeecg-boot with Apache License 2.0 | 5 votes |
/** * 还原被逻辑删除的用户 * * @param jsonObject * @return */ @RequestMapping(value = "/putRecycleBin", method = RequestMethod.PUT) public Result putRecycleBin(@RequestBody JSONObject jsonObject, HttpServletRequest request) { String userIds = jsonObject.getString("userIds"); if (StringUtils.isNotBlank(userIds)) { SysUser updateUser = new SysUser(); updateUser.setUpdateBy(JwtUtil.getUserNameByToken(request)); updateUser.setUpdateTime(new Date()); sysUserService.revertLogicDeleted(Arrays.asList(userIds.split(",")), updateUser); } return Result.ok("还原成功"); }
Example #30
Source File: SysFileController.java From teaching with Apache License 2.0 | 5 votes |
/** * 通过id删除 * * @param id * @return */ @AutoLog(value = "文件管理-通过id删除") @ApiOperation(value="文件管理-通过id删除", notes="文件管理-通过id删除") @DeleteMapping(value = "/delete") public Result<?> delete(@RequestParam(name="id",required=true) String id) { sysFileService.removeById(id); return Result.ok("删除成功!"); }