先自我介绍一下,小编浙江大学毕业,去过华为、字节跳动等大厂,目前阿里P7
深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年最新大数据全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上大数据知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
如果你需要这些资料,可以添加V获取:vip204888 (备注大数据)
正文
org.springframework.web.context.ContextLoaderListener
需要理解的是classpath指的是编译java代码的输出路径
2.springmvc配置文件编写
mvc:annotation-driven/
<content:component-scan base-package=“Test,Utils,Dao,Service,Action”></content:component-scan>
<mvc:resources mapping=“/Plug-in/” location=“Plug-in”></mvc:resources>
<mvc:resources mapping=“/Image/” location=“Image”></mvc:resources>
mvc:interceptors
mvc:interceptor
<mvc:mapping path=“/**”/>
<mvc:exclude-mapping path=“/index.do”/>
</mvc:interceptor>
</mvc:interceptors>
classpath:/config/mongoconfig.properties
3.代码
1.dao
//dao接口
package Dao;
import java.util.List;
import java.util.Map;
public interface BaseDao {
public List executeQuery(Map<String,Object> condition, String dbname, String collname,int number,int isDataLimit);
public void executeAdd(Map<String,Object> condition,String dbname,String collname);
public void executeUpdate(Map<String,Object> condition,String dbname,String collname);
public void executeRemove(Map<String,Object> condition,String dbname,String collname);
}
//dao实现
package Dao;
import Beans.Location;
import Utils.DumpClassUtil;
import Utils.MongoUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mongodb.client.FindIterable;
import com.mongodb.client.MongoCollection;
import org.bson.Document;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Component(“cityMapDao”)
public class CityMaoDao implements BaseDao {
@Resource(name = “mongoUtil”)
private MongoUtil mongoUtil;
public List executeQuery(Map<String,Object> condition, String dbname, String collname,int number,int isDataLimit) {
List result = new ArrayList();
MongoCollection collection = mongoUtil.getClient().getDatabase(dbname).getCollection(collname);
FindIterable documents = null;
if(isDataLimit == 1) {
if(condition != null)
documents = collection.find(new Document(condition)).limit(number);
else
documents = collection.find().limit(number);
}else{
if(condition != null)
documents = collection.find(new Document(condition));
else
documents = collection.find();
}
for(Document document:documents){
Location loc = DumpClassUtil.dumpLocation(document);
if(loc != null) {
result.add(loc);
}
}
return result;
}
public void executeAdd(Map<String,Object> condition,String dbname,String collname) {
}
public void executeUpdate(Map<String,Object> condition,String dbname,String collname) {
}
public void executeRemove(Map<String,Object> condition,String dbname,String collname) {
}
}
2.service
//service接口
package Service;
import Dao.BaseDao;
import java.util.Map;
public interface BaseService {
public Object service(Map<String,Object> map, String dbName,String colName,int Number,int isDataLimit);
}
//service实现
package Service;
import Dao.BaseDao;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import javax.annotation.Resource;
import java.util.Map;
@Component(“cityService”)
public class CityService implements BaseService {
@Resource(name = “cityMapDao”)
private BaseDao dao;
public Object service(Map<String,Object> map, String dbName,String colName,int number,int isDataLimit) {
return dao.executeQuery(map,dbName,colName,number,isDataLimit);
}
}
3.bean类
package Beans;
import java.util.Date;
public class Location {
private String detailUrl;
private String address;
private Float size;
private String orient;
private String roomNum;
public void setDetailUrl(String detailUrl) {
this.detailUrl = detailUrl;
}
public void setAddress(String address) {
this.address = address;
}
public void setSize(Float size) {
this.size = size;
}
public void setOrient(String orient) {
this.orient = orient;
}
public void setRoomNum(String rooomNum) {
this.roomNum = rooomNum;
}
public void setUnitPrice(Float unitPrice) {
this.unitPrice = unitPrice;
}
public void setSumPrice(Float sumPrice) {
this.sumPrice = sumPrice;
}
public void setLn(Double ln) {
this.ln = ln;
}
public void setLat(Double lat) {
this.lat = lat;
}
public void setTime(Date time) {
this.time = time;
}
public void setCity(String city) {
this.city = city;
}
public String getDetailUrl() {
return detailUrl;
}
public String getAddress() {
return address;
}
public Float getSize() {
return size;
}
public String getOrient() {
return orient;
}
public String getRoomNum() {
return roomNum;
}
public Float getUnitPrice() {
return unitPrice;
}
public Float getSumPrice() {
return sumPrice;
}
public Double getLn() {
return ln;
}
public Double getLat() {
return lat;
}
public Date getTime() {
return time;
}
public String getCity() {
return city;
}
public String print(){
return “address:”+this.getAddress()+
“Size:”+this.getSize()+
“orient:”+this.getOrient()+
“detailUrl:”+this.getDetailUrl()+
“unitPrice:”+this.getUnitPrice()+
“sumPrice:”+this.getSumPrice()+
“RooomNum:”+this.getRoomNum()+
“Ln:”+this.getLn()+
“Lat:”+this.getLat()+
“Time:”+this.getTime();
}
private Float unitPrice;
private Float sumPrice;
private Double ln;
private Double lat;
private Date time;
private String city;
}
4.用于封装bean的util类
package Utils;
import org.bson.Document;
import Beans.Location;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class DumpClassUtil {
public static Location dumpLocation(Document doc){
Location location = new Location();
if(doc.containsKey(“address”)){
location.setAddress(doc.getString(“address”));
}
if(doc.containsKey(“city”)){
location.setCity(doc.getString(“city”));
}
if(doc.containsKey(“roomNum”)){
location.setRoomNum(doc.getString(“roomNum”));
}
if(doc.containsKey(“orient”)){
location.setOrient(doc.getString(“orient”));
}
if(doc.containsKey(“size”)){
try {
Float size = Float.parseFloat(doc.getString(“size”));
location.setSize(size);
}catch (Exception e){
return null;
}
}
if(doc.containsKey(“unitPrice”)){
try {
Float unitPrice = Float.parseFloat(doc.getString(“unitPrice”));
location.setUnitPrice(unitPrice);
}catch(Exception e){
return null;
}
}
if(doc.containsKey(“sumPrice”)){
try {
Float sumPrice = Float.parseFloat(doc.getString(“sumPrice”));
location.setSumPrice(sumPrice);
}catch(Exception e){
return null;
}
}
if(doc.containsKey(“ln”)){
Double ln = doc.getDouble(“ln”);
location.setLn(ln);
}
if(doc.containsKey(“lat”)){
Double lat = doc.getDouble(“lat”);
location.setLat(lat);
}
if(doc.containsKey(“time”)){
Double dateDouble = doc.getDouble(“time”);
SimpleDateFormat format = new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss”);
try{
String dateString=format.format(dateDouble);
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
需要这份系统化的资料的朋友,可以添加V获取:vip204888 (备注大数据)
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
);
}catch(Exception e){
return null;
}
}
if(doc.containsKey(“ln”)){
Double ln = doc.getDouble(“ln”);
location.setLn(ln);
}
if(doc.containsKey(“lat”)){
Double lat = doc.getDouble(“lat”);
location.setLat(lat);
}
if(doc.containsKey(“time”)){
Double dateDouble = doc.getDouble(“time”);
SimpleDateFormat format = new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss”);
try{
String dateString=format.format(dateDouble);
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
需要这份系统化的资料的朋友,可以添加V获取:vip204888 (备注大数据)
[外链图片转存中…(img-d8DvSrhJ-1713387878135)]
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!