栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

SpringBoot+Vue项目在线小说阅读平台

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

SpringBoot+Vue项目在线小说阅读平台

文末获取源码

开发语言:Java

框架:springboot

JDK版本:JDK1.8

服务器:tomcat7

数据库:mysql 5.7/8.0

数据库工具:Navicat11

开发软件:eclipse/myeclipse/idea

Maven包:Maven3.3.9

浏览器:谷歌浏览器

前言介绍

系统采用了Java技术springboot框架,前端使用 element-ui 组件库,选择MySQL作为系统的数据库,开发工具选择 idea来进行系统的设计。基本实现了在线小说阅读平台应有的主要功能模块,本系统有以下功能:

(1)前台:首页、小说信息、交流论坛、公告资讯、个人中心、后台管理。 

(2)管理员:首页、个人中心、会员管理、小说分类管理、小说信息管理、小说评分管理、交流论坛、系统管理。

(3)会员:首页、个人中心。

系统展示 前台 

 

小说信息

 

公告资讯

管理员功能 登录   会员管理

小说分类管理 

 

小说信息管理 

小说评分管理 

部分核心代码 

 

# Tomcat
server:
    tomcat:
        uri-encoding: UTF-8
    port: 8080
    servlet:
        context-path: /springbootm3h7l

spring:
    datasource:
        driverClassName: com.mysql.jdbc.Driver
        url: jdbc:mysql://127.0.0.1:3306/springbootm3h7l?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8
        username: root
        password:

#        driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
#        url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=springbootm3h7l
#        username: sa
#        password: 123456

    servlet:
      multipart:
        max-file-size: 300MB
        max-request-size: 300MB
    resources:
      static-locations: classpath:static/,file:static/

#mybatis
mybatis-plus:
  mapper-locations: classpath*:mapper
@RestController
@RequestMapping("/xiaoshuoxinxi")
public class XiaoshuoxinxiController {
    @Autowired
    private XiaoshuoxinxiService xiaoshuoxinxiService;

    @Autowired
    private StoreupService storeupService;

    


    
    @RequestMapping("/page")
    public R page(@RequestParam Map params,XiaoshuoxinxiEntity xiaoshuoxinxi,
		HttpServletRequest request){
        EntityWrapper ew = new EntityWrapper();
		PageUtils page = xiaoshuoxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xiaoshuoxinxi), params), params));

        return R.ok().put("data", page);
    }
    
    
	@IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map params,XiaoshuoxinxiEntity xiaoshuoxinxi, 
		HttpServletRequest request){
        EntityWrapper ew = new EntityWrapper();
		PageUtils page = xiaoshuoxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xiaoshuoxinxi), params), params));
        return R.ok().put("data", page);
    }

	
    @RequestMapping("/lists")
    public R list( XiaoshuoxinxiEntity xiaoshuoxinxi){
       	EntityWrapper ew = new EntityWrapper();
      	ew.allEq(MPUtil.allEQMapPre( xiaoshuoxinxi, "xiaoshuoxinxi")); 
        return R.ok().put("data", xiaoshuoxinxiService.selectListView(ew));
    }

	 
    @RequestMapping("/query")
    public R query(XiaoshuoxinxiEntity xiaoshuoxinxi){
        EntityWrapper< XiaoshuoxinxiEntity> ew = new EntityWrapper< XiaoshuoxinxiEntity>();
 		ew.allEq(MPUtil.allEQMapPre( xiaoshuoxinxi, "xiaoshuoxinxi")); 
		XiaoshuoxinxiView xiaoshuoxinxiView =  xiaoshuoxinxiService.selectView(ew);
		return R.ok("查询小说信息成功").put("data", xiaoshuoxinxiView);
    }
	
    
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        XiaoshuoxinxiEntity xiaoshuoxinxi = xiaoshuoxinxiService.selectById(id);
		xiaoshuoxinxi.setClicknum(xiaoshuoxinxi.getClicknum()+1);
		xiaoshuoxinxi.setClicktime(new Date());
		xiaoshuoxinxiService.updateById(xiaoshuoxinxi);
        return R.ok().put("data", xiaoshuoxinxi);
    }

    
	@IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        XiaoshuoxinxiEntity xiaoshuoxinxi = xiaoshuoxinxiService.selectById(id);
		xiaoshuoxinxi.setClicknum(xiaoshuoxinxi.getClicknum()+1);
		xiaoshuoxinxi.setClicktime(new Date());
		xiaoshuoxinxiService.updateById(xiaoshuoxinxi);
        return R.ok().put("data", xiaoshuoxinxi);
    }
    



    
    @RequestMapping("/save")
    public R save(@RequestBody XiaoshuoxinxiEntity xiaoshuoxinxi, HttpServletRequest request){
    	xiaoshuoxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(xiaoshuoxinxi);
        xiaoshuoxinxiService.insert(xiaoshuoxinxi);
        return R.ok();
    }
    
    
    @RequestMapping("/add")
    public R add(@RequestBody XiaoshuoxinxiEntity xiaoshuoxinxi, HttpServletRequest request){
    	xiaoshuoxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(xiaoshuoxinxi);
        xiaoshuoxinxiService.insert(xiaoshuoxinxi);
        return R.ok();
    }

    
    @RequestMapping("/update")
    @Transactional
    public R update(@RequestBody XiaoshuoxinxiEntity xiaoshuoxinxi, HttpServletRequest request){
        //ValidatorUtils.validateEntity(xiaoshuoxinxi);
        xiaoshuoxinxiService.updateById(xiaoshuoxinxi);//全部更新
        return R.ok();
    }
    

    
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        xiaoshuoxinxiService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
    
	@RequestMapping("/remind/{columnName}/{type}")
	public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
						 @PathVariable("type") String type,@RequestParam Map map) {
		map.put("column", columnName);
		map.put("type", type);
		
		if(type.equals("2")) {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			Calendar c = Calendar.getInstance();
			Date remindStartDate = null;
			Date remindEndDate = null;
			if(map.get("remindstart")!=null) {
				Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
				c.setTime(new Date()); 
				c.add(Calendar.DAY_OF_MONTH,remindStart);
				remindStartDate = c.getTime();
				map.put("remindstart", sdf.format(remindStartDate));
			}
			if(map.get("remindend")!=null) {
				Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
				c.setTime(new Date());
				c.add(Calendar.DAY_OF_MONTH,remindEnd);
				remindEndDate = c.getTime();
				map.put("remindend", sdf.format(remindEndDate));
			}
		}
		
		Wrapper wrapper = new EntityWrapper();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}


		int count = xiaoshuoxinxiService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	
	
	@IgnoreAuth
    @RequestMapping("/autoSort")
    public R autoSort(@RequestParam Map params,XiaoshuoxinxiEntity xiaoshuoxinxi, HttpServletRequest request,String pre){
        EntityWrapper ew = new EntityWrapper();
        Map newMap = new HashMap();
        Map param = new HashMap();
		Iterator> it = param.entrySet().iterator();
		while (it.hasNext()) {
			Map.Entry entry = it.next();
			String key = entry.getKey();
			String newKey = entry.getKey();
			if (pre.endsWith(".")) {
				newMap.put(pre + newKey, entry.getValue());
			} else if (StringUtils.isEmpty(pre)) {
				newMap.put(newKey, entry.getValue());
			} else {
				newMap.put(pre + "." + newKey, entry.getValue());
			}
		}
		params.put("sort", "clicknum");
        params.put("order", "desc");
		PageUtils page = xiaoshuoxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xiaoshuoxinxi), params), params));
        return R.ok().put("data", page);
    }







}

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/1039733.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号