基于SpringBoot音乐翻唱网站的设计与实现

打印 上一主题 下一主题

主题 589|帖子 589|积分 1767

今天气炸我了!
在网上刷到两个信息:二本不要报计算机!
二本不能报计算机,我特么真第一次听说!


我本硕都是双非,我周围有很多的同学,从双非读到了名校计算机的博士甚至博士后。
尽管进互联网大厂很难。是的,我承认这个概率很低。但是他们没进互联网大厂很多都有get到招聘的信息,然后不知道如何准备校招,如果他们知道刷题、刷项目、突击其他基础有很大可能进大厂的。
我看了不建议二本报计算机专业的自媒体人都不是本专业的。那真的不要乱说。不能为了流量,啥都乱说吧!就算本科不好,你完全可以考研啊!
我从本硕到工作,一直从事计算机的工作,我可以负责任地告诉大家,只要你努力上进学习,完全可以在二线城市买车买房,即时家里不帮助你!
你可以去看看程序员的工资是多少!
当然程序员行业也有些问题,例如:996、改bug,呆板……
但是相对生化环材的天坑专业好多了!
当然有些牛b的专业,例如金融!
但对普通人来说更难!
今天手撸一个音乐系统,springboot框架,数据库mysql,核心的介绍如下所示。
1,系统的界面演示












2,系统核心代码演示

  1. /**
  2. * 小孟v:jishulearn
  3. */
  4. @RequestMapping("config")
  5. @RestController
  6. public class ConfigController{
  7.        
  8.         @Autowired
  9.         private ConfigService configService;
  10.         /**
  11.      * 列表
  12.      */
  13.     @RequestMapping("/page")
  14.     public R page(@RequestParam Map<String, Object> params,ConfigEntity config){
  15.         EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
  16.             PageUtils page = configService.queryPage(params);
  17.         return R.ok().put("data", page);
  18.     }
  19.    
  20.         /**
  21.      * 列表
  22.      */
  23.     @IgnoreAuth
  24.     @RequestMapping("/list")
  25.     public R list(@RequestParam Map<String, Object> params,ConfigEntity config){
  26.         EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
  27.             PageUtils page = configService.queryPage(params);
  28.         return R.ok().put("data", page);
  29.     }
  30.     /**
  31.      * 信息
  32.      */
  33.     @RequestMapping("/info/{id}")
  34.     public R info(@PathVariable("id") String id){
  35.         ConfigEntity config = configService.selectById(id);
  36.         return R.ok().put("data", config);
  37.     }
  38.    
  39.     /**
  40.      * 详情
  41.      */
  42.     @IgnoreAuth
  43.     @RequestMapping("/detail/{id}")
  44.     public R detail(@PathVariable("id") String id){
  45.         ConfigEntity config = configService.selectById(id);
  46.         return R.ok().put("data", config);
  47.     }
  48.    
  49.     /**
  50.      * 根据name获取信息
  51.      */
  52.     @RequestMapping("/info")
  53.     public R infoByName(@RequestParam String name){
  54.         ConfigEntity config = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
  55.         return R.ok().put("data", config);
  56.     }
  57.    
  58.     /**
  59.      * 保存
  60.      */
  61.     @PostMapping("/save")
  62.     public R save(@RequestBody ConfigEntity config){
  63. //            ValidatorUtils.validateEntity(config);
  64.             configService.insert(config);
  65.         return R.ok();
  66.     }
  67.     /**
  68.      * 修改
  69.      */
  70.     @RequestMapping("/update")
  71.     public R update(@RequestBody ConfigEntity config){
  72. //        ValidatorUtils.validateEntity(config);
  73.         configService.updateById(config);//全部更新
  74.         return R.ok();
  75.     }
  76.     /**
  77.      * 删除
  78.      */
  79.     @RequestMapping("/delete")
  80.     public R delete(@RequestBody Long[] ids){
  81.             configService.deleteBatchIds(Arrays.asList(ids));
  82.         return R.ok();
  83.     }
  84. }
