【尚庭公寓SpringBoot + Vue 项目实战】房间管理(十二)

本文主要是介绍【尚庭公寓SpringBoot + Vue 项目实战】房间管理(十二),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

【尚庭公寓SpringBoot + Vue 项目实战】房间管理(十二)


文章目录

      • 【尚庭公寓SpringBoot + Vue 项目实战】房间管理(十二)
        • 1、业务介绍
        • 2、逻辑模型介绍
        • 3、接口开发
          • 3.1、保存或更新房间信息
          • 3.2、根据条件分页查询详细信息
          • 3.3、根据id获取房间详细信息
          • 3.4、根据ID删除房间信息
          • 3.5、根据id修改房间发布状态
          • 3.6、 根据公寓ID查询房间列表

1、业务介绍

房间管理共有六个接口,分别是

  1. 保存或更新房间信息
  2. 根据条件分页查询详细信息
  3. 根据ID获取房间详情信息
  4. 根据ID删除房间信息
  5. 根据ID修改房间发布状态
  6. 根据公寓ID查询房间信息列表
2、逻辑模型介绍

image-20240616180730823

3、接口开发
3.1、保存或更新房间信息

查看接口

image-20240616180844560

代码开发

  • 查看请求的数据结构

    查看web-admin模块中的com.atguigu.lease.web.admin.vo.room.RoomSubmitVo,内容如下

    @Data
    @Schema(description = "房间信息")
    public class RoomSubmitVo extends RoomInfo {@Schema(description = "图片列表")private List<GraphVo> graphVoList;@Schema(description = "属性信息列表")private List<Long> attrValueIds;@Schema(description = "配套信息列表")private List<Long> facilityInfoIds;@Schema(description = "标签信息列表")private List<Long> labelInfoIds;@Schema(description = "支付方式列表")private List<Long> paymentTypeIds;@Schema(description = "可选租期列表")private List<Long> leaseTermIds;
    }
    
  • 编写Controller层逻辑

    RoomController中增加如下内容

    @Operation(summary = "保存或更新房间信息")
    @PostMapping("saveOrUpdate")
    public Result saveOrUpdate(@RequestBody RoomSubmitVo roomSubmitVo) {service.saveOrUpdateRoom(roomSubmitVo);return Result.ok();
    }
    
  • 编写Service 层逻辑

    RoomInfoService中增加如下内容

    void saveOrUpdateRoom(RoomSubmitVo roomSubmitVo);
    

    RoomInfoServiceImpl中增加如下内容

    @Override
    public void saveOrUpdateRoom(RoomSubmitVo roomSubmitVo) {boolean isUpdate = roomSubmitVo.getId() != null;super.saveOrUpdate(roomSubmitVo);//若为更新操作,则先删除与Room相关的各项信息列表if (isUpdate) {//1.删除原有graphInfoListLambdaQueryWrapper<GraphInfo> graphQueryWrapper = new LambdaQueryWrapper<>();graphQueryWrapper.eq(GraphInfo::getItemType, ItemType.ROOM);graphQueryWrapper.eq(GraphInfo::getItemId, roomSubmitVo.getId());graphInfoService.remove(graphQueryWrapper);//2.删除原有roomAttrValueListLambdaQueryWrapper<RoomAttrValue> attrQueryMapper = new LambdaQueryWrapper<>();attrQueryMapper.eq(RoomAttrValue::getRoomId, roomSubmitVo.getId());roomAttrValueService.remove(attrQueryMapper);//3.删除原有roomFacilityListLambdaQueryWrapper<RoomFacility> facilityQueryWrapper = new LambdaQueryWrapper<>();facilityQueryWrapper.eq(RoomFacility::getRoomId, roomSubmitVo.getId());roomFacilityService.remove(facilityQueryWrapper);//4.删除原有roomLabelListLambdaQueryWrapper<RoomLabel> labelQueryWrapper = new LambdaQueryWrapper<>();labelQueryWrapper.eq(RoomLabel::getRoomId, roomSubmitVo.getId());roomLabelService.remove(labelQueryWrapper);//5.删除原有paymentTypeListLambdaQueryWrapper<RoomPaymentType> paymentQueryWrapper = new LambdaQueryWrapper<>();paymentQueryWrapper.eq(RoomPaymentType::getRoomId, roomSubmitVo.getId());roomPaymentTypeService.remove(paymentQueryWrapper);//6.删除原有leaseTermListLambdaQueryWrapper<RoomLeaseTerm> termQueryWrapper = new LambdaQueryWrapper<>();termQueryWrapper.eq(RoomLeaseTerm::getRoomId, roomSubmitVo.getId());roomLeaseTermService.remove(termQueryWrapper);}//1.保存新的graphInfoListList<GraphVo> graphVoList = roomSubmitVo.getGraphVoList();if (!CollectionUtils.isEmpty(graphVoList)) {ArrayList<GraphInfo> graphInfoList = new ArrayList<>();for (GraphVo graphVo : graphVoList) {GraphInfo graphInfo = new GraphInfo();graphInfo.setItemType(ItemType.ROOM);graphInfo.setItemId(roomSubmitVo.getId());graphInfo.setName(graphVo.getName());graphInfo.setUrl(graphVo.getUrl());graphInfoList.add(graphInfo);}graphInfoService.saveBatch(graphInfoList);}//2.保存新的roomAttrValueListList<Long> attrValueIds = roomSubmitVo.getAttrValueIds();if (!CollectionUtils.isEmpty(attrValueIds)) {List<RoomAttrValue> roomAttrValueList = new ArrayList<>();for (Long attrValueId : attrValueIds) {RoomAttrValue roomAttrValue = RoomAttrValue.builder().roomId(roomSubmitVo.getId()).attrValueId(attrValueId).build();roomAttrValueList.add(roomAttrValue);}roomAttrValueService.saveBatch(roomAttrValueList);}//3.保存新的facilityInfoListList<Long> facilityInfoIds = roomSubmitVo.getFacilityInfoIds();if (!CollectionUtils.isEmpty(facilityInfoIds)) {List<RoomFacility> roomFacilityList = new ArrayList<>();for (Long facilityInfoId : facilityInfoIds) {RoomFacility roomFacility = RoomFacility.builder().roomId(roomSubmitVo.getId()).facilityId(facilityInfoId).build();roomFacilityList.add(roomFacility);}roomFacilityService.saveBatch(roomFacilityList);}//4.保存新的labelInfoListList<Long> labelInfoIds = roomSubmitVo.getLabelInfoIds();if (!CollectionUtils.isEmpty(labelInfoIds)) {ArrayList<RoomLabel> roomLabelList = new ArrayList<>();for (Long labelInfoId : labelInfoIds) {RoomLabel roomLabel = RoomLabel.builder().roomId(roomSubmitVo.getId()).labelId(labelInfoId).build();roomLabelList.add(roomLabel);}roomLabelService.saveBatch(roomLabelList);}//5.保存新的paymentTypeListList<Long> paymentTypeIds = roomSubmitVo.getPaymentTypeIds();if (!CollectionUtils.isEmpty(paymentTypeIds)) {ArrayList<RoomPaymentType> roomPaymentTypeList = new ArrayList<>();for (Long paymentTypeId : paymentTypeIds) {RoomPaymentType roomPaymentType = RoomPaymentType.builder().roomId(roomSubmitVo.getId()).paymentTypeId(paymentTypeId).build();roomPaymentTypeList.add(roomPaymentType);}roomPaymentTypeService.saveBatch(roomPaymentTypeList);}//6.保存新的leaseTermListList<Long> leaseTermIds = roomSubmitVo.getLeaseTermIds();if (!CollectionUtils.isEmpty(leaseTermIds)) {ArrayList<RoomLeaseTerm> roomLeaseTerms = new ArrayList<>();for (Long leaseTermId : leaseTermIds) {RoomLeaseTerm roomLeaseTerm = RoomLeaseTerm.builder().roomId(roomSubmitVo.getId()).leaseTermId(leaseTermId).build();roomLeaseTerms.add(roomLeaseTerm);}roomLeaseTermService.saveBatch(roomLeaseTerms);}
    }
    
