舊物置換網站的設計與實現(xiàn)_第1頁
舊物置換網站的設計與實現(xiàn)_第2頁
舊物置換網站的設計與實現(xiàn)_第3頁
舊物置換網站的設計與實現(xiàn)_第4頁
舊物置換網站的設計與實現(xiàn)_第5頁
已閱讀5頁,還剩52頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

參考文獻鄧笑.基于Spring

Boot的校園輕博客系統(tǒng)的設計與實現(xiàn)[D].湖北:華中科技大學,2018.余永文.跨境電商平臺運營模式分析及對策建議——以eBay平臺為例[J]商場代化,2021,(12):22-24.DOI:10.14013/ki.scxdh.2021.12.009.卞嵋君.關于在線分類廣告?zhèn)鞑?yōu)勢的研究[D].廈門大學,2007.魏海芝,易寒茹,楊嬌.基于閑魚等交易平臺的校園二手市場現(xiàn)狀及前景調研報告[J].商場現(xiàn)代化,2022,(09):43-45.DOI:10.14013/ki.scxdh.2022.09.048.陳春龍.基于混合推薦的校園二手交易系統(tǒng)的研究與實現(xiàn)[D].遼寧大學,2022.DOI:10.27209/ki.glniu.2022.001777.趙志威,張生月,蔣應舉,屠曉光.基于SpringBoot的高新技術網站創(chuàng)新能力評價平臺設計與實現(xiàn)[J].現(xiàn)代信息科技,2021:11-18.薛賓田.基于SpringBoot的星級黨員考評系統(tǒng)[J].電腦編程技巧與維護,2022:11-19.陶銘;謝仁平.基于SpringBoot的在線教育系統(tǒng)研發(fā)及應用實踐[J].軟件導刊,2022:11-20.李鈺萍.基于微信小程序的在線學習平臺設計與實現(xiàn)[D].華中科技大學,2020.DOI:10.27157/ki.ghzku.2019.003491.劉汀.基于SpringBoot的微服務體系在網站信息管理系統(tǒng)中的應用[J].信息技術與信息化,2023:11-21.顧雅楓.基于SpringBoot的質檢綜合信息管理系統(tǒng)的開發(fā)實現(xiàn)[J].信息技術與信息化,2021:11-22.劉云龍.基于SpringBoot的高職院校校外實訓基地管理系統(tǒng)設計與實現(xiàn)[J].科技風,2022:11-23.陽博,溫志萍.基于SpringBoot的在線協(xié)同辦公系統(tǒng)設計與實現(xiàn)[J].電腦知識與技術,2022.:11-24.王超,張琪立,田廣強,李晶晶.基于Springboot框架的學校機房計費管理系統(tǒng)的設計與實現(xiàn)[J].電子技術與軟件工程,2020:12-17.張浩洋,顧丹鵬,陳肖勇.

基于Vue的數(shù)據管理平臺實踐與應用[J].

計算機時代,2022,(07):66-67+72.岳峰,段政偉.基于SpringBoot框架的營區(qū)手機管控平臺設計與實現(xiàn)[J].無線互聯(lián)科技,2023:13-17.陳瑞.基于Springboot高并發(fā)JavaWeb開發(fā)模式[J].電腦編程技巧與維護,2021(04):14-17.張峰.應用SpringBoot改變web應用開發(fā)模式[J].科技創(chuàng)新與應用,2021(23):11-19.HuangMengting,YiYuhan,ZhangGuanglin.ServiceCachingandTaskOffloadingforMobileEdgeComputing-EnabledIntelligentConnectedVehicles[J].JournalofShanghaiJiaotongUniversity(Science),2021:12-17.ValeriiTkachenko,SvetlanaLukianiuk.AnalysisoftheuseoftheRedisinthedistributedorderprocessingsystemintherestaurantnetwork[J].Technologyauditandproductionreserves,2021:11-17.JieWang,LeiYuan.ResearchandImplementationofSpecialAgriculturalProductsPromotionSystemBasedonAndroid[J].JournalofPhysics:ConferenceSeries,2022:1-7.

附錄:核心源碼

public

String

