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

程序员怎么做网站赚钱环保局网站建设方案

程序员怎么做网站赚钱,环保局网站建设方案,网站改版的宣传词,内蒙古网站建设公司文章目录 在线音乐系统一、项目演示二、项目介绍三、部分功能截图四、部分代码展示五、底部获取项目#xff08;9.9#xffe5;带走#xff09; 在线音乐系统 一、项目演示 音乐网站 二、项目介绍 基于springbootvue的前后端分离在线音乐系统 登录角色 : 用户、管理员 用… 文章目录 在线音乐系统一、项目演示二、项目介绍三、部分功能截图四、部分代码展示五、底部获取项目9.9带走 在线音乐系统 一、项目演示 音乐网站 二、项目介绍 基于springbootvue的前后端分离在线音乐系统 登录角色 : 用户、管理员 用户歌单分类分页界面歌手分类分页界面我的音乐查看收藏歌曲搜索音乐可根据歌手、歌曲、歌单名进行搜索头像修改、用户信息修改歌曲播放进度条拉伸歌词加载歌曲收藏歌曲下载登录、注册等 管理员系统首页展示统计数据用户管理歌手管理歌曲管理修改音源歌词后台评论上传音乐 语言java 前端技术vue、element-ui、echarts 后端技术springboot、mybatisplus 数据库MySQL 三、部分功能截图 四、部分代码展示 package com.rabbiter.music.controller;import com.alibaba.fastjson.JSONObject; import com.rabbiter.music.pojo.Collect; import com.rabbiter.music.service.CollectService; import com.rabbiter.music.utils.Consts; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest;/*** 收藏控制类*/ RestController RequestMapping(/collect) Api(tags 收藏) public class CollectController {Autowiredprivate CollectService CollectService;/*** 添加收藏*/ApiOperation(value 添加收藏)RequestMapping(value /add,method RequestMethod.POST)public Object addCollect(HttpServletRequest request){JSONObject jsonObject new JSONObject();String userId request.getParameter(userId); //用户idString type request.getParameter(type); //收藏类型0歌曲1歌单String songId request.getParameter(songId); //歌曲idif(songIdnull||songId.equals()){jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,收藏歌曲为空);return jsonObject;}if(CollectService.existSongId(Integer.parseInt(userId),Integer.parseInt(songId))){jsonObject.put(Consts.CODE,2);jsonObject.put(Consts.MSG,已收藏);return jsonObject;}//保存到收藏的对象中Collect Collect new Collect();Collect.setUserId(Integer.parseInt(userId));Collect.setType(new Byte(type));Collect.setSongId(Integer.parseInt(songId));boolean flag CollectService.insert(Collect);if(flag){ //保存成功jsonObject.put(Consts.CODE,1);jsonObject.put(Consts.MSG,收藏成功);return jsonObject;}jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,收藏失败);return jsonObject;}/*** 删除收藏*/ApiOperation(value 取消收藏)RequestMapping(value /delete,method RequestMethod.GET)public Object deleteCollect(HttpServletRequest request){String userId request.getParameter(userId); //用户idString songId request.getParameter(songId); //歌曲idboolean flag CollectService.deleteByUserIdSongId(Integer.parseInt(userId),Integer.parseInt(songId));return flag;}/*** 查询所有收藏*/ApiOperation(value 查看所有收藏)RequestMapping(value /allCollect,method RequestMethod.GET)public Object allCollect(HttpServletRequest request){return CollectService.allCollect();}/*** 查询某个用户的收藏列表*/ApiOperation(value 用户的收藏列表)RequestMapping(value /collectOfUserId,method RequestMethod.GET)public Object collectOfUserId(HttpServletRequest request){String userId request.getParameter(userId); //用户idreturn CollectService.collectOfUserId(Integer.parseInt(userId));}} package com.rabbiter.music.controller;import com.alibaba.fastjson.JSONObject; import com.rabbiter.music.pojo.Comment; import com.rabbiter.music.service.CommentService; import com.rabbiter.music.utils.Consts; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest;/*** 评论控制类*/ Api(tags 评论) RestController RequestMapping(/comment) public class CommentController {Autowiredprivate CommentService commentService;/*** 添加评论*/ApiOperation(value 添加评论)RequestMapping(value /add,method RequestMethod.POST)public Object addComment(HttpServletRequest request){JSONObject jsonObject new JSONObject();String userId request.getParameter(userId); //用户idString type request.getParameter(type); //评论类型0歌曲1歌单String songId request.getParameter(songId); //歌曲idString songListId request.getParameter(songListId); //歌单idString content request.getParameter(content).trim(); //评论内容//保存到评论的对象中Comment comment new Comment();comment.setUserId(Integer.parseInt(userId));comment.setType(new Byte(type));if(new Byte(type) 0){comment.setSongId(Integer.parseInt(songId));}else{comment.setSongListId(Integer.parseInt(songListId));}comment.setContent(content);boolean flag commentService.insert(comment);if(flag){ //保存成功jsonObject.put(Consts.CODE,1);jsonObject.put(Consts.MSG,评论成功);return jsonObject;}jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,评论失败);return jsonObject;}/*** 修改评论*/ApiOperation(value 修改评论)RequestMapping(value /update,method RequestMethod.POST)public Object updateComment(HttpServletRequest request){JSONObject jsonObject new JSONObject();String id request.getParameter(id).trim(); //主键String userId request.getParameter(userId).trim(); //用户idString type request.getParameter(type).trim(); //评论类型0歌曲1歌单String songId request.getParameter(songId).trim(); //歌曲idString songListId request.getParameter(songListId).trim(); //歌单idString content request.getParameter(content).trim(); //评论内容//保存到评论的对象中Comment comment new Comment();comment.setId(Integer.parseInt(id));comment.setUserId(Integer.parseInt(userId));comment.setType(new Byte(type));if(songId!nullsongId.equals()){songId null;}else {comment.setSongId(Integer.parseInt(songId));}if(songListId!nullsongListId.equals()){songListId null;}else {comment.setSongListId(Integer.parseInt(songListId));}comment.setContent(content);boolean flag commentService.update(comment);if(flag){ //保存成功jsonObject.put(Consts.CODE,1);jsonObject.put(Consts.MSG,修改成功);return jsonObject;}jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,修改失败);return jsonObject;}/*** 删除评论*/ApiOperation(value 删除评论)RequestMapping(value /delete,method RequestMethod.GET)public Object deleteComment(HttpServletRequest request){String id request.getParameter(id).trim(); //主键boolean flag commentService.delete(Integer.parseInt(id));return flag;}/*** 根据主键查询整个对象*/ApiOperation(value 根据主键查询整个对象)RequestMapping(value /selectByPrimaryKey,method RequestMethod.GET)public Object selectByPrimaryKey(HttpServletRequest request){String id request.getParameter(id).trim(); //主键return commentService.selectByPrimaryKey(Integer.parseInt(id));}/*** 查询所有评论*/ApiOperation(value 查询所有评论)RequestMapping(value /allComment,method RequestMethod.GET)public Object allComment(HttpServletRequest request){return commentService.allComment();}/*** 查询某个歌曲下的所有评论*/ApiOperation(value 查询某个歌曲下的所有评论)RequestMapping(value /commentOfSongId,method RequestMethod.GET)public Object commentOfSongId(HttpServletRequest request){String songId request.getParameter(songId); //歌曲idreturn commentService.commentOfSongId(Integer.parseInt(songId));}/*** 查询某个歌单下的所有评论*/ApiOperation(value 查询某个歌单下的所有评论)RequestMapping(value /commentOfSongListId,method RequestMethod.GET)public Object commentOfSongListId(HttpServletRequest request){String songListId request.getParameter(songListId); //歌曲idreturn commentService.commentOfSongListId(Integer.parseInt(songListId));}/*** 给某个评论点赞*/ApiOperation(value 给某个评论点赞)RequestMapping(value /like,method RequestMethod.POST)public Object like(HttpServletRequest request){JSONObject jsonObject new JSONObject();String id request.getParameter(id).trim(); //主键String up request.getParameter(up).trim(); //用户id//保存到评论的对象中Comment comment new Comment();comment.setId(Integer.parseInt(id));comment.setUp(Integer.parseInt(up));boolean flag commentService.update(comment);if(flag){ //保存成功jsonObject.put(Consts.CODE,1);jsonObject.put(Consts.MSG,点赞成功);return jsonObject;}jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,点赞失败);return jsonObject;}} package com.rabbiter.music.controller;import com.alibaba.fastjson.JSONObject; import com.rabbiter.music.pojo.Consumer; import com.rabbiter.music.service.ConsumerService; import com.rabbiter.music.utils.Consts; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; import java.io.File; import java.io.IOException; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date;/*** 前端用户控制类*/ RestController RequestMapping(/consumer) Api(tags 用户) public class ConsumerController {Autowiredprivate ConsumerService consumerService;/*** 添加前端用户*/ApiOperation(value 注册、添加前端用户)RequestMapping(value /add,method RequestMethod.POST)public Object addConsumer(HttpServletRequest request){JSONObject jsonObject new JSONObject();String username request.getParameter(username).trim(); //账号String password request.getParameter(password).trim(); //密码String sex request.getParameter(sex).trim(); //性别String phoneNum request.getParameter(phoneNum).trim(); //手机号String email request.getParameter(email).trim(); //电子邮箱String birth request.getParameter(birth).trim(); //生日String introduction request.getParameter(introduction).trim();//签名String location request.getParameter(location).trim(); //地区String avator request.getParameter(avator).trim(); //头像地址if(usernamenull||username.equals()){jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,用户名不能为空);return jsonObject;}Consumer consumer1 consumerService.getByUsername(username);if(consumer1!null){jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,用户名已存在);return jsonObject;}if(passwordnull||password.equals()){jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,密码不能为空);return jsonObject;}//把生日转换成Date格式DateFormat dateFormat new SimpleDateFormat(yyyy-MM-dd);Date birthDate new Date();try {birthDate dateFormat.parse(birth);} catch (ParseException e) {e.printStackTrace();}//保存到前端用户的对象中Consumer consumer new Consumer();consumer.setUsername(username);consumer.setPassword(password);consumer.setSex(new Byte(sex));consumer.setPhoneNum(phoneNum);consumer.setEmail(email);consumer.setBirth(birthDate);consumer.setIntroduction(introduction);consumer.setLocation(location);consumer.setAvator(avator);boolean flag consumerService.insert(consumer);if(flag){ //保存成功jsonObject.put(Consts.CODE,1);jsonObject.put(Consts.MSG,添加成功);return jsonObject;}jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,添加失败);return jsonObject;}/*** 修改前端用户*/ApiOperation(value 修改前端用户)RequestMapping(value /update,method RequestMethod.POST)public Object updateConsumer(HttpServletRequest request){JSONObject jsonObject new JSONObject();String id request.getParameter(id).trim(); //主键String username request.getParameter(username).trim(); //账号String password request.getParameter(password).trim(); //密码String sex request.getParameter(sex).trim(); //性别String phoneNum request.getParameter(phoneNum).trim(); //手机号String email request.getParameter(email).trim(); //电子邮箱String birth request.getParameter(birth).trim(); //生日String introduction request.getParameter(introduction).trim();//签名String location request.getParameter(location).trim(); //地区if(usernamenull||username.equals()){jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,用户名不能为空);return jsonObject;}if(passwordnull||password.equals()){jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,密码不能为空);return jsonObject;}//把生日转换成Date格式DateFormat dateFormat new SimpleDateFormat(yyyy-MM-dd);Date birthDate new Date();try {birthDate dateFormat.parse(birth);} catch (ParseException e) {e.printStackTrace();}//保存到前端用户的对象中Consumer consumer new Consumer();consumer.setId(Integer.parseInt(id));consumer.setUsername(username);consumer.setPassword(password);consumer.setSex(new Byte(sex));consumer.setPhoneNum(phoneNum);consumer.setEmail(email);consumer.setBirth(birthDate);consumer.setIntroduction(introduction);consumer.setLocation(location);boolean flag consumerService.update(consumer);if(flag){ //保存成功jsonObject.put(Consts.CODE,1);jsonObject.put(Consts.MSG,修改成功);return jsonObject;}jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,修改失败);return jsonObject;}/*** 删除前端用户*/ApiOperation(value 删除前端用户)RequestMapping(value /delete,method RequestMethod.GET)public Object deleteConsumer(HttpServletRequest request){String id request.getParameter(id).trim(); //主键boolean flag consumerService.delete(Integer.parseInt(id));return flag;}/*** 根据主键查询整个对象*/ApiOperation(value 根据主键查询整个对象)RequestMapping(value /selectByPrimaryKey,method RequestMethod.GET)public Object selectByPrimaryKey(HttpServletRequest request){String id request.getParameter(id).trim(); //主键return consumerService.selectByPrimaryKey(Integer.parseInt(id));}/*** 查询所有前端用户*/ApiOperation(value 查询所有前端用户)RequestMapping(value /allConsumer,method RequestMethod.GET)public Object allConsumer(HttpServletRequest request){return consumerService.allConsumer();}/*** 更新前端用户图片*/ApiOperation(value 更新前端用户图片)RequestMapping(value /updateConsumerPic,method RequestMethod.POST)public Object updateConsumerPic(RequestParam(file) MultipartFile avatorFile, RequestParam(id)int id){JSONObject jsonObject new JSONObject();if(avatorFile.isEmpty()){jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,文件上传失败);return jsonObject;}//文件名当前时间到毫秒原来的文件名String fileName System.currentTimeMillis()avatorFile.getOriginalFilename();//文件路径String filePath System.getProperty(user.dir)System.getProperty(file.separator)userImages;//如果文件路径不存在新增该路径File file1 new File(filePath);if(!file1.exists()){file1.mkdir();}//实际的文件地址File dest new File(filePathSystem.getProperty(file.separator)fileName);//存储到数据库里的相对文件地址String storeAvatorPath /userImages/fileName;try {avatorFile.transferTo(dest);Consumer consumer new Consumer();consumer.setId(id);consumer.setAvator(storeAvatorPath);boolean flag consumerService.update(consumer);if(flag){jsonObject.put(Consts.CODE,1);jsonObject.put(Consts.MSG,上传成功);jsonObject.put(avator,storeAvatorPath);return jsonObject;}jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,上传失败);return jsonObject;} catch (IOException e) {jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,上传失败e.getMessage());}finally {return jsonObject;}}/*** 前端用户登录*/ApiOperation(value 前端用户登录)RequestMapping(value /login,method RequestMethod.POST)public Object login(HttpServletRequest request){JSONObject jsonObject new JSONObject();String username request.getParameter(username).trim(); //账号String password request.getParameter(password).trim(); //密码if(usernamenull||username.equals()){jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,用户名不能为空);return jsonObject;}if(passwordnull||password.equals()){jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,密码不能为空);return jsonObject;}//保存到前端用户的对象中Consumer consumer new Consumer();consumer.setUsername(username);consumer.setPassword(password);boolean flag consumerService.verifyPassword(username,password);if(flag){ //验证成功jsonObject.put(Consts.CODE,1);jsonObject.put(Consts.MSG,登录成功);jsonObject.put(userMsg,consumerService.getByUsername(username));return jsonObject;}jsonObject.put(Consts.CODE,0);jsonObject.put(Consts.MSG,用户名或密码错误);return jsonObject;} } 五、底部获取项目9.9带走 有问题或者需要协助调试运行项目的也可以
http://www.hkea.cn/news/14457580/

