AnonymousGetMapping.java 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * Copyright 2002-2016 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. package me.zhengjie.annotation.rest;
  17. import java.lang.annotation.Documented;
  18. import java.lang.annotation.ElementType;
  19. import java.lang.annotation.Retention;
  20. import java.lang.annotation.RetentionPolicy;
  21. import java.lang.annotation.Target;
  22. import me.zhengjie.annotation.AnonymousAccess;
  23. import org.springframework.core.annotation.AliasFor;
  24. import org.springframework.web.bind.annotation.RequestMapping;
  25. import org.springframework.web.bind.annotation.RequestMethod;
  26. /**
  27. * Annotation for mapping HTTP {@code GET} requests onto specific handler
  28. * methods.
  29. * <p>
  30. * 支持匿名访问 GetMapping
  31. *
  32. * @author liaojinlong
  33. * @see RequestMapping
  34. */
  35. @AnonymousAccess
  36. @Target(ElementType.METHOD)
  37. @Retention(RetentionPolicy.RUNTIME)
  38. @Documented
  39. @RequestMapping(method = RequestMethod.GET)
  40. public @interface AnonymousGetMapping {
  41. /**
  42. * Alias for {@link RequestMapping#name}.
  43. */
  44. @AliasFor(annotation = RequestMapping.class)
  45. String name() default "";
  46. /**
  47. * Alias for {@link RequestMapping#value}.
  48. */
  49. @AliasFor(annotation = RequestMapping.class)
  50. String[] value() default {};
  51. /**
  52. * Alias for {@link RequestMapping#path}.
  53. */
  54. @AliasFor(annotation = RequestMapping.class)
  55. String[] path() default {};
  56. /**
  57. * Alias for {@link RequestMapping#params}.
  58. */
  59. @AliasFor(annotation = RequestMapping.class)
  60. String[] params() default {};
  61. /**
  62. * Alias for {@link RequestMapping#headers}.
  63. */
  64. @AliasFor(annotation = RequestMapping.class)
  65. String[] headers() default {};
  66. /**
  67. * Alias for {@link RequestMapping#consumes}.
  68. *
  69. * @since 4.3.5
  70. */
  71. @AliasFor(annotation = RequestMapping.class)
  72. String[] consumes() default {};
  73. /**
  74. * Alias for {@link RequestMapping#produces}.
  75. */
  76. @AliasFor(annotation = RequestMapping.class)
  77. String[] produces() default {};
  78. }