前后端项目-part02

文章目录

  • 4 课程分类树
    • 4.1 需求展示
    • 4.2 后端开发
      • 4.2.1 添加工具类
      • 4.2.2 添加依赖
      • 4.2.3 创建实体类
      • 4.2.4 创建Mapper
      • 4.2.5 创建Service
      • 4.2.6 创建Controller
      • 4.2.7创建启动类
      • 4.2.8创建yml文件
      • 4.2.9测试
    • 4.3 前端开发
      • 4.3.1 树形控件测试
      • 4.3.2 替换测试数据
    • 4.4 利用ThreadLocal实现共享用户信息
      • 4.4.1创建工具类
      • 4.4.2 改造用户登录
    • 4.5 添加SpringMVC拦截器
      • 4.5.1 创建拦截器
      • 4.5.2 注册拦截器
      • 4.5.3 使用拦截器
      • 4.5.4 测试
  • 5课程信息管理
    • 5.1 效果图
      • 5.1.1 前台
      • 5.1.2 项目结构
    • 5.2 前台开发
      • 5.2.1 修改navment.vue-添加新菜单
      • 5.2.2 修改router/index.js-配置新菜单
      • 5.2.3 创建api/Course.js
      • 5.2.4 pages下创建新组件course.vue
      • 5.2.5 测试
    • 5.3 后台开发
      • 5.3.1 创建实体类
      • 5.3.2 创建CourseMapper
      • 5.3.3 创建CourseService
      • 5.3.4 CourseController
      • 5.3.5 创建启动类
      • 5.3.6 修改pom,添加依赖
      • 5.3.7 创建配置文件
    • 5.4 准备下拉框数据
      • 5.4.1 一级分类
        • 5.4.1.1 创建Options
        • 5.4.1.2 修改CategoryService
        • 5.4.1.3 修改CategoryController
        • 5.4.1.4 测试
        • 5.4.1.5 创建basic.js
        • 5.4.1.6修改course.vue
        • 5.4.1.7测试
        • 5.4.1.8 Bytheway 修改basic.js,修改welcom.vue,测试
      • 5.4.2 二级分类
        • 5.4.2.1 后台开发
        • 5.4.2.1 前台开发
        • 5.4.2.3 测试
      • 5.4.3 课程等级 & 教学模式
        • 5.4.3.1 创建实体类Dictionary
        • 5.4.3.2 创建CategoryMapper
        • 5.4.3.3 创建DictionaryService
        • 5.4.3.4 创建DictionaryController
        • 5.4.3.5 后台测试
        • 5.4.3.6 前台开发
        • 5.4.3.7 前后端测试

4 课程分类树

4.1 需求展示

在这里插入图片描述

4.2 后端开发

在这里插入图片描述

4.2.1 添加工具类

在这里插入图片描述

4.2.2 添加依赖

在这里插入图片描述

4.2.3 创建实体类

package com.zx.category.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
//课程分类实体
@TableName("tb_category")
@NoArgsConstructor
@AllArgsConstructor
@Data
@ToString
@Accessors(chain = true)
public class Category implements Serializable {
   
    private String id;//编号
    private String name;//名称
    private String label;//展示名称
    private String parentid;//父id
    private Integer is_show;//是否展现,1是0不是
    private Integer orderby;//排序规则
    private Integer is_leaf;//是否叶子,1是0不是

}

4.2.4 创建Mapper

package com.zx.category.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zx.category.entity.Category;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface CategoryMapper extends BaseMapper<Category> {
   
}

4.2.5 创建Service

