package com.hollywood.manage.controller;
|
|
|
import com.hollywood.common.basic.ApiResult;
|
import com.hollywood.common.basic.PageInfo;
|
import com.hollywood.common.model.TCompany;
|
import com.hollywood.common.model.TCompanyNeed;
|
import com.hollywood.manage.dto.TCompanyDTO;
|
import com.hollywood.manage.dto.TCompanyNeedDTO;
|
import com.hollywood.manage.query.TCompanyNeedQuery;
|
import com.hollywood.manage.query.TCompanyQuery;
|
import com.hollywood.manage.service.TCompanyNeedService;
|
import com.hollywood.manage.vo.TCompanyNeedVO;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
/**
|
* <p>
|
* 供需管理 前端控制器
|
* </p>
|
*
|
* @author xiaochen
|
* @since 2024-04-23
|
*/
|
@Api(tags = "供需管理")
|
@RestController
|
@RequestMapping("/t-company-need")
|
public class TCompanyNeedController {
|
|
private final TCompanyNeedService companyNeedService;
|
|
@Autowired
|
public TCompanyNeedController(TCompanyNeedService companyNeedService) {
|
this.companyNeedService = companyNeedService;
|
}
|
|
/**
|
* 获取供需管理列表
|
*/
|
@ApiOperation(value = "获取供需管理分页列表")
|
@PostMapping(value = "/pageList")
|
public ApiResult<PageInfo<TCompanyNeedVO>> pageList(@RequestBody TCompanyNeedQuery query) {
|
return ApiResult.success(companyNeedService.pageList(query));
|
}
|
|
/**
|
* 添加供需管理
|
*/
|
@ApiOperation(value = "添加供需管理")
|
@PostMapping(value = "/add")
|
public ApiResult add(@RequestBody TCompanyNeedDTO dto) {
|
return ApiResult.success(companyNeedService.save(dto));
|
}
|
|
/**
|
* 修改供需管理
|
*/
|
@ApiOperation(value = "修改供需管理")
|
@PostMapping(value = "/updateById")
|
public ApiResult updateById(@RequestBody TCompanyNeedDTO dto) {
|
return ApiResult.success(companyNeedService.updateById(dto));
|
}
|
|
/**
|
* 查看供需管理详情
|
*/
|
@ApiOperation(value = "查看供需管理详情")
|
@GetMapping(value = "/getDetailById")
|
public ApiResult<TCompanyNeed> getDetailById(@RequestParam Long id) {
|
return ApiResult.success(companyNeedService.getById(id));
|
}
|
|
/**
|
* 删除供需管理
|
*/
|
@ApiOperation(value = "删除供需管理")
|
@GetMapping(value = "/deleteById")
|
public ApiResult deleteById(@RequestParam Long id) {
|
return ApiResult.success(companyNeedService.removeById(id));
|
}
|
|
/**
|
* 供需管理上下架
|
*/
|
@ApiOperation(value = "供需管理上下架")
|
@GetMapping(value = "/upAndDown")
|
public ApiResult upAndDown(@RequestParam Long id,
|
@RequestParam Integer status) {
|
return ApiResult.success(companyNeedService.upAndDown(id,status));
|
}
|
|
}
|