实体
@Comment("摄像头信息")
@Table("sg_camera")
public class SgCamera extends Model implements Serializable {
private static final long serialVersionUID=1L;
/** 设备ID*/
@Id
@ColDefine(type = ColType.INT)
private Integer id;
/** 设备IP*/
@Column
@Comment("设备IP地址")
@ColDefine(type = ColType.VARCHAR)
private String cameraip;
/** */
@Column
@Comment("设备状态")
@ColDefine(type = ColType.INT)
private Integer status;
@At({"/delete","/delete/?"})
@Ok("json")
@SLog(tag = "删除摄像头信息", msg = "ID:${args[2].getAttribute('id')}")
public Object delete(String id, @Param("ids") String[] ids ,HttpServletRequest req) {
log.debug("test="+id);
try {
if(ids!=null&&ids.length>0){
sgCameraService.delete(id);
req.setAttribute("id", org.apache.shiro.util.StringUtils.toString(ids));
}else{
sgCameraService.delete(id);
req.setAttribute("id", id);
}
return Result.success("system.success");
} catch (Exception e) {
return Result.error("system.error");
}
}
sgCameraService.delete(id);
这个地方删除就出错
rg.nutz.dao.DaoException: Need @Name for class cn.wizzer.modules.models.sys.SgCamera
这个就不能用@Id 删除吗?