ylbtech-Java-Class-@I:org.springframework.web.bind.annotation.RequestMapping
1.返回顶部
 
2.返回顶部
1、
  1. package com.ylbtech.api.controller.operation;
  2.  
  3. import cn.hutool.core.date.DateUtil;
  4. import com.ylbtech.api.core.response.Result;
  5. import com.ylbtech.api.core.response.ResultCode;
  6. import com.ylbtech.api.core.response.ResultGenerator;
  7. import com.ylbtech.api.util.RedisUtils;
  8. import com.ylbtech.api.util.SMSUtil;
  9. import com.ylbtech.edu.classTry.service.IClassTryService;
  10. import com.ylbtech.edu.common.service.ICommonService;
  11. import com.ylbtech.edu.courseTry.domain.CourseTry;
  12. import com.ylbtech.edu.courseTry.service.ICourseTryService;
  13. import com.ylbtech.edu.organizationStudent.domain.OrganizationStudent;
  14. import com.ylbtech.edu.organizationStudent.service.IOrganizationStudentService;
  15. import com.ylbtech.edu.organizationWxuser.domain.OrganizationWxuser;
  16. import com.ylbtech.edu.organizationWxuser.service.IOrganizationWxuserService;
  17. import com.ylbtech.edu.pclass.domain.Class;
  18. import com.ylbtech.edu.pclass.service.IClassService;
  19. import com.ylbtech.edu.sms.domain.Sms;
  20. import com.ylbtech.edu.sms.service.ISmsService;
  21. import com.ylbtech.edu.student.domain.Student;
  22. import com.ylbtech.edu.student.service.IStudentService;
  23. import io.swagger.annotations.Api;
  24. import io.swagger.annotations.ApiOperation;
  25. import lombok.extern.slf4j.Slf4j;
  26. import org.springframework.beans.factory.annotation.Autowired;
  27. import org.springframework.validation.annotation.Validated;
  28. import org.springframework.web.bind.annotation.PostMapping;
  29. import org.springframework.web.bind.annotation.RequestBody;
  30. import org.springframework.web.bind.annotation.RequestMapping;
  31. import org.springframework.web.bind.annotation.RestController;
  32.  
  33. import javax.servlet.http.HttpServletRequest;
  34. import java.util.*;
  35.  
  36. @Slf4j
  37. @Api(tags = "学生业务")
  38. @Validated
  39. @RestController
  40. @RequestMapping("/student")
  41. public class StudentController {
  42.  
  43. @Autowired
  44. private IStudentService studentService;
  45.  
  46. /**
  47. * showdoc
  48. *
  49. * @param mobile 必选 string 手机号
  50. * @param verificationCode 必选 string 验证码
  51. * @param password 必选 string 密码
  52. * @param openid 必选 string openid
  53. * @param organizationId 必选 string 机构id
  54. * @return {"code":200,"data":{"city":"Kaifeng","country":"China","createTime":1537916044000,"language":"zh_CN","mobile":"13543214321","nickName":"å\u0090\u0091é\u0098³","organizationID":"shushenglanglang","params":{},"pno":1,"province":"Henan","psize":10,"studentID":"s190125162711","wxOpenID":"123456"}}
  55. * @catalog 直播教育
  56. * @title 注册
  57. * @description 注册接口
  58. * @method POST
  59. * @url https://ip:port/student/regist
  60. * @remark
  61. */
  62. @ApiOperation(value = "注册")
  63. @PostMapping("/regist")
  64. public Result regist(@RequestBody() Map map, HttpServletRequest request) {
  65.  
  66. }
  67.  
  68. }
2、
3.返回顶部
 
