Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI生成的代码无法直接使用 #4

Open
jzdayz opened this issue Oct 23, 2024 · 1 comment
Open

AI生成的代码无法直接使用 #4

jzdayz opened this issue Oct 23, 2024 · 1 comment

Comments

@jzdayz
Copy link

jzdayz commented Oct 23, 2024

先部署后端java,然后部署前段vue,ai代码生成填入 商品信息 后,点击生成文件,后端日志。

mybatis flex processor run start...
mybatis flex processor run start...
mybatis flex processor run start...
mybatis flex processor run start...
mybatis flex processor run start...
/Users/huqingfeng/Documents/cool-admin-java/src/main/java/com/cool/modules/goods/controller/admin/AdminGoodsInfoController.java:36: 错误: 找不到符号
        return R.ok(this.service.data(body.get("types", null)));
                                ^
  符号:   方法 data(Object)
  位置: 类型为S的变量 service
  其中, S,T是类型变量:
    S扩展已在类 BaseController中声明的BaseService<T>
    T扩展已在类 BaseController中声明的BaseEntity<T>
1 个错误
mybatis flex processor run start...
mybatis flex processor run start...
mybatis flex processor run start...
mybatis flex processor run start...
mybatis flex processor run start...
mybatis flex processor run start...
mybatis flex processor run start...
/Users/huqingfeng/Documents/cool-admin-java/src/main/java/com/cool/modules/goods/controller/admin/AdminGoodsInfoController.java:36: 错误: 找不到符号
        return R.ok(this.service.data(body.get("types", null)));
                                ^
  符号:   方法 data(Object)
  位置: 类型为S的变量 service
  其中, S,T是类型变量:
    S扩展已在类 BaseController中声明的BaseService<T>
    T扩展已在类 BaseController中声明的BaseEntity<T>
1 个错误
Compilation and annotation processing failed.
2024-10-23T14:59:57.245+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] org.quartz.core.QuartzScheduler          : Scheduler CoolScheduler_$_huqingfengdeMacBook-Pro.local1729666582099 paused.
2024-10-23T14:59:57.263+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] o.s.s.quartz.SchedulerFactoryBean        : Shutting down Quartz Scheduler
2024-10-23T14:59:57.263+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] org.quartz.core.QuartzScheduler          : Scheduler CoolScheduler_$_huqingfengdeMacBook-Pro.local1729666582099 shutting down.
2024-10-23T14:59:57.263+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] org.quartz.core.QuartzScheduler          : Scheduler CoolScheduler_$_huqingfengdeMacBook-Pro.local1729666582099 paused.
2024-10-23T14:59:57.263+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] org.quartz.core.QuartzScheduler          : Scheduler CoolScheduler_$_huqingfengdeMacBook-Pro.local1729666582099 shutdown complete.
2024-10-23T14:59:57.266+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2024-10-23T14:59:57.310+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.
2024-10-23T14:59:57.314+08:00 ERROR 69039 --- [cool-admin-java] [       Thread-4] com.cool.CoolApplication                 : loadClassErr /Users/huqingfeng/Documents/cool-admin-java/src/main/java/com/cool/modules/goods/controller/admin/AdminGoodsInfoController.java

java.lang.ClassNotFoundException: com.cool.modules.goods.controller.admin.AdminGoodsInfoController
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[na:na]
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[na:na]
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[na:na]
	at com.cool.CoolApplication.lambda$restart$0(CoolApplication.java:58) ~[classes/:na]
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) ~[na:na]
	at com.cool.CoolApplication.lambda$restart$1(CoolApplication.java:56) ~[classes/:na]
	at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na]

   ______    ___      ___   _____              _       ______   ____    ____  _____  ____  _____
 .' ___  | .'   `.  .'   `.|_   _|    V7.x    / \     |_   _ `.|_   \  /   _||_   _||_   \|_   _|
/ .'   \_|/  .-.  \/  .-.  \ | |     ______  / _ \      | | `. \ |   \/   |    | |    |   \ | |
| |       | |   | || |   | | | |   _|______|/ ___ \     | |  | | | |\  /| |    | |    | |\ \| |
\ `.___.'\\  `-'  /\  `-'  /_| |__/ |     _/ /   \ \_  _| |_.' /_| |_\/_| |_  _| |_  _| |_\   |_
 `.____ .' `.___.'  `.___.'|________|    |____| |____||______.'|_____||_____||_____||_____|\____|
