美文网首页
idea 配置注释 和 Yapi 搭配

idea 配置注释 和 Yapi 搭配

作者: _大叔_ | 来源:发表于2019-11-22 15:36 被阅读0次

关于YAPI的搭建

yapi使用传送门

2021/7/12 官方的安装失败,更换成docker 安装了 https://hub.docker.com/r/yapipro/yapi
在mongodb配置权限的时候,尽量全部权限给上。

方法注释

方法模板
*
 * 接口名称
 * 接口描述
 * @Author big uncle
 * @Date $date$ $time$
$param$
 * @return $return$
**/

注意事项
参数配置Edit variables
groovyScript("def result=''; def params=\"${_1}\".replaceAll('[\\\\[|\\\\]|\\\\s]', '').split(',').toList(); for(i = 0; i < params.size(); i++) {result+= ' * @param ' + params[i]  + ((i < params.size() - 1) ? '\\n':'')}; return result", methodParameters())
使用方法
/** 回车即可

类上的注释

类模板
/**
 * 所属Y-API 模块 
 * 模块描述 
 * @Author big uncle
 * @Date $date$ $time$
**/
参数

实际应用

package com.hyq.hyqcloud.controller;

import com.hyq.hyqcloud.entity.User;
import com.hyq.hyqcloud.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 订单模块 // 这里对应你yapi 项目的模块名称
 * 这是一个新的订单模块 // 模块名称的描述
 * @Author big uncle
 * @Date 2019/11/22
 * @module HYQ_APP // 一定要写 而且对应的还是 yapi建的项目名
**/
@RestController
@RequestMapping("/user")
public class UserController {
    
    
    @Autowired
    private UserService userService;

    /**
     * getAllUser写方法中文名称
     * 这是一个getAllUser描述
     * @Author big uncle
     * @Date 2019/11/22 14:46
     * @param a
     * @return java.util.List<com.hyq.hyqcloud.entity.User>
    **/
    @GetMapping("/getAllUser")
    public List<User> getAllUser(String a){
        return userService.getAllUser();
    }

    /**
     * getUserById写方法中文名称
     * 这是一个getUserById描述
     * @Author big uncle
     * @Date 2019/11/22 14:47
     * @param
     * @return com.hyq.hyqcloud.entity.User
    **/
    @GetMapping("/getUserById")
    public User getUserById(){
        return userService.getUserById(1);
    }

}

idea插件推荐 EasyApi


token:项目名称=Token
可以配置多个,没配置一个要换行。

快速发布接口 alt + shift + e ,mac自己百度 拜拜

更新:
关于 easyapi 文档可以看这里:废了好大的劲找到,觉得可以给个赞

相关文章

  • idea 配置注释 和 Yapi 搭配

    关于YAPI的搭建 传送门 方法注释 方法模板 注意事项 参数配置Edit variables 使用方法 类上的注...

  • IDE注释模板配置

    Myeclipse注释模板配置 Idea注释模板配置

  • IDEA统一CodeStyle

    IDEA 配置统一的方法注释和类注释 最近觉得建立统一的代码风格检查很有必要,主要有以下原因 没有良好的注释和返回...

  • idea自定义Java注释模板

    #idea配置 ## 1. Java类,方法自定义注释模板 配置如下: * * TODO$param$ * @re...

  • IDEA注释模板配置

    1 类注释模板 打开配置File-->settings-->Editor-->File and Code Temp...

  • Idea注释模板配置

    1、配置类模板在类和接口的上面加上这句话 2、配置方法注释模板先创建 Temolate Group再创建 Live...

  • idea配置注释模板

    路径:File --> Settings --> Editor --> File and Code Templat...

  • idea 配置方法注释

    创建 group DIYComment 在 group 下创建 Live Template param:

  • javadoc详细说明

    先看结果 本人用过idea生成的,方法如下: 1.先在idea 配置注释 菜单栏File->settings-> ...

  • centos 安装 docker 部署yApi

    安装docker 点我查看如何安装docker 安装 yApi 如何使用docker安装yApi 配置docker...

网友评论

      本文标题:idea 配置注释 和 Yapi 搭配

      本文链接:https://www.haomeiwen.com/subject/ukkqwctx.html