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

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

一个是技术总监,一个是号称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 三个平台的安装包,可以通过其官网下载

https://www.cursor.so/
图片

下载安装完成后,会引导你进行初始化设置,你即可以选择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();
    }

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

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

来个赞,做个点赞好友。

加油奥利给。
​​
​​​​在这里插入图片描述

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
THE END
分享
二维码
< <上一篇

)">
下一篇>>