【javaweb】学习日记Day10 - tlias智能管理系统 - 部门、员工管理功能开发

news2024/9/29 11:30:47

目录

一、建立项目的基本操作步骤

二、前期搭建环境

1、创建springboot工程

​2、引入对应依赖

3、对建立好的框架进行调试

(1)pom.xml没有显示蓝色怎么解决?

(2) 启动类为橙红色java文件怎么办?

4、配置application.properties文件

5、准备Mapper、Service、Controller基础结构

(1)controller层 - java类

(2)mapper层 - 接口

(3)service层 - 接口+实现类

① 实现类

② 接口 

(4)pojo实体类

 6、引入统一接口风格的响应类Result

三、部门管理功能开发

1、部门列表查询

(1)Controller类

(2)Service类

(3)Mapper类

(4)测试

2、前后端联调

3、删除部门

(1)Controller类

(2)Service类

(3)Mapper类

(4)测试 

4、添加部门

(1)Controller类

(2)Service类

(3)Mapper类

(4)测试 

5、优化

6、根据id查询部门

(1)Controller类

(2)Service类

(3)Mapper类

(4)测试

7、修改

(1)Controller类

(2)Service类

(3)Mapper类

(4)测试 

8、部门管理代码综合展示 

(1)DeptController类

(2)DeptService 接口

(3)DeptServiceImpl 实现类

(4)DeptMapper类

四、员工管理功能开发 

1、分页查询 - 原始代码

(1)复习SQL分页查询语法

(2)需求分析

​(3)定义PageBean类

(4)员工列表查询 

(1)Controller类

① 设置请求参数默认值 @RequestParam(defaultValue="1")

(2)Service类

(3)Mapper类

(4)测试

2、分页插件 PageHelper

(1)引入pagehelper依赖

(2)Controller类

(3)Service类

(4)Mapper类

3、条件分页查询

(1)动态sql - 配置xml文件

① 在resource文件下建包

② 配置EmpMapper.xml文件

③ namespace属性名与mapper接口名全限定名一致

④ sql语句的id与mapper接口中方法名一致

⑤ sql语句中 resultType 返回结果类型为封装类的全限定名 

⑥ 输入SQL语句并将参数改为动态 

⑦ 对sql代码改为 动态SQL

(3)Service类

(4)Mapper类

4、删除员工

(1)配置动态sql xml文件

(2)Controller类

(3)Service类

(4)Mapper类


一、建立项目的基本操作步骤

  • 准备数据库表(dept表,emp表)
  • 创建springboot工程,引入对应的起步依赖(web,mybatis,mysql驱动,lombok)
  • 配置文件application.properties中引入mybatis配置信息,准备对应实体类
  • 准备对应的Mapper,Service(接口,实现类),Controller基础结构

二、前期搭建环境

1、创建springboot工程

2、引入对应依赖

3、对建立好的框架进行调试

(1)pom.xml没有显示蓝色怎么解决?

(2) 启动类为橙红色java文件怎么办?

点击File,选择Project Structure

将想要设置的工程中的java包选中,然后点击Sources,即可点亮 

4、配置application.properties文件

#驱动类名称
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#数据库连接的url
spring.datasource.url=jdbc:mysql://localhost:3306/tlias
#连接数据库的用户名
spring.datasource.username=root
#连接数据库的密码
spring.datasource.password=1234

#配置mybatis的日志, 指定输出到控制台
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl

#开启mybatis的驼峰命名自动映射开关 a_column ------> aCloumn
mybatis.configuration.map-underscore-to-camel-case=true

5、准备Mapper、Service、Controller基础结构

 

 

(1)controller层 - java类

package com.itroye.controller;

import org.springframework.web.bind.annotation.RestController;

//部门管理controller
@RestController
public class DeptController {
    
}

(2)mapper层 - 接口

package com.itroye.mapper;

import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface DeptMapper {
}

(3)service层 - 接口+实现类

① 实现类

package com.itroye.service.impl.impl;

import com.itroye.service.impl.DeptService;
import org.springframework.stereotype.Service;

