草庐IT

IDE装上ChatGPT,一天开发一个系统

程序员springmeng 2023-04-15 原文

昨天白天在写代码,晚上看了一场直播,是两个技术的直播:

一个是技术总监,一个是号称Java之父的余**。

结果Java之父被技术总监吊打。然后匆匆下播。

技术这玩意,真的就是真的!

白天我开发了一个系统,Idea装上了一个插件,简直直飞了。

系统开发的很快。


每年小孟都开发大量的系统,有需求可以找我哦!

晚上小孟和甲方沟通了需要开发的需求,功能方面一般没问题,但是我们做的UI属实有点丑。

对了,他要做的是寺庙相关的小程序。

UI真的有点难住我,不知道有没有小伙伴擅长UI和前端的??

下面给大家介绍这款不错的Idea插件。

Cursor 是集成了 GPT-4 的 IDE 工具,目前免费并且无需 API Key,支持 Win、Mac、Linux 平台,可以按要求生成代码,或者让 AI 帮助优化代码,分析代码。Cursor目前已经集成了openai的GPT-4,它或将彻底改变我们写代码的方式。

以前程序员被调侃是“CV”工程师,以后我们恐怕要成为“KL"工程师,为什么叫”KL“工程师呢, 因为只要K和L两个指令就可以直接生成代码、修改代码,哪行代码不会点哪里,他都给你解释得明明白白。

目前GitHub开源(10k+ Star),支持多平台:macOS、Windows和Linux,完全免费。

使用Cursor编辑器提供了Windows、MacOS、Linux 三个平台的安装包,可以通过其官网下载

下载安装完成后,会引导你进行初始化设置,你即可以选择VIM或者Emacs的操作习惯,也可以保持默认设置,另外它还支持绑定Copilot。

其实他写代码的能力还是可以的。

目前体验感来说,还是有点差,速度方面比直接使用GPT-4逊色不少,但是用着还是不错的,能提高一定的代码效率。

当然还有其他的一些不错的ChaGPT插件,例如NetChatGPT,也是小孟的一个朋友开发的。

