{"id":251296,"date":"2022-09-04T10:59:16","date_gmt":"2022-09-04T02:59:16","guid":{"rendered":"https:\/\/gulass.cn\/?p=251296"},"modified":"2022-08-29T08:59:46","modified_gmt":"2022-08-29T00:59:46","slug":"lombok-tolerate-linux","status":"publish","type":"post","link":"https:\/\/gulass.cn\/lombok-tolerate-linux.html","title":{"rendered":"\u7b80\u5355\u4ecb\u7ecdLombok\u4f7f\u7528@Tolerate\u5b9e\u73b0\u51b2\u7a81\u517c\u5bb9\u95ee\u9898"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u4ecb\u7ecd\u4e86Lombok\u4f7f\u7528@Tolerate\u5b9e\u73b0\u51b2\u7a81\u517c\u5bb9\u95ee\u9898\uff0c\u5177\u6709\u5f88\u597d\u7684\u53c2\u8003\u4ef7\u503c\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u6709\u6240\u5e2e\u52a9\u3002\u5982\u6709\u9519\u8bef\u6216\u672a\u8003\u8651\u5b8c\u5168\u7684\u5730\u65b9\uff0c\u671b\u4e0d\u541d\u8d50\u6559<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\u4f7f\u7528@Tolerate\u5b9e\u73b0\u51b2\u7a81\u517c\u5bb9<\/strong><\/div>\n

\u4f7f\u7528Lombok\u80fd\u591f\u51cf\u5c11\u7a0b\u5e8f\u5458\u7684\u91cd\u590d\u5de5\u4f5c\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387\uff0c\u800cLombok\u7684\u6ce8\u89e3\u57fa\u672c\u662f\u57fa\u4e8e\u6807\u51c6\u7684\uff08\u5982\uff0c\u6807\u51c6\u7684Builder\u6a21\u5f0f\uff09\uff0c\u800c\u5b9e\u9645\u5f00\u53d1\u7684\u65f6\u5019\u6709\u65f6\u5019\u4e3a\u4e86\u5b9e\u73b0\u67d0\u4e9b\u80fd\u529b\u4f1a\u5bf9\u6807\u51c6\u5b9e\u73b0\u505a\u4e00\u4e9b\u53d8\u5f62\uff0c\u800c\u8fd9\u4e2a\u65f6\u5019Lombok\u7684\u6807\u51c6\u5b9e\u73b0\u5c31\u4f1a\u65e0\u6cd5\u6ee1\u8db3\u9700\u6c42\u3002<\/p>\n

\u4f8b\u5982\uff0c\u8fd9\u6837\u4e00\u4e2a\u573a\u666f<\/strong><\/span><\/div>\n

\u4f7f\u7528@Builder\u5bf9\u4e00\u4e2aDTO\u5b9e\u73b0\u4e00\u4e2a\u6784\u9020\u5668\uff0c\u4f46\u662f\u5728\u505aJson\u53cd\u5e8f\u5217\u5316\u7684\u65f6\u5019\u53d1\u751f\u9519\u8bef\uff0c<\/p>\n

\u539f\u56e0\u5c31\u662f\u7f3a\u5c11\u65e0\u53c2\u516c\u5171\u7684\u6784\u9020\u51fd\u6570\uff0c<\/p>\n

\u800c\u624b\u52a8\u5199\u4e00\u4e2a\u65e0\u53c2\u6784\u9020\u51fd\u6570\u7684\u65f6\u5019\u7f16\u8bd1\u9519\u8bef\uff0c\u5c31\u662f\u548c@Builder\u51b2\u7a81\uff0c\u867d\u7136\u6807\u51c6\u7684@Builder\u6ca1\u6cd5\u662f\u9700\u8981\u79c1\u6709\u5316\u6784\u9020\u51fd\u6570\u7684\uff0c\u4f46\u662f\u5728\u67d0\u4e9b\u573a\u666f\u4e0b\u6211\u4eec\u9700\u8981\u5bf9\u8fd9\u79cd\u6807\u51c6\u53d8\u5f62\uff0c\u8fd9\u4e2a\u65f6\u5019Lombok\u63d0\u4f9b\u4e86@Tolerate\u5b9e\u73b0\u5bf9\u51b2\u7a81\u7684\u517c\u5bb9\u3002<\/p>\n

\/**\r\n * < p>\r\n * \u5305\u62ec\u80fd\u529b\u3001\u77e5\u8bc6\u70b9\u7b49\r\n * < \/p>\r\n *\r\n * @author hlong\r\n * @since 2020-09-10\r\n *\/\r\n@Data\r\n@Entity\r\n@Table(name = \"que_attr\")\r\n@Builder\r\n@ApiModel(value=\"QueAttr\u5bf9\u8c61\", description=\"\u5305\u62ec\u80fd\u529b\u3001\u77e5\u8bc6\u70b9\u7b49\")\r\npublic class QueAttr implements Serializable {\r\n  \r\n    @Tolerate\r\n    QueAttr() {}\r\n  \r\n    private static final long serialVersionUID = 1L;\r\n  \r\n    @ApiModelProperty(value = \"\u5c5e\u6027\u7f16\u53f7\uff0c\u7cfb\u7edf\u81ea\u52a8\u4ea7\u751f\")\r\n    @Id\r\n    @Column(name = \"attr_id\")\r\n    private Long attrId;\r\n  \r\n    @ApiModelProperty(value = \"\u5c5e\u6027\u7f16\u7801\")\r\n    @Column(name = \"attr_code\")\r\n    private String attrCode;\r\n  \r\n    @ApiModelProperty(value = \"\u5c5e\u6027\u540d\u79f0\")\r\n    @Column(name = \"name\")\r\n    private String name;\r\n  \r\n    @ApiModelProperty(value = \"\u5c5e\u6027\u540d\u79f0\u4e2d\u6587\")\r\n    @Column(name = \"name_cn\")\r\n    private String nameCn;\r\n  \r\n    @ApiModelProperty(value = \"\u7b80\u79f0\")\r\n    @Column(name = \"name_short\")\r\n    private String nameShort;\r\n  \r\n    @ApiModelProperty(value = \"\u4e0a\u7ea7\u8282\u70b9\")\r\n    @Column(name = \"attr_up\")\r\n    private Long attrUp;\r\n  \r\n    @ApiModelProperty(value = \"\u7ea7\u522b\uff1a\u7b2c1\u7ea7\u4e3a0\")\r\n    @Column(name = \"lev\")\r\n    private Integer lev;\r\n  \r\n    @ApiModelProperty(value = \"\u4ece\u5c0f\u5230\u5927\uff0c\u4ece1\u5f00\u59cb\")\r\n    @Column(name = \"sort_no\")\r\n    private Integer sortNo;\r\n  \r\n    @ApiModelProperty(value = \"(\u679a\u4e3e)\u5c5e\u6027\u5206\u7c7b\u4fe1\u606f \u89c1\u5b57\u5178\u8868\uff0c\u8fd9\u91cc\u4e3b\u8981\u662f\u80fd\u529b\u548c\u77e5\u8bc6\u70b9\")\r\n    @Column(name = \"attr_type\")\r\n    private Long attrType;\r\n  \r\n    @ApiModelProperty(value = \"\u673a\u6784\u7f16\u53f7\uff1a0\u516c\u53f8\")\r\n    @Column(name = \"org_id\")\r\n    private Long orgId;\r\n  \r\n    @Column(name = \"subject\")\r\n    private Long subject;\r\n  \r\n    @Column(name = \"key_stage\")\r\n    private Long keyStage;\r\n  \r\n    @Column(name = \"grade\")\r\n    private Long grade;\r\n  \r\n    @Column(name = \"term\")\r\n    private Integer term;\r\n  \r\n    @ApiModelProperty(value = \"\u6dfb\u52a0\u4eba\")\r\n    @Column(name = \"user_create\")\r\n    private Long userCreate;\r\n  \r\n    @ApiModelProperty(value = \"-1\u5220\u9664 0\u8349\u7a3f 1\u6709\u6548\")\r\n    @Column(name = \"status\")\r\n    private Integer status;\r\n  \r\n    @Column(name = \"sys_code\")\r\n    private Long sysCode;\r\n  \r\n    @ApiModelProperty(value = \"\u66f4\u65b0\u65f6\u95f4\")\r\n    @Column(name = \"time_update\")\r\n    private Timestamp timeUpdate;\r\n  \r\n    @ApiModelProperty(value = \"\u5907\u6ce8\")\r\n    @Column(name = \"remark\")\r\n    private String remark;\r\n  \r\n    @ApiModelProperty(value = \"\u5c5e\u6027\u7684uuid\")\r\n    @Column(name = \"attr_uuid\")\r\n    private String attrUuid;\r\n  \r\n    @ApiModelProperty(value = \"\u5c5e\u6027\u7684\u7236\u7ea7uuid\")\r\n    @Column(name = \"attr_up_uuid\")\r\n    private String attrUpUuid;\r\n  \r\n    @ApiModelProperty(value = \"\u6559\u6750\u7248\u672cuuid\")\r\n    @Column(name = \"book_code\")\r\n    private String bookCode;\r\n  \r\n    @ApiModelProperty(value = \"\u6559\u6750\u7248\u672c\u540d\u79f0\")\r\n    @Column(name = \"book_name\")\r\n    private String bookName;\r\n  \r\n    @ApiModelProperty(value = \"\u5e74\u7ea7\u7684code-\u5b66\u9662code\")\r\n    @Column(name = \"grade_uuid\")\r\n    private String gradeUuid; \r\n}<\/pre>\n

\"\"<\/p>\n

Lombok\u5b9e\u9a8c\u6027\u6ce8\u89e3\u4e4b@Tolerate<\/strong><\/div>\n
\u6ce8\u89e3\u4ecb\u7ecd<\/strong><\/span><\/div>\n

\u5b9e\u73b0\u5bf9\u51b2\u7a81\u7684\u517c\u5bb9\uff0c\u5b98\u65b9\u89e3\u91ca\uff1a\u4f7f\u4efb\u4f55\u65b9\u6cd5\u6216\u8005\u6784\u9020\u51fd\u6570\u8ba9 lombok \u5047\u88c5\u5b83\u4e0d\u5b58\u5728\uff0c\u4f5c\u7528\u4e8e\u65b9\u6cd5\u4e0a\uff0c\u6ca1\u4ec0\u4e48\u5927\u7528\uff0c\u53ef\u4ee5\u914d\u5408 @Builder \u4f7f\u7528<\/p>\n

\u4f7f\u7528\u573a\u666f<\/strong><\/span><\/div>\n

\u4f7f\u7528 Lombok \u80fd\u591f\u51cf\u5c11\u7a0b\u5e8f\u5458\u7684\u91cd\u590d\u5de5\u4f5c\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387\uff0c\u800c lombok \u7684\u6ce8\u89e3\u57fa\u672c\u662f\u57fa\u4e8e\u6807\u51c6\u7684\uff08\u5982\uff0c\u6807\u51c6\u7684 Builder \u6a21\u5f0f\uff09\uff0c\u800c\u5b9e\u9645\u5f00\u53d1\u7684\u65f6\u5019\u6709\u65f6\u5019\u4e3a\u4e86\u5b9e\u73b0\u67d0\u4e9b\u80fd\u529b\u4f1a\u5bf9\u6807\u51c6\u5b9e\u73b0\u505a\u4e00\u4e9b\u53d8\u5f62\uff0c\u800c\u8fd9\u4e2a\u65f6\u5019 lombok \u7684\u6807\u51c6\u5b9e\u73b0\u5c31\u4f1a\u65e0\u6cd5\u6ee1\u8db3\u9700\u6c42<\/p>\n

\u4f7f\u7528 @Builder \u5bf9\u4e00\u4e2a DTO \u5b9e\u73b0\u4e00\u4e2a\u6784\u9020\u5668\uff0c\u4f46\u662f\u5728\u505a Json \u53cd\u5e8f\u5217\u5316\u7684\u65f6\u5019\u53d1\u751f\u9519\u8bef\uff0c\u539f\u56e0\u5c31\u662f\u7f3a\u5c11\u65e0\u53c2\u516c\u5171\u7684\u6784\u9020\u51fd\u6570\uff0c\u800c\u624b\u52a8\u5199\u4e00\u4e2a\u65e0\u53c2\u6784\u9020\u51fd\u6570\u7684\u65f6\u5019\u7f16\u8bd1\u9519\u8bef\uff0c\u5c31\u662f\u548c @Builder \u51b2\u7a81\uff0c\u867d\u7136\u6807\u51c6\u7684 @Builder \u6ca1\u6cd5\u662f\u9700\u8981\u79c1\u6709\u5316\u6784\u9020\u51fd\u6570\u7684\uff0c\u4f46\u662f\u5728\u67d0\u4e9b\u573a\u666f\u4e0b\u6211\u4eec\u9700\u8981\u5bf9\u8fd9\u79cd\u6807\u51c6\u53d8\u5f62\uff0c\u8fd9\u4e2a\u65f6\u5019 lombok \u63d0\u4f9b\u4e86 @Tolerate \u5b9e\u73b0\u5bf9\u51b2\u7a81\u7684\u517c\u5bb9<\/p>\n

\u5b9e\u6218\u6f14\u7ec3<\/strong><\/span><\/div>\n
@Builder\r\npublic class \u7a0b\u7199\u5a9b {\r\n    @Tolerate\r\n    public \u7a0b\u7199\u5a9b() {}\r\n}<\/pre>\n

\u4ee5\u4e0a\u4e3a\u4e2a\u4eba\u7ecf\u9a8c\uff0c\u5e0c\u671b\u80fd\u7ed9\u5927\u5bb6\u4e00\u4e2a\u53c2\u8003<\/p>\n","protected":false},"excerpt":{"rendered":"

\u4f7f\u7528Lombok\u80fd\u591f\u51cf\u5c11\u7a0b\u5e8f\u5458\u7684\u91cd\u590d\u5de5\u4f5c\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387\uff0c\u800cLombok\u7684\u6ce8\u89e3\u57fa\u672c\u662f\u57fa\u4e8e\u6807\u51c6\u7684\uff08\u5982\uff0c\u6807\u51c6\u7684Buil […]<\/p>\n","protected":false},"author":668,"featured_media":249446,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-251296","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/251296","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/668"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=251296"}],"version-history":[{"count":4,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/251296\/revisions"}],"predecessor-version":[{"id":251301,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/251296\/revisions\/251301"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/249446"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=251296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=251296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=251296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}