logout(HttpServletRequest

request,HttpSession

session){

String

userid

=

(String)session.getAttribute("userid");

String

username

=

(String)session.getAttribute("username");

if(StringUtils.isEmpty(userid)

&&

StringUtils.isEmpty(username)){

return

"redirect:/";

}

request.getSession().removeAttribute("userid");

request.getSession().removeAttribute("username");

return

"redirect:/";

}}@Controllerpublic

class

UserController

{

@Autowired

private

LoginService

loginService;

@Autowired

private

UserInfoService

userInfoService;

/**手機號和更換手機號驗證碼map集合*/

private

static

Map<String,

String>

phonecodemap

=

new

HashMap<>();

/**

*

修改密碼

*

1.前端傳入舊密碼(oldpwd)、新密碼(newpwd)

*

2.判斷輸入舊密碼和系統(tǒng)舊密碼是否相等

*

4.修改密碼

*/

@ResponseBody

@PutMapping("/user/updatepwd")

public

ResultVo

updatepwd(HttpSession

session,

HttpServletRequest

request)

throws

IOException

{

JSONObject

json

=

JsonReader.receivePost(request);

String

oldpwd

=

json.getString("oldpwd");

String

newpwd

=

json.getString("newpwd");

String

userid

=

(String)

session.getAttribute("userid");

Login

login

=

new

Login();

UserInfo

userInfo

=

new

UserInfo();

login.setUserid(userid);

Login

login1

=

loginService.userLogin(login);

String

oldpwds

=

new

Md5Hash(oldpwd,

"Campus-shops").toString();

//如果舊密碼相等

if

(oldpwds.equals(login1.getPassword())){

//鹽加密

String

passwords

=

new

Md5Hash(newpwd,

"Campus-shops").toString();

login.setPassword(passwords);

userInfo.setPassword(passwords).setUserid(login1.getUserid());

Integer

integer

=

loginService.updateLogin(login);

Integer

integer1

=

userInfoService.UpdateUserInfo(userInfo);

if

(integer

==

1

&&

integer1

==

1)

{

return

new

ResultVo(true,

StatusCode.OK,

"修改密碼成功");

}

return

new

ResultVo(false,

StatusCode.ERROR,

"修改密碼失敗");

}

return

new

ResultVo(false,

StatusCode.LOGINERROR,

"當前密碼錯誤");

}

/**

*

展示用戶頭像昵稱

*/

@ResponseBody

@PostMapping("/user/avatar")

public

ResultVo

userAvatar(

HttpSession

session)

{

String

userid

=

(String)

session.getAttribute("userid");

UserInfo

userInfo

=

userInfoService.queryPartInfo(userid);

return

new

ResultVo(true,

StatusCode.OK,

"查詢頭像成功",userInfo);

}

/**

*

修改頭像

*

*/

@PostMapping(value

=

"/user/updateuimg")

@ResponseBody

public

JSONObject

updateuimg(@RequestParam(value

=

"file",

required

=

false)

MultipartFile

file,

HttpSession

session)

throws

IOException

{

JSONObject

res

=

new

JSONObject();

JSONObject

resUrl

=

new

JSONObject();

String

filename

=

UUID.randomUUID().toString().replaceAll("-",

"");

String

ext

=

FilenameUtils.getExtension(file.getOriginalFilename());//獲得文件擴展名

String

filenames

=

filename

+

"."

+

ext;//文件全名

String

pathname

=

"D:\\campusshops\\file\\"

+

filenames;

file.transferTo(new

File(pathname));

resUrl.put("src",

"/pic/"+filenames);

res.put("msg",

"");

res.put("code",

0);

res.put("data",

resUrl);

String

uimgUrl

=

"/pic/"

+

filenames;

String

userid=(String)

session.getAttribute("userid");

UserInfo

userInfo

=

new

UserInfo().setUserid(userid).setUimage(uimgUrl);

userInfoService.UpdateUserInfo(userInfo);

return

res;

}

/**

*

展示個人信息

*/

@RequiresPermissions("user:userinfo")

@GetMapping("/user/lookinfo")

public

String

lookinfo(HttpSession

session,

ModelMap

modelMap)

{

String

userid

=

(String)

session.getAttribute("userid");

UserInfo

userInfo

=

userInfoService.LookUserinfo(userid);

modelMap.put("userInfo",userInfo);

return

"/user/userinfo";

}

/**

*

跳轉到完善個人信息

*/

@GetMapping("/user/perfectinfo")

public

String

perfectInfo(HttpSession

session,

ModelMap

modelMap)

{

String

userid

=

(String)

session.getAttribute("userid");

UserInfo

userInfo

=

userInfoService.LookUserinfo(userid);

modelMap.put("perfectInfo",userInfo);

return

"/user/perfectInfo";

}

/**

*

修改個人信息

*

1.前端傳入用戶昵稱(username)、用戶郵箱(email)、性別(sex)、學校(school)、院系(faculty)、入學時間(startime)

*

2.前端傳入變更后的字段,未變更的不傳入后臺

*

3.判斷更改的用戶名是否已存在

*

4.修改個人信息

*/

@ResponseBody

@PostMapping("/user/updateinfo")

public

ResultVo

updateInfo(@RequestBody

UserInfo

userInfo,

HttpSession

session)

{

String

username

=

userInfo.getUsername();

String

userid

=

(String)

session.getAttribute("userid");

Login

login

=

new

Login();

//如果傳入用戶名

if

(!StringUtils.isEmpty(username)){

login.setUsername(username);

Login

login1

=

loginService.userLogin(login);

//如果該用戶名對應有用戶

if

(!StringUtils.isEmpty(login1)){

return

new

ResultVo(false,

StatusCode.ERROR,

"該用戶名已存在");

}

login.setUserid(userid);

//修改登錄表中用戶名

loginService.updateLogin(login);

}

userInfo.setUserid(userid);

Integer

integer1

=

userInfoService.UpdateUserInfo(userInfo);

if

(integer1

==

1)

{

return

new

ResultVo(true,

StatusCode.OK,

"修改成功");

}

return

new

ResultVo(false,

StatusCode.ERROR,

"修改失敗");

}

/**更換手機號時發(fā)送短信驗證碼

*

1.判斷是否為更換手機號類型驗證碼

*

2.判斷手機號格式是否正確

*

3.查詢賬號是否存在

*

4.發(fā)送驗證碼

*

*/

@ResponseBody

@PostMapping("/userndupdatephone")

public

ResultVo

sendupdatephone(HttpServletRequest

request)

throws

IOException

{

JSONObject

json

=

JsonReader.receivePost(request);

final

String

mobilephone

=

json.getString("mobilephone");

Integer

type

=

json.getInt("type");

Login

login

=

new

Login();

if(type!=2){

return

new

ResultVo(false,StatusCode.ACCESSERROR,"違規(guī)操作");

}

if

(!JustPhone.justPhone(mobilephone))

{//判斷輸入的手機號格式是否正確

return

new

ResultVo(false,StatusCode.ERROR,"請輸入正確格式的手機號");

}

//查詢手機號是否存在

login.setMobilephone(mobilephone);

Login

userIsExist

=

loginService.userLogin(login);

if

(!StringUtils.isEmpty(userIsExist)){//若手機號已注冊過

return

new

ResultVo(false,

StatusCode.REPERROR,"手機號已存在");

}

String

code

=

GetCode.phonecode();

Integer

result

=

new

SmsUtil().SendMsg(mobilephone,

code,

type);//發(fā)送驗證碼

if(result

==

1)

{//發(fā)送成功

phonecodemap.put(mobilephone,

code);//放入map集合進行對比/*

final

Timer

timer

=

new

Timer();

timer.schedule(new

TimerTask()

{

@Override

public

void

run()

{

phonecodemap2.remove(phoneNum);

timer.cancel();

}

},

5

*

60

*

1000);*/

//執(zhí)行定時任務

ScheduledExecutorService

executorService

=

new

ScheduledThreadPoolExecutor(1,

new

BasicThreadFactory.Builder().namingPattern("example-schedule-pool-%d").daemon(true).build());

executorService.scheduleAtFixedRate(new

Runnable()

{

@Override

public

void

run()

{

phonecodemap.remove(mobilephone);

((ScheduledThreadPoolExecutor)

executorService).remove(this::run);

}

},5

*

60

*

1000,5

*

60

*

1000,

TimeUnit.HOURS);

return

new

ResultVo(true,StatusCode.SMS,"驗證碼發(fā)送成功");

}else

if(result

==

2){

return

new

ResultVo(false,StatusCode.ERROR,"請輸入正確格式的手機號");

}

return

new

ResultVo(false,StatusCode.REMOTEERROR,"驗證碼發(fā)送失敗");

}

/**

*

修改綁定手機號

*

1.獲取session中userid

*

2.修改login和userInfo中對應的手機號

*/

@ResponseBody

@PutMapping("/user/updatephone/{mobilephone}/{vercode}")

public

ResultVo

updatephone(@PathVariable("mobilephone")String

mobilephone,@PathVariable("vercode")String

vercode,HttpSession

session)

{

String

userid

=

(String)

session.getAttribute("userid");

String

rel

=

phonecodemap.get(mobilephone);

if

(StringUtils.isEmpty(rel))

{//驗證碼到期

或者

沒發(fā)送短信驗證碼

return

new

ResultVo(false,StatusCode.ERROR,"請重新獲取驗證碼");

}

if

(rel.equalsIgnoreCase(vercode))

{//驗證碼正確

Login

login

=

new

Login().setUserid(userid).setMobilephone(mobilephone);

UserInfo

userInfo

=

new

UserInfo().setUserid(userid).setMobilephone(mobilephone);

Integer

integer

=

loginService.updateLogin(login);

Integer

integer1

=

userInfoService.UpdateUserInfo(userInfo);

if

(integer

==

1

&&

integer1

==

1)

{

return

new

ResultVo(true,

StatusCode.OK,

"更換手機號成功");

}

return

new

ResultVo(false,

StatusCode.SERVERERROR,

"系統(tǒng)錯誤,更換失敗");

}

return

new

ResultVo(false,StatusCode.ERROR,"驗證碼錯誤");

}}@ControllerpublicclassCollectController{@AutowiredprivateCollectServicecollectService;/***商品詳情界面:收藏商品or取消收藏*前端傳入收藏操作(colloperate:1收藏,2取消收藏),獲取session中用戶id信息,判斷是否登錄*(1).收藏商品*1.前端傳入商品id(commid)、商品名(commname)、商品描述(commdesc)、商品用戶id(cmuserid)*商品用戶名(username)、商品所在學校(school)*2.session中獲取收藏用戶id(couserid)*3.進行收藏操作*(2).取消收藏*1.前端傳入商品id(commid)*2.判斷是否本人取消收藏*3.進行取消收藏操作*/@ResponseBody@PostMapping("/collect/operate")publicResultVoinsertcollect(@RequestBodyCollectcollect,HttpSessionsession){Stringcouserid=(String)session.getAttribute("userid");Integercolloperate=collect.getColloperate();collect.setCouserid(couserid);if(StringUtils.isEmpty(couserid)){returnnewResultVo(false,StatusCode.ACCESSERROR,"請先登錄");}if(colloperate==1){Collectcollect1=collectService.queryCollectStatus(collect);if(!StringUtils.isEmpty(collect1)){/**更改原來的收藏信息和狀態(tài)*/collect1.setCommname(collect.getCommname()).setCommdesc(collect.getCommdesc()).setSchool(collect.getSchool()).setSoldtime(GetDate.strToDate());Integeri=collectService.updateCollect(collect);if(i==1){returnnewResultVo(true,StatusCode.OK,"收藏成功");}returnnewResultVo(false,StatusCode.ERROR,"收藏失敗");}else{collect.setId(KeyUtil.genUniqueKey());Integeri=collectService.insertCollect(collect);if(i==1){returnnewResultVo(true,StatusCode.OK,"收藏成功");}returnnewResultVo(false,StatusCode.ERROR,"收藏失敗");}}else{Collectcollect1=collectService.queryCollectStatus(collect);/**判斷是否為本人操作*/if(collect1.getCouserid().equals(couserid)){Integeri=collectService.updateCollect(collect);if(i==1){returnnewResultVo(true,StatusCode.OK,"取消成功");}returnnewResultVo(false,StatusCode.ERROR,"取消失敗");}returnnewR

溫馨提示

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

評論

0/150

提交評論