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

东莞中高端网站建设/ueeshop建站费用

东莞中高端网站建设,ueeshop建站费用,网站建设工资多少钱,python做网站方便吗文章目录 1.基本设计2.生成CRUD代码1.生成五张表的代码1.subject_info2.subject_brief3.subject_judge4.subject_multiple5.subject_radio 2.将所有的dao放到mapper文件夹3.将所有实体类使用lombok简化4.删除所有mapper的Param("pageable") Pageable pageable5.删除所…

文章目录

    • 1.基本设计
    • 2.生成CRUD代码
        • 1.生成五张表的代码
          • 1.subject_info
          • 2.subject_brief
          • 3.subject_judge
          • 4.subject_multiple
          • 5.subject_radio
        • 2.将所有的dao放到mapper文件夹
        • 3.将所有实体类使用lombok简化
        • 4.删除所有mapper的@Param("pageable") Pageable pageable
        • 5.删除所有service的分页查询接口
    • 3.具体实现
        • 1.sun-club-application-controller
          • 1.dto
            • 1.SubjectInfoDTO.java
            • 2.SubjectAnswerDTO.java
          • 2.convert
            • 1.SubjectAnswerDTOConverter.java
            • 2.SubjectInfoDTOConverter.java
        • 2.sun-club-domain
          • 1.entity
            • 1.SubjectAnswerBO.java
            • 2.SubjectInfoBO.java
          • 2.convert
            • 1.SubjectInfoConverter.java
          • 3.service
            • 1.SubjectInfoDomainService.java
        • 3.sun-club-common
          • 1.enums
            • 1.SubjectInfoTypeEnum.java 题目类型枚举
        • 4.sun-club-domain
          • 1.subject包构建一个题目类型工厂
            • 1.SubjectTypeHandler.java
            • 2.BriefTypeHandler.java
            • 3.JudgeTypeHandler.java
            • 4.MultipleTypeHandler.java
            • 5.RadioTypeHandler.java
            • 6.SubjectTypeHandlerFactory.java
          • 2.service包来注入工厂,调用插入方法
            • 1.SubjectInfoDomainService.java
            • 2.SubjectInfoDomainServiceImpl.java
          • 3.单选题的插入
            • 1.RadioTypeHandler.java
        • 5.sun-club-infra
          • 1.SubjectMappingDao.xml的批量插入如果逻辑删除字段为空就设置成0
          • 2.SubjectRadioDao.xml 如果逻辑删除字段为空就设置成0
        • 6.sun-club-application-controller
          • SubjectController.java
        • 7.接口测试

1.基本设计

image-20240527135224721

2.生成CRUD代码

1.生成五张表的代码
1.subject_info

image-20240526172642220

2.subject_brief

image-20240526172735698

3.subject_judge

4.subject_multiple

image-20240526173001618

5.subject_radio

image-20240526173107512

2.将所有的dao放到mapper文件夹

image-20240527131816152

3.将所有实体类使用lombok简化
4.删除所有mapper的@Param(“pageable”) Pageable pageable
5.删除所有service的分页查询接口

3.具体实现