3.2、根据条件分页查询详细信息

查看接口

image-20240616181117766

代码开发

  • 查看请求和响应的数据结构

    • 请求数据结构

      • currentsize为分页相关参数,分别表示当前所处页面每个页面的记录数

      • RoomQueryVo为房间的查询条件,详细结构如下:

        @Schema(description = "房间查询实体")
        @Data
        public class RoomQueryVo {@Schema(description = "省份Id")private Long provinceId;@Schema(description = "城市Id")private Long cityId;@Schema(description = "区域Id")private Long districtId;@Schema(description = "公寓Id")private Long apartmentId;
        }
        
    • 响应数据结构

      单个房间信息记录可查看com.atguigu.lease.web.admin.vo.room.RoomItemVo,内容如下:

      @Data
      @Schema(description = "房间信息")
      public class RoomItemVo extends RoomInfo {@Schema(description = "租约结束日期")private Date leaseEndDate;@Schema(description = "当前入住状态")private Boolean isCheckIn;@Schema(description = "所属公寓信息")private ApartmentInfo apartmentInfo;
      }
      
  • 编写Controller层逻辑

    RoomController中增加如下内容

    @Operation(summary = "根据条件分页查询房间列表")
    @GetMapping("pageItem")
    public Result<IPage<RoomItemVo>> pageItem(@RequestParam long current, @RequestParam long size, RoomQueryVo queryVo) {IPage<RoomItemVo> page = new Page<>(current, size);IPage<RoomItemVo> result = service.pageRoomItemByQuery(page, queryVo);return Result.ok(result);
    }
    
  • 编写Service 层逻辑

    • RoomInfoService中增加如下内容

      IPage<RoomItemVo> pageRoomItemByQuery(IPage<RoomItemVo> page, RoomQueryVo queryVo);
      
    • RoomInfoServiceImpl中增加如下内容

      @Override
      public IPage<RoomItemVo> pageRoomItemByQuery(IPage<RoomItemVo> page, RoomQueryVo queryVo) {return roomInfoMapper.pageRoomItemByQuery(page, queryVo);
      }
      
  • 编写Mapper层逻辑

    • RoomInfoMapper中增加如下内容

      IPage<RoomItemVo> pageRoomItemByQuery(IPage<RoomItemVo> page, RoomQueryVo queryVo);
      
    • RoomInfoMapper.xml中增加如下内容

      <resultMap id="RoomItemVoMap" type="com.atguigu.lease.web.admin.vo.room.RoomItemVo" autoMapping="true"><id property="id" column="id"/><association property="apartmentInfo" javaType="com.atguigu.lease.model.entity.ApartmentInfo" autoMapping="true"><id property="id" column="apart_id"/><result property="isRelease" column="apart_is_release"/></association>
      </resultMap><select id="pageRoomItemByQuery" resultMap="RoomItemVoMap">select ri.id,ri.room_number,ri.rent,ri.apartment_id,ri.is_release,la.room_id is not null is_check_in,la.lease_end_date,ai.id                  apart_id,ai.name,ai.introduction,ai.district_id,ai.district_name,ai.city_id,ai.city_name,ai.province_id,ai.province_name,ai.address_detail,ai.latitude,ai.longitude,ai.phone,ai.is_release          apart_is_releasefrom room_info rileft join lease_agreement laon ri.id = la.room_idand la.is_deleted = 0and la.status in (2,5)left join apartment_info aion ri.apartment_id = ai.idand ai.is_deleted = 0<where>ri.is_deleted = 0<if test="queryVo.provinceId != null">apart.province_id = #{queryVo.provinceId}</if><if test="queryVo.cityId != null">and apart.city_id = #{queryVo.cityId}</if><if test="queryVo.districtId != null">and apart.district_id = #{queryVo.districtId}</if><if test="queryVo.apartmentId != null">and apartment_id = #{queryVo.apartmentId}</if></where>
      </select>
      
