当前位置: 首页 > article >正文

Java项目-基于springboot框架的智能热度分析和自媒体推送平台项目实战(附源码+文档)

作者:计算机学长阿伟
开发技术:SpringBoot、SSM、Vue、MySQL、ElementUI等,“文末源码”。

开发运行环境

  • 开发语言:Java
  • 数据库:MySQL
  • 技术:SpringBoot、Vue、Mybaits Plus、ELementUI
  • 工具:IDEA/Ecilpse、Navicat、Maven

源码下载地址:

Java项目-基于springboot框架的智能热度分析和自媒体推送平台项目实战(附源码+文档)资源-CSDN文库

一、项目简介

        该项目是一个集智能热度分析和自媒体推送功能于一体的综合性平台。平台界面简洁明了,以白色为背景,顶部配以浅蓝色横条,底部为深蓝色,营造出清晰舒适的视觉效果。导航栏上设置了多个功能选项,包括首页、文章信息、图片信息、视频信息、个人中心和后台管理,每个选项都配备有蓝色的下拉箭头,方便用户快速访问所需功能。该平台旨在通过智能分析技术,为自媒体创作者提供热度分析、内容推送等一站式服务,助力其精准定位受众,提升内容影响力。

三、系统项目部分截图

3.1后台系统部分页面效果

3.2前台系统部分页面效果

四、部分核心代码


package com.controller;


import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;

/**
 * 登录相关
 */
@RequestMapping("users")
@RestController
public class UserController{
	
	@Autowired
	private UserService userService;
	
	@Autowired
	private TokenService tokenService;

	/**
	 * 登录
	 */
	@IgnoreAuth
	@PostMapping(value = "/login")
	public R login(String username, String password, String captcha, HttpServletRequest request) {
		UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
		if(user==null || !user.getPassword().equals(password)) {
			return R.error("账号或密码不正确");
		}
		String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
		return R.ok().put("token", token);
	}
	
	/**
	 * 注册
	 */
	@IgnoreAuth
	@PostMapping(value = "/register")
	public R register(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);
    	if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
    		return R.error("用户已存在");
    	}
        userService.insert(user);
        return R.ok();
    }

	/**
	 * 退出
	 */
	@GetMapping(value = "logout")
	public R logout(HttpServletRequest request) {
		request.getSession().invalidate();
		return R.ok("退出成功");
	}
	
	/**
     * 密码重置
     */
    @IgnoreAuth
	@RequestMapping(value = "/resetPass")
    public R resetPass(String username, HttpServletRequest request){
    	UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
    	if(user==null) {
    		return R.error("账号不存在");
    	}
    	user.setPassword("123456");
        userService.update(user,null);
        return R.ok("密码已重置为:123456");
    }
	
	/**
     * 列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,UserEntity user){
        EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
    	PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/list")
    public R list( UserEntity user){
       	EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
      	ew.allEq(MPUtil.allEQMapPre( user, "user")); 
        return R.ok().put("data", userService.selectListView(ew));
    }

    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") String id){
        UserEntity user = userService.selectById(id);
        return R.ok().put("data", user);
    }
    
    /**
     * 获取用户的session用户信息
     */
    @RequestMapping("/session")
    public R getCurrUser(HttpServletRequest request){
    	Long id = (Long)request.getSession().getAttribute("userId");
        UserEntity user = userService.selectById(id);
        return R.ok().put("data", user);
    }

    /**
     * 保存
     */
    @PostMapping("/save")
    public R save(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);
    	if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
    		return R.error("用户已存在");
    	}
        userService.insert(user);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody UserEntity user){
//        ValidatorUtils.validateEntity(user);
    	UserEntity u = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername()));
    	if(u!=null && u.getId()!=user.getId() && u.getUsername().equals(user.getUsername())) {
    		return R.error("用户名已存在。");
    	}
        userService.updateById(user);//全部更新
        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        userService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
}

获取源码或文档

如需对应的论文或文档,以及其他定制需求,也可以下方添加联系我。


http://www.kler.cn/news/356131.html

相关文章:

  • C++:priority_queue优先队列
  • Spring Boot视频网站:构建高性能的视频服务
  • ASO优化手机游戏的秘密功能
  • Ubuntu安装运行 xx.AppImage 文件
  • KCC@广州活动预告:开源共融,粤创未来
  • 基于SpringBoot+Vue+uniapp的涪陵区特色农产品交易系统的详细设计和实现(源码+lw+部署文档+讲解等)
  • Linux 系统常用命令
  • 鸿蒙-键盘弹出时 promptAction.showToast 被遮盖
  • KubeSphere部署Elasticsearch+Kibana
  • vulnhub(15):lemonsqueezy(hydra爆破、计划任务提权)
  • Vue是一套构建用户界面的渐进式框架,常用于构建单页面应用
  • OpenCV高级图形用户界面(7)获取指定窗口的属性值函数getWindowProperty()的使用
  • 十二、结构型(代理模式)
  • 雷达液位计在污水测量中的应用与优势
  • sentinel原理源码分析系列(四)-ContextEntry
  • Python爬虫进阶:高效数据采集的艺术
  • MySQL-10.DML-添加数据insert
  • 机器视觉入门基础相关概念一 ——单目相机模型
  • 高级java每日一道面试题-2024年10月18日-数据库篇[Redis篇]-一个Redis实例最多能存放多少的keys?
  • OpenWRT 和 Padavan 路由器配置网络打印机 实现远程打印