4.返回顶部
1、
  1. /*
  2. * Copyright 2002-2018 the original author or authors.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16.  
  17. package org.springframework.web.bind.annotation;
  18.  
  19. import java.lang.annotation.Documented;
  20. import java.lang.annotation.ElementType;
  21. import java.lang.annotation.Retention;
  22. import java.lang.annotation.RetentionPolicy;
  23. import java.lang.annotation.Target;
  24.  
  25. import org.springframework.core.annotation.AliasFor;
  26.  
  27. /**
  28. * Annotation for mapping web requests onto methods in request-handling classes
  29. * with flexible method signatures.
  30. *
  31. * <p>Both Spring MVC and Spring WebFlux support this annotation through a
  32. * {@code RequestMappingHandlerMapping} and {@code RequestMappingHandlerAdapter}
  33. * in their respective modules and package structure. For the exact list of
  34. * supported handler method arguments and return types in each, please use the
  35. * reference documentation links below:
  36. * <ul>
  37. * <li>Spring MVC
  38. * <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#mvc-ann-arguments">Method Arguments</a>
  39. * and
  40. * <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#mvc-ann-return-types">Return Values</a>
  41. * </li>
  42. * <li>Spring WebFlux
  43. * <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/web-reactive.html#webflux-ann-arguments">Method Arguments</a>
  44. * and
  45. * <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/web-reactive.html#webflux-ann-return-types">Return Values</a>
  46. * </li>
  47. * </ul>
  48. *
  49. * <p><strong>Note:</strong> This annotation can be used both at the class and
  50. * at the method level. In most cases, at the method level applications will
  51. * prefer to use one of the HTTP method specific variants
  52. * {@link GetMapping @GetMapping}, {@link PostMapping @PostMapping},
  53. * {@link PutMapping @PutMapping}, {@link DeleteMapping @DeleteMapping}, or
  54. * {@link PatchMapping @PatchMapping}.</p>
  55. *
  56. * <p><b>NOTE:</b> When using controller interfaces (e.g. for AOP proxying),
  57. * make sure to consistently put <i>all</i> your mapping annotations - such as
  58. * {@code @RequestMapping} and {@code @SessionAttributes} - on
  59. * the controller <i>interface</i> rather than on the implementation class.
  60. *
  61. * @author Juergen Hoeller
  62. * @author Arjen Poutsma
  63. * @author Sam Brannen
  64. * @since 2.5
  65. * @see GetMapping
  66. * @see PostMapping
  67. * @see PutMapping
  68. * @see DeleteMapping
  69. * @see PatchMapping
  70. * @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter
  71. * @see org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerAdapter
  72. */
  73. @Target({ElementType.METHOD, ElementType.TYPE})
  74. @Retention(RetentionPolicy.RUNTIME)
  75. @Documented
  76. @Mapping
  77. public @interface RequestMapping {
  78.  
  79. /**
  80. * Assign a name to this mapping.
  81. * <p><b>Supported at the type level as well as at the method level!</b>
  82. * When used on both levels, a combined name is derived by concatenation
  83. * with "#" as separator.
  84. * @see org.springframework.web.servlet.mvc.method.annotation.MvcUriComponentsBuilder
  85. * @see org.springframework.web.servlet.handler.HandlerMethodMappingNamingStrategy
  86. */
  87. String name() default "";
  88.  
  89. /**
  90. * The primary mapping expressed by this annotation.
  91. * <p>This is an alias for {@link #path}. For example
  92. * {@code @RequestMapping("/foo")} is equivalent to
  93. * {@code @RequestMapping(path="/foo")}.
  94. * <p><b>Supported at the type level as well as at the method level!</b>
  95. * When used at the type level, all method-level mappings inherit
  96. * this primary mapping, narrowing it for a specific handler method.
  97. */
  98. @AliasFor("path")
  99. String[] value() default {};
  100.  
  101. /**
  102. * The path mapping URIs (e.g. "/myPath.do").
  103. * Ant-style path patterns are also supported (e.g. "/myPath/*.do").
  104. * At the method level, relative paths (e.g. "edit.do") are supported
  105. * within the primary mapping expressed at the type level.
  106. * Path mapping URIs may contain placeholders (e.g. "/${connect}").
  107. * <p><b>Supported at the type level as well as at the method level!</b>
  108. * When used at the type level, all method-level mappings inherit
  109. * this primary mapping, narrowing it for a specific handler method.
  110. * @see org.springframework.web.bind.annotation.ValueConstants#DEFAULT_NONE
  111. * @since 4.2
  112. */
  113. @AliasFor("value")
  114. String[] path() default {};
  115.  
  116. /**
  117. * The HTTP request methods to map to, narrowing the primary mapping:
  118. * GET, POST, HEAD, OPTIONS, PUT, PATCH, DELETE, TRACE.
  119. * <p><b>Supported at the type level as well as at the method level!</b>
  120. * When used at the type level, all method-level mappings inherit
  121. * this HTTP method restriction (i.e. the type-level restriction
  122. * gets checked before the handler method is even resolved).
  123. */
  124. RequestMethod[] method() default {};
  125.  
  126. /**
  127. * The parameters of the mapped request, narrowing the primary mapping.
  128. * <p>Same format for any environment: a sequence of "myParam=myValue" style
  129. * expressions, with a request only mapped if each such parameter is found
  130. * to have the given value. Expressions can be negated by using the "!=" operator,
  131. * as in "myParam!=myValue". "myParam" style expressions are also supported,
  132. * with such parameters having to be present in the request (allowed to have
  133. * any value). Finally, "!myParam" style expressions indicate that the
  134. * specified parameter is <i>not</i> supposed to be present in the request.
  135. * <p><b>Supported at the type level as well as at the method level!</b>
  136. * When used at the type level, all method-level mappings inherit
  137. * this parameter restriction (i.e. the type-level restriction
  138. * gets checked before the handler method is even resolved).
  139. * <p>Parameter mappings are considered as restrictions that are enforced at
  140. * the type level. The primary path mapping (i.e. the specified URI value)
  141. * still has to uniquely identify the target handler, with parameter mappings
  142. * simply expressing preconditions for invoking the handler.
  143. */
  144. String[] params() default {};
  145.  
  146. /**
  147. * The headers of the mapped request, narrowing the primary mapping.
  148. * <p>Same format for any environment: a sequence of "My-Header=myValue" style
  149. * expressions, with a request only mapped if each such header is found
  150. * to have the given value. Expressions can be negated by using the "!=" operator,
  151. * as in "My-Header!=myValue". "My-Header" style expressions are also supported,
  152. * with such headers having to be present in the request (allowed to have
  153. * any value). Finally, "!My-Header" style expressions indicate that the
  154. * specified header is <i>not</i> supposed to be present in the request.
  155. * <p>Also supports media type wildcards (*), for headers such as Accept
  156. * and Content-Type. For instance,
  157. * <pre class="code">
  158. * @RequestMapping(value = "/something", headers = "content-type=text/*")
  159. * </pre>
  160. * will match requests with a Content-Type of "text/html", "text/plain", etc.
  161. * <p><b>Supported at the type level as well as at the method level!</b>
  162. * When used at the type level, all method-level mappings inherit
  163. * this header restriction (i.e. the type-level restriction
  164. * gets checked before the handler method is even resolved).
  165. * @see org.springframework.http.MediaType
  166. */
  167. String[] headers() default {};
  168.  
  169. /**
  170. * The consumable media types of the mapped request, narrowing the primary mapping.
  171. * <p>The format is a single media type or a sequence of media types,
  172. * with a request only mapped if the {@code Content-Type} matches one of these media types.
  173. * Examples:
  174. * <pre class="code">
  175. * consumes = "text/plain"
  176. * consumes = {"text/plain", "application/*"}
  177. * </pre>
  178. * Expressions can be negated by using the "!" operator, as in "!text/plain", which matches
  179. * all requests with a {@code Content-Type} other than "text/plain".
  180. * <p><b>Supported at the type level as well as at the method level!</b>
  181. * When used at the type level, all method-level mappings override
  182. * this consumes restriction.
  183. * @see org.springframework.http.MediaType
  184. * @see javax.servlet.http.HttpServletRequest#getContentType()
  185. */
  186. String[] consumes() default {};
  187.  
  188. /**
  189. * The producible media types of the mapped request, narrowing the primary mapping.
  190. * <p>The format is a single media type or a sequence of media types,
  191. * with a request only mapped if the {@code Accept} matches one of these media types.
  192. * Examples:
  193. * <pre class="code">
  194. * produces = "text/plain"
  195. * produces = {"text/plain", "application/*"}
  196. * produces = MediaType.APPLICATION_JSON_UTF8_VALUE
  197. * </pre>
  198. * <p>It affects the actual content type written, for example to produce a JSON response
  199. * with UTF-8 encoding, {@link org.springframework.http.MediaType#APPLICATION_JSON_UTF8_VALUE} should be used.
  200. * <p>Expressions can be negated by using the "!" operator, as in "!text/plain", which matches
  201. * all requests with a {@code Accept} other than "text/plain".
  202. * <p><b>Supported at the type level as well as at the method level!</b>
  203. * When used at the type level, all method-level mappings override
  204. * this produces restriction.
  205. * @see org.springframework.http.MediaType
  206. */
  207. String[] produces() default {};
  208.  
  209. }
