Java项目:SSH在线交友交流网站平台管理系统

作者主页:夜未央5788

 简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

项目介绍

本项目分为前后台,前台为用户角色登录,后台为管理员登录;

管理员角色包含以下功能:

管理员登录,用户管理,积分管理,等级管理,意见箱管理,新闻发布管理等功能。

用户角色包含以下功能:
用户登录注册,用户首页,我的相册管理,和好友在线聊天,个人基本信息管理,好友动态查看,意见箱管理等功能。

由于本程序规模不大,可供课程设计,毕业设计学习演示之用

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;

5.数据库:MySql 5.7版本;

6.是否Maven项目:否;

技术栈

1. 后端:mysql+Spring+hibernate+spring mcv

2. 前端:JSP+CSS+JavaScript+Bootstrap+jQuery

使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,本项目前台与后台是分开的两个项目,需要分别运行;
3. 将项目中jdbc.properties配置文件中的数据库配置改为自己的配置;
4. 运行项目,前台登录地址:http://localhost:8080/ssh_zxjypt_sys/ 登录
用户账号/密码: user/123456

后台登录地址:http://localhost:8081/ssh_zxjypt_sys_manage/
管理员账号/密码:admin/admin

运行截图

前台界面-用户角色

 

 

 

 

 

管理员界面

 

 

 

相关代码 

积分管理控制器

@Controller("jsAction")
@Scope("prototype")
public class JfAction extends ActionSupport implements ModelDriven<Jf>{
  private Jf jf;
  @Autowired
  private JfService JfService;
	@Override
	public Jf getModel() {
		if(jf==null) jf = new Jf();
		return jf;
	}
	
	public String jfList(){
		List<Jf> jfs = JfService.list();
		return null;
	}

	
	public String findJfByType(){
		Jf jf =	JfService.findJfByType(1);
		return null;
	}
}

消息管理控制器

@Controller("messageAction")
@Scope("prototype")
public class MessageAction extends ActionSupport implements ModelDriven<Message> {

	private Message message;
	
	@Autowired
	private MessageService messageService;
	@Override
	public Message getModel() {
		if(message==null) message = new Message();
		return message;
	}
	
	/**
	 * 页面一开始加载的时候,就进行聊天记录查询
	 * @throws IOException 
	 */
	public void findMessageJIluList() throws IOException{
		HttpServletResponse resp = ServletActionContext.getResponse();
		resp.setContentType("application/json;charset=UTF-8");
		PrintWriter out = null;
		HttpSession session =	ServletActionContext.getRequest().getSession();
		if(session.getAttribute("userId") != null){
			int userId = Integer.parseInt( session.getAttribute("userId").toString());
			List<Message> messages = messageService.findMessageJIluList(userId);
			out = resp.getWriter();
			 System.out.println(JSONArray.fromObject(messages).toString());
			 out.write(JSONArray.fromObject(messages).toString());
	    }
	}
	
	/**
	 * 发送消息
	 * @throws IOException
	 */
	public void sendMessage() throws IOException{
		HttpServletResponse resp = ServletActionContext.getResponse();
		resp.setContentType("application/json;charset=UTF-8");
		PrintWriter out = null;
		HttpSession session =	ServletActionContext.getRequest().getSession();
		if(session.getAttribute("userId") != null){
			int userId = Integer.parseInt( session.getAttribute("userId").toString());
			JSONObject json  = new JSONObject();
			int re = messageService.saveMessage(userId,message);
			if(re<0){//失败
				json.put("result", 2);
			}else{
				json.put("result", 1);
			}
			
			out = resp.getWriter();
			/* System.out.println(JSONArray.fromObject(messages).toString());*/
			 out.write(json.toString());
	    }
		
	}
}

会员管理控制器

@Controller("gradeAction")
@Scope("prototype")
public class GradeAction extends ActionSupport implements ModelDriven<Grade> {
   private Grade grade;
   @Autowired
   private GradeService gradeService;
	@Override
	public Grade getModel() {
		if(grade==null) grade = new Grade();
		return grade;
	}
	public String gradeList(){
		List<Grade> gads = gradeService.list();
		ActionContext.getContext().put("gads", gads);
		return SUCCESS;
	}

	public String addgrade(){
		return SUCCESS;
	}
	public String add(){
		gradeService.add(grade);
		ActionContext.getContext().put("url", "/grade_gradeList.do");
		return "redirect";
	}
	
	/*普通会员(1-500积分)
    黄金会员(501-1200积分)
    白金会员(1201-1800积分)
    钻石会员(1800积分以上)*/
	public String updategrade(){
		Grade g = gradeService.load(grade);
		ActionContext.getContext().put("grade", g);
		return SUCCESS;
	}
	
	public String update(){
		gradeService.update(grade);
		ActionContext.getContext().put("url", "/grade_gradeList.do");
		return "redirect";
	}
	
	public String del(){
		gradeService.del(grade);
		ActionContext.getContext().put("url", "/grade_gradeList.do");
		return "redirect";
	}

}

如果也想学习本系统,下面领取。关注并回复:099ssh

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夜未央5788

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值