@Service
public class DeptServiceImpl implements DeptService {

}

② 接口 

package com.itroye.service.impl;

public interface DeptService {
}

(4)pojo实体类

package com.itroye.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.time.LocalDateTime;

// 员工实体类
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Emp {
    private Integer id;
    private String username;
    private String password;
    private String name;
    private Short gender;
    private String image;
    private Short job;
    private LocalDate entrydate;
    private Integer deptId;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
}
package com.itroye.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

// 部门实体类
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Dept {
    private Integer id;
    private String name;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
    
}

 6、引入统一接口风格的响应类Result

package com.itroye.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {
    private Integer code;//响应码,1 代表成功; 0 代表失败
    private String msg;  //响应信息 描述字符串
    private Object data; //返回的数据

    //增删改 成功响应
    public static Result success(){
        return new Result(1,"success",null);
    }
    //查询 成功响应
    public static Result success(Object data){
        return new Result(1,"success",data);
    }
    //失败响应
    public static Result error(String msg){
        return new Result(0,msg,null);
    }
}

三、部门管理功能开发

具体流程:

  • 前端发送请求后,会请求到controller这个方法,controller方法首先会调用service获取数据
  • 在service方法中调用了mapper接口中的方法来查询数据
  • mapper接口会往数据库里发送sql查询语句,并把查询的信息封装到List集合中,并将该集合数据返回给service
  • service又返回给controller,controller拿到数据后返回给前端

1、部门列表查询

接口信息

  • 请求方式:GET —— @GetMapping
  • 请求路径:("/depts")  

请求参数:无

响应数据:dept类

(1)Controller类

//部门管理controller
@Slf4j
@RestController
public class DeptController {

    @Autowired
    private DeptService deptService; //调用service接口

    @GetMapping("/depts")
    public Result list()
    {
        log.info("查询全部部门数据");

        //调用service查询部门数据
        List<Dept> deptList = deptService.list();

        return Result.success(deptList);
    }
}

在启动类点击运行,然后在下方提示框显示端口号8080

(2)Service类

点击controller类中list方法,按alt+enter自动跳转到service接口,并生成list方法

public interface DeptService {
    //查询全部部门数据
    List<Dept> list();
}

点击左侧小绿圈,跳转到service实现类

 

选中类名,按alt+enter自动生成接口的实现方法

 

@Service
public class DeptServiceImpl implements DeptService {

    @Autowired
    private DeptMapper deptMapper; //调用mapper接口

    @Override
    public List<Dept> list() {
        return deptMapper.list();
    }
}

(3)Mapper类

最后mapper通过@select注解中的sql语句,在数据库中查询数据并封装到list类

@Mapper
public interface DeptMapper {
    //查询全部部门数据
    @Select("select * from dept")
    List<Dept> list();
}

(4)测试

  打开postman进行测试,收到从数据库中查询到的数据

localhost:8080/depts

2、前后端联调

Day10-03. 案例-部门管理-前后端联调_哔哩哔哩_bilibili

3、删除部门

接口信息

  • 请求方式:DELETE —— @DeleteMapping
  • 请求路径:("/depts/{id}") 

 请求参数:路径参数 @PathVariable

 响应数据:直接Result.success()

(1)Controller类

//删除
    @DeleteMapping("/depts/{id}")
    public Result delete(@PathVariable Integer id)
    {
        log.info("根据id删除部门:{}",id);
        
        //调用service删除部门
        deptService.delete(id);
        
        return Result.success();
    }

(2)Service类

public interface DeptService {

    //删除部门
    void delete(Integer id);
}
@Service
public class DeptServiceImpl implements DeptService {

    @Autowired
    private DeptMapper deptMapper; //调用mapper接口


    @Override
    public void delete(Integer id) {
        deptMapper.deleteById();
    }
}

(3)Mapper类

@Mapper
public interface DeptMapper {
    //删除数据
    @Delete("delete from dept where id = #{id}")
    void deleteById(Integer id);
}

(4)测试 

4、添加部门

