试图查看我是否可以公开 curl http://localhost:9090/studentinfo?schoolId=12341324,其中“studentinfo”是服务路径。
@http:ServiceConfig { basePath: "/studentinfo" }
service<http:Service> studentInfo bind studentInfoListener {
@http:ResourceConfig {
methods: ["GET"],
path: "?"
}
getStudentBySearch(endpoint client, http:Request req) {
http:Response response;
var params = req.getQueryParams();
var schoolId = <string>params.schoolId;
var addmissionYear = <string>params.addmissionYear;
...
}
...
}