easy-yapi icon indicating copy to clipboard operation
easy-yapi copied to clipboard

method.return 这个配置项不起作用

Open lan2475 opened this issue 2 years ago • 7 comments

method.return=#real_return 版本[2.6.3.212.0]

lan2475 avatar Oct 18 '23 05:10 lan2475

怎么用的呢?

tangcent avatar Oct 21 '23 11:10 tangcent

怎么用的呢?

IMG_20231021_202508.jpg

同样的用法,我有个老项目用的2.2.7就可以

lan2475 avatar Oct 21 '23 12:10 lan2475

用的地方是这样的吗? @real_return com.itangcent.common.model.UserInfo

tangcent avatar Oct 21 '23 13:10 tangcent

我试了一下:

    /**
     * 更新用户名
     *
     * @param id      当前用户id
     * @param newName 新的用户名
     * @param slogon  个人签名
     * @real_return com.itangcent.common.model.UserInfo
     * @deprecated 改用{@link #update(UserInfo)}
     */
    @RequestMapping(value = "/set", method = RequestMethod.PUT)
    public Result<UserInfo> set(@CookieValue(value = "currentId", required = false, defaultValue = "123") long id,
                                String newName,
                                @RequestParam String slogon,
                                @RequestParam(required = false, defaultValue = "10") long times) {

        UserInfo userInfo = new UserInfo();

        userInfo.setId(id);
        userInfo.setName(newName);
        userInfo.setAge(45);
        return Result.success(userInfo);
    }

响应:

RESPONSE

Headers:

name value required desc
content-type application/json;charset=UTF-8 NO

Body:

name type required default desc
id integer NO 用户id
type integer NO 1 :管理员
2 :成员
3 :游客
name string NO
age integer NO 年龄
sex integer NO 「已废弃」It's a secret
birthDay string NO 生日
regtime string NO 注册时间

Response Demo:

{
  "id": 0,
  "type": 0,
  "name": "",
  "age": 0,
  "sex": 0,
  "birthDay": "",
  "regtime": ""
}

tangcent avatar Oct 21 '23 13:10 tangcent

我用的是最新的社区版idea会和这个有关系么? 我试了很久的,不可能是使用问题,我也把不同版本的插件安装上,都不行

lan2475 avatar Oct 21 '23 14:10 lan2475

我用的是最新的社区版idea会和这个有关系么?

概率很小


用的地方是这样的吗? @real_return com.itangcent.common.model.UserInfo 还是简单的? @real_return UserInfo

tangcent avatar Oct 22 '23 01:10 tangcent

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 15 '23 07:12 stale[bot]