复制代码
  1. /**
  2. * 小孟v:jishulearn
  3. */
  4. @RestController
  5. public class CommonController{
  6.         @Autowired
  7.         private CommonService commonService;
  8.        
  9.         @Autowired
  10.         private ConfigService configService;
  11.        
  12.         private static AipFace client = null;
  13.        
  14.         private static String BAIDU_DITU_AK = null;
  15.        
  16.         @RequestMapping("/location")
  17.         public R location(String lng,String lat) {
  18.                 if(BAIDU_DITU_AK==null) {
  19.                         BAIDU_DITU_AK = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "baidu_ditu_ak")).getValue();
  20.                         if(BAIDU_DITU_AK==null) {
  21.                                 return R.error("请在配置管理中正确配置baidu_ditu_ak");
  22.                         }
  23.                 }
  24.                 Map<String, String> map = BaiduUtil.getCityByLonLat(BAIDU_DITU_AK, lng, lat);
  25.                 return R.ok().put("data", map);
  26.         }
  27.        
  28.         /**
  29.          * 人脸比对
  30.          *
  31.          * @param face1 人脸1
  32.          * @param face2 人脸2
  33.          * @return
  34.          */
  35.         @RequestMapping("/matchFace")
  36.         public R matchFace(String face1, String face2) {
  37.                 if(client==null) {
  38.                         /*String AppID = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "AppID")).getValue();*/
  39.                         String APIKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "APIKey")).getValue();
  40.                         String SecretKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "SecretKey")).getValue();
  41.                         String token = BaiduUtil.getAuth(APIKey, SecretKey);
  42.                         if(token==null) {
  43.                                 return R.error("请在配置管理中正确配置APIKey和SecretKey");
  44.                         }
  45.                         client = new AipFace(null, APIKey, SecretKey);
  46.                         client.setConnectionTimeoutInMillis(2000);
  47.                         client.setSocketTimeoutInMillis(60000);
  48.                 }
  49.                 JSONObject res = null;
  50.                 try {
  51.                         File file1 = new File(ResourceUtils.getFile("classpath:static/upload").getAbsolutePath()+"/"+face1);
  52.                         File file2 = new File(ResourceUtils.getFile("classpath:static/upload").getAbsolutePath()+"/"+face2);
  53.                         String img1 = Base64Util.encode(FileUtil.FileToByte(file1));
  54.                         String img2 = Base64Util.encode(FileUtil.FileToByte(file2));
  55.                         MatchRequest req1 = new MatchRequest(img1, "BASE64");
  56.                         MatchRequest req2 = new MatchRequest(img2, "BASE64");
  57.                         ArrayList<MatchRequest> requests = new ArrayList<MatchRequest>();
  58.                         requests.add(req1);
  59.                         requests.add(req2);
  60.                         res = client.match(requests);
  61.                         System.out.println(res.get("result"));
  62.                 } catch (FileNotFoundException e) {
  63.                         e.printStackTrace();
  64.                         return R.error("文件不存在");
  65.                 } catch (IOException e) {
  66.                         e.printStackTrace();
  67.                 }
  68.                 return R.ok().put("data", com.alibaba.fastjson.JSONObject.parse(res.get("result").toString()));
  69.         }
  70.    
  71.         /**
  72.          * 获取table表中的column列表(联动接口)
  73.          * @param table
  74.          * @param column
  75.          * @return
  76.          */
  77.         @IgnoreAuth
  78.         @RequestMapping("/option/{tableName}/{columnName}")
  79.         public R getOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,String level,String parent) {
  80.                 Map<String, Object> params = new HashMap<String, Object>();
  81.                 params.put("table", tableName);
  82.                 params.put("column", columnName);
  83.                 if(StringUtils.isNotBlank(level)) {
  84.                         params.put("level", level);
  85.                 }
  86.                 if(StringUtils.isNotBlank(parent)) {
  87.                         params.put("parent", parent);
  88.                 }
  89.                 List<String> data = commonService.getOption(params);
  90.                 return R.ok().put("data", data);
  91.         }
  92.        
  93.         /**
  94.          * 根据table中的column获取单条记录
  95.          * @param table
  96.          * @param column
  97.          * @return
  98.          */
  99.         @IgnoreAuth
  100.         @RequestMapping("/follow/{tableName}/{columnName}")
  101.         public R getFollowByOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName, @RequestParam String columnValue) {
  102.                 Map<String, Object> params = new HashMap<String, Object>();
  103.                 params.put("table", tableName);
  104.                 params.put("column", columnName);
  105.                 params.put("columnValue", columnValue);
  106.                 Map<String, Object> result = commonService.getFollowByOption(params);
  107.                 return R.ok().put("data", result);
  108.         }
  109.        
  110.         /**
  111.          * 修改table表的sfsh状态
  112.          * @param table
  113.          * @param map
  114.          * @return
  115.          */
  116.         @RequestMapping("/sh/{tableName}")
  117.         public R sh(@PathVariable("tableName") String tableName, @RequestBody Map<String, Object> map) {
  118.                 map.put("table", tableName);
  119.                 commonService.sh(map);
  120.                 return R.ok();
  121.         }
  122.        
  123.         /**
  124.          * 获取需要提醒的记录数
  125.          * @param tableName
  126.          * @param columnName
  127.          * @param type 1:数字 2:日期
  128.          * @param map
  129.          * @return
  130.          */
  131.         @IgnoreAuth
  132.         @RequestMapping("/remind/{tableName}/{columnName}/{type}")
  133.         public R remindCount(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,
  134.                                                  @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
  135.                 map.put("table", tableName);
  136.                 map.put("column", columnName);
  137.                 map.put("type", type);
  138.                
  139.                 if(type.equals("2")) {
  140.                         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  141.                         Calendar c = Calendar.getInstance();
  142.                         Date remindStartDate = null;
  143.                         Date remindEndDate = null;
  144.                         if(map.get("remindstart")!=null) {
  145.                                 Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
  146.                                 c.setTime(new Date());
  147.                                 c.add(Calendar.DAY_OF_MONTH,remindStart);
  148.                                 remindStartDate = c.getTime();
  149.                                 map.put("remindstart", sdf.format(remindStartDate));
  150.                         }
  151.                         if(map.get("remindend")!=null) {
  152.                                 Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
  153.                                 c.setTime(new Date());
  154.                                 c.add(Calendar.DAY_OF_MONTH,remindEnd);
  155.                                 remindEndDate = c.getTime();
  156.                                 map.put("remindend", sdf.format(remindEndDate));
  157.                         }
  158.                 }
  159.                
  160.                 int count = commonService.remindCount(map);
  161.                 return R.ok().put("count", count);
  162.         }
  163.        
  164.         /**
  165.          * 单列求和
  166.          */
  167.         @IgnoreAuth
  168.         @RequestMapping("/cal/{tableName}/{columnName}")
  169.         public R cal(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
  170.                 Map<String, Object> params = new HashMap<String, Object>();
  171.                 params.put("table", tableName);
  172.                 params.put("column", columnName);
  173.                 Map<String, Object> result = commonService.selectCal(params);
  174.                 return R.ok().put("data", result);
  175.         }
  176.        
  177.         /**
  178.          * 分组统计
  179.          */
  180.         @IgnoreAuth
  181.         @RequestMapping("/group/{tableName}/{columnName}")
  182.         public R group(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
  183.                 Map<String, Object> params = new HashMap<String, Object>();
  184.                 params.put("table", tableName);
  185.                 params.put("column", columnName);
  186.                 List<Map<String, Object>> result = commonService.selectGroup(params);
  187.                 return R.ok().put("data", result);
  188.         }
  189.        
复制代码
如果你想学习更多的技术,欢迎关注我!
   你好,我是小孟,10年开发老司机,小作坊boss、做过码农、主管、产品经理。喜欢自由,讨厌职场的勾心斗角。我的偶像是乔布斯,10年前选择计算机这个行业,就是因为热爱。现在已而立之年,虽然没有当初追寻技术的单纯,但依然热爱。技术改变世界,知识改变命运是我不变的信念。学习、思考、因时代变化而变化是我的武器。如果我觉得一件事,值得干,至少我会坚持5年。在我毕业一年后,我就搞定了房贷、车贷等一切贷款,所以我可以自由。我不喜欢循规蹈矩和被安排的生活,大学时候就喜欢折腾,现在也是。我大多数时候很孤独,也喜欢孤独,不怎么合群,在创业中苟延残喘的活下来。未来怎么样,我不知道,但是我依然会追寻有激情的生活和事情,我相信坚持的力量,如果能把一件事坚持下去,真的可以打败99%的人。关注我,一起聊技术、职场、人生和好玩的事。

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

正序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

风雨同行

金牌会员
这个人很懒什么都没写!

标签云

快速回复 返回顶部 返回列表