0

我有一个 servlet,它可以处理多个路径并基于它做不同的事情。我想使用http://apidocjs.com记录类文件中的不同函数,但无法弄清楚如何让两个函数显示出来。当我尝试这个(见下文)时,只有第一个出现:

/**
 * @api {get} /authenticate/user?
 * @apiName Authenticator
 * @apiGroup Authentication
 *
 * @apiDescription Authenticate a user
 *
 * @apiSampleRequest /authenticate/user
 *
 * @apiParam    {String}            username                    User name
 * @apiParam    {String}            password                    User password
 *
 * @apiSuccess  {JSONObject}        user                        User
 *
 * @apiExample Success-Response (example):
 *     {
 *       ...
 *     }
 *
 * @apiExample Error-Response (example):
 *     {
 *          ...
 *     }
 *
 * @api {get} /authenticate/app?
 * @apiName Authenticator
 * @apiGroup Authentication
 *
 * @apiDescription Authenticate an app
 *
 * @apiSampleRequest /authenticate/app
 *
 * @apiParam    {String}            appId                   App Id
 * @apiParam    {String}            appKey                  Secret Key
 *
 * @apiSuccess  {JSONObject}        app                     App
 *
 * @apiExample Success-Response (example):
 *     {
 *       ...
 *     }
 *
 * @apiExample Error-Response (example):
 *     {
 *          ...
 *     }
 */
4

1 回答 1

1

刚刚发现如果你把它分成两个评论块,它会起作用:

/**
 * @api {get} /authenticate/user?
 * @apiName Authenticator
 * @apiGroup Authentication
 *
 * @apiDescription Authenticate a user
 *
 * @apiSampleRequest /authenticate/user
 *
 * @apiParam    {String}            username                    User name
 * @apiParam    {String}            password                    User password
 *
 * @apiSuccess  {JSONObject}        user                        User
 *
 * @apiExample Success-Response (example):
 *     {
 *       ...
 *     }
 *
 * @apiExample Error-Response (example):
 *     {
 *          ...
 *     }
 */

/**
 * @api {get} /authenticate/app?
 * @apiName Authenticator
 * @apiGroup Authentication
 *
 * @apiDescription Authenticate an app
 *
 * @apiSampleRequest /authenticate/app
 *
 * @apiParam    {String}            appId                   App Id
 * @apiParam    {String}            appKey                  Secret Key
 *
 * @apiSuccess  {JSONObject}        app                     App
 *
 * @apiExample Success-Response (example):
 *     {
 *       ...
 *     }
 *
 * @apiExample Error-Response (example):
 *     {
 *          ...
 *     }
 */
于 2016-06-20T20:21:17.270 回答