liujie
2025-12-12 9a063585a64af45e83c3dde35a01ff45f194fd76
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package com.ruoyi.web.controller.api;
 
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.BasePage;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.model.TBanner;
import com.ruoyi.system.model.TEmploymentEntrepreneurship;
import com.ruoyi.system.model.TEmploymentInfo;
import com.ruoyi.system.service.TEmploymentEntrepreneurshipService;
import com.ruoyi.system.service.TEmploymentInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
@Slf4j
@RestController
@RequestMapping("/employment")
@Api(tags = "新就业模块")
public class EmploymentController {
 
    private final TEmploymentInfoService employmentInfoService;
    private final TEmploymentEntrepreneurshipService employmentEntrepreneurshipService;
 
    public EmploymentController(TEmploymentInfoService employmentInfoService, TEmploymentEntrepreneurshipService employmentEntrepreneurshipService) {
        this.employmentInfoService = employmentInfoService;
        this.employmentEntrepreneurshipService = employmentEntrepreneurshipService;
    }
 
 
    @PostMapping("/getEmploymentInfoList")
    @ApiOperation(value = "新就业模块--新就业信息列表",response =  TEmploymentInfo.class)
    public R<Page<TEmploymentInfo>> getEmploymentInfoList(@RequestBody BasePage basePage) {
        Page<TEmploymentInfo> page = new Page<>(basePage.getPageNum(), basePage.getPageSize());
        Page<TEmploymentInfo> pageEmploymentInfo = employmentInfoService.page(page, Wrappers.<TEmploymentInfo>lambdaQuery().orderByDesc(TEmploymentInfo::getCreateTime));
        return R.ok(pageEmploymentInfo);
    }
 
 
    @PostMapping("/getEmploymentInfoDetail/{id}")
    @ApiOperation(value = "新就业模块--新就业信息详情",response =  TEmploymentInfo.class)
    public R<TEmploymentInfo> getEmploymentInfoDetail(@PathVariable String id) {
        TEmploymentInfo employmentInfo = employmentInfoService.getById(id);
        employmentInfo.setReadCount(employmentInfo.getReadCount() + 1);
        employmentInfoService.updateById(employmentInfo);
        return R.ok(employmentInfo);
    }
 
 
    @PostMapping("/getEntrepreneurshipList")
    @ApiOperation(value = "创业模块--创业信息列表",response =  TEmploymentEntrepreneurship.class)
    public R<Page<TEmploymentEntrepreneurship>> getEntrepreneurshipList(@RequestBody BasePage basePage) {
        Page<TEmploymentEntrepreneurship> page = new Page<>(basePage.getPageNum(), basePage.getPageSize());
        Page<TEmploymentEntrepreneurship> tEmploymentEntrepreneurshipPage = employmentEntrepreneurshipService.page(page, Wrappers.<TEmploymentEntrepreneurship>lambdaQuery().orderByDesc(TEmploymentEntrepreneurship::getCreateTime));
        return R.ok(tEmploymentEntrepreneurshipPage);
    }
 
 
    @PostMapping("/getEntrepreneurshipDetail/{id}")
    @ApiOperation(value = "创业模块--创业信息详情",response =  TEmploymentEntrepreneurship.class)
    public R<TEmploymentEntrepreneurship> getEntrepreneurshipDetail(@PathVariable String id) {
        TEmploymentEntrepreneurship employmentEntrepreneurship = employmentEntrepreneurshipService.getById(id);
        employmentEntrepreneurship.setReadCount(employmentEntrepreneurship.getReadCount() + 1);
        employmentEntrepreneurshipService.updateById(employmentEntrepreneurship);
        return R.ok(employmentEntrepreneurship);
    }
 
}