feat: 完善脚本生成

This commit is contained in:
2024-11-19 22:50:18 +08:00
parent bc23c0baf2
commit 1d110285b5

View File

@@ -1017,15 +1017,16 @@ public class Codegen {
import cn.lihongjie.coal.base.dto.CommonQuery
import %s
import org.springframework.context.ApplicationContext
import com.fasterxml.jackson.databind.ObjectMapper
ApplicationContext ioc = ioc;
def controller = ioc.getBean(%s.class)
def objectMapper = ioc.getBean(ObjectMapper.class) as ObjectMapper
return controller.list(new CommonQuery())
return controller.list(params!=null ? objectMapper.convertValue(params, CommonQuery.class ) : new CommonQuery())
"""