开发工具:IDEA ,数据库mysql5.7或者以上
技术:springboot+layui
管理员账号admin,密码123456
package com.bjpowernode.employment.controller;
import com.bjpowernode.employment.common.CommonResult;
import com.bjpowernode.employment.mapper.entity.EmploymentInfo;
import com.bjpowernode.employment.service.EmploymentInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
import java.util.UUID;
@Controller
public class EmploymentInfoController {
@Autowired
EmploymentInfoService employmentInfoService;
@RequestMapping({"/employment/index", "/employment/employmentinfo"})
public String index(){
return "system/employmentinfo/employmentinfo";
}
@ResponseBody
@RequestMapping("/employment/getallinfo")
public CommonResult<List<EmploymentInfo>> getAllInfo(EmploymentInfo employmentInfo, @RequestParam("limit") int pageSize, @RequestParam("page") int pageNum){
List<EmploymentInfo> infoList = employmentInfoService.getAllEmploymentInfo(employmentInfo, pageNum, pageSize);
CommonResult<List<EmploymentInfo>> rtInfoResult = CommonResult.generateSuccessResult(infoList.size(), infoList);
return rtInfoResult;
}
@ResponseBody
@RequestMapping("/employment/getinfo")
public CommonResult<List<EmploymentInfo>> getinfo(EmploymentInfo info, @RequestParam("limit") int pageSize, @RequestParam("page") int pageNum){
List<EmploymentInfo> infoList = employmentInfoService.getEmploymentInfo(info, pageNum, pageSize);
CommonResult<List<EmploymentInfo>> rtInfoResult = CommonResult.generateSuccessResult(infoList.size(), infoList);
return rtInfoResult;
}
@ResponseBody
@RequestMapping("/employment/addinfo")
public CommonResult<Integer> addInfo(EmploymentInfo info){
info.setInformationId(UUID.randomUUID().toString());
employmentInfoService.addEmploymentInfo(info);
return CommonResult.generateSuccessResult(1, 1);
}
@ResponseBody
@RequestMapping("/employment/updateinfo")
public CommonResult<Integer> updateInfo(EmploymentInfo info){
employmentInfoService.updateEmploymentInfo(info);
return CommonResult.generateSuccessResult(1, 1);
}
@ResponseBody
@RequestMapping("/employment/delinfo/{infoId}")
public CommonResult<Integer> delInfo(@PathVariable("infoId") String infoId){
employmentInfoService.deleteEmploymentInfo(infoId);
return CommonResult.generateSuccessResult(1, 1);
}
}
package com.bjpowernode.employment.controller;
import com.bjpowernode.employment.mapper.entity.User;
import com.bjpowernode.employment.service.UserService;
import com.bjpowernode.employment.common.CommonResult;
import com.bjpowernode.employment.util.MD5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
import java.util.UUID;
@Controller
public class UserController {
@Autowired
UserService userService;
@RequestMapping("/employment/usermanage")
public String index(){
return "system/usermanage/usermanage";
}
@ResponseBody
@RequestMapping("/employment/getallusers")
public CommonResult<List<User>> getAllUsers(User user, @RequestParam("limit") int pageSize, @RequestParam("page") int pageNum){
List<User> result = userService.getAllUsers(user, pageNum, pageSize);
return CommonResult.generateSuccessResult(result.size(), result);
}
@ResponseBody
@RequestMapping("/employment/getuserbyaccount/{userAccount}")
public CommonResult<User> getUserByAccount(@PathVariable("userAccount") String userAccount){
return CommonResult.generateSuccessResult(1, userService.getUserByAccount(userAccount));
}
@ResponseBody
@RequestMapping("/employment/adduser")
public CommonResult<Integer> addUser(User user){
user.setUserId(UUID.randomUUID().toString());
user.setUserPwd(MD5Util.getMD5(user.getUserPwd()));
userService.addUser(user);
return CommonResult.generateSuccessResult(1, 1);
}
@ResponseBody
@RequestMapping("/employment/updateuser")
public CommonResult<Integer> updateUser(User user){
userService.updateUser(user);
return CommonResult.generateSuccessResult(1, 1);
}
@ResponseBody
@RequestMapping("/employment/deluser/{userId}")
public CommonResult<Integer> delInfo(@PathVariable("userId") String userId){
userService.deleteUser(userId);
return CommonResult.generateSuccessResult(1, 1);
}
}
package com.bjpowernode.employment.service.impl;
import com.github.pagehelper.PageHelper;
import com.bjpowernode.employment.mapper.UserMapper;
import com.bjpowernode.employment.mapper.entity.User;
import com.bjpowernode.employment.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class UserServiceImpl implements UserService {
@Autowired
UserMapper userMapper;
@Override
public List<User> getAllUsers(User user, int pageNum, int pageSize) {
PageHelper.startPage(pageNum, pageSize);
return userMapper.getAllUsers(user);
}
@Override
public User getUserById(String userId) {
return userMapper.getUserById(userId);
}
@Override
public User getUserByAccount(String userAccount) {
return userMapper.getUserByAccount(userAccount);
}
@Override
public void addUser(User user) {
userMapper.addUser(user);
}
@Override
public void updateUser(User user) {
userMapper.updateUser(user);
}
@Override
public void deleteUser(String userId) {
userMapper.deleteUser(userId);
}
}
源码获取:关注底部,口令020领取下载链接