You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.9 KiB

3 years ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace Apewer.Web
  5. {
  6. #region 路由
  7. /// <summary></summary>
  8. [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
  9. public sealed class RoutePrefixAttribute : Attribute
  10. {
  11. string _path;
  12. /// <summary></summary>
  13. public string Path { get { return _path; } }
  14. /// <summary></summary>
  15. /// <param name="path"></param>
  16. public RoutePrefixAttribute(string path) { _path = path; }
  17. }
  18. /// <summary></summary>
  19. [AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
  20. public sealed class RouteAttribute : Attribute
  21. {
  22. string _path;
  23. /// <summary></summary>
  24. public string Path { get { return _path; } }
  25. /// <summary></summary>
  26. public RouteAttribute(string path) { _path = path; }
  27. }
  28. #endregion
  29. #region 方法
  30. /// <summary></summary>
  31. [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
  32. public sealed class HttpConnectAttribute : Attribute { }
  33. /// <summary></summary>
  34. [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
  35. public sealed class HttpDeleteAttribute : Attribute { }
  36. /// <summary></summary>
  37. [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
  38. public sealed class HttpGetAttribute : Attribute { }
  39. /// <summary></summary>
  40. [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
  41. public sealed class HttpHeadAttribute : Attribute { }
  42. /// <summary></summary>
  43. [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
  44. public sealed class HttpOptionsAttribute : Attribute { }
  45. /// <summary></summary>
  46. [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
  47. public sealed class HttpPatchAttribute : Attribute { }
  48. /// <summary></summary>
  49. [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
  50. public sealed class HttpPostAttribute : Attribute { }
  51. /// <summary></summary>
  52. [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
  53. public sealed class HttpPutAttribute : Attribute { }
  54. /// <summary></summary>
  55. [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
  56. public sealed class HttpTraceAttribute : Attribute { }
  57. #endregion
  58. #region 参数
  59. /// <summary></summary>
  60. [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
  61. public sealed class FromBodyAttribute : Attribute { }
  62. /// <summary></summary>
  63. [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
  64. public sealed class FromUriAttribute : Attribute { }
  65. #endregion
  66. }