?? 作者主頁(yè):超級(jí)無(wú)敵暴龍戰(zhàn)士塔塔開(kāi)
?? 簡(jiǎn)介:Java領(lǐng)域優(yōu)質(zhì)創(chuàng)作者??、 簡(jiǎn)歷模板、學(xué)習(xí)資料、面試題庫(kù)【關(guān)注我,都給你】
??文末獲取源碼聯(lián)系??
項(xiàng)目介紹
基于SpringBoot的校園求職招聘系統(tǒng),java項(xiàng)目。
eclipse和idea都能打開(kāi)運(yùn)行。
推薦環(huán)境配置:eclipse/idea jdk1.8 maven mysql
前端技術(shù):vue,Ajax,Json
后端技術(shù):SpringBoot,MyBatis
本系統(tǒng)共分為兩個(gè)角色:管理員、企業(yè)、用戶。
主要功能有:
后臺(tái):登錄注冊(cè)、首頁(yè)、個(gè)人中心、用戶管理、基礎(chǔ)數(shù)據(jù)管理、企業(yè)管理、用戶管理、簡(jiǎn)歷管理、職位招聘管理、面試申請(qǐng)管理、論壇管理、輪播圖信息等
前臺(tái):登錄注冊(cè)、首頁(yè)展示、企業(yè)列表、論壇列表、個(gè)人中心、招聘中心、發(fā)送面試申請(qǐng)等。
提供遠(yuǎn)程部署、代碼講解等服務(wù)
更多精品項(xiàng)目,請(qǐng)查看主頁(yè)
主要功能截圖:
部分代碼展示
控制層,ClockInNewController,對(duì)登錄用戶信息的查詢(xún),基于Cookie,從cookie中提取用戶信息,并根據(jù)提取的用戶字段,在數(shù)據(jù)庫(kù)中查詢(xún)相關(guān)信息。
@RequestMapping("/queryClockInAll2")
public JsonObject queryClockInAll2(Clockinnew clockinnew, HttpServletRequest request,
@RequestParam(defaultValue = "1") Integer pageNum,
@RequestParam(defaultValue = "15") Integer pageSize
){
//獲取當(dāng)前得登錄用戶
Userinfo userinfo= (Userinfo) request.getSession().getAttribute("user");
String username=userinfo.getUsername();
//根據(jù)username獲取登錄賬號(hào)得業(yè)主id
Owner owner=ownerService.queryOwnerByName(username);
clockinnew.setOwnerId(owner.getId());
PageInfo<Clockinnew> pageInfo= clockinnewService.queryClockInAll(pageNum,pageSize,clockinnew);
return new JsonObject(0,"ok",pageInfo.getTotal(),pageInfo.getList());
}
核心接口,封裝具體方法,方便對(duì)象的注入
package com.yx.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.yx.model.Clockinnew;
import java.util.Date;
/**
* <p>
* 服務(wù)類(lèi)
* </p>
*
* @author yx
* @since 2021-04-27
*/
public interface IClockInNewService extends IService<Clockinnew> {
PageInfo<Clockinnew> queryClockInAll(int pageNum, int pageSize, Clockinnew clockinnew);
/**
* 查詢(xún)分頁(yè)數(shù)據(jù)
*
* @param page 頁(yè)碼
* @param pageCount 每頁(yè)條數(shù)
* @return IPage<Clockinnew>
*/
IPage<Clockinnew> findListByPage(Integer page, Integer pageCount);
/**
* 添加
*
* @param clockinnew
* @return int
*/
int add(Clockinnew clockinnew);
/**
* 刪除
*
* @param id 主鍵
* @return int
*/
int delete(Long id);
/**
* 修改
*
* @param clockinnew
* @return int
*/
int updateData(Clockinnew clockinnew);
/**
* id查詢(xún)數(shù)據(jù)
*
* @param id id
* @return Clockinnew
*/
Clockinnew findById(Long id);
Date queryCountByOwnId(Integer ownerId);
}
針對(duì)登錄接口進(jìn)行講解
首先是controller層
涉及登錄,自然是分不開(kāi)session,需要從session中提取用戶,判斷該用戶是否處于登錄狀態(tài)。其中密碼是經(jīng)過(guò)md5加密的,固定的鹽值加入到數(shù)據(jù)庫(kù)中,提高系統(tǒng)的安全行。
@RequestMapping(value="/login",method= RequestMethod.POST)
public String login(Model model, String name, String password){//throws ParseException
Subject subject = SecurityUtils.getSubject();
UsernamePasswordToken token = new UsernamePasswordToken(name,password);
try {
subject.login(token);
User us = userService.getByName(name);
String lastLoginTime = "";
if(us!=null){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//上次時(shí)間
Date time = us.getLasttime();
lastLoginTime = sdf.format(time);
//新時(shí)間
String format = sdf.format(new Date());
//string轉(zhuǎn)date 不處理時(shí)間格式會(huì)不理想
ParsePosition pos = new ParsePosition(0);
Date strtodate = sdf.parse(format, pos);
us.setLasttime(strtodate);
userService.update(us);
}
if (us.getStatus()==1){
Session session=subject.getSession();
session.setAttribute("subject", subject);
session.setAttribute("lastLoginTime",lastLoginTime);
return "redirect:index";
}else {
model.addAttribute("error", "賬號(hào)已被停用!");
return "/login";
}
} catch (AuthenticationException e) {
model.addAttribute("error", "驗(yàn)證失?。?);
return "/login";
}
}
接下來(lái)就是impl實(shí)現(xiàn)類(lèi),可根據(jù)獲得的參數(shù)進(jìn)行條件查詢(xún)。
當(dāng)然,具體的查詢(xún)語(yǔ)句一般都不會(huì)直接在implement類(lèi)中寫(xiě),而是將其寫(xiě)在封裝好的mapper的xml文件中,xml文件又映射對(duì)應(yīng)的mapper文件。
而真正起作用的是mapper中的sql語(yǔ)句,在implement實(shí)現(xiàn)類(lèi)中只是對(duì)mapper進(jìn)行注入。
@Override
public User getByName(String name) {
UserExample example = new UserExample();
example.createCriteria().andNameEqualTo(name);
List<User> users = userMapper.selectByExample(example);
if (users.isEmpty()) return null;
return users.get(0);
}
UserMapper.java
package com.byh.biyesheji.dao;
import com.byh.biyesheji.pojo.User;
import com.byh.biyesheji.pojo.UserExample;
import java.util.List;
public interface UserMapper extends SysDao<User>{
List<User> selectByExample(UserExample example);
/**
* 停用管理員賬號(hào)
* @param name
*/
void enableStatus(String name);
/**
* 開(kāi)啟管理員賬號(hào)
* @param name
*/
void stopStatus(String name);
}
UserMapper.xml
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.byh.biyesheji.pojo.UserExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from user
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
設(shè)計(jì)總結(jié)
通過(guò)對(duì)校園點(diǎn)餐系統(tǒng)的開(kāi)發(fā),讓我深刻明白開(kāi)發(fā)一個(gè)程序軟件需要經(jīng)歷的流程,當(dāng)確定要開(kāi)發(fā)一個(gè)程序時(shí),我在開(kāi)發(fā)期間,對(duì)其功能進(jìn)行合理的需求分析,然后才是程序軟件的功能的框架設(shè)計(jì),數(shù)據(jù)庫(kù)的實(shí)體與數(shù)據(jù)表設(shè)計(jì),程序軟件的功能詳細(xì)界面實(shí)現(xiàn),以及程序的功能測(cè)試等進(jìn)行全方位的細(xì)致考慮,雖然在此過(guò)程中,各個(gè)環(huán)節(jié)都遇到了大大小小的困難,但是通過(guò)對(duì)這些問(wèn)題進(jìn)行反復(fù)的分析,深入的思考,借助各種相關(guān)文獻(xiàn)資料提供的方法與解決思路成功解決面臨的各個(gè)問(wèn)題,最后成功的讓我開(kāi)發(fā)的系統(tǒng)得以正常運(yùn)行。在功能上面是基本可以滿足用戶對(duì)系統(tǒng)的操作,但是這個(gè)程序軟件也有許多方面是不足的,因此,在下一個(gè)時(shí)間階段,有幾點(diǎn)需要改進(jìn)的地方需要提出來(lái),它們分別是:
(1)操作頁(yè)面可以滿足用戶簡(jiǎn)易操作的要求,但是在頁(yè)面多樣化設(shè)計(jì)層面上需要把一些比較豐富的設(shè)計(jì)結(jié)構(gòu)考慮進(jìn)來(lái)。
(2)程序軟件的總體安全性能需要優(yōu)化,例如程序的退出安全性,以及程序的并發(fā)性等問(wèn)題都需要進(jìn)行安全性升級(jí),讓開(kāi)發(fā)的產(chǎn)品與現(xiàn)實(shí)中的相關(guān)網(wǎng)站更貼合。
(3)需要對(duì)程序的數(shù)據(jù)結(jié)構(gòu)方面,程序的代碼方面等進(jìn)行優(yōu)化,讓運(yùn)行起來(lái)的程序可以保持穩(wěn)定運(yùn)行,也讓程序能夠保證短時(shí)間內(nèi)處理相關(guān)事務(wù),節(jié)省處理事務(wù)的時(shí)間,提高事務(wù)處理的效率,同時(shí)對(duì)服務(wù)器上資源占用的比例進(jìn)行降低。
平臺(tái)的開(kāi)發(fā)一方面是對(duì)自身專(zhuān)業(yè)知識(shí)技能進(jìn)行最終考核,另一方面也是讓自己學(xué)會(huì)獨(dú)立解決程序開(kāi)發(fā)過(guò)程中所遇到的問(wèn)題,掌握將理論知識(shí)運(yùn)用于程序開(kāi)發(fā)實(shí)踐的方法。最終目標(biāo)就是讓系統(tǒng)更具人性化,同時(shí)在邏輯設(shè)計(jì)上,讓系統(tǒng)能夠更加的嚴(yán)謹(jǐn)。
獲取源碼聯(lián)系:
大家點(diǎn)贊、收藏、關(guān)注、評(píng)論啦文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-814054.html
項(xiàng)目獲取方式
精彩專(zhuān)欄推薦訂閱:在下方專(zhuān)欄????
Java精品項(xiàng)目100套文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-814054.html
到了這里,關(guān)于基于SpringBoot的校園求職招聘系統(tǒng)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!