本文主要是介绍:Java+MySQL基于ssm的个人婚恋交友网站,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
文末获取源码
开发环境
项目编号:Java+MySQL ssm239个人婚恋交友网站
开发语言:Java
开发工具:IDEA /Eclipse
数据库:MYSQL5.7
应用服务:Tomcat7/Tomcat8
使用框架:ssm+vue
项目介绍
个人交友网站的主要使用者分为管理员和用户,实现功能包括管理员:个人中心、用户管理、交友信息管理、线下活动管理、活动报名管理、系统公告管理、论坛交流、系统管理,用户:个人中心、交友信息管理、活动报名管理、我的收藏管理,前台首页;首页、交友信息、线下活动、系统公告、论坛信息、我的、跳转到后台、客服等功能。由于本网站的功能模块设计比较全面,所以使得整个个人交友网站信息管理的过程得以实现。
系统截图
关键代码
/*** 交友信息* 后端接口* @author * @email * @date 2021-03-03 14:14:54*/
@RestController
@RequestMapping("/jiaoyouxinxi")
public class JiaoyouxinxiController {@Autowiredprivate JiaoyouxinxiService jiaoyouxinxiService;/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,JiaoyouxinxiEntity jiaoyouxinxi, HttpServletRequest request){String tableName = request.getSession().getAttribute("tableName").toString();if(tableName.equals("yonghu")) {jiaoyouxinxi.setYonghuzhanghao((String)request.getSession().getAttribute("username"));}EntityWrapper<JiaoyouxinxiEntity> ew = new EntityWrapper<JiaoyouxinxiEntity>();PageUtils page = jiaoyouxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiaoyouxinxi), params), params));request.setAttribute("data", page);return R.ok().put("data", page);}/*** 前端列表*/@IgnoreAuth@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params,JiaoyouxinxiEntity jiaoyouxinxi, HttpServletRequest request){EntityWrapper<JiaoyouxinxiEntity> ew = new EntityWrapper<JiaoyouxinxiEntity>();PageUtils page = jiaoyouxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiaoyouxinxi), params), params));request.setAttribute("data", page);return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/lists")public R list( JiaoyouxinxiEntity jiaoyouxinxi){EntityWrapper<JiaoyouxinxiEntity> ew = new EntityWrapper<JiaoyouxinxiEntity>();ew.allEq(MPUtil.allEQMapPre( jiaoyouxinxi, "jiaoyouxinxi")); return R.ok().put("data", jiaoyouxinxiService.selectListView(ew));}/*** 查询*/@RequestMapping("/query")public R query(JiaoyouxinxiEntity jiaoyouxinxi){EntityWrapper< JiaoyouxinxiEntity> ew = new EntityWrapper< JiaoyouxinxiEntity>();ew.allEq(MPUtil.allEQMapPre( jiaoyouxinxi, "jiaoyouxinxi")); JiaoyouxinxiView jiaoyouxinxiView = jiaoyouxinxiService.selectView(ew);return R.ok("查询交友信息成功").put("data", jiaoyouxinxiView);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id){JiaoyouxinxiEntity jiaoyouxinxi = jiaoyouxinxiService.selectById(id);jiaoyouxinxi.setClicknum(jiaoyouxinxi.getClicknum()+1);jiaoyouxinxi.setClicktime(new Date());jiaoyouxinxiService.updateById(jiaoyouxinxi);return R.ok().put("data", jiaoyouxinxi);}/*** 前端详情*/@IgnoreAuth@RequestMapping("/detail/{id}")public R detail(@PathVariable("id") Long id){JiaoyouxinxiEntity jiaoyouxinxi = jiaoyouxinxiService.selectById(id);jiaoyouxinxi.setClicknum(jiaoyouxinxi.getClicknum()+1);jiaoyouxinxi.setClicktime(new Date());jiaoyouxinxiService.updateById(jiaoyouxinxi);return R.ok().put("data", jiaoyouxinxi);}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody JiaoyouxinxiEntity jiaoyouxinxi, HttpServletRequest request){jiaoyouxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(jiaoyouxinxi);jiaoyouxinxiService.insert(jiaoyouxinxi);return R.ok();}/*** 前端保存*/@RequestMapping("/add")public R add(@RequestBody JiaoyouxinxiEntity jiaoyouxinxi, HttpServletRequest request){jiaoyouxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(jiaoyouxinxi);jiaoyouxinxiService.insert(jiaoyouxinxi);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody JiaoyouxinxiEntity jiaoyouxinxi, HttpServletRequest request){//ValidatorUtils.validateEntity(jiaoyouxinxi);jiaoyouxinxiService.updateById(jiaoyouxinxi);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){jiaoyouxinxiService.deleteBatchIds(Arrays.asList(ids));return R.ok();}
这篇关于:Java+MySQL基于ssm的个人婚恋交友网站的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!