接口信息

  • 请求方式:POST —— @PostMapping
  • 请求路径:("/depts") 

 

请求参数:json格式数据,需要封装到实体类 

json格式的参数需要加上注解 @RequestBody

【javaweb】学习日记Day5 - 请求响应 分层解耦 IOC DI 三层架构_Roye_ack的博客-CSDN博客

响应数据: 直接Result.success()

(1)Controller类

//新增
    @PostMapping("/depts")
    public Result add(@RequestBody Dept dept)
    {
        log.info("新增部门:{}",dept);

        //调用service新增部门
        deptService.add(dept);

        return Result.success();
    }

(2)Service类

public interface DeptService {

    //新增部门
    void add(Dept dept);
}
@Service
public class DeptServiceImpl implements DeptService {

    @Autowired
    private DeptMapper deptMapper; //调用mapper接口


    @Override
    public void add(Dept dept) {
        dept.setCreateTime(LocalDateTime.now());
        dept.setUpdateTime(LocalDateTime.now());

        deptMapper.add(dept);
    }
}

(3)Mapper类

@Mapper
public interface DeptMapper {

    //新增数据
    @Insert("insert into dept(name,create_time,update_time) values(#{name},#{createTime},#{updateTime})")
    void add(Dept dept);
}

(4)测试 

5、优化

  • 请求路径"/depts"重复,可以放在类上
  • 一个完整的请求路径,应该是类上的@RequestMapping 的value属性+方法上的@RequestMapping的value属

6、根据id查询部门

接口信息

  • 请求方式:GET —— @GetMapping
  • 请求路径:("/depts/{id}") 

 请求参数

响应数据:dept类 

(1)Controller类

//根据id查询数据
    @GetMapping("/{id}")
    public Result getByID(@PathVariable Integer id)
    {
        log.info("获取部门id:{}",id);

        Dept dept = deptService.getByID(id);
        return Result.success(dept);
    }

(2)Service类

//根据id查询部门
    Dept getByID(Integer id);
@Override
public Dept getByID(Integer id) {
    Dept dept = deptMapper.getByID(id);
    return dept;
}

(3)Mapper类

    //根据id获取部门
    @Select("select * from dept where id = #{id}")
    Dept getByID(Integer id);

(4)测试

7、修改

接口信息

  • 请求方式:PUT —— @PutMapping
  • 请求路径:("/depts") 

 

响应数据:直接Result.success() 

(1)Controller类

    //修改
    @PutMapping
    public Result modify(@RequestBody Dept dept)
    {
        log.info("修改数据:{}",dept.getId());

        //调用service修改数据
        deptService.modify(dept);

        return Result.success();
    }

(2)Service类

public interface DeptService {

    //修改部门
    void modify(Dept dept);
}
@Service
public class DeptServiceImpl implements DeptService {

    @Autowired
    private DeptMapper deptMapper; //调用mapper接口

    @Override
    public void modify(Dept dept) {
        dept.setUpdateTime(LocalDateTime.now());

        deptMapper.modify(dept);
    }
}

(3)Mapper类

@Mapper
public interface DeptMapper {

    //修改数据
    @Update("update dept set name = #{name},update_time = #{updateTime} where id = #{id}")
    void modify(Dept dept);
}

(4)测试 

 

8、部门管理代码综合展示 

(1)DeptController类

//部门管理controller
@Slf4j
@RestController
@RequestMapping("/depts")
public class DeptController {

    @Autowired
    private DeptService deptService; //调用service接口

    //查询
    @GetMapping
    public Result list()
    {
        log.info("查询全部部门数据");

        //调用service查询部门数据
        List<Dept> deptList = deptService.list();

        return Result.success(deptList);
    }

    //删除
    @DeleteMapping("/{id}")
    public Result delete(@PathVariable Integer id)
    {
        log.info("根据id删除部门:{}",id);

        //调用service删除部门
        deptService.delete(id);

        return Result.success();
    }

