Pu Zhibing
2025-03-17 b68ac80de1daf22142886af16d36479259106065
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
package com.ruoyi.system.controller;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.system.api.model.Enterprise;
import com.ruoyi.system.api.query.GetEnterpriseListReq;
import com.ruoyi.system.service.IEnterpriseService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
 
/**
 * @author zhibing.pu
 * @Date 2025/3/6 11:01
 */
@RestController
@RequestMapping("/enterprise")
public class EnterpriseController {
    
    @Resource
    private IEnterpriseService enterpriseService;
    
    
    /**
     * 获取企业
     *
     * @param username
     * @return
     */
    @PostMapping("/getEnterprise")
    public R<Enterprise> getEnterprise(@RequestParam("username") String username) {
        Enterprise username1 = enterpriseService.getOne(new QueryWrapper<Enterprise>().eq("username", username));
        return R.ok(username1);
    }
    
    
    @GetMapping("/getEnterpriseList")
    @ApiOperation(value = "获取公司列表数据", tags = {"公司管理"})
    public R<PageInfo<Enterprise>> getEnterpriseList(GetEnterpriseListReq req) {
        PageInfo<Enterprise> enterpriseList = enterpriseService.getEnterpriseList(req);
        return R.ok(enterpriseList);
    }
    
    
    @GetMapping("/getEnterpriseInfo/{id}")
    @ApiOperation(value = "获取公司详情", tags = {"公司管理"})
    public R<Enterprise> getEnterpriseInfo(@PathVariable("id") Integer id) {
        Enterprise enterprise = enterpriseService.getById(id);
        return R.ok(enterprise);
    }
}