首页>代码>springboot+mybatis+layui实现的简单就业信息管理系统>/employment-manage/src/main/java/com/javaer/employmentmanage/controller/EmploymentInfoController.java
package com.javaer.employmentmanage.controller;

import com.javaer.employmentmanage.common.CommonResult;
import com.javaer.employmentmanage.mapper.entity.EmploymentInfo;
import com.javaer.employmentmanage.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({"/employmentmanage/index", "/employmentmanage/employmentinfo"})
    public String index(){
        return "system/employmentinfo/employmentinfo";
    }

    @ResponseBody
    @RequestMapping("/employmentmanage/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("/employmentmanage/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("/employmentmanage/addinfo")
    public CommonResult<Integer> addInfo(EmploymentInfo info){
        info.setInformationId(UUID.randomUUID().toString());
        employmentInfoService.addEmploymentInfo(info);
        return CommonResult.generateSuccessResult(1, 1);
    }

    @ResponseBody
    @RequestMapping("/employmentmanage/updateinfo")
    public CommonResult<Integer> updateInfo(EmploymentInfo info){
        employmentInfoService.updateEmploymentInfo(info);
        return CommonResult.generateSuccessResult(1, 1);
    }

    @ResponseBody
    @RequestMapping("/employmentmanage/delinfo/{infoId}")
    public CommonResult<Integer> delInfo(@PathVariable("infoId") String infoId){
        employmentInfoService.deleteEmploymentInfo(infoId);
        return CommonResult.generateSuccessResult(1, 1);
    }
}
最近下载更多
krispeng  LV15 6月15日
haomc052829  LV4 2024年11月18日
daisys  LV2 2024年7月2日
计科一班  LV7 2024年6月19日
chenranr  LV10 2024年6月4日
叉烧君  LV3 2024年5月21日
zhijidong  LV4 2024年1月15日
admin_z  LV22 2023年12月27日
709885402  LV4 2023年8月31日
最近浏览更多
krispeng  LV15 6月15日
暂无贡献等级
shuaiqi 4月22日
暂无贡献等级
mike12s 3月28日
暂无贡献等级
叶云浩  LV2 3月1日
哪里的完整版  LV8 2月26日
暂无贡献等级
短巷拥猫  LV12 2024年12月16日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友