以前可以 现在这么不行了呢
package io.nutz.nutzsite.common.base;
import io.nutz.nutzsite.module.sys.models.User;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.nutz.dao.entity.annotation.*;
import org.nutz.lang.random.R;
import java.io.Serializable;
import java.util.Date;
/**
* @author Hamming_Yu on 2018/12/29.
*/
public abstract class BaseModel implements Serializable {
private static final long serialVersionUID = 1L;
@Column("create_by")
@Comment("创建者")
@Prev(els = @EL("$me.uid()"))
@ColDefine(type = ColType.VARCHAR, width = 32)
protected String createBy;
@Column("create_time")
@Prev(els = {@EL("$me.now()")})
protected Date createTime;
@Column("update_by")
@Comment("更新者")
@Prev(els = @EL("$me.uid()"))
@ColDefine(type = ColType.VARCHAR, width = 32)
protected String updateBy;
@Prev(els=@EL("$me.now()"))
@Column("update_time")
protected Date updateTime;
public String uuid() {
return R.UU32().toLowerCase();
}
public String uid() {
try {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
return user == null ? "" : user.getId();
} catch (Exception e) {
return "";
}
}
public Date now() {
return new Date();
}
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 String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
}
[DEBUG] 17:29:52.617 net.sf.ehcache.store.disk.Segment.faultInternal(Segment.java:777) - fault added 0 on disk
[DEBUG] 17:29:52.618 org.nutz.plugins.cache.impl.lcache.LCache.fire(LCache.java:96) - fire channel=LCache:io.nutz.nutzsite.common.shiro.SimpleAuthorizingRealm.authorizationCache msg=u238it33c6j1opj986noqtk8ab:io.nutz.nutzsite.module.sys.models.User@57707421
[DEBUG] 17:29:52.621 org.nutz.plugins.cache.impl.lcache.CachePubSub.onPMessage(CachePubSub.java:15) - channel=LCache:io.nutz.nutzsite.common.shiro.SimpleAuthorizingRealm.authorizationCache, msg=u238it33c6j1opj986noqtk8ab:io.nutz.nutzsite.module.sys.models.User@57707421
[DEBUG] 17:29:52.625 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - // NOT SQL // ElFieldMacro=uuid()
[DEBUG] 17:29:52.626 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - INSERT INTO pro_product(id,title,url,price,weight,reference_url1,reference_url2,reference_url3,reference_url4,create_by,create_time,update_by,update_time) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?)
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
|----------------------------------|------|--|------|------|--|--|--|--|------|------|------|------|
| ed3aca6538754cd89979cac22fa12bf2 | test | | NULL | NULL | | | | | NULL | NULL | NULL | NULL |
For example:> "INSERT INTO pro_product(id,title,url,price,weight,reference_url1,reference_url2,reference_url3,reference_url4,create_by,create_time,update_by,update_time) VALUES('ed3aca6538754cd89979cac22fa12bf2','test','',NULL,NULL,'','','','',NULL,NULL,NULL,NULL) "
[DEBUG] 17:29:52.647 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - // NOT SQL // ElFieldMacro=uuid()
[DEBUG] 17:29:52.648 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - INSERT INTO sys_log(uu32,t,tg,url,src,msg,u_id,u_name,param,os,browser,ip,location,ct) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?)
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
|----------------------------------|-----------|----|------------------------|--------------------------------------------------------------------|--------------------------------------------|----------------------------|-------|----------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|-----------------|------|---------------------|
| bd04c109a76648e3b444a0f7b9f03028 | aop.after | 商品 | /product/product/addDo | io.nutz.nutzsite.module.product.controller.ProductController#addDo | 新增保存商品 id=ed3aca6538754cd89979cac22fa12bf2 | 5a4eirrf16i83rta1og2l7qjl4 | admin | {"referenceUrl1":[""],"referenceUrl2":[""],"referenceUrl3":[""],"price":[""],"weight":[""],"title":["test"],"referenceUrl4":[""],"url":[""]} | Mac OS X | Chrome 8 | 0:0:0:0:0:0:0:1 | 内网IP | 2020-11-22 17:29:52 |
For example:> "INSERT INTO sys_log(uu32,t,tg,url,src,msg,u_id,u_name,param,os,browser,ip,location,ct) VALUES('bd04c109a76648e3b444a0f7b9f03028','aop.after','商品','/product/product/addDo','io.nutz.nutzsite.module.product.controller.ProductController#addDo','新增保存商品 id=ed3aca6538754cd89979cac22fa12bf2','5a4eirrf16i83rta1og2l7qjl4','admin','{"referenceUrl1":[""],"referenceUrl2":[""],"referenceUrl3":[""],"price":[""],"weight":[""],"title":["test"],"referenceUrl4":[""],"url":[""]}','Mac OS X','Chrome 8','0:0:0:0:0:0:0:1','内网IP','2020-11-22 17:29:52') "
[DEBUG] 17:29:52.689 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:103) - Found mapping for [POST] path=/product/product/list : ProductController.list(ProductController.java:59)
[DEBUG] 17:29:52.692 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) - Get 'productController'<class io.nutz.nutzsite.module.product.controller.ProductController>
[DEBUG] 17:29:52.695 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - SELECT * FROM sys_user WHERE id=?
class 的能执行 继承后的 base 不执行 这个是为什么呢 求指点
@Table("pro_product")
public class Product extends BaseModel implements Serializable {
private static final long serialVersionUID = 1L;
@Name
@Column("id")
@Comment("id")
@ColDefine(type = ColType.VARCHAR, width = 64)
@Prev(els = {@EL("uuid()")})
private String id;