:: https://java.cool-admin.com ::
2024-10-23T14:59:57.404+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] o.s.boot.SpringApplication               : Starting application using Java 17.0.9 with PID 69039 (started by huqingfeng in /Users/huqingfeng/Documents/cool-admin-java)
2024-10-23T14:59:57.404+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] o.s.boot.SpringApplication               : The following 1 profile is active: "local"
2024-10-23T14:59:57.568+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
2024-10-23T14:59:57.569+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
2024-10-23T14:59:57.580+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 11 ms. Found 0 Redis repository interfaces.
2024-10-23T14:59:57.623+08:00  WARN 69039 --- [cool-admin-java] [       Thread-4] trationDelegate$BeanPostProcessorChecker : Bean 'com.mybatisflex.spring.boot.FlexTransactionAutoConfiguration' of type [com.mybatisflex.spring.boot.FlexTransactionAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [projectingArgumentResolverBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2024-10-23T14:59:57.664+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port 8001 (http)
2024-10-23T14:59:57.665+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2024-10-23T14:59:57.665+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.20]
2024-10-23T14:59:57.674+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2024-10-23T14:59:57.674+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 269 ms
2024-10-23T14:59:57.718+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] com.zaxxer.hikari.HikariDataSource       : HikariPool-2 - Starting...
2024-10-23T14:59:57.760+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] com.zaxxer.hikari.pool.HikariPool        : HikariPool-2 - Added connection com.mysql.cj.jdbc.ConnectionImpl@63e56f3d
2024-10-23T14:59:57.761+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] com.zaxxer.hikari.HikariDataSource       : HikariPool-2 - Start completed.
2024-10-23T14:59:58.735+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] org.quartz.impl.StdSchedulerFactory      : Using default implementation for ThreadExecutor
2024-10-23T14:59:58.737+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] org.quartz.simpl.SimpleThreadPool        : Job execution threads will use class loader of thread: Thread-4
2024-10-23T14:59:58.738+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] org.quartz.core.SchedulerSignalerImpl    : Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
2024-10-23T14:59:58.738+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] org.quartz.core.QuartzScheduler          : Quartz Scheduler v.2.3.2 created.
2024-10-23T14:59:58.738+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] o.s.s.quartz.LocalDataSourceJobStore     : Using db table-based data access locking (synchronization).
2024-10-23T14:59:58.738+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] o.s.s.quartz.LocalDataSourceJobStore     : JobStoreCMT initialized.
2024-10-23T14:59:58.738+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] org.quartz.core.QuartzScheduler          : Scheduler meta-data: Quartz Scheduler (v2.3.2) 'CoolScheduler' with instanceId 'huqingfengdeMacBook-Pro.local1729666798737'
  Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
  NOT STARTED.
  Currently in standby mode.
  Number of jobs executed: 0
  Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 5 threads.
  Using job-store 'org.springframework.scheduling.quartz.LocalDataSourceJobStore' - which supports persistence. and is clustered.