1.sun-club-application-controller
1.dto
1.SubjectInfoDTO.java
package com.sunxiansheng.subject.application.dto;import lombok.Data;import java.io.Serializable;
import java.util.List;/*** 题目信息表(SubjectInfo)实体类** @author makejava* @since 2024-05-26 17:26:43*/
@Data
public class SubjectInfoDTO implements Serializable {private static final long serialVersionUID = -99877276843752542L;/*** 题目名称*/private String subjectName;/*** 题目难度*/private Integer subjectDifficult;/*** 题目类型 1单选 2多选 3判断 4简答*/private Integer subjectType;/*** 题目分数*/private Integer subjectScore;/*** 题目解析*/private String subjectParse;/*** 题目答案*/private String subjectAnswer;/*** 分类id*/private List<Integer> categoryIds;/*** 标签id*/private List<Integer> labelIds;/*** 答案选项*/private List<SubjectAnswerDTO> optionList;
}
2.SubjectAnswerDTO.java
package com.sunxiansheng.subject.application.dto;import lombok.Data;import java.io.Serializable;/*** Description: 题目答案dto* @Author sun* @Create 2024/5/27 13:39* @Version 1.0*/
@Data
public class SubjectAnswerDTO implements Serializable {/*** 答案选项标识*/private Integer optionType;/*** 答案*/private String optionContent;/*** 是否正确*/private Integer isCorrect;}
2.convert
1.SubjectAnswerDTOConverter.java
package com.sunxiansheng.subject.application.convert;import com.sunxiansheng.subject.application.dto.SubjectAnswerDTO;
import com.sunxiansheng.subject.domain.entity.SubjectAnswerBO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;import java.util.List;/*** Description: DTO与BO转换* @Author sun* @Create 2024/5/24 9:40* @Version 1.0*/
@Mapper
public interface SubjectAnswerDTOConverter {SubjectAnswerDTOConverter INSTANCE= Mappers.getMapper(SubjectAnswerDTOConverter.class);// 将SubjectAnswerDTO转换为SubjectAnswerBOSubjectAnswerBO convertDTO2BO(SubjectAnswerDTO subjectAnswerDTO);// 将SubjectAnswerBO转换为SubjectAnswerDTOSubjectAnswerDTO convertBO2DTO(SubjectAnswerBO subjectAnswerBO);// 将SubjectAnswerDTO集合转换为SubjectAnswerBO集合List<SubjectAnswerBO> convertDTO2BO(List<SubjectAnswerDTO> subjectAnswerDTOList);// 将SubjectAnswerBO集合转换为SubjectAnswerDTO集合List<SubjectAnswerDTO> convertBO2DTO(List<SubjectAnswerBO> subjectAnswerBOList);
}
2.SubjectInfoDTOConverter.java
package com.sunxiansheng.subject.application.convert;import com.sunxiansheng.subject.application.dto.SubjectInfoDTO;
import com.sunxiansheng.subject.domain.entity.SubjectInfoBO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;import java.util.List;/*** Description: DTO与BO转换* @Author sun* @Create 2024/5/24 9:40* @Version 1.0*/
@Mapper
public interface SubjectInfoDTOConverter {SubjectInfoDTOConverter INSTANCE= Mappers.getMapper(SubjectInfoDTOConverter.class);// 将SubjectInfoDTO转换为SubjectInfoBOSubjectInfoBO convertDTO2BO(SubjectInfoDTO subjectInfoDTO);// 将SubjectInfoBO转换为SubjectInfoDTOSubjectInfoDTO convertBO2DTO(SubjectInfoBO subjectInfoBO);// 将SubjectInfoDTO集合转换为SubjectInfoBO集合List<SubjectInfoBO> convertDTO2BO(List<SubjectInfoDTO> subjectInfoDTOList);// 将SubjectInfoBO集合转换为SubjectInfoDTO集合List<SubjectInfoDTO> convertBO2DTO(List<SubjectInfoBO> subjectInfoBOList);
}
2.sun-club-domain
1.entity
1.SubjectAnswerBO.java
package com.sunxiansheng.subject.domain.entity;import lombok.Data;import java.io.Serializable;/*** Description: 题目答案dto* @Author sun* @Create 2024/5/27 13:39* @Version 1.0*/
@Data
public class SubjectAnswerBO implements Serializable {/*** 答案选项标识*/private Integer optionType;/*** 答案*/private String optionContent;/*** 是否正确*/private Integer isCorrect;}
2.SubjectInfoBO.java
package com.sunxiansheng.subject.domain.entity;import lombok.Data;import java.io.Serializable;
import java.util.List;/*** 题目信息表(SubjectInfo)实体类** @author makejava* @since 2024-05-26 17:26:43*/
@Data
public class SubjectInfoBO implements Serializable {private static final long serialVersionUID = -99877276843752542L;/*** 题目名称*/private String subjectName;/*** 题目难度*/private Integer subjectDifficult;/*** 题目类型 1单选 2多选 3判断 4简答*/private Integer subjectType;/*** 题目分数*/private Integer subjectScore;/*** 题目解析*/private String subjectParse;/*** 题目答案*/private String subjectAnswer;/*** 分类id*/private List<Integer> categoryIds;/*** 标签id*/private List<Integer> labelIds;/*** 答案选项*/private List<SubjectAnswerBO> optionList;
}
2.convert
1.SubjectInfoConverter.java
package com.sunxiansheng.subject.domain.convert;import com.sunxiansheng.subject.domain.entity.SubjectInfoBO;
import com.sunxiansheng.subject.infra.basic.entity.SubjectInfo;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;import java.util.List;/*** Description: 题目标签转换器* @Author sun* @Create 2024/5/24 9:18* @Version 1.0*/
@Mapper // mapstruct的注解
public interface SubjectInfoConverter {SubjectInfoConverter INSTANCE = Mappers.getMapper(SubjectInfoConverter.class);// 将BO转换为entitySubjectInfo convertBoToSubjectInfo(SubjectInfoBO subjectInfoBO);// 将entity转换为BOSubjectInfoBO convertSubjectInfoToBo(SubjectInfo subjectInfo);// 将List<entity>转换为List<BO>List<SubjectInfoBO> convertSubjectInfoToBo(List<SubjectInfo> subjectInfoList);// 将List<BO>转换为List<entity>List<SubjectInfo> convertBoToSubjectInfo(List<SubjectInfoBO> subjectInfoBOList);
}
3.service
1.SubjectInfoDomainService.java
package com.sunxiansheng.subject.domain.service;import com.sunxiansheng.subject.domain.entity.SubjectInfoBO;/*** Description:* @Author sun* @Create 2024/5/24 9:03* @Version 1.0*/
public interface SubjectInfoDomainService {/*** 新增题目* @param subjectInfoBO*/Boolean add(SubjectInfoBO subjectInfoBO);}
3.sun-club-common
1.enums
1.SubjectInfoTypeEnum.java 题目类型枚举
package com.sunxiansheng.subject.common.enums;import lombok.Getter;/*** Description: 题目类型枚举* @Author sun* @Create 2024/5/24 9:53* @Version 1.0*/
@Getter
public enum SubjectInfoTypeEnum {RADIO(1,"单选"),MULTIPLE(2,"多选"),JUDGE(3,"判断"),BRIEF(4,"简答");public int code;public String desc;SubjectInfoTypeEnum(int code, String desc) {this.code = code;this.desc = desc;}/*** 根据code获取枚举* @param code* @return*/public static SubjectInfoTypeEnum getByCode(int code) {for (SubjectInfoTypeEnum value : values()) {if (value.code == code) {return value;}}return null;}
}
4.sun-club-domain
1.subject包构建一个题目类型工厂
1.SubjectTypeHandler.java
package com.sunxiansheng.subject.domain.handler.subject;import com.sunxiansheng.subject.common.enums.SubjectInfoTypeEnum;
import com.sunxiansheng.subject.domain.entity.SubjectInfoBO;/*** Description:* @Author sun* @Create 2024/5/27 21:12* @Version 1.0*/
public interface SubjectTypeHandler {/*** 枚举身份的识别* @return*/SubjectInfoTypeEnum getHandlerType();/*** 实际题目的插入* @param subjectInfoBO*/void add(SubjectInfoBO subjectInfoBO);
}
2.BriefTypeHandler.java
package com.sunxiansheng.subject.domain.handler.subject;import com.sunxiansheng.subject.common.enums.SubjectInfoTypeEnum;
import com.sunxiansheng.subject.domain.entity.SubjectInfoBO;
import org.springframework.stereotype.Component;/*** Description:* @Author sun* @Create 2024/5/27 21:16* @Version 1.0*/
@Component
public class BriefTypeHandler implements SubjectTypeHandler{@Overridepublic SubjectInfoTypeEnum getHandlerType() {return SubjectInfoTypeEnum.BRIEF;}@Overridepublic void add(SubjectInfoBO subjectInfoBO) {}
}
3.JudgeTypeHandler.java
package com.sunxiansheng.subject.domain.handler.subject;import com.sunxiansheng.subject.common.enums.SubjectInfoTypeEnum;
import com.sunxiansheng.subject.domain.entity.SubjectInfoBO;
import org.springframework.stereotype.Component;/*** Description:* @Author sun* @Create 2024/5/27 21:16* @Version 1.0*/
@Component
public class JudgeTypeHandler implements SubjectTypeHandler{@Overridepublic SubjectInfoTypeEnum getHandlerType() {return SubjectInfoTypeEnum.JUDGE;}@Overridepublic void add(SubjectInfoBO subjectInfoBO) {}
}
4.MultipleTypeHandler.java
package com.sunxiansheng.subject.domain.handler.subject;import com.sunxiansheng.subject.common.enums.SubjectInfoTypeEnum;
import com.sunxiansheng.subject.domain.entity.SubjectInfoBO;
import org.springframework.stereotype.Component;/*** Description:* @Author sun* @Create 2024/5/27 21:16* @Version 1.0*/
@Component
public class MultipleTypeHandler implements SubjectTypeHandler{@Overridepublic SubjectInfoTypeEnum getHandlerType() {return SubjectInfoTypeEnum.MULTIPLE;}@Overridepublic void add(SubjectInfoBO subjectInfoBO) {}
}
5.RadioTypeHandler.java
package com.sunxiansheng.subject.domain.handler.subject;import com.sunxiansheng.subject.common.enums.SubjectInfoTypeEnum;
import com.sunxiansheng.subject.domain.entity.SubjectInfoBO;
import org.springframework.stereotype.Component;/*** Description:* @Author sun* @Create 2024/5/27 21:16* @Version 1.0*/
@Component
public class RadioTypeHandler implements SubjectTypeHandler{@Overridepublic SubjectInfoTypeEnum getHandlerType() {return SubjectInfoTypeEnum.RADIO;}@Overridepublic void add(SubjectInfoBO subjectInfoBO) {// 单选题目的插入}
}
6.SubjectTypeHandlerFactory.java
package com.sunxiansheng.subject.domain.handler.subject;import com.sunxiansheng.subject.common.enums.SubjectInfoTypeEnum;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;/*** Description: 题目类型工厂* @Author sun* @Create 2024/5/27 21:25* @Version 1.0*/
@Component
public class SubjectTypeHandlerFactory implements InitializingBean {// 将所有的题目类型对象注入到List中@Resourceprivate List<SubjectTypeHandler> subjectTypeHandlerList;// 这个map是存储题目类型枚举和具体的题目类型对象的,方便取出private Map<SubjectInfoTypeEnum, SubjectTypeHandler> handlerMap = new HashMap<>();/*** 简单工厂核心方法:根据输入的类型,返回对应类型的对象* @param subjectType* @return*/public SubjectTypeHandler getHandler(int subjectType) {// 首先根据这个枚举码来获取对应的枚举对象SubjectInfoTypeEnum subjectInfoTypeEnum = SubjectInfoTypeEnum.getByCode(subjectType);// 然后通过map,根据不同类型的枚举码,返回对应类型的题目类型对象return handlerMap.get(subjectInfoTypeEnum);}/*** 这个方法bean装载完毕之后就会执行,可以进行初始化操作* @throws Exception*/@Overridepublic void afterPropertiesSet() throws Exception {// 初始化存储题目类型的mapsubjectTypeHandlerList.forEach(subjectTypeHandler -> {handlerMap.put(subjectTypeHandler.getHandlerType(), subjectTypeHandler);});}
}
2.service包来注入工厂,调用插入方法
1.SubjectInfoDomainService.java
package com.sunxiansheng.subject.domain.service;import com.sunxiansheng.subject.domain.entity.SubjectInfoBO;/*** Description:* @Author sun* @Create 2024/5/24 9:03* @Version 1.0*/
public interface SubjectInfoDomainService {/*** 新增题目* @param subjectInfoBO*/void add(SubjectInfoBO subjectInfoBO);}
2.SubjectInfoDomainServiceImpl.java
package com.sunxiansheng.subject.domain.service.impl;import com.google.common.collect.Lists;
import com.sunxiansheng.subject.domain.convert.SubjectInfoConverter;
import com.sunxiansheng.subject.domain.entity.SubjectInfoBO;
import com.sunxiansheng.subject.domain.handler.subject.SubjectTypeHandler;
import com.sunxiansheng.subject.domain.handler.subject.SubjectTypeHandlerFactory;
import com.sunxiansheng.subject.domain.service.SubjectInfoDomainService;
import com.sunxiansheng.subject.infra.basic.entity.SubjectInfo;
import com.sunxiansheng.subject.infra.basic.entity.SubjectMapping;
import com.sunxiansheng.subject.infra.basic.service.SubjectInfoService;
import com.sunxiansheng.subject.infra.basic.service.SubjectMappingService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;/*** Description:* @Author sun* @Create 2024/5/24 9:03* @Version 1.0*/
@Service
@Slf4j
public class SubjectInfoDomainServiceImpl implements SubjectInfoDomainService {@Resourceprivate SubjectInfoService subjectInfoService;@Resourceprivate SubjectMappingService subjectMappingService;@Resourceprivate SubjectTypeHandlerFactory subjectTypeHandlerFactory;@Overridepublic void add(SubjectInfoBO subjectInfoBO) {// 打印日志if (log.isInfoEnabled()) {log.info("SubjectInfoDomainServiceImpl add SubjectInfoBO, SubjectInfoBO:{}", subjectInfoBO);}// 将BO转换为entitySubjectInfo subjectInfo = SubjectInfoConverter.INSTANCE.convertBoToSubjectInfo(subjectInfoBO);// 向SubjectInfo表中插入数据subjectInfoService.insert(subjectInfo);// 从工厂中获取对应的题目对象,并执行对应的插入逻辑SubjectTypeHandler handler = subjectTypeHandlerFactory.getHandler(subjectInfo.getSubjectType());handler.add(subjectInfoBO);// 处理映射表// 首先获取分类idList<Long> categoryIds = subjectInfoBO.getCategoryIds();// 然后获取标签idList<Long> labelIds = subjectInfoBO.getLabelIds();// 这个映射表是多对多的关系,假如有两个分类id和两个标签id则会有四条映射记录// 构建一个list,用于存储映射表的实体类List<SubjectMapping> subjectMappings = new ArrayList<>();labelIds.forEach(laberId -> {categoryIds.forEach(categoryId -> {SubjectMapping subjectMapping = new SubjectMapping();subjectMapping.setSubjectId(subjectInfoBO.getId());subjectMapping.setLabelId(laberId);subjectMapping.setCategoryId(categoryId);subjectMappings.add(subjectMapping);});});// 批量插入映射表subjectMappingService.insertBatch(subjectMappings);}
}
3.单选题的插入
1.RadioTypeHandler.java
package com.sunxiansheng.subject.domain.handler.subject;import com.sunxiansheng.subject.common.enums.SubjectInfoTypeEnum;
import com.sunxiansheng.subject.domain.entity.SubjectInfoBO;
import com.sunxiansheng.subject.infra.basic.entity.SubjectRadio;
import com.sunxiansheng.subject.infra.basic.service.SubjectRadioService;
import org.springframework.stereotype.Component;import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;/*** Description:* @Author sun* @Create 2024/5/27 21:16* @Version 1.0*/
@Component
public class RadioTypeHandler implements SubjectTypeHandler {@Resourceprivate SubjectRadioService subjectRadioService;@Overridepublic SubjectInfoTypeEnum getHandlerType() {return SubjectInfoTypeEnum.RADIO;}@Overridepublic void add(SubjectInfoBO subjectInfoBO) {// 一个单选题目是有多个选项,所以需要一个listList<SubjectRadio> subjectRadioList = new ArrayList<>();// 将bo中的选项列表转换为list<SubjectRadio>subjectInfoBO.getOptionList().forEach(subjectAnswerBO -> {SubjectRadio subjectRadio = new SubjectRadio();// 设置基本信息subjectRadio.setOptionType(subjectAnswerBO.getOptionType());subjectRadio.setOptionContent(subjectAnswerBO.getOptionContent());subjectRadio.setIsCorrect(subjectAnswerBO.getIsCorrect());// 设置题目idsubjectRadio.setSubjectId(subjectInfoBO.getId());subjectRadioList.add(subjectRadio);});// 批量插入subjectRadioService.batchInsert(subjectRadioList);}
}
5.sun-club-infra
1.SubjectMappingDao.xml的批量插入如果逻辑删除字段为空就设置成0
2.SubjectRadioDao.xml 如果逻辑删除字段为空就设置成0

image-20240528142721846

6.sun-club-application-controller
SubjectController.java
package com.sunxiansheng.subject.application.controller;import com.alibaba.fastjson.JSON;
import com.google.common.base.Preconditions;
import com.sunxiansheng.subject.application.convert.SubjectAnswerDTOConverter;
import com.sunxiansheng.subject.application.convert.SubjectInfoDTOConverter;
import com.sunxiansheng.subject.application.dto.SubjectInfoDTO;
import com.sunxiansheng.subject.common.eneity.Result;
import com.sunxiansheng.subject.domain.convert.SubjectInfoConverter;
import com.sunxiansheng.subject.domain.entity.SubjectAnswerBO;
import com.sunxiansheng.subject.domain.entity.SubjectInfoBO;
import com.sunxiansheng.subject.domain.service.SubjectInfoDomainService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;import javax.annotation.Resource;
import java.util.List;/*** Description: 刷题微服务控制器* @Author sun* @Create 2024/5/23 16:42* @Version 1.0*/
@RestController
@Slf4j
public class SubjectController {@Resourceprivate SubjectInfoDomainService subjectInfoDomainService;private final SubjectAnswerDTOConverter subjectAnswerDTOConverter;public SubjectController(SubjectAnswerDTOConverter subjectAnswerDTOConverter) {this.subjectAnswerDTOConverter = subjectAnswerDTOConverter;}/*** 新增题目* @param subjectInfoDTO* @return*/@PostMapping("/add")public Result<Boolean> add(@RequestBody SubjectInfoDTO subjectInfoDTO) {try {// 打印日志if (log.isInfoEnabled()) {log.info("SubjectController add SubjectInfoDTO, subjectInfoDTO:{}", JSON.toJSONString(subjectInfoDTO));}// 参数校验Preconditions.checkArgument(!StringUtils.isBlank(subjectInfoDTO.getSubjectName()), "题目名称不能为空");Preconditions.checkNotNull(subjectInfoDTO.getSubjectDifficult(), "题目难度不能为空");Preconditions.checkNotNull(subjectInfoDTO.getSubjectType(), "题目类型不能为空");Preconditions.checkNotNull(subjectInfoDTO.getSubjectScore(), "题目分数不能为空");Preconditions.checkArgument(!CollectionUtils.isEmpty(subjectInfoDTO.getCategoryIds()), "题目所属分类不能为空");Preconditions.checkArgument(!CollectionUtils.isEmpty(subjectInfoDTO.getLabelIds()), "题目所属标签不能为空");// 转换DTO为BOSubjectInfoBO subjectInfoBO = SubjectInfoDTOConverter.INSTANCE.convertDTO2BO(subjectInfoDTO);List<SubjectAnswerBO> subjectAnswerBOS = subjectAnswerDTOConverter.convertDTO2BO(subjectInfoDTO.getOptionList());subjectInfoBO.setOptionList(subjectAnswerBOS);// 新增题目subjectInfoDomainService.add(subjectInfoBO);return Result.ok(true);} catch (Exception e) {log.error("SubjectController add error, subjectInfoDTO:{}", JSON.toJSONString(subjectInfoDTO), e);return Result.fail("新增题目失败");}}
}
7.接口测试

image-20240528153343996

image-20240528153350317

image-20240528153406939

image-20240528153419034

image-20240528153429556

相关文章:

新增题目接口开发

文章目录 1.基本设计2.生成CRUD代码1.生成五张表的代码1.subject_info2.subject_brief3.subject_judge4.subject_multiple5.subject_radio 2.将所有的dao放到mapper文件夹3.将所有实体类使用lombok简化4.删除所有mapper的Param("pageable") Pageable pageable5.删除所…...

国内怎样使用GPT4 turbo

GPT是当前最为熟知的大模型&#xff0c;它优越的性能一直遥遥领先于其它一众厂商&#xff0c;然而如此优秀的AI在中国境内却是无法正常使用的。本文将告诉你4种使用gpt4的方法&#xff0c;让你突破限制顺利使用。 官方售价是20美元/月&#xff0c;40次提问/3小时&#xff0c;需…...

【语义分割】1-标注数据集-【单张图片】labelme标注json文件转mask

声明&#xff1a;我学习了b站&#xff1a;标注自己的语义分割数据集_哔哩哔哩_bilibili 并且复现了&#xff0c;记录了所思所得。 主要是说了&#xff1a; 做语义分割&#xff0c;数据集怎么用labelme标注成json文件&#xff0c;以及&#xff0c;json文件怎么转成mask 流程…...

c++: 理解编译器在背后所做的工作-工具篇

理解C模板以及编译器的优化是深入掌握C编程的重要部分。有一些其他工具和技术可以帮助你更好地理解编译器在背后所做的工作&#xff0c;特别是优化方面。以下是一些有用的工具和技术&#xff1a; 1. Compiler Explorer (Godbolt) Compiler Explorer 是一个非常流行的在线工具…...

Verilog HDL语法入门系列(三):Verilog的语言操作符规则(上)

目录 1.操作符优先级2.Verilog中的大小(size)与符号3.算术操作符4.按位操作符5.逻辑操作符6.逻辑反与位反的对比 微信公众号获取更多FPGA相关源码&#xff1a; 1.操作符优先级 下表以优先级顺序列出了Verilog操作符。 2.Verilog中的大小(size)与符号 Verilog根据表达式中变…...

IT营大地老师是谁,怎么什么都会?

很多学员都很好奇大地老师到底是谁&#xff0c;怎么什么都会&#xff1f;每过一段时间就会出一门新课程&#xff0c;涉足深耕不同的领域。经反馈常有童鞋私聊IT营官网客服咨询这个问题&#xff0c;也有很多人在b站大地老师的免费课程里私信&#xff0c;有好奇也有崇拜&#xff…...

【python013】pyinstaller打包PDF提取脚本为exe工具

1.在日常工作和学习中&#xff0c;遇到类似问题处理场景&#xff0c;如pdf文件核心内容截取&#xff0c;这里将文件打包成exe可执行文件&#xff0c;实现功能简便使用。 2.欢迎点赞、关注、批评、指正&#xff0c;互三走起来&#xff0c;小手动起来&#xff01; 3.欢迎点赞、关…...

VUE div的右上角的角标/标签

一、效果图 二、代码 <div class"comp-overview"><div class"overview-item" v-for"(item,index) in overviewInfoList" :key"index"><div class"angle_mark"><span>{{item.label}}</span>&…...

WPS复制后转置粘贴

1. WPS复制后转置粘贴 复制-》右键-》顶部第一行-》粘贴行列转置&#xff0c;如下图&#xff1a; 2. Excel office365 本地版 2. Excel office365 在线版...

Shell编程之正则表达式与文本处理器

一&#xff0c;正则表达式 1&#xff1a;正则表达式概述 1.正则表达式的定义 正则表达式&#xff08;Regular Expression&#xff0c;RegEx&#xff09;是一种高度灵活的文本处理工具&#xff0c;它结合了字符序列、特殊控制字符&#xff08;称为元字符&#xff09;、以及特定…...

linux文本粘贴格式错乱的问题

vi/vim :set paste然后再 insert, 粘贴...

第二节课 6月13日 ssh密钥登陆方式

centos和ubuntu openssh服务的初始安装 一、实验&#xff1a;ubuntu系统激活root用户 ubuntu系统如何激活root用户&#xff0c;允许root用户ssh登陆&#xff1f; 1、ubuntu默认root用户未设置密码&#xff0c;未激活 激活root用户&#xff0c;设置root密码 sudo passwd roo…...

图书馆借阅表

DDL 用户表 (Users) 图书表 (Books) 图书类别表 (BookCategories) 图书与类别关联表 (BookCategoryRelations) 借阅记录表 (BorrowRecords) 供应商表 (Suppliers) 采购记录表 (PurchaseRecords) CREATE TABLE Users (user_id INT PRIMARY KEY AUTO_INCREMENT,username …...

云动态摘要 2024-06-25

给您带来云厂商的最新动态&#xff0c;最新产品资讯和最新优惠更新。 最新产品更新 Web应用防火墙 - 验证码支持微信小程序接入 阿里云 2024-06-25 支持客户从微信小程序场景下接入&#xff0c;提供人机识别的安全防护。 工业数字模型驱动引擎 - iDME控制台换新升级 华为云…...

Docker编译nanopc-t4源码流程介绍

官方文档 Android系统编译 vnc加环境变量配置 https://github.com/friendlyarm/docker-cross-compiler-novnc 下载 git clone https://github.com/friendlyarm/docker-ubuntu-lxde-novnc cd docker-ubuntu-lxde-novnc docker build --no-cache -t docker-ubuntu-lxde-novnc …...

Redis八股文目录

Redis缓存穿透-CSDN博客 Redis缓存击穿-CSDN博客 Redis缓存雪崩&#xff08;主从复制、哨兵模式&#xff08;脑裂&#xff09;、分片集群&#xff09;-CSDN博客 Redis双写一致性-CSDN博客 Redis持久化-CSDN博客 Redis数据过期、淘汰策略-CSDN博客 分布式锁&#xff08;Re…...

Ext JS+Spring Boot 使用Ajax方式上传文件

实现方式 使用 Ext JS 进行 AJAX 调用以传递文件通常涉及到创建一个 FormData 对象,将文件附加到这个对象中,然后通过 Ext JS 的 AJAX API 发送这个对象。 基本步骤 以下是使用 Ext JS 发送文件的基本步骤: 准备文件和数据: 首先需要获取到要传递的文件 创建 FormData 对…...

windows桌面运维----第九天

1、新的电脑需要安装哪些驱动&#xff1a; 显卡驱动、声卡驱动、主板驱动、网卡驱动、打印机驱动、外设驱动、 2、网络打印机如何开启打印机共享核客户端连接共享打印机&#xff1a; 一、打开控制面板并定位到设备和打印机&#xff1a; 首先&#xff0c;我们在电脑桌面上找…...

【Docker】安装和加速

目录 1.安装 2.了解 docker 信息 3.查询状态 4. 重新启动Docker 1.安装 yum install –y docker 2.了解 docker 信息 cat /etc/redhat-release 3.查询状态 systemctl status docker 4.支持 1.12 的 docker 镜像加速 sudo mkdir -p /etc/docker sudo tee /etc/docke…...

如何关闭win10音量调节时 左上角出现的黑框

目录 1.谷歌浏览器&#xff1a; 2.edge浏览器&#xff1a; 3.没得办法的办法&#xff1a; 4.官方回复&#xff1a; 1.谷歌浏览器&#xff1a; 把这行地址chrome://flags/#hardware-media-key-handling 输入到chrome的地址栏里&#xff0c;回车&#xff0c;把黄色里的Hardwa…...

准确率(accuracy)、召回率(recall)的意义和区别

准确率&#xff08;accuracy&#xff09;、召回率&#xff08;recall&#xff09;的意义和区别 对于准确率和召回率&#xff1a;一句话&#xff0c;准确率就是“找的对”&#xff0c;召回率就是“找的全” &#xff08;精确率&#xff1a;正样本中找对的准确率&#xff09; 注…...

分享5个卫星影像查看网站

我们在《分享5个图源二维码及使用方法》一文中&#xff0c;为你分享了5个图源二维码。 现在再为你为分享5种在线卫星影像&#xff0c;如果你需要更多的图源二维码&#xff0c;请在文末查看领取方式。 MapBox卫星影像 可能很多人都知道MapBox的地名路网地图&#xff0c;但可能…...

37岁,被裁员,失业三个月,被面试官嫌弃“太水”:就这也叫10年以上工作经验?

今年部门要招两个自动化测试&#xff0c;这几个月我面试了几十位候选人。发现一个很奇怪的现象&#xff0c;面试中一问到元素定位、框架api、脚本编写之类的&#xff0c;很多候选人都对答如流。但是一问到实际项目&#xff0c;比如“项目中UI自动化和接口自动化如何搭配使用&am…...

如何选择一款优质的酱香酒?

很多人在评价一款酒的好坏时&#xff0c;往往只关注一个标准&#xff1a;口感是否顺滑。然而&#xff0c;真正品鉴一款酒的品质&#xff0c;首要的是香味&#xff0c;其次是味道&#xff0c;最后才是岁月带来的柔和。这种由岁月赋予的柔和&#xff0c;才能展现出酒的力量感和层…...

SQL Server数据库安装

原文&#xff1a;https://blog.c12th.cn/archives/26.html SQL Server数据库安装 测试&#xff1a;笔记本原装操作系统&#xff1a;Windows 10 家庭中文版 资源分享链接&#xff1a;提取码&#xff1a;qbt2 注意事项&#xff1a; 请严格按照步骤安装&#xff0c;SQL软件安装较…...

Hadoop 面试题(十)

1. 简述下列关于Hadoop命令中&#xff0c;命令执行成功返回0&#xff0c;执行失败返回-1&#xff0c;下列命令返回-1的是 &#xff1f; A&#xff1a;hadoop fs -mv /user/hadoop/file1 /user/hadoop/file2 B&#xff1a;hdfs dfs -mv hdfs:///testData file:///tmp/testData …...

Python网络安全项目开发实战,如何看清Web攻击

注意:本文的下载教程,与以下文章的思路有相同点,也有不同点,最终目标只是让读者从多维度去熟练掌握本知识点。 下载教程: Python网络安全项目开发实战_看清Web攻击_编程案例解析实例详解课程教程.pdf 一、引言 在网络安全领域,Web攻击一直是一个严峻的问题。攻击者通过各…...

持续总结中!2024年面试必问的操作系统面试题(三)

上一篇地址&#xff1a;持续总结中&#xff01;2024年面试必问的操作系统面试题&#xff08;二&#xff09;-CSDN博客 五、什么是分页和分段&#xff1f;它们之间有什么区别&#xff1f; 分页和分段是操作系统中用于内存管理的两种不同技术&#xff0c;它们都旨在允许操作系统…...

请说明Thread类中run和start的区别,从方法的区别,及运行结果的区别分别说明

方法本身的区别 start() 方法&#xff1a; run()方法是Thread类的一个普通方法&#xff0c;它包含了线程要执行的代码。当你直接调用一个线程的run()方法&#xff08;如myThread.run()&#xff09;&#xff0c;你实际上是在当前线程&#xff08;通常是主线程&#xff09;中执行…...

MySQL:概念、逻辑与物理结构设计详解

MySQL&#xff1a;概念、逻辑与物理结构设计详解 一、引言 MySQL是一个流行的开源关系型数据库管理系统&#xff08;RDBMS&#xff09;&#xff0c;广泛应用于各种规模和类型的应用程序中。在设计和实现一个MySQL数据库时&#xff0c;理解其基本概念、逻辑结构设计和物理结构…...