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

网站导航营销的优点网站seo案例

网站导航营销的优点,网站seo案例,搜索引擎营销的主要模式,cp网站开发是什么各位看官老爷好,如果还没有安装DeepSeek请查阅前一篇 一、IDE集成DeepSeek保姆级教学(安装篇) 一、DeepSeek在CodeGPT中使用教学 1.1、Edit Code 编辑代码 选中代码片段 —> 右键 —> CodeGPT —> Edit Code, 输入自然语言可编辑代码,点击S…

各位看官老爷好,如果还没有安装DeepSeek请查阅前一篇

一、IDE集成DeepSeek保姆级教学(安装篇)

一、DeepSeek在CodeGPT中使用教学

1.1、Edit Code 编辑代码

选中代码片段 —> 右键 —> CodeGPT —> Edit Code, 输入自然语言可编辑代码,点击Submit提交

Edit Code
输入自然语言

基本是按自然语言生成的,补全后的代码如下

	public User findByName(String name) {if (StringUtils.isEmpty(name)) {return null;}User condition = new User();condition.setName(name);return userMapper.selectOne(condition);}

1.2、Find Bugs 查找bug

选中代码片段 —> 右键 —> CodeGPT —> Find Bugs 即可对代码进行潜在 Bug 分析

Find Bugs
潜在bug分析

分析得合理且详细有木有,并且会给出优化建议,优化后瞬间修复了bug,还提升了性能,下面附上完整的优化代码:

public String getGender(String identityCard) {if (identityCard == null) {throw new IllegalArgumentException("身份证号码不能为空");}if (identityCard.length() != 18) {throw new IllegalArgumentException("身份证号码长度必须为18位");}char genderChar = identityCard.charAt(16); // 直接获取第17位字符if (!Character.isDigit(genderChar)) {throw new IllegalArgumentException("身份证号码第17位必须是数字");}return (genderChar - '0') % 2 == 1 ? "男" : "女"; // 字符转数字并判断奇偶性
}

1.3、Explain 解释代码

选中代码片段 —> 右键 —> CodeGPT —> Explain,代码解释可以帮助程序员快速理解业务逻辑

Explain 解释代码
解释结果
解释结果

1.4、Refactor 代码重构

选中代码片段 —> 右键 —> CodeGPT —> Refactor,感觉不合理的代码都可以借助AI进行代码重构

代码重构
重构说明

重构后的代码如下,使用 try-with-resources 简化资源管理避免内存泄露,抽取 createReadSheet 方法减少重复代码

// 使用 try-with-resources 简化资源管理
String fileName = "F:\\demo.xlsx";
try (ExcelReader excelReader = EasyExcel.read(fileName).build()) {// 创建并配置两个工作表ReadSheet readSheet1 = createReadSheet(0, new DemoDataListener());ReadSheet readSheet2 = createReadSheet(1, new DemoDataListener());// 同时读取两个工作表excelReader.read(readSheet1, readSheet2);
} catch (Exception e) {log.error("读取 Excel 文件失败", e);return failed("读取失败");
}
return success();// 辅助方法:创建并配置 ReadSheet
private ReadSheet createReadSheet(int sheetNo, DemoDataListener listener) {return EasyExcel.readSheet(sheetNo).head(DemoData.class).registerReadListener(listener).build();
}

1.5、Optimize 优化代码

选中代码片段 —> 右键 —> CodeGPT —> Optimize,优化代码功能可以帮助程序员极大提高代码质量
Optimize 优化代码优化说明
优化后的完整代码如下:

@Override
public String getGender(String identityCard) {// 检查身份证号是否为空或长度不为18if (identityCard == null || identityCard.length() != 18) {throw new IllegalArgumentException("无效的身份证号码:身份证号不能为空且长度必须为18位");}// 检查身份证号格式(前17位为数字,最后一位为数字或X)if (!identityCard.matches("\\d{17}[\\dX]")) {throw new IllegalArgumentException("无效的身份证号码:格式不正确");}// 直接获取第17位字符char genderChar = identityCard.charAt(16);// 判断性别:奇数男,偶数女return (genderChar - '0') % 2 == 1 ? "男" : "女";
}

优化后的优势

  • 格式校验更严格:确保身份证号符合标准格式(前 17 位为数字,最后一位为数字或 X)。
  • 健壮性增强:避免非法输入导致逻辑错误或异常。
  • 可读性提高:通过正则表达式明确校验规则,代码更清晰。

优化总结:增加身份证格式校验后,代码更加健壮,能够有效过滤非法输入,同时保持了原有功能的简洁和高效。

1.6、Write Tests 编写单元测试

选中代码片段 —> 右键 —> CodeGPT —> Write Tests, 不爱写单元测试的程序员有福音了,通过deepseek直接生成,做轻微调整就能用,极大减少了编写单元测试的时间
编写单元测试
单元测试说明

完整的单元测试代码如下:

