1

カスタム ドメイン レベルのバリデーターを超えた機能を実行する特別な oracle pl/sql 検証パッケージをカスタム呼び出ししようとしていますが、「firemyvalidations」は起動しません。私が試したもののいくつかをコメントアウトして見ることができます。誰でも私の問題を見つけることができますか? angularjsレストプロファイルでgrails 3.2.6を使用しています。

urlmappings.groovy

package fytrnlt

  class UrlMappings {




static mappings = {
        delete "/$controller/$id(.$format)?"(action:"delete")
        get "/$controller(.$format)?"(action:"index")
        get "/$controller/$id(.$format)?"(action:"show")
        post "/$controller(.$format)?"(action:"save")
        put "/$controller/$id(.$format)?"(action:"update")
        patch "/$controller/$id(.$format)?"(action:"patch")

        //"/fetchStvnatnData"(controller: 'FybkbraController', action: 'fetchStvnatn')

        "/events"(resources:"event")
        "/fytrnlts"(resources:"fytrnlt")
        //"/fytrnlts"(resources:"fytrnlt"){"/fytrnlts/myvalidations" (controller: "FytrnltController", action: "myvalidations", method: "POST")}
       // "/fytrnlts/myvalidations" (controller: 'FytrnltController', action: 'myvalidations', method: 'POST')
        "/firemyvalidations" (controller: 'FytrnltController', action: 'myvalidations', method: 'GET')
        "/spridens"(resources:"spriden")
       // "/fybkbras"(resources:"fybkbra")
        "/fybkbras"(resources:"fybkbra"){"/fetchStvnatnData" (controller: "FybkbraController", action: "fetchStvnatn", method: "GET")}
        "/fytbanks"(resources:"fytbank")
        "/fyrsigns"(resources:"fyrsign")

        "/"(view: '/index')
        "500"(view: '/error')
        "404"(view: '/notFound')
    }
}

FytrnltController.groovy

package fytrnlt


import grails.rest.*
import grails.converters.*
import fytrnlt.BannerService

class FytrnltController extends RestfulController {
    //def bannerService

    static responseFormats = ['json', 'xml']
    FytrnltController() {
        super(Fytrnlt)



    }

   def myvalidations(){

       //def String mresult = bannerService.dataValidation()

       def fytrnlt = Fytrnlt.get(4)
       def CheckResult = fytrnlt.bannerService.documentValidation(fytrnlt.checkpayeepidm, fytrnlt.benefiaryname, fytrnlt.id, fytrnlt.userid, 1, fytrnlt.version, fytrnlt.actnum, fytrnlt.actnumintmdry, fytrnlt.swift, fytrnlt.createdate, null)


       respond CheckResult, [excludes: ['class']]

       /*
       def fytrnlt = Fytrnlt.get(params.id)



       if (fytrnlt.validate()) {
       def CheckResult = fytrnlt.bannerService.documentValidation(fytrnlt.checkpayeepidm, fytrnlt.benefiaryname, fytrnlt.id, fytrnlt.userid, 1, fytrnlt.version, fytrnlt.actnum, fytrnlt.actnumintmdry, fytrnlt.swift, fytrnlt.createdate, null)

       return CheckResult

       } */


    }
}

Postman 経由でエンドポイントにアクセスすると、404 エラーが返されます。

Grails は以下を生成します。

WARN --- [nio-8080-exec-2] o.s.web.servlet.PageNotFound : No mapping found for HTTP request with URI [/firemyvalidations] in DispatcherServlet with name 'grailsDispatcherServlet'
4

1 に答える 1

0

URL マッピングに Controller サフィックスを追加する必要はありません。

したがって、次のものを置き換えることができます。

"/firemyvalidations" (controller: 'FytrnltController', action: 'myvalidations', method: 'GET')

と:

"/firemyvalidations" (controller: 'fytrnlt', action: 'myvalidations', method: 'GET')
于 2017-05-04T10:38:17.903 に答える