博客目录
- SSM+Mysql实现的大学校园兼职系统
- 实现功能截图
- 系统功能
- 使用技术
- 代码
- 完整源码
SSM+Mysql实现的大学校园兼职系统
本系统是一个在线的大学校园兼职系统,商家可以在上面发布自己的兼职,学生可以根据自己的需要,联系兼职,给学生和商家提供了一个方便的对接平台。
(文末查看完整源码)
实现功能截图
登录
发布兼职
个人中心
平台兼职首页
查看我发布的兼职
查看首页兼职详细信息
论坛交流
平台公告
系统功能
本系统实现了以下功能:
1、登录
2、发布兼职
3、兼职查看
4、查看用户
5、论坛交流
6、平台公告
7、个人中心
等
使用技术
数据库:mysql
开发工具:Idea(Myeclispe、Eclipse也可以)
知识点:Spring+springmvc+mybatis+layui
项目结构
代码
java端
实体类
Adver.java
package com.work.pojo;
import java.util.Date;
public class Adver {
private Integer id;
private User user;
private String title;
private String content;
private String image;
private Integer position;
private Date createTime;
private Integer userId;
private String nickName;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public Integer getPosition() {
return position;
}
public void setPosition(Integer position) {
this.position = position;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
}
Chat.java
package com.work.pojo;
import java.util.Date;
public class Chat{
private Integer id;
private User userFa;
private User userJie;
private String content;
private String image;
private Date createTime;
private Integer isRemoveFa;
private Integer isRemoveJie;
private String chatSignal;
private Integer isLook;
private Integer userIdFa;
private String nickNameFa;
private String headerImageFa;
private Integer userIdJie;
private String nickNameJie;
private String headerImageJie;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public User getUserFa() {
return userFa;
}
public void setUserFa(User userFa) {
this.userFa = userFa;
}
public User getUserJie() {
return userJie;
}
public void setUserJie(User userJie) {
this.userJie = userJie;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Integer getIsRemoveFa() {
return isRemoveFa;
}
public void setIsRemoveFa(Integer isRemoveFa) {
this.isRemoveFa = isRemoveFa;
}
public Integer getIsRemoveJie() {
return isRemoveJie;
}
public void setIsRemoveJie(Integer isRemoveJie) {
this.isRemoveJie = isRemoveJie;
}
public String getChatSignal() {
return chatSignal;
}
public void setChatSignal(String chatSignal) {
this.chatSignal = chatSignal;
}
public Integer getIsLook() {
return isLook;
}
public void setIsLook(Integer isLook) {
this.isLook = isLook;
}
public Integer getUserIdFa() {
return userIdFa;
}
public void setUserIdFa(Integer userIdFa) {
this.userIdFa = userIdFa;
}
public String getNickNameFa() {
return nickNameFa;
}
public void setNickNameFa(String nickNameFa) {
this.nickNameFa = nickNameFa;
}
public String getHeaderImageFa() {
return headerImageFa;
}
public void setHeaderImageFa(String headerImageFa) {
this.headerImageFa = headerImageFa;
}
public Integer getUserIdJie() {
return userIdJie;
}
public void setUserIdJie(Integer userIdJie) {
this.userIdJie = userIdJie;
}
public String getNickNameJie() {
return nickNameJie;
}
public void setNickNameJie(String nickNameJie) {
this.nickNameJie = nickNameJie;
}
public String getHeaderImageJie() {
return headerImageJie;
}
public void setHeaderImageJie(String headerImageJie) {
this.headerImageJie = headerImageJie;
}
}
mapper
AdverMapper.java
package com.work.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.work.pojo.Adver;
public interface AdverMapper {
public List<Adver> getAdverList(@Param("adver")Adver adver, @Param("page")Integer page, @Param("limit")Integer limit);
public Integer getAdverListCount(@Param("adver")Adver adver);
public void addAdver(@Param("adver")Adver adver);
public void updateAdver(@Param("adver")Adver adver);
public Adver getAdverById(@Param("id")Integer id);
public void deleteAdverById(@Param("id")int id);
}
service层
AdverServiceImpl.java
package com.work.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.work.mapper.AdverMapper;
import com.work.pojo.Adver;
import com.work.service.AdverService;
@Service
public class AdverServiceImpl implements AdverService{
@Autowired
private AdverMapper adverMapper;
@Override
public List<Adver> getAdverList(Adver adver, Integer page, Integer limit) {
return adverMapper.getAdverList(adver, page, limit);
}
@Override
public Integer getAdverListCount(Adver adver) {
return adverMapper.getAdverListCount(adver);
}
@Override
public void addAdver(Adver adver) {
adverMapper.addAdver(adver);
}
@Override
public void updateAdver(Adver adver) {
adverMapper.updateAdver(adver);
}
@Override
public Adver getAdverById(Integer id) {
return adverMapper.getAdverById(id);
}
@Override
public void deleteAdverById(int id) {
adverMapper.deleteAdverById(id);
}
}
ChatServiceImpl.java
package com.work.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.work.mapper.ChatMapper;
import com.work.pojo.Chat;
import com.work.service.ChatService;
@Service
public class ChatServiceImpl implements ChatService{
@Autowired
private ChatMapper chatMapper;
@Override
public List<Chat> getChatList(Chat chat, Integer page, Integer limit) {
return chatMapper.getChatList(chat, page, limit);
}
@Override
public Integer getChatListCount(Chat chat) {
return chatMapper.getChatListCount(chat);
}
@Override
public void addChat(Chat chat) {
chatMapper.addChat(chat);
}
@Override
public void updateChat(Chat chat) {
chatMapper.updateChat(chat);
}
@Override
public Chat getChatById(Integer id) {
return chatMapper.getChatById(id);
}
@Override
public void deleteChatByChatId(int id) {
chatMapper.deleteChatById(id);
}
@Override
public List<Chat> findChatList(Chat chat, Integer page, Integer limit) {
return chatMapper.findChatList(chat, page, limit);
}
@Override
public Integer findChatListCount(Chat chat) {
return chatMapper.findChatListCount(chat);
}
@Override
public List<Chat> myChatList(Chat chat) {
return chatMapper.myChatList(chat);
}
}
controller层
AdverController.java
package com.work.controller;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import com.work.common.utils.BaseUtil;
import com.work.common.utils.JsonUtil;
import com.work.pojo.Adver;
import com.work.pojo.User;
import com.work.service.AdverService;
@Controller
@RequestMapping("/server/adver")
public class AdverController extends BaseUtil{
@Autowired
private AdverService adverService;
//去广告列表
@RequestMapping("/goAdverList")
public ModelAndView goAdverList(ModelAndView mv){
mv.setViewName("server/adverManage/adverList");
return mv;
}
//获取广告列表
@RequestMapping("/getAdverList")
public void getAdverList(HttpServletResponse response,Adver adver,Integer page,Integer limit){
if(page == null){
page = 1;
}
if(limit == null){
limit = 10;
}
int totalCount = adverService.getAdverListCount(adver);
List<Adver> list = adverService.getAdverList(adver,(page-1) * limit, limit);
output(response,JsonUtil.buildJsonByTotalCount(list, totalCount));
}
//去添加广告
@RequestMapping("/goAddAdver")
public ModelAndView goAddAdver(ModelAndView mv){
mv.setViewName("server/adverManage/addAdver");
return mv;
}
//添加广告
@RequestMapping("/addAdver")
public void addAdver(HttpServletRequest request,HttpServletResponse response,Adver adver){
User serverUser = (User) request.getSession().getAttribute("serverUser");
adver.setCreateTime(new Date());
adver.setUserId(serverUser.getUserId());
adverService.addAdver(adver);
output(response,JsonUtil.buildFalseJson(0, "添加成功!"));
}
//去编辑广告
@RequestMapping("/goUpdateAdver")
public ModelAndView goUpdateAdver(ModelAndView mv,Integer id){
Adver adver = adverService.getAdverById(id);
mv.addObject("adver", adver);
mv.setViewName("server/adverManage/updateAdver");
return mv;
}
//编辑广告
@RequestMapping("/updateAdver")
public void updateAdver(HttpServletResponse response,Adver adver){
adverService.updateAdver(adver);
output(response,JsonUtil.buildFalseJson(0, "编辑成功!"));
}
//删除广告
@RequestMapping("/deleteAdver")
public void deleteAdver(HttpServletResponse response,Integer id){
adverService.deleteAdverById(id);
output(response,JsonUtil.buildFalseJson(0, "删除成功!"));
}
}
ChatController.java
package com.work.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import com.work.common.utils.BaseUtil;
import com.work.common.utils.JsonUtil;
import com.work.pojo.Chat;
import com.work.service.ChatService;
@Controller
@RequestMapping(value="/server/chat")
public class ChatController extends BaseUtil{
@Autowired
private ChatService chatService;
//去聊天列表
@RequestMapping("/goChatList")
public ModelAndView goChatList(ModelAndView mv){
mv.setViewName("server/chatManage/chatList");
return mv;
}
//获取聊天列表
@RequestMapping("/getChatList")
public void getChatList(HttpServletResponse response,Chat chat,Integer page,Integer limit){
if(page == null){
page = 1;
}
if(limit == null){
limit = 10;
}
int totalCount = chatService.getChatListCount(chat);
List<Chat> list = chatService.getChatList(chat,(page-1) * limit, limit);
output(response,JsonUtil.buildJsonByTotalCount(list, totalCount));
}
//去编辑聊天
@RequestMapping("/goUpdateChat")
public ModelAndView goUpdateChat(ModelAndView mv,Integer id){
Chat chat = chatService.getChatById(id);
mv.addObject("chat", chat);
mv.setViewName("server/chatManage/updateChat");
return mv;
}
//编辑聊天
@RequestMapping("/updateChat")
public void updateChat(HttpServletResponse response,Chat chat){
chatService.updateChat(chat);
output(response,JsonUtil.buildFalseJson(0, "编辑成功!"));
}
//删除聊天
@RequestMapping("/deleteChat")
public void deleteChat(HttpServletResponse response,Integer id){
chatService.deleteChatByChatId(id);
output(response,JsonUtil.buildFalseJson(0, "删除成功!"));
}
}
完整源码
觉得有用,记得一键三连哦!