| <html> |
| <head> |
| <!-- Matomo --> |
| <script> |
| var _paq = window._paq = window._paq || []; |
| /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ |
| _paq.push(["setDoNotTrack", true]); |
| _paq.push(["disableCookies"]); |
| _paq.push(['trackPageView']); |
| _paq.push(['enableLinkTracking']); |
| (function() { |
| var u="https://analytics.apache.org/"; |
| _paq.push(['setTrackerUrl', u+'matomo.php']); |
| _paq.push(['setSiteId', '79']); |
| var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; |
| g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); |
| })(); |
| </script> |
| <!-- End Matomo Code --> |
| <meta http-equiv="Content-type" content="text/html; charset=utf-8"/> |
| <title>Grails Reference</title> |
| <link rel="stylesheet" href="../../css/ref.css" type="text/css" media="screen" title="Ref" charset="utf-8" /> |
| <link rel="icon" href="../../img/favicon.ico" type="image/x-icon"/> |
| <link rel="shortcut icon" href="../../img/favicon.ico" type="image/x-icon"/> |
| </head> |
| <body class="body"> |
| <h1>create-service </h1><p class="paragraph"/><h2>Purpose</h2><p class="paragraph"/>The <code>create-service</code> command will create a Grails service class for the given base name.<p class="paragraph"/><h2>Examples</h2><p class="paragraph"/><div class="code"><pre>grails create-service book</pre></div><p class="paragraph"/><h2>Description </h2><p class="paragraph"/>Creates a service for the give base name. For example for a base name <code>book</code> a service called <code>BookService</code> will be created in the <code>grails-app/services</code> directory.<p class="paragraph"/>A service class encapsulates business logic and is delegated to by controllers to perform the core logic of a Grails application. For more information on tags refer to the section on <a href="../../guide/single.html#8. The Service Layer" class="guide">Services</a> in the user guide.<p class="paragraph"/><blockquote class="note"> |
| Note that this command is merely for convenience and you can also create services in your favorite text editor or IDE if you choose. |
| </blockquote><p class="paragraph"/>Usage:<p class="paragraph"/><div class="code"><pre>grails create-service [name]</pre></div><p class="paragraph"/>Fired Events: |
| <ul class="star"> |
| <li><code>CreatedFile</code> - When the service has been created</li> |
| </ul><p class="paragraph"/> |
| </body> |
| </html> |