相关文章:

  • 成都微信网站建设推阳江建设网站
  • 网站做程序西安vi设计公司
  • 网站建设中通知一级域名与二级域名有啥区别
  • 国外免费iphone网站小程序ui界面设计
  • 家教网站模板下载郑州企业网站价格
  • 舟山市建设工程造价管理协会网站徐州建站推广
  • 龙华网站建设网站做超链接薪资多少一个月
  • php企业网站通讯录管理系统wordpress $数组
  • 网站建设完工后在什么科目核算北京网站制作服务
  • 建阳网站建设wzjseo汕头seo管理
  • 移动端网站建设 新闻动态南阳千牛网站建设
  • 轴承外贸网站怎么做淄博网站seo公司
  • 云南建设厅网站 安全员南宁市平台公司
  • 易语言登录WordPress账号泰兴网站优化
  • 企智网站建设深圳广告牌制作公司
  • 各学院二级网站建设通报cmd iis重启单个网站
  • 淮安集团网站建设网上商城开发
  • 网站建设公司新报娄底网站建设wyo8
  • 莆田社交网站青岛外贸网站
  • 南通公司网站模板建站wordpress主题知更
  • 网站空格 教程wordpress 生成gif
  • 厦门在线制作网站合肥企业建站程序
  • 政务服务中心网站建设实施方案怎么查看网站提交百度的度
  • 深圳网站建设..软件开发外包
  • 郑州哪家网站建设好wordpress怎么设置派送中
  • 中国企业网站开发wordpress和vue哪个好
  • 网站是怎么做新手引导南宁整合推广公司
  • 网站建设太金手指六六十一如何做免费企业网站
  • 四川建设厅网站打不开wordpress主题二级菜单栏
  • 一个网站收录很高 但外链很少是什么原因深圳营销策划公司哪家好