2020-2021学年第二学期《非关系型数据库系统》考查报告
课题名称:基于HBASE博客系统
班 级:
学 号:
姓 名:
成 绩:
2021年6月
(一)非关系型数据库集的搭建
(二)c++课程设计报告数据库存储对象的定义
(1)课题简介
完成系统需求分析;完成系统的项目架构设计;完成Hbase数据系统环境的搭建;完成用
户信息管理功能的实现; 完成关注用户功能实现; 完成取关用户功能实现;完成发布微博功能与实现;完成获取个人所有微博功能的实现。
(2)数据库表清单
(三)Web应用编写
此处描写Java Web应用的实现界面和代码。此部分主要介绍功能的实现,每个功能分别描述。每个功能单独作为二级标题。
(1)登录、注册功能
1)功能简介
(2)写微博功能
(1)功能简介
(3)修改、删除功能
(1)功能介绍
(3)关注功能
(1)功能介绍
代码:
控制层代码:
@Controller
public class Control {
@Resource
private UserService userService;
@Resource
private MicroblogService microblogService;
@Resource
private AFService afService;
@RequestMapping("toRegister")
public String toRegister(){
return "registerView";
}
@RequestMapping("register")
public String register(String uname,String upwd){
int count =userService.queryUserByUserName(uname);
if(count>0||uname==null||upwd==null){
return "registerView";
}
userService.addUser(uname,upwd);
return "redirect:index.jsp";
}
@RequestMapping("toLogin")
public String toLogin(){
return "loginView";
}
@RequestMapping("login")
public String login(String uname, String upwd, HttpSession session){
int count =userService.queryUserByNameAndPwd(uname,upwd);
if(count!=1){
return "loginView";
}
User UserByName(uname);
session.setAttribute("user",user);
return "userView";
}
@RequestMapping("toUserView")
public String toShowMicroblog(){
return "userView";
}
@RequestMapping("toWriteMicroblog")
public String toWriteMicroblog(){
return "writeMicroblogView";
}
@RequestMapping("writeMicroblog")
public String writeMicroblog(String data,HttpSession session) throws Exception{
User user= (User) Attribute("user");
microblogService.addMicroblog(user,data);
Uname());
session.setAttribute("user",user);
return "userView";
}
@RequestMapping("showMicroblog")
public String showMircroblog(HttpSession session, HttpServletRequest request) throws Exception{
User user= (User) Attribute("user");
List<Microblog> microblogs=microblogService.Uname());
request.setAttribute("microblogs",microblogs);
return "microblogView";
}
@RequestMapping("toUpdateMicroblog")
public String toUpdateMicroblog(String colVal, HttpSession session) throws Exception{
User user= (User) Attribute("user");
Microblog Uname(),colVal);
session.setAttribute("microblog",microblog);
return "updateMicroblogView";
}
@RequestMapping("updateMicroblog")
public String updateMicroblog(String data,HttpSession session) throws Exception{
Microblog microblog= (Microblog) Attribute("microblog");
microblog.setData(data);
microblogService.updateMicroblog(microblog);
veAttribute("microblog");
return "redirect:showMicroblog";
}
@RequestMapping("returnMicroblog")
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论