设为首页 加入收藏

TOP

最代码网站中关于动态表event的设计思路(二)
2014-11-24 08:16:24 来源: 作者: 【 】 浏览:11
Tags:代码 网站 关于 动态 event 设计 思路
swer answer = null; Project project = null; switch (eventRule.getType()) { case ModuleConstants.EVENT_TYPE_RULE_PROJECT_CREATE: case ModuleConstants.EVENT_TYPE_RULE_PROJECT_DELETE_BY_USER: case ModuleConstants.EVENT_TYPE_RULE_PROJECT_DELETE_BY_ADMIN: case ModuleConstants.EVENT_TYPE_RULE_PROJECT_VIEW: case ModuleConstants.EVENT_TYPE_RULE_PROJECT_COLLECT: case ModuleConstants.EVENT_TYPE_RULE_PROJECT_REWARD: if (sourceId > 0) { source = projectService.findOneById(sourceId); } if (targetId > 0) { target = projectService.findOneById(targetId); } project = (Project) target; if (source != null) { project = (Project) source; } if (project == null) { return; } _description = String.format( description, ModuleConstants.PROJECT_TYPE_DESC_MAP.get( project.getType()).getDesc()); break; case ModuleConstants.EVENT_TYPE_RULE_POST_CREATE: case ModuleConstants.EVENT_TYPE_RULE_POST_DELETE_BY_USER: case ModuleConstants.EVENT_TYPE_RULE_POST_DELETE_BY_ADMIN: if (sourceId > 0) { source = postService.findOneById(sourceId); } if (targetId > 0) { target = postService.findOneById(targetId); } Post post = (Post) target; if (source != null) { post = (Post) source; } _description = String.format(description, ModuleConstants.POST_TYPE_DESC_MAP.get(post.getType())); break; // case ModuleConstants.EVENT_TYPE_RULE_GROUP_CREATE://暂时没有这种动态 case ModuleConstants.EVENT_TYPE_RULE_GROUP_JOIN_IN: case ModuleConstants.EVENT_TYPE_RULE_GROUP_DELETE_BY_USER: // case // ModuleConstants.EVENT_TYPE_RULE_GROUP_DELETE_BY_ADMIN://暂时没有这种动态 if (sourceId > 0) { source = groupService.findOneById(sourceId); } if (targetId > 0) { target = groupService.findOneById(targetId); } Group group = (Group) source; _description = String .format(description, ModuleConstants.GROUP_TYPE_DESC_MAP.get(group .getType())); break; case ModuleConstants.EVENT_TYPE_RULE_COMMENT_CREATE: case ModuleConstants.EVENT_TYPE_RULE_COMMENT_DELETE_BY_USER: case ModuleConstants.EVENT_TYPE_RULE_COMMENT_DELETE_BY_ADMIN: target = commentService.findOneById(targetId); Comment comment = (Comment) target; int commentType = comment.getType(); if (commentType == ModuleConstants.COMMENT_TYPE_ANSWER) { source = answerService.findOneById(sourceId); answer = (Answer) source; project = (Project) answer.getTarget(); _description = String.format( description, ModuleConstants.PROJECT_TYPE_DESC_MAP.get( project.getType()).getDesc()); } else if (commentType == ModuleConstants.COMMENT_TYPE_PROJECT) { source = projectService.findOneById(sourceId); project = (Project) source; _description = String.format( description, ModuleConstants.PROJECT_TYPE_DESC_MAP.get( project.getType()).getDesc()); } else if (commentType == ModuleConstants.COMMENT_TYPE_POST) { source = postService.findOneById(sourceId); post = (Post) source; _des
首页 上一页 1 2 3 4 下一页 尾页 2/4/4
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇微机主板维修思路 下一篇rman备份优化思路

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·Redis on AWS:Elast (2025-12-27 04:19:30)
·在 Spring Boot 项目 (2025-12-27 04:19:27)
·使用华为开发者空间 (2025-12-27 04:19:24)
·Getting Started wit (2025-12-27 03:49:24)
·Ubuntu 上最好用的中 (2025-12-27 03:49:20)