    //新增
    @PostMapping
    public Result add(@RequestBody Dept dept)
    {
        log.info("新增部门:{}",dept);

        //调用service新增部门
        deptService.add(dept);

        return Result.success();
    }

    //根据id查询数据
    @GetMapping("/{id}")
    public Result getByID(@PathVariable Integer id)
    {
        log.info("获取部门id:{}",id);

        Dept dept = deptService.getByID(id);
        return Result.success(dept);
    }

    //修改
    @PutMapping
    public Result modify(@RequestBody Dept dept)
    {
        log.info("修改数据:{}",dept.getId());

        //调用service修改数据
        deptService.modify(dept);

        return Result.success();
    }
}

(2)DeptService 接口

public interface DeptService {

    //查询全部部门数据
    List<Dept> list();

    //删除部门
    void delete(Integer id);

    //新增部门
    void add(Dept dept);

    //修改部门
    void modify(Dept dept);

    //根据id查询部门
    Dept getByID(Integer id);

}

(3)DeptServiceImpl 实现类

@Service
public class DeptServiceImpl implements DeptService {

    @Autowired
    private DeptMapper deptMapper; //调用mapper接口

    @Override
    public List<Dept> list() {
        return deptMapper.list();
    }

    @Override
    public void delete(Integer id) {
        deptMapper.deleteById(id);
    }

    @Override
    public void add(Dept dept) {
        dept.setCreateTime(LocalDateTime.now());
        dept.setUpdateTime(LocalDateTime.now());

        deptMapper.add(dept);
    }

    @Override
    public void modify(Dept dept) {
        dept.setUpdateTime(LocalDateTime.now());

        deptMapper.modify(dept);
    }

    @Override
    public Dept getByID(Integer id) {
        Dept dept = deptMapper.getByID(id);
        return dept;
    }
}

(4)DeptMapper类

@Mapper
public interface DeptMapper {
    //查询全部部门数据
    @Select("select * from dept")
    List<Dept> list();

    //删除数据
    @Delete("delete from dept where id = #{id}")
    void deleteById(Integer id);

    //新增数据
    @Insert("insert into dept(name,create_time,update_time) values(#{name},#{createTime},#{updateTime})")
    void add(Dept dept);

    //修改数据
    @Update("update dept set name = #{name},update_time = #{updateTime} where id = #{id}")
    void modify(Dept dept);

    //根据id获取部门
    @Select("select * from dept where id = #{id}")
    Dept getByID(Integer id);
}

四、员工管理功能开发 

1、分页查询 - 原始代码

(1)复习SQL分页查询语法

select 字段列表 from 表名 limit 起始索引,查询记录数;

 起始索引 = (页码 - 1)* 每页展示记录数

-- 1. 从起始索引0开始查询员工数据, 每页展示5条记录
select * from tb_emp limit 0,5;
 
-- 2. 查询 第1页 员工数据, 每页展示5条记录
select * from tb_emp limit 0,5;
 
-- 3. 查询 第2页 员工数据, 每页展示5条记录
select * from tb_emp limit 5,5;
 
-- 4. 查询 第3页 员工数据, 每页展示5条记录
select * from tb_emp limit 10,5;

(2)需求分析

(3)定义PageBean类

 接口文档里需要返回两个数据,一个是总记录数total,一个是展示数据列表rows,我们将它们封装在一个实体类PageBean中

@Data
@NoArgsConstructor
@AllArgsConstructor
public class PageBean {

    private Long total; //总记录数
    private List rows; //数据列表
}

(4)员工列表查询 

接口信息:

 

请求参数:

 注意!参数一定要和接口文档中一致,否则无法传参!

响应数据: 一个【Emp类的list表】和【Integer类的total页面总数】 封装在一个类中

(1)Controller类

① 设置请求参数默认值 @RequestParam(defaultValue="1")
//员工管理controller
@Slf4j
@RestController
@RequestMapping("/emps")
public class EmpController {

    @Autowired
    private EmpService empService;

