From 052e1d5c47c4e536fde79074d53b0481c7d4f9b6 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 13 十月 2021 18:33:42 +0800 Subject: [PATCH] 自动化代码生成优化 --- src/test/java/com/generater/TestEntity.java | 26 ++++++++++++++++++++------ 1 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/test/java/com/generater/TestEntity.java b/src/test/java/com/generater/TestEntity.java index 0d6211b..eda83a7 100644 --- a/src/test/java/com/generater/TestEntity.java +++ b/src/test/java/com/generater/TestEntity.java @@ -1,6 +1,7 @@ package com.generater; import org.springframework.data.annotation.Id; +import org.springframework.data.mongodb.core.mapping.Document; import org.yeshi.utils.generater.annotation.admin.AdminController; import org.yeshi.utils.generater.annotation.admin.DaoQueryCondition; import org.yeshi.utils.generater.annotation.admin.Show; @@ -10,40 +11,46 @@ import org.yeshi.utils.generater.annotation.admin.form.Text; import org.yeshi.utils.generater.entity.admin.FormVerifyType; +import java.util.Date; + /** * @author Administrator * @title: TestEntity * @description: 娴嬭瘯entity * @date 2021/9/23 14:22 */ -@AdminController(mapping = "admin/api/test", title = "娴嬭瘯", searchForm = TestEntity.SearchForm.class) +@Document(collection = "test") +@AdminController(mapping = "admin/api/test", title = "娴嬭瘯", searchForm = TestEntity.SearchForm.class,jsonp = true) public class TestEntity { @Id private String id; @DaoQueryCondition(queryType = DaoQueryCondition.QueryType.contains) @Show(order = 0, title = "鏄电О") - @Text(title = "鏄电О", maxLength = 50, require = true, placeHolder = "璇疯緭鍏ユ樀绉�", desc = "鏄电О涓嶈兘鍖呭惈鐗规畩瀛楃", verifyType = FormVerifyType.regex, verifyValue = "^.{0-100}$", verifyNotifyMsg = "璇疯緭鍏ユ纭殑鏄电О") + @Text(title = "鏄电О", maxLength = 50, require = true, placeHolder = "璇疯緭鍏ユ樀绉�", desc = "鏄电О涓嶈兘鍖呭惈鐗规畩瀛楃", verifyType = FormVerifyType.none, verifyValue = "^.{0-100}$", verifyNotifyMsg = "璇疯緭鍏ユ纭殑鏄电О") private String nickName; @DaoQueryCondition @Show(order = 1, title = "绫诲瀷") - @Select(values = {"1,鐢�", "2,濂�"}, title = "绫诲瀷") + @Select(values = {"1:鐢�", "2:濂�"}, title = "绫诲瀷") private int type; @DaoQueryCondition @Show(order = 2, title = "鎬у埆") - @RadioGroup(values = {"1,鐢�", "2,濂�"}, title = "鎬у埆") + @RadioGroup(values = {"1:鐢�", "2:濂�"}, title = "鎬у埆") private int sex; @Show(order = 3, title = "澶村儚", showType = Show.ShowType.IMG, imgWidth = 50, imgHeight = 50) - @Img(width = 50, height = 50, title = "澶村儚") + @Img(height = 50, title = "澶村儚", uploadApi = "/admin/uploadimg", uploadApiParams = {"id:123123","type:2"}) private String portrait; @DaoQueryCondition @Show(order = 4, title = "鐪�") - @Select(apiPath = "/admin/api/getProvince", title = "鐪�") + @Select(values = {"cq:閲嶅簡","js:姹熻嫃"}, title = "鐪�", apiParams = {"page:1", "pageSize:10", "id:\"test\""}) private String province; + + @DaoQueryCondition + private Date createTime; public String getId() { @@ -94,6 +101,13 @@ this.province = province; } + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } public class SearchForm { -- Gitblit v1.8.0