再看一个用低代码和ChatGPT生成的系统,然后我起飞了。

 /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,ZonghejingyingEntity zonghejingying, 
		HttpServletRequest request){

		String tableName = request.getSession().getAttribute("tableName").toString();
		if(tableName.equals("wuye")) {
			zonghejingying.setWuyezhanghao((String)request.getSession().getAttribute("username"));
		}
        EntityWrapper<ZonghejingyingEntity> ew = new EntityWrapper<ZonghejingyingEntity>();
    	PageUtils page = zonghejingyingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zonghejingying), params), params));
		request.setAttribute("data", page);
        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
	@IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,ZonghejingyingEntity zonghejingying, 
		HttpServletRequest request){
        EntityWrapper<ZonghejingyingEntity> ew = new EntityWrapper<ZonghejingyingEntity>();
    	PageUtils page = zonghejingyingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zonghejingying), params), params));
		request.setAttribute("data", page);
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( ZonghejingyingEntity zonghejingying){
       	EntityWrapper<ZonghejingyingEntity> ew = new EntityWrapper<ZonghejingyingEntity>();
      	ew.allEq(MPUtil.allEQMapPre( zonghejingying, "zonghejingying")); 
        return R.ok().put("data", zonghejingyingService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(ZonghejingyingEntity zonghejingying){
        EntityWrapper< ZonghejingyingEntity> ew = new EntityWrapper< ZonghejingyingEntity>();
 		ew.allEq(MPUtil.allEQMapPre( zonghejingying, "zonghejingying")); 
		ZonghejingyingView zonghejingyingView =  zonghejingyingService.selectView(ew);
		return R.ok("查询综合经营成功").put("data", zonghejingyingView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        ZonghejingyingEntity zonghejingying = zonghejingyingService.selectById(id);
        return R.ok().put("data", zonghejingying);
    }

    /**
     * 前端详情
     */
	@IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        ZonghejingyingEntity zonghejingying = zonghejingyingService.selectById(id);
        return R.ok().put("data", zonghejingying);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody ZonghejingyingEntity zonghejingying, HttpServletRequest request){
    	zonghejingying.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(zonghejingying);

        zonghejingyingService.insert(zonghejingying);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody ZonghejingyingEntity zonghejingying, HttpServletRequest request){
    	zonghejingying.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(zonghejingying);

        zonghejingyingService.insert(zonghejingying);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody ZonghejingyingEntity zonghejingying, HttpServletRequest request){
        //ValidatorUtils.validateEntity(zonghejingying);
        zonghejingyingService.updateById(zonghejingying);//全部更新
        return R.ok();
    }
@RestController
@RequestMapping(value = "/userInfo")
public class UserInfoController {

    @Resource
    private UserInfoService userInfoService;

    @PostMapping
    public Result<UserInfo> add(@RequestBody UserInfoVo userInfo) {
        userInfoService.add(userInfo);
        return Result.success(userInfo);
    }

    @DeleteMapping("/{id}")
    public Result delete(@PathVariable Long id) {
        userInfoService.delete(id);
        return Result.success();
    }

    @PutMapping
    public Result update(@RequestBody UserInfoVo userInfo) {
        userInfoService.update(userInfo);
        return Result.success();
    }

    @GetMapping("/{id}")
    public Result<UserInfo> detail(@PathVariable Long id) {
        UserInfo userInfo = userInfoService.findById(id);
        return Result.success(userInfo);
    }

    @GetMapping("/page/allYimao")
    public Result<PageInfo<UserYimiaoVo>> pageAllYimiao(
                                          @RequestParam(defaultValue = "1") Integer pageNum,
                                          @RequestParam(defaultValue = "5") Integer pageSize) {
        return Result.success(userInfoService.findPageYimiao(pageNum, pageSize));
    }
    @GetMapping
    public Result<List<UserInfoVo>> all() {
        return Result.success(userInfoService.findAll());
    }
    @GetMapping("/noHome")
    public Result<List<UserInfo>> noHome() {
        return Result.success(userInfoService.findAllNoHome());
    }
    @GetMapping("/thisHome/{id}")
    public Result<List<UserInfo>> noHome2(@PathVariable Long id) {
        return Result.success(userInfoService.findAllThisHome(id));
    }
    @GetMapping("/thisHomeUserInfo/{id}")
    public Result<List<UserInfo>> thisHomeUserInfo(@PathVariable Long id) {
        return Result.success(userInfoService.findAllThisHomeUserInfo(id));
    }
    @GetMapping("/thisHomeByUserId/{id}")
    public Result<List<UserInfo>> thisHome(@PathVariable Long id) {
        return Result.success(userInfoService.findAllThisHomeByUserId(id));
    }
    @GetMapping("/page/{name}")
    public Result<PageInfo<UserInfoVo>> page(@PathVariable String name,
                                                @RequestParam(defaultValue = "1") Integer pageNum,
                                                @RequestParam(defaultValue = "5") Integer pageSize,
                                                HttpServletRequest request) {
        return Result.success(userInfoService.findPage(name, pageNum, pageSize, request));
    }

    @PostMapping("/register")
    public Result<UserInfo> register(@RequestBody UserInfo userInfo) {
        if (StrUtil.isBlank(userInfo.getName()) || StrUtil.isBlank(userInfo.getPassword())) {
            throw new CustomException(ResultCode.PARAM_ERROR);
        }
        return Result.success(userInfoService.add(userInfo));
    }

    /**
    * 批量通过excel添加信息
    * @param file excel文件
    * @throws IOException
    */
    @PostMapping("/upload")
    public Result upload(MultipartFile file) throws IOException {

        List<UserInfo> infoList = ExcelUtil.getReader(file.getInputStream()).readAll(UserInfo.class);
        if (!CollectionUtil.isEmpty(infoList)) {
            // 处理一下空数据
            List<UserInfo> resultList = infoList.stream().filter(x -> ObjectUtil.isNotEmpty(x.getName())).collect(Collectors.toList());
            for (UserInfo info : resultList) {
                userInfoService.add(info);
            }
        }
        return Result.success();
    }

工欲善其器,必先利其器。

最后,祝你早日成为大神。

来个赞,做个点赞好友。

加油奥利给。
​​
​​​​

有关IDE装上ChatGPT,一天开发一个系统的更多相关文章

  1. ruby - 使用 Vim Rails,您可以创建一个新的迁移文件并一次性打开它吗? - 2

    使用带有Rails插件的vim,您可以创建一个迁移文件,然后一次性打开该文件吗?textmate也可以这样吗? 最佳答案 你可以使用rails.vim然后做类似的事情::Rgeneratemigratonadd_foo_to_bar插件将打开迁移生成的文件,这正是您想要的。我不能代表textmate。 关于ruby-使用VimRails,您可以创建一个新的迁移文件并一次性打开它吗?,我们在StackOverflow上找到一个类似的问题: https://sta

  2. ruby-on-rails - Rails - 一个 View 中的多个模型 - 2

    我需要从一个View访问多个模型。以前,我的links_controller仅用于提供以不同方式排序的链接资源。现在我想包括一个部分(我假设)显示按分数排序的顶级用户(@users=User.all.sort_by(&:score))我知道我可以将此代码插入每个链接操作并从View访问它,但这似乎不是“ruby方式”,我将需要在不久的将来访问更多模型。这可能会变得很脏,是否有针对这种情况的任何技术?注意事项:我认为我的应用程序正朝着单一格式和动态页面内容的方向发展,本质上是一个典型的网络应用程序。我知道before_filter但考虑到我希望应用程序进入的方向,这似乎很麻烦。最终从任何

  3. ruby-on-rails - 渲染另一个 Controller 的 View - 2

    我想要做的是有2个不同的Controller,client和test_client。客户端Controller已经构建,我想创建一个test_clientController,我可以使用它来玩弄客户端的UI并根据需要进行调整。我主要是想绕过我在客户端中内置的验证及其对加载数据的管理Controller的依赖。所以我希望test_clientController加载示例数据集,然后呈现客户端Controller的索引View,以便我可以调整客户端UI。就是这样。我在test_clients索引方法中试过这个:classTestClientdefindexrender:template=>

  4. ruby-on-rails - 如果 Object::try 被发送到一个 nil 对象,为什么它会起作用? - 2

    如果您尝试在Ruby中的nil对象上调用方法,则会出现NoMethodError异常并显示消息:"undefinedmethod‘...’fornil:NilClass"然而,有一个tryRails中的方法,如果它被发送到一个nil对象,它只返回nil:require'rubygems'require'active_support/all'nil.try(:nonexisting_method)#noNoMethodErrorexceptionanymore那么try如何在内部工作以防止该异常? 最佳答案 像Ruby中的所有其他对象

  5. ruby - 为什么 SecureRandom.uuid 创建一个唯一的字符串? - 2

    关闭。这个问题需要detailsorclarity.它目前不接受答案。想改进这个问题吗?通过editingthispost添加细节并澄清问题.关闭8年前。Improvethisquestion为什么SecureRandom.uuid创建一个唯一的字符串?SecureRandom.uuid#=>"35cb4e30-54e1-49f9-b5ce-4134799eb2c0"SecureRandom.uuid方法创建的字符串从不重复?

  6. ruby-on-rails - Rails - 从另一个模型中创建一个模型的实例 - 2

    我有一个正在构建的应用程序,我需要一个模型来创建另一个模型的实例。我希望每辆车都有4个轮胎。汽车模型classCar轮胎模型classTire但是,在make_tires内部有一个错误,如果我为Tire尝试它,则没有用于创建或新建的activerecord方法。当我检查轮胎时,它没有这些方法。我该如何补救?错误是这样的:未定义的方法'create'forActiveRecord::AttributeMethods::Serialization::Tire::Module我测试了两个环境:测试和开发,它们都因相同的错误而失败。 最佳答案

  7. ruby - 用 Ruby 编写一个简单的网络服务器 - 2

    我想在Ruby中创建一个用于开发目的的极其简单的Web服务器(不,不想使用现成的解决方案)。代码如下:#!/usr/bin/rubyrequire'socket'server=TCPServer.new('127.0.0.1',8080)whileconnection=server.acceptheaders=[]length=0whileline=connection.getsheaders想法是从命令行运行这个脚本,提供另一个脚本,它将在其标准输入上获取请求,并在其标准输出上返回完整的响应。到目前为止一切顺利,但事实证明这真的很脆弱,因为它在第二个请求上中断并出现错误:/usr/b

  8. ruby - 一个 YAML 对象可以引用另一个吗? - 2

    我想让一个yaml对象引用另一个,如下所示:intro:"Hello,dearuser."registration:$introThanksforregistering!new_message:$introYouhaveanewmessage!上面的语法只是它如何工作的一个例子(这也是它在thiscpanmodule中的工作方式。)我正在使用标准的ruby​​yaml解析器。这可能吗? 最佳答案 一些yaml对象确实引用了其他对象:irb>require'yaml'#=>trueirb>str="hello"#=>"hello"ir

  9. ruby - Rails 关联 - 同一个类的多个 has_one 关系 - 2

    我的问题的一个例子是体育游戏。一场体育比赛有两支球队,一支主队和一支客队。我的事件记录模型如下:classTeam"Team"has_one:away_team,:class_name=>"Team"end我希望能够通过游戏访问一个团队,例如:Game.find(1).home_team但我收到一个单元化常量错误:Game::team。谁能告诉我我做错了什么?谢谢, 最佳答案 如果Gamehas_one:team那么Rails假设您的teams表有一个game_id列。不过,您想要的是games表有一个team_id列,在这种情况下

  10. 亚特兰蒂斯的回声(中文版): chatGPT 的杰作 - 2

    英文版英文链接关注公众号在“亚特兰蒂斯的回声”中踏上一段难忘的冒险之旅,深入未知的海洋深处。足智多谋的考古学家AriaSeaborne偶然发现了一件古代神器,揭示了一张通往失落之城亚特兰蒂斯的隐藏地图。在她神秘的导师内森·兰登教授的指导和勇敢的冒险家亚历克斯·默瑟的帮助下,阿丽亚开始了一段危险的旅程,以揭开这座传说中城市的真相。他们的冒险之旅带领他们穿越险恶的大海、神秘的岛屿和充满陷阱和谜语的致命迷宫。随着Aria潜在的魔法能力的觉醒,她被睿智勇敢的QueenNeria的幻象所指引,她让她为即将到来的挑战做好准备。三人组揭开亚特兰蒂斯令人惊叹的隐藏文明,并了解到邪恶的巫师马拉卡勋爵试图利用其古

随机推荐