    //分页查询
    @GetMapping
    public Result selectByPage(@RequestParam(defaultValue = "1") Integer page,
                               @RequestParam(defaultValue = "10") Integer pageSize)
    {
        log.info("查询数据:第{}页,{}条数据",page,pageSize);

        PageBean pageBean = empService.selectByPage(page,pageSize);

        return Result.success(pageBean);
    }
}

(2)Service类

    //分页查询
    PageBean selectByPage(Integer page, Integer pageSize);
@Service
public class EmpServiceImpl implements EmpService {

    @Autowired
    private EmpMapper empmapper;
    
    //分页查询
    @Override
    public PageBean selectByPage(Integer page, Integer pageSize) {

        Integer start = (page - 1) * pageSize;
        List<Emp> rows = empmapper.selectByPage(start,pageSize);

        Long total = empmapper.count();

        PageBean pageBean = new PageBean(total,rows);

        return pageBean;
    }
}

(3)Mapper类

@Mapper
public interface EmpMapper {
    
    //查询总记录数
    @Select("select count(*) from emp")
    public Long count();
    
    //分页查询获取列表数据
    @Select("select * from emp limit #{start}, #{pageSize};")
    public List<Emp> selectByPage(Integer start,Integer pageSize);
}

(4)测试

2、分页插件 PageHelper

(1)引入pagehelper依赖

在pom.xml文件中引入依赖

        <!--pageHelper分页插件-->
        <dependency>
            <groupId>com.github.pagehelper</groupId>
            <artifactId>pagehelper-spring-boot-starter</artifactId>
            <version>1.4.2</version>
        </dependency>

(2)Controller类

//员工管理controller
@Slf4j
@RestController
@RequestMapping("/emps")
public class EmpController {

    @Autowired
    private EmpService empService;

    //分页查询
    @GetMapping
    public Result selectByPage(@RequestParam(defaultValue = "1") Integer page,
                               @RequestParam(defaultValue = "10") Integer pageSize)
    {
        log.info("查询数据:第{}页,{}条数据",page,pageSize);

        PageBean pageBean = empService.selectByPage(page,pageSize);

        return Result.success(pageBean);
    }
}

(3)Service类

    //分页查询
    PageBean selectByPage(Integer page, Integer pageSize);
@Service
public class EmpServiceImpl implements EmpService {

    @Autowired
    private EmpMapper empmapper;

    //分页查询
    @Override
    public PageBean selectByPage(Integer page, Integer pageSize) {

        //1.设置分页参数
        PageHelper.startPage(page,pageSize);

        //2.执行查询
        List<Emp> empList = empmapper.list(); //获取的是分页结果查询的封装类
        Page<Emp> p = (Page<Emp>) empList; //进行强制转换


        //3.封装PageBean对象
        PageBean pageBean = new PageBean(p.getTotal(),p.getResult());

        return pageBean;
    }
}

(4)Mapper类

@Mapper
public interface EmpMapper {
    
    //用pagehelper插件 - 分页查询获取列表数据
    @Select("select * from emp ")
    public List<Emp> list();
}

3、条件分页查询

请求参数

日期格式的参数需要加上注解 @DataTimeFormat(pattern = "yyyy-MM-dd")

【javaweb】学习日记Day5 - 请求响应 分层解耦 IOC DI 三层架构_Roye_ack的博客-CSDN博客

(1)动态sql - 配置xml文件

【javaweb】学习日记Day9 - Mybatis 基础操作_Roye_ack的博客-CSDN博客

① 在resource文件下建包

mapper接口同包同名,且与mapper接口名称一致 

② 配置EmpMapper.xml文件

先打开mybatis中文网MyBatis中文网

点击【入门 - 探究已映射的SQL语句】

复制这些代码

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
  PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

③ namespace属性名与mapper接口名全限定名一致

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.itroye.mapper.EmpMapper">
    

    
</mapper>

④ sql语句的id与mapper接口中方法名一致

 

⑤ sql语句中 resultType 返回结果类型为封装类的全限定名 

