From 47e3087067abd35e6337c011f96d2338c0bb1aae Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 25 七月 2024 13:39:31 +0800
Subject: [PATCH] 优化自动化代码

---
 src/test/java/com/generater/TestEntity.java |   48 ++++++++++++++++++++++++++++++++++++------------
 1 files changed, 36 insertions(+), 12 deletions(-)

diff --git a/src/test/java/com/generater/TestEntity.java b/src/test/java/com/generater/TestEntity.java
index 0d6211b..05fcef3 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,48 @@
 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 = "绫诲瀷")
-    private int type;
+    @Select(values = {"1:鐢�", "2:濂�"}, title = "绫诲瀷")
+    private Integer type;
 
     @DaoQueryCondition
     @Show(order = 2, title = "鎬у埆")
-    @RadioGroup(values = {"1,鐢�", "2,濂�"}, title = "鎬у埆")
-    private int sex;
+    @RadioGroup(values = {"1:鐢�", "2:濂�"}, title = "鎬у埆")
+    private Integer 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;
+
+    private Date updateTime;
 
 
     public String getId() {
@@ -62,19 +71,19 @@
         this.nickName = nickName;
     }
 
-    public int getType() {
+    public Integer getType() {
         return type;
     }
 
-    public void setType(int type) {
+    public void setType(Integer type) {
         this.type = type;
     }
 
-    public int getSex() {
+    public Integer getSex() {
         return sex;
     }
 
-    public void setSex(int sex) {
+    public void setSex(Integer sex) {
         this.sex = sex;
     }
 
@@ -94,6 +103,21 @@
         this.province = province;
     }
 
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
 
     public class SearchForm {
 

--
Gitblit v1.8.0