ylbtech-Java-Class-@I:io.swagger.annotation.ApiParam
1.返回顶部
 
2.返回顶部
1、
package com.ylbtech.api.controller.auth;

import com.ylbtech.api.core.response.Result;
import com.ylbtech.api.core.response.ResultCode;
import com.ylbtech.api.core.response.ResultGenerator;
import com.ylbtech.api.service.WechatService;
import com.ylbtech.edu.organizationWxuser.domain.OrganizationWxuser;
import com.ylbtech.edu.organizationWxuser.service.IOrganizationWxuserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import java.util.Map; /**
* @author ylbtech
*/
@Api(tags = "微信用户")
@RequestMapping("wx")
@RestController
@Slf4j
public class WxController { @Autowired
private WechatService wechatService; @Autowired
private IOrganizationWxuserService organizationWxuserService; /**
* showdoc
*
* @param code 必选 string code
* @param organizationID 必选 string 机构id
* @return
* @catalog 微信用户
* @title 微信登录
* @description 微信登录接口
* @method POST
* @url https://ip:port/wx/login
* @remark
*/
@ApiOperation(value = "微信登录", notes = "微信登录")
@PostMapping("/login")
public Result loginWechat(@ApiParam("微信登录对象") @RequestBody Map map) { try { if (map.get("code") == null) {
return ResultGenerator.genFailedResult("code is null");
}
if (map.get("organizationID") == null) {
return ResultGenerator.genFailedResult("organizationID is null");
}
return wechatService.checkWechatInfo(map); } catch (Exception e) { log.error("微信登录异常:", e);
return ResultGenerator.genFailedResult(500, "系统异常");
} } @ApiOperation(value = "账户注销")
@DeleteMapping("/logout")
public Result logout(@ApiParam("用户id") @RequestBody String openid) {
try {
wechatService.logout(openid);
return ResultGenerator.genOkResult();
} catch (Exception e) { log.error("账户注销:", e);
return ResultGenerator.genFailedResult(500, "系统异常");
}
} }
2、
3.返回顶部
 
4.返回顶部
1、
/**
* Copyright 2016 SmartBear Software
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ package io.swagger.annotations; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; /**
* Adds additional meta-data for operation parameters.
* <p>
* This annotation can be used only in combination of JAX-RS 1.x/2.x annotations.
*/
@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface ApiParam {
/**
* The parameter name.
* <p>
* The name of the parameter will be derived from the field/method/parameter name,
* however you can override it.
* <p>
* Path parameters must always be named as the path section they represent.
*/
String name() default ""; /**
* A brief description of the parameter.
*/
String value() default ""; /**
* Describes the default value for the parameter.
* <p>
* If the parameter is annotated with JAX-RS's {@code @DefaultValue}, that value would
* be used, but can be overridden by setting this property.
*/
String defaultValue() default ""; /**
* Limits the acceptable values for this parameter.
* <p>
* There are three ways to describe the allowable values:
* <ol>
* <li>To set a list of values, provide a comma-separated list.
* For example: {@code first, second, third}.</li>
* <li>To set a range of values, start the value with "range", and surrounding by square
* brackets include the minimum and maximum values, or round brackets for exclusive minimum and maximum values.
* For example: {@code range[1, 5]}, {@code range(1, 5)}, {@code range[1, 5)}.</li>
* <li>To set a minimum/maximum value, use the same format for range but use "infinity"
* or "-infinity" as the second value. For example, {@code range[1, infinity]} means the
* minimum allowable value of this parameter is 1.</li>
* </ol>
*/
String allowableValues() default ""; /**
* Specifies if the parameter is required or not.
* <p>
* Path parameters will always be set as required, whether you set this property or not.
*/
boolean required() default false; /**
* Allows for filtering a parameter from the API documentation.
* <p>
* See io.swagger.core.filter.SwaggerSpecFilter for further details.
*/
String access() default ""; /**
* Specifies whether the parameter can accept multiple values by having multiple occurrences.
*/
boolean allowMultiple() default false; /**
* Hides the parameter from the list of parameters.
*/
boolean hidden() default false; /**
* a single example for non-body type parameters
*
* @since 1.5.4
*
* @return
*/
String example() default ""; /**
* Examples for the parameter. Applies only to BodyParameters
*
* @since 1.5.4
*
* @return
*/
Example examples() default @Example(value = @ExampleProperty(mediaType = "", value = "")); /**
* Adds the ability to override the detected type
*
* @since 1.5.11
*
* @return
*/
String type() default ""; /**
* Adds the ability to provide a custom format
*
* @since 1.5.11
*
* @return
*/
String format() default ""; /**
* Adds the ability to set a format as empty
*
* @since 1.5.11
*
* @return
*/
boolean allowEmptyValue() default false; /**
* adds ability to be designated as read only.
*
* @since 1.5.11
*
*/
boolean readOnly() default false; /**
* adds ability to override collectionFormat with `array` types
*
* @since 1.5.11
*
*/
String collectionFormat() default "";
}
2、
5.返回顶部
 
 
6.返回顶部
 