⑥ 输入SQL语句并将参数改为动态 

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.itroye.mapper.EmpMapper">
    
    <select id="list" resultType="com.itroye.pojo.Emp">
        select *
        from emp
        where
            name like concat('%',#{name},'%')
            and gender = #{gender}
            and entrydate between #{begin} and #{end}
    order by update_time desc
    </select>
    
</mapper>

⑦ 对sql代码改为 动态SQL

注意xml文件的注释格式是<!-- -->

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.itroye.mapper.EmpMapper">

    <!--条件查询-->
    <select id="list" resultType="com.itroye.pojo.Emp">
        select *
        from emp
        <where>
            <if test="name !=null and name != ''">
                name like concat('%',#{name},'%')
            </if>
            <if test="gender != null">
                and gender = #{gender}
            </if>
            <if test="begin != null and end != null">
                and entrydate between #{begin} and #{end}
            </if>
        </where>
        order by update_time desc
    </select>
    
</mapper>

(2)Controller类

//员工管理controller
@Slf4j
@RestController
@RequestMapping("/emps")
public class EmpController {

    @Autowired
    private EmpService empService;

    //分页查询
    @GetMapping
    public Result selectByPage(@RequestParam(defaultValue = "1") Integer page,
                               @RequestParam(defaultValue = "10") Integer pageSize,
                               String name, Short gender,
                               @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate begin,
                               @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate end)
    {
        log.info("分页查询,参数:{},{},{},{},{},{}",page,pageSize,name,gender,begin,end);

        PageBean pageBean = empService.selectByPage(page,pageSize,name,gender,begin,end);

        return Result.success(pageBean);
    }
}

(3)Service类

public interface EmpService {

    //分页查询
    PageBean selectByPage(Integer page, Integer pageSize,
                          String name, Short gender,LocalDate begin,LocalDate end);
}
@Service
public class EmpServiceImpl implements EmpService {

    @Autowired
    private EmpMapper empmapper;

    //分页查询
    @Override
    public PageBean selectByPage(Integer page, Integer pageSize, String name,
                                 Short gender, LocalDate begin, LocalDate end) {

        //1.设置分页参数
        PageHelper.startPage(page,pageSize);

        //2.执行查询
        List<Emp> empList = empmapper.list(name, gender, begin, end); //获取的是分页结果查询的封装类
        Page<Emp> p = (Page<Emp>) empList; //进行强制转换


        //3.封装PageBean对象
        PageBean pageBean = new PageBean(p.getTotal(),p.getResult());

        return pageBean;
    }
}

(4)Mapper类

@Mapper
public interface EmpMapper {
    
    //用pagehelper插件 - 分页查询获取列表数据
    public List<Emp> list(String name, Short gender, LocalDate begin, LocalDate end);
}

4、删除员工

接口参数

请求信息

 响应数据:直接Result.success()

(1)配置动态sql xml文件

遍历删除id,使用foreach标签

    <!--批量删除-->
    <delete id="delete">
        delete
        from emp
        where id in
        <foreach collection="ids" item="x" separator="," open="(" close=")">
            #{x}
        </foreach>
    </delete>

(2)Controller类

    //删除员工
    @DeleteMapping("/{ids}")
    public Result delete(@PathVariable List<Integer> ids)
    {
        log.info("删除员工id:{}",ids);

        empService.delete(ids);

        return Result.success();
    }

(3)Service类

    //批量删除
    void delete(List<Integer> ids);
    //批量删除
    @Override
    public void delete(List<Integer> ids) {
        empmapper.delete(ids);
    }

(4)Mapper类

    // 批量删除
    void delete(List<Integer> ids);

 

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

OSS专栏------文件上传(一)

目录 1、简单上传1.1、流式上传1.1.1、上传字符串1.1.1.1、代码示例1.1.1.2、执行结果 1.1.2、上传Byte数组1.1.2.1、代码示例1.1.2.2、执行结果 1.1.3、上传网络流1.1.3.1、代码示例1.1.3.2、执行结果 1.1.4、上传文件流1.1.4.1、代码示例1.1.4.2、执行结果 1.2、文件上传1.2.…

申威芯片UOS中opencv DNN推理

Cmake&#xff0c;opencv&#xff0c;opencv-contribute安装 #apt可能需要更新apt update apt install -y wget unzip apt-get install build-essential libgtk2.0-dev libgtk-3-dev libavcodec-dev libavformat-dev libjpeg-dev libswscale-dev libtiff5-dev#安装cmake apt i…

【OceanBase概念】国产数据库OceanBase的那些事儿(1)初识OceanBase

文章目录 写在前面涉及知识点1、OceanBase是什么&#xff1f;1.1基本概念1.2发展历史 2、TPC-C认证2.1什么是TPCC2.2OceanBase认证成果 3、OceanBase应用场景3.1行业应用A、金融行业B、电信运营行业C、保险行业D、初创互联网行业 3.2内部应用A、支付宝B、淘宝C、网商银行D、Pay…

草图大师SketchUp Pro 2023 for Mac

SketchUp Pro 2023 for Mac&#xff08;草图大师&#xff09;是一款专业的三维建模软件&#xff0c;由Trimble Inc.开发。它可以用于创建、修改和分享3D模型&#xff0c;包括建筑、家具、景观等。 SketchUp Pro 2023 for Mac提供了简单易学的用户界面和强大的工具集&#xff0…

【数据恢复】.360勒索病毒|金蝶、用友、OA、ERP等软件数据库恢复

引言&#xff1a; 在当今数字化的时代&#xff0c;网络犯罪已经演变成了一场全球性的威胁&#xff0c;而 360 勒索病毒则是其中最为可怕和具有破坏性的威胁之一。这种恶意软件以其危害深远、难以防范的特点而令人震惊。本文91数据恢复将深入探讨 360 勒索病毒的可怕性&#xff…

Navicat连接mysql8.0:提示无法加载身份验证插件“caching_sha2_password”

Navicat连接mysql时&#xff0c;提示&#xff1a;Unable to load authentication plugin ‘caching_sha2_password‘. 原因&#xff1a;mysql 8.0 默认使用 caching_sha2_password 身份验证机制。 D:\MySQL8.0\install\bin>mysql -uroot -p123456789 #登录 mysql: [War…

【Redis】Redis 通用命令、键的过期策略

文章目录 一、基础命令SET 和 GET 二、全局命令KEYSEXISTSDELEXPIRE 和 TTL经典面试题&#xff1a;Redis 中 key 的过期策略是怎么实现的TYPE Redis 有许多种数据结构&#xff0c;但是这些数据结构的 key 的类型都是字符串类型的&#xff08;所以说&#xff0c;Redis 不同的数据…

vue插槽slot

插槽有三种&#xff1a; 目录 1.普通插槽 2.具名插槽 3.作用域插槽 1.普通插槽 sub.vue 子组件 --- 子组件写slot标签&#xff0c;父组件的Sub标签内填写的内容会显示在slot的位置&#xff0c;父组件如果不写内容就会展示默认内容。 <template><div class"…

智慧物流发展的重要推动力量:北斗卫星导航系统

随着经济的快速发展和电商的普及&#xff0c;物流行业的规模不断扩大&#xff0c;对物流运输的效率和安全性也提出了更高的要求。传统的物流运输方式存在着效率低下、信息不对称、安全隐患等问题&#xff0c;因此发展智慧物流已经成为物流行业的必然趋势。智慧物流可以通过先进…

软文发稿平台那么多,为什么选择媒介盒子

近年来随着互联网技术的发展&#xff0c;越来越多的企业开始注重软文营销&#xff0c;品牌软文推广对企业来说是至关重要的&#xff0c;也有许多企业选择和软文发稿平台合作来增强品牌曝光&#xff0c;提升宣传效果&#xff0c;那么为什么会有这么多企业选择媒介盒子合作呢&…

2023高教社杯 国赛数学建模A题思路 - 定日镜场的优化设计

1 赛题 A 题 定日镜场的优化设计 构建以新能源为主体的新型电力系统&#xff0c; 是我国实现“碳达峰”“碳中和”目标的一项重要 措施。塔式太阳能光热发电是一种低碳环保的新型清洁能源技术[1]。 定日镜是塔式太阳能光热发电站(以下简称塔式电站)收集太阳能的基本组件&…

微服务04-Gateway网关

作用 身份认证&#xff1a;用户能不能访问 服务路由&#xff1a;用户访问到那个服务中去 负载均衡&#xff1a;一个服务可能有多个实例&#xff0c;甚至集群&#xff0c;负载均衡就是你的请求到哪一个实例上去 请求限流功能&#xff1a;对请求进行流量限制&#xff0c;对服务…

【智慧工地源码】物联网和传感器技术在智慧工地的应用

物联网&#xff08;IoT&#xff09;和传感器技术在智慧工地中扮演着至关重要的角色。这些技术的应用&#xff0c;使得智慧工地能够实现对施工过程的精确监控、数据收集和分析&#xff0c;以及设备互联&#xff0c;从而提高工程效率、减少成本并改善工人的工作环境。 一、物联网…

Faster RCNN

【简介】 Faster RCNN[7]是第一个端到端&#xff0c;最接近于实时性能的深度学习检测算法&#xff0c;该网络的主要创新点就是提出了区域选择网络用于申城候选框&#xff0c;能几大提升检测框的生成速度。该网络首先输入图像到卷积网络中&#xff0c;生成该图像的特征映射。在特…

cocos 之纹理格式和压缩纹理

Cocos2dx 版本&#xff1a; 3.10 CocosCreator 版本&#xff1a; 3.8.0 环境&#xff1a; Mac 简介 在项目开发中&#xff0c;图片资源的优化是作为性能优化和包体优化的一项重要侧露。常用的手段有&#xff1a; 使用TexturePacker将散图打包图集 JPG和PNG的使用&#xff0…

SpringMVC概述,SpringMVC是什么,有什么优势?

目录 一、MVC 模式 二、SpringMVC 是什么&#xff1f; 三、SpringMVC的优势 四、SpringMVC 的应用场景 一、MVC 模式 MVC模式是一种软件架构模式&#xff0c;它将软件的用户界面&#xff08;即前台页面&#xff09;和业务逻辑分离&#xff0c;使代码具有更高的可扩展性、可…

2023年MySQL实战核心技术第一篇

目录 四 . 基础架构&#xff1a;一条SQl查询语句是如何执行的&#xff1f; 4.1 MySQL逻辑架构图&#xff1a; 4.2 MySQL的Server层和存储引擎层 4.2.1 连接器 4.2.1.1 解释 4.2.1.2 MySQL 异常重启 解决方案&#xff1a; 4.2.1.2.1. 定期断开长连接&#xff1a; 4.2.1.2.2. 初始…

MySQL数据库的回滚rollback是怎么做到的?

MySQL的几种日志 MySQL主要有3种日志&#xff1a; 二进制日志&#xff0c;就我们都熟悉的binlog&#xff0c;它主要的作用 主从复制、PIT恢复重做日志&#xff0c;redo log&#xff0c;它主要的作用是 当突然数据库宕机了&#xff0c;它能恢复数据第三种就是 undo log&#x…

冠达管理:重拳出击!六大科技巨头被列入“看门人”名单!

当地时刻9月6日&#xff0c;美股三大股指团体收跌&#xff0c;截至收盘&#xff0c;道指跌0.57%&#xff0c;标普500指数跌0.70%&#xff0c;纳指跌1.06%。 投资者忧虑美联储的加息周期或许没有完毕。波士顿联储主席苏珊柯林斯标明&#xff0c;美联储或许需求更多的加息&#…

【广州华锐互动】3D在线展示家具的应用及优势

在数字化的世界里&#xff0c;我们的生活方式正在发生深刻的变化。其中&#xff0c;家具行业也在逐步接纳并应用这一趋势&#xff0c;创新的3D线上展览展示已经成为新的潮流。这种新型的展示方式不仅可以让顾客在家中就能全方位、立体地了解家具产品&#xff0c;还能为设计师提…