package com.zx.category.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.common.tree.Node;
import com.zx.category.entity.Category;
import com.zx.category.mapper.CategoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class CategoryService extends ServiceImpl<CategoryMapper, Category> {
   
    @Autowired
    private CategoryMapper categoryMapper;

    //查询课程分类三级菜单
    public List<Node> getTree() {
   
        //存放所有维护好的数据
        List<Node> tree = new ArrayList<>();

        //查询1级菜单->SELECT * from tb_category where parentid=0 and is_show=1
        QueryWrapper qw1 = new QueryWrapper();//封装查询条件
        qw1.eq("parentid", 0);//父节点id为0
        qw1.eq("is_show", 1);//需要展示
        List<Category> level1 = categoryMapper.selectList(qw1);//查到所有1级菜单
        for (Category c : level1) {
   
            Node node1 = new Node();//1级节点
            node1.setValue(c.getId());
            node1.setLabel(c.getLabel());
//            node1.setChildren();//1级菜单的子菜单是2级菜单,现在需要查询所有2级菜单
            //查询2级菜单,并添加为1级菜单的children->SELECT * from tb_category where parentid='1' and is_show=1 order by orderby
            QueryWrapper<Category> qw2 = new QueryWrapper<>();
            qw2.eq("parentid", "1");
            qw2.eq("is_show", 1);
            qw2.orderByAsc("orderby");//排序
            List<Category> level2 = categoryMapper.selectList(qw2);//查到所有2级

            //存2级节点
            List<Node> children1 = new ArrayList<>();
            for (Category c2 : level2) {
   
                Node node2 = new Node();//2级节点
                node2.setValue(c2.getId());
                node2.setLabel(c2.getLabel());
//                node2.setChildren();//2级菜单的子菜单,继续查3级...
                //查询3级菜单,并添加为2级菜单的children->SELECT * from tb_category where parentid='1-1' and is_show=1 order by orderby
                QueryWrapper<Category> qw3 = new QueryWrapper<>();
                qw3.eq("parentid", c2.getId());
                qw3.eq("is_show", 1);
                qw3.orderByAsc("orderby");//排序
                List<Category> level3 = categoryMapper.selectList(qw3);//查到所有3级

                //存3级节点
                List<Node> children2 = new ArrayList<>();
                for (Category c3 : level3) {
   
                    Node node3 = new Node();//2级节点
                    node3.setValue(c3.getId());
                    node3.setLabel(c3.getLabel());
//                    node3.setChildren();//3级菜单是叶子节点,他没有子节点
                    children2.add(node3);//TODO 1.把查出来的3级节点,添加为2级节点的children
                }

                children1.add(node2); //TODO 2.把查出来的2级节点,添加为1级节点的children
                node2.setChildren(children2);//TODO 3.把children2添加给node2
            }
            node1.setChildren(children1);//TODO 4.把children1添加给node1
            tree.add(node1);//准备返回数据
        }
        return tree;
    }
}

4.2.6 创建Controller

package com.zx.category.controller;

import com.common.tree.Node;
import com.zx.category.entity.Category;
import com.zx.category.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/basic/category")
public class CategoryController {
   

    @Autowired
    private CategoryService categoryService;

    @RequestMapping("/getTree")
    //查询课程分类三级菜单
    public List<Node> getTree() {
   
        return categoryService.getTree();
    }

}

4.2.7创建启动类

package com.zx.category;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class BasicRunApp {
   
    public static void main(String[] args) {
   
        SpringApplication.run(BasicRunApp.class);
    }
}

4.2.8创建yml文件

server:
  port: 9999
spring:
  application:
    name: zx-basic-service
  datasource:
    type: com.zaxxer.hikari.HikariDataSource
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://localhost:3306/zx-basic?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
    username: root
    password: root

    hikari:
      minimum-idle: 5
      maximum-pool-size: 15
      auto-commit: true
      idle-timeout: 30000
      pool-name: DatebookHikariCP
      max-lifetime: 1800000
      connection-timeout: 30000
      connection-test-query: SELECT 1