作者:ylbtech
出处:http://ylbtech.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

Java-Class-@I:io.swagger.annotation.ApiParam的更多相关文章

  1. Java-Class-@I:io.swagger.annotation.ApiOperation

    ylbtech-Java-Class-@I:io.swagger.annotation.ApiOperation 1.返回顶部   2.返回顶部 1. package com.ylbtech.api. ...

  2. Java-Class-@I:io.swagger.annotation.Api

    ylbtech-Java-Class-@I:io.swagger.annotation.Api 1.返回顶部   2.返回顶部 1. package com.ylbtech.api.controlle ...

  3. Java基础教程:IO流与文件基础

    Java:IO流与文件基础 说明: 本章内容将会持续更新,大家可以关注一下并给我提供建议,谢谢啦. 走进流 什么是流 流:从源到目的地的字节的有序序列. 在Java中,可以从其中读取一个字节序列的对象 ...

  4. Java 基础巩固:IO

    在学习IO的时候发现IO的类太多,如InputStream下面就用ReaderInputStream.InputStreamBuffer等等, 还用Reader.Writer.OutputStream ...

  5. API生命周期第三阶段:API实施:使用swagger codegen生成可部署工程,择取一个作为mock service

    在分享培训了swagger对于API的设计之后,有一些人问我说:你看,现在咱们前端使用web_API做为mock data在进行测试,后端也有mock 测试.然后我们再进行联调,这之中肯定会出现一些偏 ...

  6. Spring Boot:整合Swagger文档

    综合概述 spring-boot作为当前最为流行的Java web开发脚手架,越来越多的开发者选择用其来构建企业级的RESTFul API接口.这些接口不但会服务于传统的web端(b/s),也会服务于 ...

  7. 深入理解Java:注解(Annotation)自定义注解入门

    转载:http://www.cnblogs.com/peida/archive/2013/04/24/3036689.html 元注解: 元注解的作用就是负责注解其他注解.Java5.0定义了4个标准 ...

  8. 深入理解Java:注解(Annotation)--注解处理器

    如果没有用来读取注解的方法和工作,那么注解也就不会比注释更有用处了.使用注解的过程中,很重要的一部分就是创建于使用注解处理器.Java SE5扩展了反射机制的API,以帮助程序员快速的构造自定义注解处 ...

  9. 深入理解Java:注解(Annotation)基本概念

    转自:http://www.cnblogs.com/peida/archive/2013/04/23/3036035.html 竹子-博客(.NET/Java/Linux/架构/管理/敏捷) 什么是注 ...

随机推荐

  1. [CSP-S模拟测试]:夜鹰与玫瑰(数学)

    题目描述 红晕爬上了白玫瑰的花瓣,花刺还没有到达夜莺的心脏,玫瑰的心依旧苍白如终年不化的积雪.由生命铸就的玫瑰不允许存在一丝一毫的瑕疵,假设玫瑰的一片花瓣可以抽象成一个点,一朵玫瑰我们用一个$N\ti ...

  2. express设置允许跨域访问该服务.

    const express = require('express');const app = express(); //设置允许跨域访问该服务.app.all('*', function (req, ...

  3. SQL执行计划详解explain

    1.使用explain语句去查看分析结果 如explain select * from test1 where id=1;会出现:id selecttype table type possible_k ...

  4. MySQL高级学习笔记(三):Mysql逻辑架构介绍、mysql存储引擎

    文章目录 Mysql逻辑架构介绍 总体概览 总体概览 mysql存储引擎 查看命令 看你的 mysql 现在已提供什么存储引擎 : 看你的 mysql 当前默认的存储引擎 : 各个引擎简介 MyISA ...

  5. 03 java语言基础逻辑运算符

    03.01_Java语言基础(逻辑运算符的基本用法) A:逻辑运算符有哪些 &,|,^,! &&,|| B:案例演示 逻辑运算符的基本用法 注意事项: a:逻辑运算符一般用于连 ...

  6. Eclipes 配置src.zip(查看源代码)

    接着将这些改变应用,重启eclipes即可.

  7. <读书笔记>《JS DOM编程艺术》

    2016/03/04 12:00 第一二章:JS的简史以及基本语法 1.P11 2.variable 3.P13    等于 4.P13 5.P14 转义字符 6.关联数组不是一个好习惯 7.P18 ...

  8. 哈希表(hash)详解

     哈希表结构讲解: 哈希表(Hash table,也叫散列表),是根据关键码值(Key value)而直接进行访问的数据结构.也就是说,它通过把关键码值映射到表中一个位置来访问记录,以加快查找的速度. ...

  9. 利用HTML制作一个简单的界面(工具HBuilder)

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"><!--标题,里面填写 ...

  10. Linux下的解压缩

    Linux下常见的压缩包格式有5种:zip tar.gz tar.bz2 tar.xz tar.Z 其中tar是种打包格式,gz和bz2等后缀才是指代压缩方式:gzip和bzip2 filename. ...