在Grails中创建管理部分的最佳方法

编程入门 行业动态 更新时间:2024-10-10 12:22:06
本文介绍了在Grails中创建管理部分的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 Hy,

我想知道在Grails应用程序中创建Admin(后端)部分的最佳方式是什么?

我想在Grails的controllers文件夹中创建一个Admin文件夹来放置我所有的管理员控制器。但是,那么我将不得不手动创建每个管理控制器的URL映射?

我已经用 genernate-all 命令生成了我所有的前端GSP,该命令带有一个 Domain Class 但知道如何为我的管理部分生成我的CRUD(具有相同的域类)。是我拧了吗?

非常感谢您的提示!

我的首选是为管理员提供一个单独的应用程序。将所有的域类都放在一个插件中,并将该插件安装到管理应用程序和消费者应用程序中。

这样,您可以调整控制器到您的内容中而不用担心最终用户打他们。共享服务也可以在域插件中。

有一个特殊的文件,您可以在您的grails-app / conf中调用BuildConfig.groovy,您可以在其中指定local 像插件那样的插件可以自动进入类路径,而无需打包/安装插件。使它变得非常简单。

Hy,

I'm wondering what's the best way to create an Admin (backend) section in a Grails app ?

I want to create an "Admin" folder in the "controllers" folder of Grails to put all my admin controllers. But then will I have to create manually the URL mapping for each Admin controller?

I have already generated all my frontend GSP with the genernate-all command which takes a Domain Class but know how can I generate my CRUD for my admin section (with the same domain class). Am I screwed ?

Thanks a lot for your tips!

解决方案

My preference for this is to have a separate application for admin. Stick all of your domain classes in a plugin and install that plugin into both the admin application and the consumer appilcation.

That way, you can tweak the controllers to your hearts content and not worry about end users hitting them. Shared services can also be in the domain plugin.

There's a special file that you can put in your grails-app/conf called BuildConfig.groovy where you can specify "local" plugins like the domain plugin that are automatically brought into the classpath without having to package/install the plugin. Makes it super easy.

更多推荐

在Grails中创建管理部分的最佳方法

本文发布于:2023-11-28 06:36:50,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:方法   Grails

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!