mybatis-plus:
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
  mapper-locations: classpath:/mapper/*.xml
  type-aliases-package: com.zx.category.entity

4.2.9测试

在这里插入图片描述

4.3 前端开发

4.3.1 树形控件测试

拿来主义,找到elementui官网的实例代码,一整个直接拷贝到welcome.vue里,启动服务测试效果
在这里插入图片描述

<template>
	<h2>欢迎您来到我们的MOOC世界,开始您的技术学习之旅</h2>
	<a href="https://blog.csdn.net/u012932876/article/details/118487949" target="_blank"
	 class="button">java学习路径 官网</a>

	<!-- 树形控件 -->
	<el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>


	<div style="padding-top: 20px;"><img src='/images/info.png'/></div>
	
</template>

<script >
 export default {
     
    data() {
     
      return {
     
        data: [{
     
          label: '一级 1',
          children: [{
     
            label: '二级 1-1',
            children: [{
     
              label: '三级 1-1-1'
            }]
          }]
        }, {
     
          label: '一级 2',
          children: [{
     
            label: '二级 2-1',
            children: [{
     
              label: '三级 2-1-1'
            }]
          }, {
     
            label: '二级 2-2',
            children: [{
     
              label: '三级 2-2-1'
            }]
          }]
        }, {
     
          label: '一级 3',
          children: [{
     
            label: '二级 3-1',
            children: [{
     
              label: '三级 3-1-1'
            }]
          }, {
     
            label: '二级 3-2',
            children: [{
     
              label: '三级 3-2-1'
            }]
          }]
        }],
        defaultProps: {
     
          children: 'children',
          label: 'label'
        }
      };
    },
    methods: {
     
      handleNodeClick(data) {
     
        console.log(data);
      }
    }
  };
</script>

<style scoped>
	a.button {
     
		background-color: #4CAF50;
		padding: 6px 16px 7px 16px;
		font-size: 14px;
		color: white;
		text-align: center;
		border: none;
		cursor: pointer;
		border-radius: 4px;
		margin-right: 20px;
		text-decoration:none;
	}

	a.button:hover {
     
		background-color: #3e8e41;
	}
</style>

4.3.2 替换测试数据

把后端返回的JSON串,直接替换掉data
在这里插入图片描述

<template>
	<h2>欢迎您来到我们的MOOC世界,开始您的技术学习之旅</h2>
	<a href="https://blog.csdn.net/u012932876/article/details/118487949" target="_blank"
	 class="button">java学习路径 官网</a>

	<!-- 树形控件 -->
	<el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>


	<div style="padding-top: 20px;"><img src='/images/info.png'/></div>
	
</template>

<script >
 export default {
     
    data() {
     
      return {
     
        data:[
    {
     
        "value": "1",
        "label": "根结点",
        "children": [
            {
     
                "value": "1-1",
                "label": "前端开发",
                "children": [
                    {
     
                        "value": "1-1-2",
                        "label": "JavaScript",
                        "children": null
                    },
                    {
     
                        "value": "1-1-3",
                        "label": "jQuery",
                        "children": null
                    },
                    {
     
                        "value": "1-1-4",
                        "label": "ExtJS",
                        "children": null
                    },
                    {
     
                        "value": "1-1-5",
                        "label": "AngularJS",
                        "children": null
                    },
                    {
     
                        "value": "1-1-6",
                        "label": "ReactJS",
                        "children": null
                    },
                    {
     
                        "value": "1-1-7",
                        "label": "Bootstrap",
                        "children": null
                    },
                    {
     
                        "value": "1-1-8",
                        "label": "Node.js",
                        "children": null
                    },
                    {
     
                        "value": "1-1-9",
                        "label": "Vue",
                        "children": null
                    },
                    {
     
                        "value": "1-1-10",
                        "label": "其它",
                        "children": null
                    }
                ]
            },
            {
     
                "value": "1-2",
                "label": "移动开发",
                "children": [
                    {
     
                        "value": "1-2-1",
                        "label": "微信开发",
                        "children": null
                    },
                    {
     
                        "value": "1-2-2",
                        "label": "iOS",
                        "children": null
                    },
                    {
     
                        "value": "1-2-3",
                        "label": "手游开发",
                        "children": null
                    },
                    {
     
                        "value": "1-2-4",
                        "label": "Swift",
                        "children": null
                    },
                    {
     
                        "value": "1-2-5",
                        "label": "Android",
                        "children": null
                    },
                    {
     
                        "value": "1-2-6",
                        "label": "ReactNative",
                        "children": null
                    },
                    {
     
                        "value": "1-2-7",
                        "label": "Cordova",
                        "children": null
                    },
                    {
     
                        "value": "1-2-8",
                        "label": "其它",
                        "children": null
                    }
                ]
            },
            {
     
                "value": "1-3",
                "label": "编程开发",
                "children": [
                    {
     
                        "value": "1-3-1",
                        "label": "C/C++",
                        "children": null
                    },
                    {
     
                        "value": "1-3-2",
                        "label": "Java",
                        "children": null
                    },
                    {
     
                        "value": "1-3-3",
                        "label": ".NET",
                        "children": null
                    },
                    {
     
                        "value": "1-3-4",
                        "label": "Objective-C",
                        "children": null
                    },
                    {
     
                        "value": "1-3-5",
                        "label": "Go语言",
                        "children": null
                    },
                    {
     
                        "value": "1-3-6",
                        "label": "Python",
                        "children": null
                    },
                    {
     
                        "value": "1-3-7",
                        "label": "Ruby/Rails",
                        "children": null
                    },
                    {
     
                        "value": "1-3-8",
                        "label": "其它",
                        "children": null
                    }
                ]
            },
            {
     
                "value": "1-4",
                "label": "数据库",
                "children": [
                    {
     
                        "value": "1-4-1",
                        "label": "Oracle",
                        "children": null
                    },
                    {
     
                        "value": "1-4-2",
                        "label": "MySQL",
                        "children": null
                    },
                    {
     
                        "value": "1-4-3",
                        "label": "SQL Server",
                        "children": null
                    },
                    {
     
                        "value": "1-4-4",
                        "label": "DB2",
                        "children": null
                    },
                    {
     
                        "value": "1-4-5",
                        "label": "NoSQL",
                        "children": null
                    },
                    {
     
                        "value": "1-4-6",
                        "label": "Mongo DB",
                        "children": null
                    },
                    {
     
                        "value": "1-4-7",
                        "label": "Hbase",
                        "children": null
                    },
                    {
     
                        "value": "1-4-8",
                        "label": "数据仓库",
                        "children": null
                    },
                    {
     
                        "value": "1-4-9",
                        "label": "其它",
                        "children": null
                    }
                ]
            },
            {
     
                "value": "1-5",
                "label": "人工智能",
                "children": [
                    {
     
                        "value": "1-5-1",
                        "label": "机器学习",
                        "children": null
                    },
                    {
     
                        "value": "1-5-2",
                        "label": "深度学习",
                        "children": null
                    },
                    {
     
                        "value": "1-5-3",
                        "label": "语音识别",
                        "children": null
                    },
                    {
     
                        "value": "1-5-4",
                        "label": "计算机视觉",
                        "children": null
                    },
                    {
     
                        "value": "1-5-5",
                        "label": "NLP",
                        "children": null
                    },
                    {
     
                        "value": "1-5-6",
                        "label": "强化学习",
                        "children": null
                    },
                    {
     
                        "value": "1-5-7",
                        "label": "其它",
                        "children": null
                    }
                ]
            },
            {
     
                "value": "1-6",
                "label": "云计算/大数据",
                "children": [
                    {
     
                        "value": "1-6-1",
                        "label": "Spark",
                        "children": null
                    },
                    {
     
                        "value": "1-6-2",
                        "label": "Hadoop",
                        "children": null
                    },
                    {
     
                        "value": "1-6-3",
                        "label": "OpenStack",
                        "children": null
                    },
                    {
     
                        "value": "1-6-4",
                        "label": "Docker/K8S",
                        "children": null
                    },
                    {
     
                        "value": "1-6-5",
                        "label": "云计算基础架构",
                        "children": null
                    },
                    {
     
                        "value": "1-6-6",
                        "label": "虚拟化技术",
                        "children": null
                    },
                    {
     
                        "value": "1-6-7",
                        "label": "云平台",
                        "children": null
                    },
                    {
     
                        "value": "1-6-8",
                        "label": "ELK",
                        "children": null
                    },
                    {
     
                        "value": "1-6-9",
                        "label": "其它",
                        "children": null
                    }
                ]
            },
            {
     
                "value": "1-7",
                "label": "UI设计",
                "children": [
                    {
     
                        "value": "1-7-1",
                        "label": "Photoshop",
                        "children": null
                    },
                    {
     
                        "value": "1-7-2",
                        "label": "3Dmax",
                        "children": null
                    },
                    {
     
                        "value": "1-7-3",
                        "label": "Illustrator",
                        "children": null
                    },
                    {
     
                        "value": "1-7-4",
                        "label": "Flash",
                        "children": null
                    },
                    {
     
                        "value": "1-7-5",
                        "label": "Maya",
                        "children": null
                    },
                    {
     
                        "value": "1-7-6",
                        "label": "AUTOCAD",
                        "children": null
                    },
                    {
     
                        "value": "1-7-7",
                        "label": "UG",
                        "children": null
                    },
                    {
     
                        "value": "1-7-8",
                        "label": "SolidWorks",
                        "children": null
                    },
                    {
     
                        "value": "1-7-9",
                        "label": "CorelDraw",
                        "children": null
                    },
                    {
     
                        "value": "1-7-10",
                        "label": "InDesign",
                        "children": null
                    },
                    {
     
                        "value": "1-7-11",
                        "label": "Pro/Engineer",
                        "children": null
                    },
                    {
     
                        "value": "1-7-12",
                        "label": "Cinema 4D",
                        "children": null
                    },
                    {
     
                        "value": "1-7-13",
                        "label": "3D Studio",
                        "children": null
                    },
                    {
     
                        "value": "1-7-14",
                        "label": "After Effects(AE)",
                        "children": null
                    },
                    {
     
                        "value": "1-7-15",
                        "label": "原画设计",
                        "children": null
                    },
                    {
     
                        "value": "1-7-16",
                        "label": "动画制作",
                        "children": null
                    },
                    {
     
                        "value": "1-7-17",
                        "label": "Dreamweaver",
                        "children": null
                    },
                    {
     
                        "value": "1-7-18",
                        "label": "Axure",
                        "children": null
                    },
                    {
     
                        "value": "1-7-19",
                        "label": "其它",
                        "children": null
                    }
                ]
            },
            {
     
                "value": "1-8",
                "label": "游戏开发",
                "children": [
                    {
     
                        "value": "1-8-1",
                        "label": "Cocos",
                        "children": null
                    },
                    {
     
                        "value": "1-8-2",
                        "label": "Unity3D",
                        "children": null
                    },
                    {
     
                        "value": "1-8-3",
                        "label": "Flash",
                        "children": null
                    },
                    {
     
                        "value": "1-8-4",
                        "label": "SpriteKit 2D",
                        "children": null
                    },
                    {
     
                        "value": "1-8-5",
                        "label": "Unreal",
                        "children": null
                    },
                    {
     
                        "value": "1-8-6",
                        "label": "其它",
                        "children": null
                    }
                ]
            },
            {
     
                "value": "1-9",
                "label": "智能硬件/物联网",
                "children": [
                    {
     
                        "value": "1-9-1",
                        "label": "无线通信",
                        "children": null
                    },
                    {
     
                        "value": "1-9-2",
                        "label": "电子工程",
                        "children": null
                    },
                    {
     
                        "value": "1-9-3",
                        "label": "Arduino",
                        "children": null
                    },
                    {
     
                        "value": "1-9-4",
                        "label": "体感技术",
                        "children": null
                    },
                    {
     
                        "value": "1-9-5",
                        "label": "智能硬件",
                        "children": null
                    },
                    {
     
                        "value": "1-9-6",
                        "label": "驱动/内核开发",
                        "children": null
                    },
                    {
     
                        "value": "1-9-7",
                        "label": "单片机/工控",
                        "children": null
                    },
                    {
     
                        "value": "1-9-8",
                        "label": "WinCE",
                        "children": null
                    },
                    {
     
                        "value": "1-9-9",
                        "label": "嵌入式",
                        "children": null
                    },
                    {
     
                        "value": "1-9-10",
                        "label": "物联网技术",
                        "children": null
                    },
                    {
     
                        "value": "1-9-11",
                        "label": "其它",
                        "children": null
                    }
                ]
            },
            {
     
                "value": "1-10",
                "label": "研发管理",
                "children": [
                    {
     
                        "value": "1-10-1",
                        "label": "敏捷开发",
                        "children": null
                    },
                    {
     
                        "value": "1-10-2",
                        "label": "软件设计",
                        "children": null
                    },
                    {
     
                        "value": "1-10-3",
                        "label": "软件测试",
                        "children": null
                    },
                    {
     
                        "value": "1-10-4",
                        "label": "研发管理",
                        "children": null
                    },
                    {
     
                        "value": "1-10-5",
                        "label": "其它",
                        "children": null
                    }
                ]
            },
            {
     
                "value": "1-11",
                "label": "系统运维",
                "children": [
                    {
     
                        "value": "1-11-1",
                        "label": "Linux",
                        "children": null
                    },
                    {
     
                        "value": "1-11-2",
                        "label": "Windows",
                        "children": null
                    },
                    {
     
                        "value": "1-11-3",
                        "label": "UNIX",
                        "children": null
                    },
                    {
     
                        "value": "1-11-4",
                        "label": "Mac OS",
                        "children": null
                    },
                    {
     
                        "value"

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/414009.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

腾讯云服务器4核8G性能,和阿里云比怎么样?

腾讯云4核8G服务器支持多少人在线访问&#xff1f;支持25人同时访问。实际上程序效率不同支持人数在线人数不同&#xff0c;公网带宽也是影响4核8G服务器并发数的一大因素&#xff0c;假设公网带宽太小&#xff0c;流量直接卡在入口&#xff0c;4核8G配置的CPU内存也会造成计算…

实现unity场景切换

本文实现两个按键实现场景1和场景2之间的切换 ①首先在unity 3D中创建两个场景&#xff0c;分别为Scene1和Scene2 ②在Scene1中创建一个Button&#xff0c;修改txt内容为“To Scene2”&#xff0c;并在Buttons下创建一个空物体&#xff0c;用于挂载脚本。 脚本Trans Scene.…

ElasticSearch之找到乔丹的空中大灌篮电影

写在前面 本文看一个搜索的实际例子&#xff0c;找到篮球之神乔丹的电影Space Jam&#xff0c;即空中大灌篮。 正式开始之前先来看下要查询的目标文档&#xff0c;以及查询的text&#xff1a; 要查询的目标文档 {..."title": "Space Jam",..."ove…

顶顶通呼叫中心中间件-如何使处于机器人话术中的通话手动转接到坐席分机上讲解(mod_cti基于FreeSWITCH)

顶顶通呼叫中心中间件使用httpapi实现电话转接操作过程讲解(mod_cti基于FreeSWITCH) 需要了解呼叫中心中间件可以点以下链接了解顶顶通小孙 1、使用httpapi接口转接 一、打开web版的ccadmin并且找到接口测试 打开web-ccadmin并且登录&#xff0c;登录完成之后点击运维调试-再…

5G-A,未来已来

目前&#xff0c;全国首个5G-A规模组网示范完成。这项由北京联通携手华为共同打造的示范项目&#xff0c;实现了北京市中心金融街、历史建筑长话大楼、大型综合性体育场北京工人体育场三个重点场景的连片覆盖。 实际路测结果显示&#xff0c;5G-A用户下行峰值速率达到10Gbps&am…

力扣5. 最长回文子串(双指针、动态规划)

Problem: 5. 最长回文子串 文章目录 题目描述思路复杂度Code 题目描述 思路 思路1&#xff1a;双指针 1.我们利用双指针从中间向两边扩散来判断是否为回文串&#xff0c;则关键是找到以s[i]为中心的回文串&#xff1b; 2.我们编写一个函数string palindrome(string &s, in…

WPF的DataGrid自动生成中文列头

直接将一个对象集合绑定到DataGrid上面&#xff0c;设置自动生成列AutoGenerateColumns"True"&#xff0c;DataGrid会自动根据对象类的属性生成对应的列 示例类对象&#xff1a; public class DataModel{public int Id { get; set; }public string Name { get; set;…

vue3第三节(v-model 执行原理)

特殊说明&#xff1a; 以下vue3语法是基于 3.4之前版本进行使用的&#xff0c;3.4之后的版本 引入了 defineModel 宏&#xff0c;后续会介绍defineModel 1、vue3 与vue2 中v-model区别 vue3 中v-model绑定的不再是value&#xff0c;而是modelValue&#xff0c;接收的方法也不再…

Flink CDC 提取记录变更时间作为事件时间和 Hudi 表的 precombine.field 以及1970-01-01 取值问题

博主历时三年精心创作的《大数据平台架构与原型实现&#xff1a;数据中台建设实战》一书现已由知名IT图书品牌电子工业出版社博文视点出版发行&#xff0c;点击《重磅推荐&#xff1a;建大数据平台太难了&#xff01;给我发个工程原型吧&#xff01;》了解图书详情&#xff0c;…

windows系统使用Vscode在WSL调试golang本地进程

背景&#xff1a; windows10企业版 vscodegolang1.20 wsl编译运行。 vscode 使用本地wsl进行进程attach操作&#xff0c;发现&#xff1a;Access is denied. 本地进程启动&#xff0c;vscode调试进程。windows-Linux控制台: Starting: C:\Users\book\go\bin\dlv.exe dap --l…

node.js 用 xml2js.Parser 读 Freeplane.mm文件,生成测试用例.csv文件

Freeplane 是一款基于 Java 的开源软件&#xff0c;继承 Freemind 的思维导图工具软件&#xff0c;它扩展了知识管理功能&#xff0c;在 Freemind 上增加了一些额外的功能&#xff0c;比如数学公式、节点属性面板等。 编写 mm_xml2js_csv.js 如下 // 用 xml2js.Parser 读 F…

ROS开发基础-Linux基础第四部(开发板设置本地IP)

一 、网线连接设备 使用网线连接jetson NX与机械臂&#xff0c;如下图所示&#xff1a; 二、 修改上位机IPV4 IP ①测试是否可连接。网线连接机械臂之后&#xff0c;在桌面打开终端输入命令“ping 192.168.1.18”,如不可正常通信&#xff0c;可按照下述步骤进行设置。 ②在U…

Vue3前端实现一个本地消息队列(MQ), 让消息延迟消费或者做缓存

MQ功能实现的具体代码(TsMQ.ts)&#xff1a; import { v4 as uuidx } from uuid;import emitter from /utils/mitt// 消息类 class Message {// 过期时间&#xff0c;0表示马上就消费exp: number;// 消费标识&#xff0c;避免重复消费tag : string;// 消息体body : any;constr…

备战蓝桥杯Day18 - 双链表

一、每日一题 蓝桥杯真题之工作时长 这个题写代码做的话很麻烦&#xff0c;而且我也不一定能写出来&#xff0c;所以我直接就是用的excel来计算的时间和。 使用excel的做法 1.先把文件中的时间复制到excel中。 2.把日期和时间分到两列。 分成两列的步骤&#xff1a; 选中要…

让两个电脑通信的方法(TCP连接,UDP连接,C/S架构)

目录 TCP-面向连接UDP-面向无连接C/S架构服务器和客户端的工作过程C/S架构例子 让两个电脑通信的方法是 在C/S的基础上&#xff0c;采用TCP和UDP的方式连接 TCP-面向连接 UDP-面向无连接 C/S架构 服务器和客户端的工作过程 C/S架构例子 服务器与客户端通信的过程类似公司与客户…

【亚马逊云】跨AWS账号创建复制规则同步S3存储桶中的数据

文章目录 注意事项一、创建存储桶【创建方&接收方完成操作】二、上传数据至bucket-transmit待同步测试三、创建复制规则【创建方完成操作】四、接收复制的对象【接收方完成操作】五、创建复制任务【创建方操作】六、运行批处理操作【创建方完成操作】七、检查是否完成跨账号…

React UI框架Antd 以及 如何按需引入css样式配置

一、react UI框架Antd使用 1.下载模块 npm install antd -S 2.引入antd的样式 import ../node_modules/antd/dist/reset.css; 3.局部使用antd组件 import {Button, Calendar} from antd; import {PieChartTwoTone} from ant-design/icons; {/* 组件汉化配置 */} import l…