2、
5.返回顶部
 
 
6.返回顶部
 
作者:ylbtech
出处:http://ylbtech.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

Java-Class-@I:org.springframework.web.bind.annotation.RequestMapping的更多相关文章

  1. Java-API-Package:org.springframework.web.bind.annotation

    ylbtech-Java-API-Package:org.springframework.web.bind.annotation 1.返回顶部 1. @NonNullApi @NonNullField ...

  2. Java-Class-@I:org.springframework.web.bind.annotation.PostMapping

    ylbtech-Java-Class-@I:org.springframework.web.bind.annotation.PostMapping 1.返回顶部   2.返回顶部 1. package ...

  3. Java-Class-@I:org.springframework.web.bind.annotation.RestController

    ylbtech-Java-Class-@I:org.springframework.web.bind.annotation.RestController 1.返回顶部   2.返回顶部 1. pack ...

  4. Java-Class-@I:org.springframework.web.bind.annotation.RequestBody

    ylbtech-Java-Class-@I:org.springframework.web.bind.annotation.RequestBody 1.返回顶部   2.返回顶部 1. package ...

  5. org.springframework.web.bind.annotation不存在 site:blog.csdn.net(IDEA中运行springboot时报错)

    原因:MAVEN版本与IDEA版本不兼容问题, maven虽然更新比较慢,但是最新的3.6.6在与IDEA2019版本及以下版本兼容时会出现以上问题 解决办法:重新配置一个3.6低级别版本的maven ...

  6. org.springframework.web.bind.annotation重定向的问题

    @RequestMapping(value="/redir/authcode") public ModelAndView getAuthCode(){ String authUrl ...

  7. spring org.springframework.web.bind.annotation 常用注解

    开发中常用的注解记录,查缺补漏 Request注解 @RequestBody @RequestHeader @RequestMapping @RequestParam @RequestPart @Co ...

  8. Spring MVC报异常:org.springframework.web.util.NestedServletException: Request processing failed

    在使用SpringMVC绑定基本类型(如String,Integer等)参数时,应通过@RequestParam注解指定具体的参数名称,否则,当源代码在非debug模式下编译后,运行时会引发Handl ...

  9. SSM报错:No converter found for return value of type: class java.util.ArrayList at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverter

    我使用的是SSM框架,是在编写测试RESTFUL接口的时候出现, @RequestMapping(value = "/selectAll", method = RequestMet ...

随机推荐

  1. obj.offsetHeight与obj.style.height $(obj).height()与$(obj).css('height')

    相同:都可以获取obj的高度区别:(1)obj.offsetHeight可以获取外部.内嵌和内联中定义的高,而obj.style.height只能获取内联中定义的高:(2)obj.offsetHeig ...

  2. 向量vector 容器浅析

    一.什么是vector? 向量(Vector)是一个封装了动态大小数组的顺序容器(Sequence Container).跟任意其它类型容器一样,它能够存放各种类型的对象.可以简单的认为,向量是一个能 ...

  3. MySql命令行无法显示中文

    好烦遇到了,遇到MySql命令行无法显示中文问题????? show variables like 'char%';//显示字符集 set names utf8;//设置字符集 describer t ...

  4. Java-Class-I:javax.servlet.http.HttpServletRequest

    ylbtech-Java-Class-I:javax.servlet.http.HttpServletRequest 1.返回顶部   2.返回顶部 1. package com.ylbtech.ap ...

  5. LightOJ 1203 Guarding Bananas (凸包最小顶角)

    题目链接:LightOJ 1203 Problem Description Once there was a lazy monkey in a forest. But he loved banana ...

  6. PAT_A1012#The Best Rank

    Source: PAT A1012 The Best Rank (25 分) Description: To evaluate the performance of our first year CS ...

  7. 2019河北省大学生程序设计竞赛(重现赛)J-舔狗 (拓扑排序)

    题目链接:https://ac.nowcoder.com/acm/contest/903/J 题意:给你 n 个舔狗和他喜欢的人,让你俩俩配对(只能和喜欢它的和它喜欢的),求剩下的单身狗数量. 思路: ...

  8. JSoup安装

    要运行任何jsoup示例,需要先安装好jsoup相关Jar包.到目前为止(2017年05月),jsoup的当前版本是1.10.2.0.安装jsoup主要有三种方法: 通过Maven的pom.xml配置 ...

  9. ubuntu 无pthread

    由于学习多线程编程,所以用到pthread,但是man的时候却发现没有pthread函数库的手册页,然后安装 $sudo apt-get install glibc-doc 安装以后,发现还是有很多函 ...

  10. JUC源码分析-集合篇(一)ConcurrentHashMap

    JUC源码分析-集合篇(一)ConcurrentHashMap 1. 概述 <HashMap 源码详细分析(JDK1.8)>:https://segmentfault.com/a/1190 ...