AnonymousPatchMapping.java 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 PATCH} requests onto specific handler
  28. * methods.
  29. * * 支持匿名访问 PatchMapping
  30. *
  31. * @author liaojinlong
  32. * @see AnonymousGetMapping
  33. * @see AnonymousPostMapping
  34. * @see AnonymousPutMapping
  35. * @see AnonymousDeleteMapping
  36. * @see RequestMapping
  37. */
  38. @AnonymousAccess
  39. @Target(ElementType.METHOD)
  40. @Retention(RetentionPolicy.RUNTIME)
  41. @Documented
  42. @RequestMapping(method = RequestMethod.PATCH)
  43. public @interface AnonymousPatchMapping {
  44. /**
  45. * Alias for {@link RequestMapping#name}.
  46. */
  47. @AliasFor(annotation = RequestMapping.class)
  48. String name() default "";
  49. /**
  50. * Alias for {@link RequestMapping#value}.
  51. */
  52. @AliasFor(annotation = RequestMapping.class)
  53. String[] value() default {};
  54. /**
  55. * Alias for {@link RequestMapping#path}.
  56. */
  57. @AliasFor(annotation = RequestMapping.class)
  58. String[] path() default {};
  59. /**
  60. * Alias for {@link RequestMapping#params}.
  61. */
  62. @AliasFor(annotation = RequestMapping.class)
  63. String[] params() default {};
  64. /**
  65. * Alias for {@link RequestMapping#headers}.
  66. */
  67. @AliasFor(annotation = RequestMapping.class)
  68. String[] headers() default {};
  69. /**
  70. * Alias for {@link RequestMapping#consumes}.
  71. */
  72. @AliasFor(annotation = RequestMapping.class)
  73. String[] consumes() default {};
  74. /**
  75. * Alias for {@link RequestMapping#produces}.
  76. */
  77. @AliasFor(annotation = RequestMapping.class)
  78. String[] produces() default {};
  79. }