StarRocks——Stream Load 事务接口实现原理

目录 前言 一、StarRocks 数据导入 二、StarRocks 事务写入原理 三、InLong 实时写入StarRocks原理 3.1 InLong概述 3.2 基本原理 3.3 详细流程 3.3.1 任务写入数据 3.3.2 任务保存检查点 3.3.3 任务如何确认保存点成功 3.3.4 任务如何初始化 3.4 Exactly Once 保证…

go test用法(获取单元测试覆盖率)

go test用法&#xff08;获取ut覆盖率&#xff09; 为了提升系统的稳定性&#xff0c;一般公司都会对代码的单元测试覆盖率有一定要求。下面针对golang自带的测试命令go test做讲解。 1 命令 1.1 go test ./… &#xff08;运行当前目录及所有子目录下的测试用例&#xff09; …

【Nginx笔记02】通过Nginx服务器转发客户端的WebSocket接口到后端服务

这篇文章&#xff0c;主要介绍如何通过Nginx服务器转发客户端的WebSocket接口到后端服务【知识星球】。 目录 一、Nginx配置WebSocket 1.1、Nginx配置内容 1.2、客户端请求地址 1.3、创建WebSocket测试工程 1.4、启动测试 1.5、WebSocket超时问题 1.5.1、设置超时时间 …