Menu.java 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /*
  2. * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. *
  7. * Redistributions of source code must retain the above copyright notice,
  8. * this list of conditions and the following disclaimer.
  9. * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * Neither the name of the dreamlu.net developer nor the names of its
  13. * contributors may be used to endorse or promote products derived from
  14. * this software without specific prior written permission.
  15. * Author: Chill 庄骞 (smallchill@163.com)
  16. */
  17. package org.springblade.modules.system.entity;
  18. import com.baomidou.mybatisplus.annotation.IdType;
  19. import com.baomidou.mybatisplus.annotation.TableId;
  20. import com.baomidou.mybatisplus.annotation.TableLogic;
  21. import com.baomidou.mybatisplus.annotation.TableName;
  22. import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  23. import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
  24. import io.swagger.annotations.ApiModel;
  25. import io.swagger.annotations.ApiModelProperty;
  26. import lombok.Data;
  27. import org.springblade.core.tool.utils.Func;
  28. import java.io.Serializable;
  29. import java.util.Objects;
  30. /**
  31. * 实体类
  32. *
  33. * @author Chill
  34. */
  35. @Data
  36. @TableName("blade_menu")
  37. @ApiModel(value = "Menu对象", description = "Menu对象")
  38. public class Menu implements Serializable {
  39. private static final long serialVersionUID = 1L;
  40. /**
  41. * 主键
  42. */
  43. @JsonSerialize(using = ToStringSerializer.class)
  44. @ApiModelProperty(value = "主键")
  45. @TableId(value = "id", type = IdType.ASSIGN_ID)
  46. private Long id;
  47. /**
  48. * 菜单父主键
  49. */
  50. @JsonSerialize(using = ToStringSerializer.class)
  51. @ApiModelProperty(value = "菜单父主键")
  52. private Long parentId;
  53. /**
  54. * 菜单编号
  55. */
  56. @ApiModelProperty(value = "菜单编号")
  57. private String code;
  58. /**
  59. * 菜单名称
  60. */
  61. @ApiModelProperty(value = "菜单名称")
  62. private String name;
  63. /**
  64. * 菜单别名
  65. */
  66. @ApiModelProperty(value = "菜单别名")
  67. private String alias;
  68. /**
  69. * 组件路径(基于vben前端版本增加)
  70. */
  71. @ApiModelProperty(value = "组件路径")
  72. private String component;
  73. /**
  74. * 请求地址
  75. */
  76. @ApiModelProperty(value = "请求地址")
  77. private String path;
  78. /**
  79. * 菜单资源
  80. */
  81. @ApiModelProperty(value = "菜单资源")
  82. private String source;
  83. /**
  84. * 排序
  85. */
  86. @ApiModelProperty(value = "排序")
  87. private Integer sort;
  88. /**
  89. * 菜单类型
  90. */
  91. @ApiModelProperty(value = "菜单类型")
  92. private Integer category;
  93. /**
  94. * 操作按钮类型
  95. */
  96. @ApiModelProperty(value = "操作按钮类型")
  97. private Integer action;
  98. /**
  99. * 是否打开新页面
  100. */
  101. @ApiModelProperty(value = "是否打开新页面")
  102. private Integer isOpen;
  103. /**
  104. * 备注
  105. */
  106. @ApiModelProperty(value = "备注")
  107. private String remark;
  108. /**
  109. * 是否已删除
  110. */
  111. @TableLogic
  112. @ApiModelProperty(value = "是否已删除")
  113. private Integer isDeleted;
  114. @Override
  115. public boolean equals(Object obj) {
  116. if (this == obj) {
  117. return true;
  118. }
  119. if (obj == null) {
  120. return false;
  121. }
  122. Menu other = (Menu) obj;
  123. if (Func.equals(this.getId(), other.getId())) {
  124. return true;
  125. }
  126. return false;
  127. }
  128. @Override
  129. public int hashCode() {
  130. return Objects.hash(id, parentId, code);
  131. }
  132. }