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/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

最新文章

  1. JS判断用户手机是IOS还是Android
  2. Visual Studio 2013 Nuget控制台无法找到程序包
  3. 访问者(Visitor)模式
  4. Android提高21篇之一:MediaPlayer
  5. 虚函数表以及RTTI阅读(阅后焚)
  6. MySql 集群配置
  7. UITabBarItem&#39;s appearance
  8. 常量池之String.intern()方法
  9. 014_zk路径过滤分析
  10. luogu P5288 [HNOI2019]多边形
  11. TP5上传图片
  12. SQLSERVER 数据量太大,重启服务器后,数据库显示正在恢复
  13. 使用VMware通过vmdk文件创建XP虚拟机
  14. 第七章 过滤器基础 Filter
  15. C#语法之特性
  16. SpannableString属性详解
  17. 操作数据类m
  18. table 中的tr 行点击 变换颜色背景
  19. H5上传图片,并且显示进度条
  20. kvm初体验之四:从Host登录Guest的五种方式

热门文章

  1. BZOJ 5415: [Noi2018]归程(kruskal重构树)
  2. 用orm操作sql数据库的优缺点
  3. idea 配置idk
  4. php开发面试题---Redis和Memcache区别,优缺点对比
  5. centos svn 安装
  6. STM32例程之USB HID双向数据传输(源码下载)【转】
  7. HTML5: HTML5 表单属性
  8. hci_ceph安装过程
  9. Xen的概况
  10. Python编写购物小程序