3.3、根据id获取房间详细信息

查看接口

image-20240616181322669

代码开发

  • 查看响应数据结构

    查看web-admin下的com.atguigu.lease.web.admin.vo.room.RoomDetailVo,内容如下

    @Schema(description = "房间信息")
    @Data
    public class RoomDetailVo extends RoomInfo {@Schema(description = "所属公寓信息")private ApartmentInfo apartmentInfo;@Schema(description = "图片列表")private List<GraphVo> graphVoList;@Schema(description = "属性信息列表")private List<AttrValueVo> attrValueVoList;@Schema(description = "配套信息列表")private List<FacilityInfo> facilityInfoList;@Schema(description = "标签信息列表")private List<LabelInfo> labelInfoList;@Schema(description = "支付方式列表")private List<PaymentType> paymentTypeList;@Schema(description = "可选租期列表")private List<LeaseTerm> leaseTermList;
    }
    
  • 编写Controller层逻辑

    RoomController中增加如下内容

    @Operation(summary = "根据id获取房间详细信息")
    @GetMapping("getDetailById")
    public Result<RoomDetailVo> getDetailById(@RequestParam Long id) {RoomDetailVo roomInfo = service.getRoomDetailById(id);return Result.ok(roomInfo);
    }
    
  • 编写Service 层逻辑

    • RoomInfoService中增加如下内容

      RoomDetailVo getRoomDetailById(Long id);
      
    • RoomInfoServiceImpl中增加如下内容

      @Override
      public RoomDetailVo getRoomDetailById(Long id) {//1.查询RoomInfoRoomInfo roomInfo = roomInfoMapper.selectById(id);//2.查询所属公寓信息ApartmentInfo apartmentInfo = apartmentInfoMapper.selectById(roomInfo.getApartmentId());//3.查询graphInfoListList<GraphVo> graphVoList = graphInfoMapper.selectListByItemTypeAndId(ItemType.ROOM, id);//4.查询attrValueListList<AttrValueVo> attrvalueVoList = attrValueMapper.selectListByRoomId(id);//5.查询facilityInfoListList<FacilityInfo> facilityInfoList = facilityInfoMapper.selectListByRoomId(id);//6.查询labelInfoListList<LabelInfo> labelInfoList = labelInfoMapper.selectListByRoomId(id);//7.查询paymentTypeListList<PaymentType> paymentTypeList = paymentTypeMapper.selectListByRoomId(id);//8.查询leaseTermListList<LeaseTerm> leaseTermList = leaseTermMapper.selectListByRoomId(id);RoomDetailVo adminRoomDetailVo = new RoomDetailVo();BeanUtils.copyProperties(roomInfo, adminRoomDetailVo);adminRoomDetailVo.setApartmentInfo(apartmentInfo);adminRoomDetailVo.setGraphVoList(graphVoList);adminRoomDetailVo.setAttrValueVoList(attrvalueVoList);adminRoomDetailVo.setFacilityInfoList(facilityInfoList);adminRoomDetailVo.setLabelInfoList(labelInfoList);adminRoomDetailVo.setPaymentTypeList(paymentTypeList);adminRoomDetailVo.setLeaseTermList(leaseTermList);return adminRoomDetailVo;
      }
      
    • 编写Mapper层逻辑

      • 编写房间属性查询逻辑

        • AttrValueMapper中增加如下内容

          List<AttrValueVo> selectListByRoomId(Long id);
          
        • AttrValueMapper.xml中增加如下内容

          <select id="selectListByRoomId" resultType="com.atguigu.lease.web.admin.vo.attr.AttrValueVo">select v.id,v.name,v.attr_key_id,k.name attr_key_namefrom attr_value vjoin attr_key k on v.attr_key_id = k.idwhere v.is_deleted = 0and k.is_deleted = 0and v.id in (select attr_value_idfrom room_attr_valuewhere is_deleted = 0and room_id = #{id})
          </select>
          
      • 编写房间配套查询逻辑

        • FacilityInfoMapper中增加如下内容

          List<FacilityInfo> selectListByRoomId(Long id);
          
        • FacilityInfoMapper.xml中增加如下内容

          <select id="selectListByRoomId" resultType="com.atguigu.lease.model.entity.FacilityInfo">select id,type,name,iconfrom facility_infowhere is_deleted = 0and id in(select facility_idfrom room_facilitywhere is_deleted = 0and room_id = #{id})
          </select>
          
      • 编写房间标签查询逻辑

        • LabelInfoMapper中增加如下内容

          List<LabelInfo> selectListByRoomId(Long id);
          
        • LabelInfoMapper.xml中增加如下内容

          <select id="selectListByRoomId" resultType="com.atguigu.lease.model.entity.LabelInfo">select id,type,namefrom label_infowhere is_deleted = 0and id in(select label_idfrom room_labelwhere is_deleted = 0and room_id = #{id})
          </select>
          
      • 编写房间可选支付方式查询逻辑

        • PaymentTypeMapper中增加如下内容

          List<PaymentType> selectListByRoomId(Long id);
          
        • PaymentTypeMapper.xml中增加如下内容

          <select id="selectListByRoomId" resultType="com.atguigu.lease.model.entity.PaymentType">select id,name,pay_month_count,additional_infofrom payment_typewhere is_deleted = 0and id in(select payment_type_idfrom room_payment_typewhere is_deleted = 0and room_id = #{id})
          </select> 
          
      • 编写房间可选租期查询逻辑

        • Mapper中增加如下内容

          List<LeaseTerm> selectListByRoomId(Long id);
          
        • Mapper.xml中增加如下内容

          <select id="selectListByRoomId" resultType="com.atguigu.lease.model.entity.LeaseTerm">select id,month_count,unitfrom lease_termwhere is_deleted = 0and id in (select lease_term_idfrom room_lease_termwhere is_deleted = 0and room_id = #{id})
          </select>
          
  • 编写Mapper层逻辑

    • 编写房间属性查询逻辑

      • AttrValueMapper中增加如下内容

        List<AttrValueVo> selectListByRoomId(Long id);
        
      • AttrValueMapper.xml中增加如下内容

        <select id="selectListByRoomId" resultType="com.atguigu.lease.web.admin.vo.attr.AttrValueVo">select v.id,v.name,v.attr_key_id,k.name attr_key_namefrom attr_value vjoin attr_key k on v.attr_key_id = k.idwhere v.is_deleted = 0and k.is_deleted = 0and v.id in (select attr_value_idfrom room_attr_valuewhere is_deleted = 0and room_id = #{id})
        </select>
        
    • 编写房间配套查询逻辑

      • FacilityInfoMapper中增加如下内容

        List<FacilityInfo> selectListByRoomId(Long id);
        
      • FacilityInfoMapper.xml中增加如下内容

        <select id="selectListByRoomId" resultType="com.atguigu.lease.model.entity.FacilityInfo">select id,type,name,iconfrom facility_infowhere is_deleted = 0and id in(select facility_idfrom room_facilitywhere is_deleted = 0and room_id = #{id})
        </select>
        
    • 编写房间标签查询逻辑

      • LabelInfoMapper中增加如下内容

        List<LabelInfo> selectListByRoomId(Long id);
        
      • LabelInfoMapper.xml中增加如下内容

        <select id="selectListByRoomId" resultType="com.atguigu.lease.model.entity.LabelInfo">select id,type,namefrom label_infowhere is_deleted = 0and id in(select label_idfrom room_labelwhere is_deleted = 0and room_id = #{id})
        </select>
        
    • 编写房间可选支付方式查询逻辑

      • PaymentTypeMapper中增加如下内容

        List<PaymentType> selectListByRoomId(Long id);
        
      • PaymentTypeMapper.xml中增加如下内容

        <select id="selectListByRoomId" resultType="com.atguigu.lease.model.entity.PaymentType">select id,name,pay_month_count,additional_infofrom payment_typewhere is_deleted = 0and id in(select payment_type_idfrom room_payment_typewhere is_deleted = 0and room_id = #{id})
        </select> 
        
    • 编写房间可选租期查询逻辑

      • Mapper中增加如下内容

        List<LeaseTerm> selectListByRoomId(Long id);
        
      • Mapper.xml中增加如下内容

        <select id="selectListByRoomId" resultType="com.atguigu.lease.model.entity.LeaseTerm">select id,month_count,unitfrom lease_termwhere is_deleted = 0and id in (select lease_term_idfrom room_lease_termwhere is_deleted = 0and room_id = #{id})
        </select>
        
3.4、根据ID删除房间信息

查看接口

image-20240616181722644

代码开发

  • 编写Controller层逻辑

    RoomController中增加如下内容

    @Operation(summary = "根据id删除房间信息")
    @DeleteMapping("removeById")
    public Result removeById(@RequestParam Long id) {service.removeRoomById(id);return Result.ok();
    }
    
  • 编写Service 层逻辑

    • RoomInfoService中增加如下内容

      void removeRoomById(Long id);
      
    • RoomInfoServiceImpl中增加如下内容

      @Override
      public void removeRoomById(Long id) {//1.删除RoomInfosuper.removeById(id);//2.删除graphInfoListLambdaQueryWrapper<GraphInfo> graphQueryWrapper = new LambdaQueryWrapper<>();graphQueryWrapper.eq(GraphInfo::getItemType, ItemType.ROOM);graphQueryWrapper.eq(GraphInfo::getItemId, id);graphInfoService.remove(graphQueryWrapper);//3.删除attrValueListLambdaQueryWrapper<RoomAttrValue> attrQueryWrapper = new LambdaQueryWrapper<>();attrQueryWrapper.eq(RoomAttrValue::getRoomId, id);roomAttrValueService.remove(attrQueryWrapper);//4.删除facilityInfoListLambdaQueryWrapper<RoomFacility> facilityQueryWrapper = new LambdaQueryWrapper<>();facilityQueryWrapper.eq(RoomFacility::getRoomId, id);roomFacilityService.remove(facilityQueryWrapper);//5.删除labelInfoListLambdaQueryWrapper<RoomLabel> labelQueryWrapper = new LambdaQueryWrapper<>();labelQueryWrapper.eq(RoomLabel::getRoomId, id);roomLabelService.remove(labelQueryWrapper);//6.删除paymentTypeListLambdaQueryWrapper<RoomPaymentType> paymentQueryWrapper = new LambdaQueryWrapper<>();paymentQueryWrapper.eq(RoomPaymentType::getRoomId, id);roomPaymentTypeService.remove(paymentQueryWrapper);//7.删除leaseTermListLambdaQueryWrapper<RoomLeaseTerm> termQueryWrapper = new LambdaQueryWrapper<>();termQueryWrapper.eq(RoomLeaseTerm::getRoomId, id);roomLeaseTermService.remove(termQueryWrapper);
      }
      
3.5、根据id修改房间发布状态

查看接口

image-20240616183331120

代码开发

RoomController中增加如下内容

@Operation(summary = "根据id修改房间发布状态")
@PostMapping("updateReleaseStatusById")
public Result updateReleaseStatusById(Long id, ReleaseStatus status) {LambdaUpdateWrapper<RoomInfo> updateWrapper = new LambdaUpdateWrapper<>();updateWrapper.eq(RoomInfo::getId, id);updateWrapper.set(RoomInfo::getIsRelease, status);service.update(updateWrapper);return Result.ok();
}
3.6、 根据公寓ID查询房间列表

查看接口

image-20240616183410735

代码开发

RoomController中增加如下内容

@GetMapping("listBasicByApartmentId")
@Operation(summary = "根据公寓id查询房间列表")
public Result<List<RoomInfo>> listBasicByApartmentId(Long id) {LambdaQueryWrapper<RoomInfo> queryWrapper = new LambdaQueryWrapper<>();queryWrapper.eq(RoomInfo::getApartmentId, id);queryWrapper.eq(RoomInfo::getIsRelease, ReleaseStatus.RELEASED);List<RoomInfo> roomInfoList = service.list(queryWrapper);return Result.ok(roomInfoList);
}

这篇关于【尚庭公寓SpringBoot + Vue 项目实战】房间管理(十二)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1068690

相关文章

Spring Security自定义身份认证的实现方法

《SpringSecurity自定义身份认证的实现方法》:本文主要介绍SpringSecurity自定义身份认证的实现方法,下面对SpringSecurity的这三种自定义身份认证进行详细讲解,... 目录1.内存身份认证(1)创建配置类(2)验证内存身份认证2.JDBC身份认证(1)数据准备 (2)配置依

SpringBoot整合OpenFeign的完整指南

《SpringBoot整合OpenFeign的完整指南》OpenFeign是由Netflix开发的一个声明式Web服务客户端,它使得编写HTTP客户端变得更加简单,本文为大家介绍了SpringBoot... 目录什么是OpenFeign环境准备创建 Spring Boot 项目添加依赖启用 OpenFeig

Java Spring 中 @PostConstruct 注解使用原理及常见场景

《JavaSpring中@PostConstruct注解使用原理及常见场景》在JavaSpring中,@PostConstruct注解是一个非常实用的功能,它允许开发者在Spring容器完全初... 目录一、@PostConstruct 注解概述二、@PostConstruct 注解的基本使用2.1 基本代

springboot使用Scheduling实现动态增删启停定时任务教程

《springboot使用Scheduling实现动态增删启停定时任务教程》:本文主要介绍springboot使用Scheduling实现动态增删启停定时任务教程,具有很好的参考价值,希望对大家有... 目录1、配置定时任务需要的线程池2、创建ScheduledFuture的包装类3、注册定时任务,增加、删

SpringBoot整合mybatisPlus实现批量插入并获取ID详解

《SpringBoot整合mybatisPlus实现批量插入并获取ID详解》这篇文章主要为大家详细介绍了SpringBoot如何整合mybatisPlus实现批量插入并获取ID,文中的示例代码讲解详细... 目录【1】saveBATch(一万条数据总耗时:2478ms)【2】集合方式foreach(一万条数

IntelliJ IDEA 中配置 Spring MVC 环境的详细步骤及问题解决

《IntelliJIDEA中配置SpringMVC环境的详细步骤及问题解决》:本文主要介绍IntelliJIDEA中配置SpringMVC环境的详细步骤及问题解决,本文分步骤结合实例给大... 目录步骤 1:创建 Maven Web 项目步骤 2:添加 Spring MVC 依赖1、保存后执行2、将新的依赖

SpringBoot中配置文件的加载顺序解读

《SpringBoot中配置文件的加载顺序解读》:本文主要介绍SpringBoot中配置文件的加载顺序,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录SpringBoot配置文件的加载顺序1、命令⾏参数2、Java系统属性3、操作系统环境变量5、项目【外部】的ap

SpringBoot UserAgentUtils获取用户浏览器的用法

《SpringBootUserAgentUtils获取用户浏览器的用法》UserAgentUtils是于处理用户代理(User-Agent)字符串的工具类,一般用于解析和处理浏览器、操作系统以及设备... 目录介绍效果图依赖封装客户端工具封装IP工具实体类获取设备信息入库介绍UserAgentUtils

Spring 中的循环引用问题解决方法

《Spring中的循环引用问题解决方法》:本文主要介绍Spring中的循环引用问题解决方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录什么是循环引用?循环依赖三级缓存解决循环依赖二级缓存三级缓存本章来聊聊Spring 中的循环引用问题该如何解决。这里聊

Java学习手册之Filter和Listener使用方法

《Java学习手册之Filter和Listener使用方法》:本文主要介绍Java学习手册之Filter和Listener使用方法的相关资料,Filter是一种拦截器,可以在请求到达Servl... 目录一、Filter(过滤器)1. Filter 的工作原理2. Filter 的配置与使用二、Listen