版權(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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2026年四川希望汽車職業(yè)學(xué)院?jiǎn)握新殬I(yè)適應(yīng)性考試題庫(kù)及答案詳解一套
- 2026年南陽(yáng)科技職業(yè)學(xué)院?jiǎn)握新殬I(yè)適應(yīng)性考試題庫(kù)參考答案詳解
- 2026年南充文化旅游職業(yè)學(xué)院?jiǎn)握新殬I(yè)傾向性測(cè)試題庫(kù)及答案詳解一套
- 2026年濟(jì)南工程職業(yè)技術(shù)學(xué)院?jiǎn)握新殬I(yè)技能考試題庫(kù)參考答案詳解
- 2026年浙江工業(yè)職業(yè)技術(shù)學(xué)院?jiǎn)握新殬I(yè)技能考試題庫(kù)及完整答案詳解1套
- 2026年煙臺(tái)工程職業(yè)技術(shù)學(xué)院?jiǎn)握新殬I(yè)傾向性考試題庫(kù)及完整答案詳解1套
- 2026年河南科技職業(yè)大學(xué)單招職業(yè)傾向性測(cè)試題庫(kù)及參考答案詳解1套
- 2026年貴州電子商務(wù)職業(yè)技術(shù)學(xué)院?jiǎn)握新殬I(yè)適應(yīng)性考試題庫(kù)附答案詳解
- 2026年渭南職業(yè)技術(shù)學(xué)院?jiǎn)握芯C合素質(zhì)考試題庫(kù)及答案詳解1套
- 2026年上海財(cái)經(jīng)大學(xué)浙江學(xué)院?jiǎn)握新殬I(yè)傾向性測(cè)試題庫(kù)及答案詳解一套
- 《Stata數(shù)據(jù)統(tǒng)計(jì)分析教程》
- 2024-2025學(xué)年廣州市越秀區(qū)八年級(jí)上學(xué)期期末語(yǔ)文試卷(含答案)
- 寵物診療治療試卷2025真題
- 媒體市場(chǎng)競(jìng)爭(zhēng)力分析-洞察及研究
- 口腔科口腔潰瘍患者漱口液選擇建議
- 精神科抑郁癥心理干預(yù)培訓(xùn)方案
- 2025年國(guó)家開(kāi)放大學(xué)(電大)《外國(guó)文學(xué)》期末考試復(fù)習(xí)題庫(kù)及答案解析
- 三防漆涂覆流程及質(zhì)量控制標(biāo)準(zhǔn)
- 慢性阻塞性肺病糖皮質(zhì)激素使用培訓(xùn)
- 2026中水淮河規(guī)劃設(shè)計(jì)研究有限公司新員工招聘筆試考試備考試題及答案解析
- 綜合義診活動(dòng)方案
評(píng)論
0/150
提交評(píng)論