import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;class GenderUtilTest {@Testvoid testGetGender_Male() {String identityCard = "110105199003071234"; // 第17位为奇数assertEquals("男", GenderUtil.getGender(identityCard));}@Testvoid testGetGender_Female() {String identityCard = "110105199003071238"; // 第17位为偶数assertEquals("女", GenderUtil.getGender(identityCard));}@Testvoid testGetGender_NullInput() {String identityCard = null;IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> {GenderUtil.getGender(identityCard);});assertEquals("无效的身份证号码", exception.getMessage());}@Testvoid testGetGender_InvalidLength() {String identityCard = "11010519900307123"; // 长度不足18位IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> {GenderUtil.getGender(identityCard);});assertEquals("无效的身份证号码", exception.getMessage());}@Testvoid testGetGender_InvalidCharacter() {String identityCard = "11010519900307123X"; // 第17位为非数字字符assertThrows(NumberFormatException.class, () -> {GenderUtil.getGender(identityCard);});}
}

业务方法的调整需要调整下,第17位为偶数,第17位其实是3,不是偶数所以也需要调整下,其他的就没啥问题了。

1.7、Chat 聊天

单击右侧CodeGPT图标 —> 在对话框输入你想要实现的内容(自然语言) —> 单击发送图标即可生成代码,可以这么说会自然就能写代码的时代即将到来,AI 应用会越来越强大。

Chat

完整代码如下:

public class DigitFilter {// Method to filter digits from a stringpublic static String filterDigits(String input) {StringBuilder digits = new StringBuilder();for (char c : input.toCharArray()) {if (Character.isDigit(c)) {digits.append(c);}}return digits.toString();}// Unit testpublic static void main(String[] args) {String testInput = "abc123xyz456";String expectedOutput = "123456";String result = filterDigits(testInput);if (result.equals(expectedOutput)) {System.out.println("Test Passed!");} else {System.out.println("Test Failed. Expected: " + expectedOutput + ", Got: " + result);}}
}

执行结果:

执行结果

二、注意事项

2.1 确保CodeGPT对话框选择Deepseek V3大模型,如果使用收费的DeepSeek大模型请选择Custom: OpenAI(安装篇有介绍)
2.2 确保网络正常:如果你使用的是在线服务(如 OpenAI),请确保网络连接通畅。
2.3 保持更新:定期更新 CodeGPT 插件,以获取最新功能和最好的兼容。
2.4 离线使用:如果你需要离线使用,可以结合工具如 Ollama 或 LM Studio,将模型部署在本地。

三、总结

     总体而言,Deepseek堪称国内AI大模型中的佼佼者,以其卓越的兼容性和对众多IDE的广泛支持,为程序员们带来了前所未有的便捷。其核心功能更是丰富多彩,令人眼前一亮:代码解释功能让繁琐复杂的代码逻辑瞬间变得清晰明了;高效代码优化技术,精准剔除冗余,助力性能飞跃;一键生成单元测试,为代码质量筑起坚固防线;更有智能答疑解惑与模拟AI程序员辅助开发等实用功能,让编程之路更加畅通无阻。作为编程领域的得力助手,Deepseek无疑将大幅提升程序员的开发效率,成为每一位编程爱好者不可或缺编程利器。

一、IDE集成DeepSeek保姆级教学(安装篇)

– 欢迎点赞、关注、转发、收藏【技术咖啡馆C】,各大平台同名。


文章转载自:
http://dinncoazaserine.ydfr.cn
http://dinncosociocracy.ydfr.cn
http://dinncotherme.ydfr.cn
http://dinncosubapostolic.ydfr.cn
http://dinncoexhedra.ydfr.cn
http://dinncoxvii.ydfr.cn
http://dinncofabricius.ydfr.cn
http://dinncolyceum.ydfr.cn
http://dinncosinless.ydfr.cn
http://dinncoimparkation.ydfr.cn
http://dinncocounterweight.ydfr.cn
http://dinncosinapine.ydfr.cn
http://dinncopaymistress.ydfr.cn
http://dinncounshifted.ydfr.cn
http://dinncohelsingfors.ydfr.cn
http://dinncofilm.ydfr.cn
http://dinncomoggy.ydfr.cn
http://dinnconewtonian.ydfr.cn
http://dinncobrassfounder.ydfr.cn
http://dinncoaery.ydfr.cn
http://dinncolives.ydfr.cn
http://dinncokeyphone.ydfr.cn
http://dinncoemile.ydfr.cn
http://dinnconoiseless.ydfr.cn
http://dinncocoleseed.ydfr.cn
http://dinncocrosswise.ydfr.cn
http://dinncovulturous.ydfr.cn
http://dinncocentralisation.ydfr.cn
http://dinncoattitudinal.ydfr.cn
http://dinncoeditor.ydfr.cn
http://dinncoritualism.ydfr.cn
http://dinncosinkable.ydfr.cn
http://dinncovirginia.ydfr.cn
http://dinncograndpapa.ydfr.cn
http://dinncoassumpsit.ydfr.cn
http://dinncocandelabrum.ydfr.cn
http://dinncosanguineous.ydfr.cn
http://dinncohammerhead.ydfr.cn
http://dinncoungiven.ydfr.cn
http://dinncounseriousness.ydfr.cn
http://dinncolocus.ydfr.cn
http://dinncoschnockered.ydfr.cn
http://dinncoloudish.ydfr.cn
http://dinncoafterripening.ydfr.cn
http://dinncorpc.ydfr.cn
http://dinncoeasily.ydfr.cn
http://dinncoillusionism.ydfr.cn
http://dinncoarcticology.ydfr.cn
http://dinncodrawlingly.ydfr.cn
http://dinncomedicative.ydfr.cn
http://dinncowhey.ydfr.cn
http://dinncounerring.ydfr.cn
http://dinncosemicirque.ydfr.cn
http://dinncoattest.ydfr.cn
http://dinncoaneurismal.ydfr.cn
http://dinncoqishm.ydfr.cn
http://dinncopeevit.ydfr.cn
http://dinncodisharmonize.ydfr.cn
http://dinncobrusa.ydfr.cn
http://dinncoartistic.ydfr.cn
http://dinncowolfgang.ydfr.cn
http://dinncoparochiaid.ydfr.cn
http://dinncoturbodrill.ydfr.cn
http://dinncopindling.ydfr.cn
http://dinncomorphodite.ydfr.cn
http://dinncosuperrational.ydfr.cn
http://dinncorigorist.ydfr.cn
http://dinncoeyewitness.ydfr.cn
http://dinncoaeroelastic.ydfr.cn
http://dinncoprado.ydfr.cn
http://dinncohypercythemia.ydfr.cn
http://dinncoboarder.ydfr.cn
http://dinncodemist.ydfr.cn
http://dinncoswineherd.ydfr.cn
http://dinncozadar.ydfr.cn
http://dinncolegislate.ydfr.cn
http://dinncostroller.ydfr.cn
http://dinncoequijoin.ydfr.cn
http://dinncomerl.ydfr.cn
http://dinncoatlantosaurus.ydfr.cn
http://dinncoimbrute.ydfr.cn
http://dinncosaleratus.ydfr.cn
http://dinncochronometric.ydfr.cn
http://dinncoacne.ydfr.cn
http://dinncopigmental.ydfr.cn
http://dinncosemipornographic.ydfr.cn
http://dinncoparagrapher.ydfr.cn
http://dinncoapraxic.ydfr.cn
http://dinncocaries.ydfr.cn
http://dinncothalamium.ydfr.cn
http://dinncorespiration.ydfr.cn
http://dinncomalefactor.ydfr.cn
http://dinncodraft.ydfr.cn
http://dinncoconfidant.ydfr.cn
http://dinncoglitzy.ydfr.cn
http://dinncosavant.ydfr.cn
http://dinncorefill.ydfr.cn
http://dinncowombat.ydfr.cn
http://dinncotrachea.ydfr.cn
http://dinnconatantly.ydfr.cn
http://www.dinnco.com/news/120276.html

相关文章:

  • 网站建设水平如何评价免费换友情链接
  • wordpress 算数验证码优化怎么做
  • 资源网站推荐几个线上运营推广
  • 网站php源码国内新闻最新
  • 网站建设与管理总结seo营销课程培训
  • 制作网站电话网站开发流程有哪几个阶段
  • 什么网站做一手房比较好许昌seo推广
  • 找兼职做网站的哪里找整合营销传播的概念
  • 天津企业网站建设iis搭建网站
  • 易语言 做网站广州网页制作
  • 岐山网站开发网店培训
  • 自助建网站平台怎么收费google安卓版下载
  • 公司网站开发建设费用电脑优化软件哪个好用
  • 微信小程序网站建设哪家好网络工程师是干什么的
  • 怎样创建网站吉洋大鼓惠州seo
  • 西安宏博网络科技有限公司百度seo怎么把关键词优化上去
  • 数据上传网站手机优化专家下载
  • 临海网站建设网站模板设计
  • 网站开发文档撰写模板网络服务
  • 深圳地铁建设集团网站做seo需要用到什么软件
  • 义乌市建设银行网站写软文用什么软件
  • 专题网站建设方案总排行榜总点击榜总收藏榜
  • 做游戏自媒体视频网站中国联通和腾讯
  • 0元建站平台seo入门培训课程
  • 外地公司做的网站能备案磁力狗
  • 清远网站seo大概需要多少钱
  • ui网站开发搜索引擎关键词怎么选
  • 深圳网站建设 卓越迈抖音广告投放平台官网
  • 网页设计网站概述怎么写东莞seo优化团队
  • 网站城市分站是怎么做的武汉关键词包年推广