【維普】軟件工程-基于SpringBoot的寵物領(lǐng)養(yǎng)系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)_第1頁(yè)
【維普】軟件工程-基于SpringBoot的寵物領(lǐng)養(yǎng)系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)_第2頁(yè)
【維普】軟件工程-基于SpringBoot的寵物領(lǐng)養(yǎng)系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)_第3頁(yè)
【維普】軟件工程-基于SpringBoot的寵物領(lǐng)養(yǎng)系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)_第4頁(yè)
【維普】軟件工程-基于SpringBoot的寵物領(lǐng)養(yǎng)系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)_第5頁(yè)
已閱讀5頁(yè),還剩53頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

目錄參考文獻(xiàn)朱九超,孫泉云,夏爐明,等.流浪寵物的成因、危害及其防控對(duì)策[J].上海畜牧獸醫(yī)通訊,2015(3):3.趙衡.對(duì)流浪寵物該如何有效管理[N].檢察日?qǐng)?bào),2017-12-16(003).吳文洋,劉世宇.基于B/S架構(gòu)寵物領(lǐng)養(yǎng)管理系統(tǒng)設(shè)計(jì)[J].軟件,2020,41(11):85-87.趙亞洲,楊曉冬.動(dòng)物領(lǐng)養(yǎng)管理系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)[J].無(wú)線互聯(lián)科技,2022,19(18):61-65+72.姜蘇.基于互聯(lián)網(wǎng)平臺(tái)解決社會(huì)流浪動(dòng)物問(wèn)題的可行性研究[D].泰安:山東農(nóng)業(yè)大學(xué),2020.李俊山,葉霞,羅蓉,等.數(shù)據(jù)庫(kù)原理及應(yīng)用(SQLServer)[M].北京:清華大學(xué)出版社,2017.黑馬程序員.JavaEE企業(yè)級(jí)應(yīng)用開(kāi)發(fā)教程(Spring+SpringMVC+MyBatis)[M].北京:人民郵電出版社,2017.黃玲,余霞.基于云平臺(tái)的電子商務(wù)商品智能推薦系統(tǒng)[J].現(xiàn)代電子技術(shù),2020,43(5):183-186.LimH,XieL.ANewWeightedImputedNeighborhood-RegularizedTri-FactorizationOne-ClassCollaborativeFilteringAlgorithm:ApplicationtoTargetGenePredictionofTranscriptionFactors[J].IEEE/ACMtransactionsoncomputationalbiologyandbioinformatics,2021(1):18.王紹卿,李鑫鑫,孫福振,等.個(gè)性化新聞推薦技術(shù)研究綜述[J].計(jì)算機(jī)科學(xué)與探索,2020,14(1):18-29.HuangChuangguang,YinJian,WanJing,Unmcertainneighbors'collaborativefilteringrecommendationalgorithm[J].ChineseJournalofcomputers,2014,33(8):1369-1377.湯偉韜,余敦輝,魏世偉.融合知識(shí)圖譜與用戶評(píng)論的商品推薦算法[J].計(jì)算機(jī)工程,2020,46(8):93-100.王子茹,宋尚文,閻紅燦.協(xié)同過(guò)濾推薦算法的性能對(duì)比與分析[J].計(jì)算機(jī)仿真,2022,39(09):435-440.榮輝桂,火生旭,胡春華,等.基于用戶相似度的協(xié)同過(guò)濾推薦算法[J].通信學(xué)報(bào),2014,35(2):16-24.ZhaoW,TianH,WuY,etal.ANewItem-BasedCollaborativeFilteringAlgorithmtolmprovetheAccuracyofPredictioninSparseData[J].InternationalJournalofComputationalIntelligenceSystems,2022,15(1):1-15.致謝附錄附錄ApublicclassUser{

privateIntegeruserid;

privateStringaccount;

privateStringpassword;

privateStringusername;

privateStringaddress;

privateintsex;

@DateTimeFormat(pattern="yyyy-MM-dd")

privateDatebirthday;

privateStringnickname;

privateDateEdittime;

privateStringtelephone;

privateintexperience;

privatebyte[]photo;

publicUser(){

}

publicUser(Integeruserid,Stringaccount,

Stringpassword,Stringusername,Stringaddress,

intsex,Datebirthday,Stringnickname,Dateedittime,

Stringtelephone,intexperience,byte[]photo){

this.userid=userid;

this.account=account;

this.password=password;

this.username=username;

this.address=address;

this.sex=sex;

this.birthday=birthday;

this.nickname=nickname;

Edittime=edittime;

this.telephone=telephone;

this.experience=experience;

this.photo=photo;

}

publicIntegergetUserid(){

returnuserid;}

publicvoidsetUserid(Integeruserid){

this.userid=userid;}

publicStringgetAccount(){

returnaccount;}

publicvoidsetAccount(Stringaccount){

this.account=account;}

publicStringgetPassword(){

returnpassword;}

publicvoidsetPassword(Stringpassword){

this.password=password;}

publicStringgetUsername(){

returnusername;}

publicvoidsetUsername(Stringusername){

this.username=username;}

publicStringgetAddress(){

returnaddress;}

publicvoidsetAddress(Stringaddress){

this.address=address;}

附錄B

@Controller

publicclassUserLoginController{

@Autowired

privateUserServiceuserService;

@Value("${imgpath}")

privateStringimgpath;

@PostMapping(value="user/login")

publicStringUserLogin(Stringaccount,Stringpassword,

Map<String,Object>map,HttpSessionsession){

Useruser=userService.returnUserByAccount(account,password);

if(user!=null){

session.setAttribute("loginUser",user);

map.put("loginUser",user);

System.out.println("要登錄的用戶為:"+user);

if(user.getPhoto()!=null){

StringfileSavePath=imgpath+

"Project_1.0\\src\\main\\resources\\static\\asserts\\userphoto\\";

StringfileSaveName=fileSavePath+user.getUserid()+".jpg";

Stringsrc="/asserts/userphoto/";

Stringfilename=src+user.getUserid()+".jpg";

session.setAttribute("filename",filename);

FileOutputStreamfos=null;

byte[]photo=user.getPhoto();

try{

fos=newFileOutputStream(fileSaveName);

fos.write(photo);

}catch(FileNotFoundExceptione){

e.printStackTrace();

}catch(IOExceptione){

e.printStackTrace();

}finally{

if(fos!=null)

{

try{

fos.close();

}catch(IOExceptione){

e.printStackTrace();

}

}

}

//將路徑傳給”用戶頁(yè)面“去顯示

map.put("fileName",filename);

}

else{

//頭像頭像為空。顯示一個(gè)默認(rèn)頭像

map.put("fileName","/asserts/img/catDefault.jpg");

session.setAttribute("filename","/asserts/img/catDefault.jpg");

}

return"userPage";

}

else{

map.put("msg","密碼錯(cuò)誤或賬號(hào)不對(duì),導(dǎo)致登錄失敗");

System.out.println("登錄失敗");

return"index";

}

}

附錄C

@Controller

publicclassAdminManagePetsController{

@Autowired

privateAdoptRelationshipServiceadoptRelationshipService;

@Autowired

privateVarietiesServicevarietiesService;

@Autowired

privateAnimalServiceanimalService;

@Autowired

privateAdminServiceadminService;

@Value("${imgpath}")

privateStringimgpath;

@GetMapping(value="toManagePetsPage")

publicStringtoManagePetsPage(@RequestParam("currentPage")IntegercurrentPage,

Modelmodel,HttpSessionsession)

{

//管理員信息回顯

ControllerTrmationEcho(session,model,1);

IntegernumberOfAnimals=animalService.getNumberOfAnimals();

PageSupportpageSupport=newPageSupport();

ArrayList<Integer>integers=PaginationTool.paginationTool(currentPage,numberOfAnimals,pageSupport,3);

//分頁(yè)顯示的動(dòng)物信息

Map<Integer,Animal>allAnimalsBySeparate=

adminService.getAllAnimalsBySeparate(currentPage*pageSupport.getPageSize(),pageSupport.getPageSize());

intsize=allAnimalsBySeparate.size();

//存儲(chǔ)去頁(yè)面展示的各動(dòng)物的照片路徑信息

Map<Integer,String>fileName=newHashMap<>();

intk=1;

while(size!=0&&allAnimalsBySeparate.get(currentPage*pageSupport.getPageSize()+k)!=null)

{

Integerid=allAnimalsBySeparate.get(currentPage*pageSupport.getPageSize()+k).getAnimalID();

if(allAnimalsBySeparate.get(currentPage*pageSupport.getPageSize()+k).getPhoto()!=null)

{

//動(dòng)物照片的相對(duì)路徑

Stringfilename="/asserts/animalphoto/"+id+".jpg";

fileName.put(id,filename);

}

size--;

k++;

}

model.addAttribute("fileName",fileName);

model.addAttribute("animals",allAnimalsBySeparate);

//在頁(yè)面中用于循環(huán)的變量

ArrayList<Integer>arrayList=newArrayList<>();

inti=pageSupport.getPageSize();

intj=1;

while(i!=0)

{

arrayList.add(j);

i--;

j++;

}

model.addAttribute("arrayList",arrayList);

model.addAttribute("list",integers);

//前端頁(yè)面在Map中取值的Key值

model.addAttribute("currentPage",currentPage*pageSupport.getPageSize());

System.out.println(allAnimalsBySeparate);

return"managePets";

}

@GetMapping(value="toEditAnimalPage")

publicStringtoEditAnimalPage(@RequestParam(value="animalId")IntegeranimalID,HttpSessionsession,Modelmodel)

{

//管理員信息回顯

ControllerTrmationEcho(session,model,1);

//根據(jù)動(dòng)物編號(hào)查詢出動(dòng)物

AnimalanimalById=animalService.getAnimalById(animalID);

//也頁(yè)面回顯

model.addAttribute("EditAnimal",animalById);

Collection<Varieties>varieties=varietiesService.getAllVarieties().values();

//回顯動(dòng)物種類

model.addAttribute("varieties",varieties);

VarietiesvarietiesById=varietiesService.getVarietiesById(animalById.getVarieties().getVarietiesID());

model.addAttribute("varietiesById",varietiesById);

return"editAnimalPage";

}

@PostMapping(value="updateAnimalInfo")

publicStringupdateAnimalInfo(@RequestPart(value="animalPhotos")MultipartFilefile,

Animalanimal,@RequestParam("varietiesID")IntegervarietiesID)

throwsIOException

{

Stringfilename=null;

if(!file.isEmpty())

{

//拿到文件名

IntegeranimalID=animal.getAnimalID();

//文件保存路徑

StringfileSavePath=imgpath+

"Project_1.0\\src\\main\\resources\\static\\asserts\\animalphoto\\";

//完整文件名

filename=fileSavePath+animalID+".jpg";

//將文件傳輸?shù)揭粋€(gè)地方,先將文件保存在本地,再寫入到數(shù)據(jù)庫(kù)

file.transferTo(newFile(filename));

FileInputStreamfis=newFileInputStream(filename);

//更新動(dòng)物照片

inti=animalService.updateAnimalPhotos(animal.getAnimalID(),fis);

if(i!=0)

{

System.out.println("更新動(dòng)物照片成功");

}

else{

System.out.println("更新動(dòng)物照片失敗");

}

fis.close();

}

//更新動(dòng)物信息

inti=animalService.updateAnimalInfo(animal,varietiesID);

if(i!=0)

{

System.out.println("更新動(dòng)物信息成功");

}

else{

System.out.println("更新動(dòng)物信息失敗");

}

return"redirect:/toManagePetsPage?currentPage=0";

}

}附錄D@OverridepublicList<Animal>selectAll(Integercurrent){if(current==null){returnnull;}//List<Animal>page=newList<>(current,8);List<Animal>list=articleMapper.selectAll(page);returnlist;}@OverridepublicList<Animal>getAnimal(IntegeruserId){try{//創(chuàng)建訓(xùn)練集FastByIDMap<PreferenceArray>preMap=newFastByIDMap<>();//首先放自己的行為L(zhǎng)ist<History>histories=historyMapper.getHistoryByUserId(userId);if(histories==null||histories.size()<=0){//如果是新用戶的話,就沒(méi)有歷史記錄,直接返回首頁(yè)頁(yè)面returnselectAll(newRandom().nextInt(5)).getRecords();}PreferenceArrayuser1=newGenericUserPreferenceArray(100);inttemp=0;for(Historyhistory:histories){user1.setUserID(temp,history.getUserId());user1.setItemID(temp,Long.parseLong(history.getPid()));user1.setValue(temp,newRandom().nextLong()%10);temp++;}preMap.put(userId,user1);//每個(gè)用戶大概10條數(shù)據(jù),一次從50條數(shù)據(jù)中查找Page<Student>userPage=newPage<>(newRandom().nextInt(3),5);List<Student>users=studentMapper.selectPage(userPage,null).getRecords();("用戶"+String.valueOf(users.size()));for(Studentuser:users){histories=historyMapper.getHistoryByUserId(user.getId());user1=newGenericUserPreferenceArray(10);temp=0;for(Historyhistory:histories)

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論