2024-10-23T14:59:58.738+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] org.quartz.impl.StdSchedulerFactory      : Quartz scheduler 'CoolScheduler' initialized from an externally provided properties instance.
2024-10-23T14:59:58.738+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] org.quartz.impl.StdSchedulerFactory      : Quartz scheduler version: 2.3.2
2024-10-23T14:59:58.738+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] org.quartz.core.QuartzScheduler          : JobFactory set to: org.springframework.scheduling.quartz.SpringBeanJobFactory@66740d11
2024-10-23T14:59:58.901+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] o.s.s.web.DefaultSecurityFilterChain     : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@5edb1331, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@3743b449, org.springframework.security.web.context.SecurityContextHolderFilter@33f331b, org.springframework.security.web.header.HeaderWriterFilter@45431656, org.springframework.web.filter.CorsFilter@1cfdec8e, org.springframework.security.web.authentication.logout.LogoutFilter@181e3dee, com.cool.core.security.JwtAuthenticationTokenFilter@1c5802d8, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@39bb21f8, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@6417713f, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@6010d561, org.springframework.security.web.session.SessionManagementFilter@3a879ab9, org.springframework.security.web.access.ExceptionTranslationFilter@45dfec28, org.springframework.security.web.access.intercept.AuthorizationFilter@270b634b]
2024-10-23T14:59:59.111+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port 8001 (http) with context path ''
2024-10-23T14:59:59.111+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] o.s.s.quartz.SchedulerFactoryBean        : Will start Quartz Scheduler [CoolScheduler] in 2 seconds
2024-10-23T14:59:59.121+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] c.t.a.core.dynamicds.IDataSourceHandler  : 使用数据源:
2024-10-23T14:59:59.122+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] c.t.a.core.dynamicds.IDataSourceHandler  : 数据库链接 => jdbc:mysql://127.0.0.1:3306/cool?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
2024-10-23T14:59:59.122+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] c.t.a.core.dynamicds.IDataSourceHandler  : 数据库方言(MySQL)
2024-10-23T14:59:59.401+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] c.t.autotable.core.strategy.IStrategy    : 创建表:goods_info
2024-10-23T14:59:59.426+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] c.t.autotable.core.strategy.IStrategy    : 执行sql(22ms):CREATE TABLE `goods_info` (`id` bigint   NOT NULL  AUTO_INCREMENT  ,`create_time` datetime   NULL   COMMENT '创建时间' ,`update_time` datetime   NULL   COMMENT '更新时间' ,`name` varchar(255)   NOT NULL   COMMENT '名称' ,`price` double(6,2)   NOT NULL   COMMENT '价格' ,`stock` int   NOT NULL   COMMENT '库存' ,`description` varchar(255)   NULL   COMMENT '描述' ,`category` varchar(255)   NOT NULL   COMMENT '分类' ,`brand` varchar(255)   NOT NULL   COMMENT '品牌' ,`image` varchar(255)   NULL   COMMENT '图片' ,`specification` varchar(255)   NULL   COMMENT '规格' ,`status` int   NULL DEFAULT 0  COMMENT '状态 0-下架 1-上架 2-预售' ,`sales` int   NOT NULL   COMMENT '销量' ,PRIMARY KEY (`id`), INDEX `auto_idx_goods_info_brand`(`brand` ) , INDEX `auto_idx_goods_info_category`(`category` ) ,UNIQUE INDEX `auto_idx_goods_info_name`(`name` ) ) COMMENT = '商品信息';
2024-10-23T14:59:59.427+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] c.t.a.core.dynamicds.IDataSourceHandler  : 清理数据源:
2024-10-23T14:59:59.427+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] c.t.autotable.core.AutoTableBootstrap    : AutoTable执行结束。耗时:312ms
2024-10-23T14:59:59.427+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] o.s.boot.SpringApplication               : Started application in 2.109 seconds (process running for 220.237)
2024-10-23T14:59:59.431+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] com.cool.core.init.DBFromJsonInit        : db_base.json 业务数据已初始化过...
2024-10-23T14:59:59.433+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] com.cool.core.init.DBFromJsonInit        : menu_menu.json 菜单数据已初始化过...
2024-10-23T14:59:59.433+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] com.cool.core.init.DBFromJsonInit        : 数据初始化完成!
2024-10-23T14:59:59.456+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] com.cool.modules.task.event.TaskEvent    : 初始化任务
2024-10-23T14:59:59.457+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] c.c.c.plugin.service.CoolPluginService   : 没有可初始化的插件
2024-10-23T14:59:59.458+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] .s.a.AnnotationAsyncExecutionInterceptor : More than one TaskExecutor bean found within the context, and none is named 'taskExecutor'. Mark one of them as primary or name it 'taskExecutor' (possibly as an alias) in order to use it for async processing: [logTaskExecutor, taskScheduler]
2024-10-23T14:59:59.458+08:00  INFO 69039 --- [cool-admin-java] [       Thread-4] com.cool.core.eps.EpsEvent               : 构建eps信息
2024-10-23T14:59:59.830+08:00  INFO 69039 --- [cool-admin-java] [cTaskExecutor-1] o.springdoc.api.AbstractOpenApiResource  : Init duration for springdoc-openapi is: 371 ms
2024-10-23T15:00:00.015+08:00  INFO 69039 --- [cool-admin-java] [pool-4-thread-2] com.cool.core.eps.CoolEps                : 初始化eps完成,服务启动成功,端口:8001
2024-10-23T15:00:01.112+08:00  INFO 69039 --- [cool-admin-java] [[CoolScheduler]] o.s.s.quartz.SchedulerFactoryBean        : Starting Quartz Scheduler now, after delay of 2 seconds
2024-10-23T15:00:01.153+08:00  INFO 69039 --- [cool-admin-java] [[CoolScheduler]] org.quartz.core.QuartzScheduler          : Scheduler CoolScheduler_$_huqingfengdeMacBook-Pro.local1729666798737 started.
2024-10-23T15:00:01.843+08:00  INFO 69039 --- [cool-admin-java] [nio-8001-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2024-10-23T15:00:01.843+08:00  INFO 69039 --- [cool-admin-java] [nio-8001-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2024-10-23T15:00:01.847+08:00  INFO 69039 --- [cool-admin-java] [nio-8001-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 4 ms

@jzdayz
Copy link
Author

jzdayz commented Oct 23, 2024

  • 生成文件之后的项目目录
image
  • 就算拷贝到正确目录后,也会少service.data这个方法
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant