You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tcZz-java/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcMtlxController.java

106 lines
3.2 KiB

2 years ago
package com.ruoyi.tcZz.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
2 years ago
import com.ruoyi.common.core.page.TableDataInfo;
2 years ago
import com.ruoyi.common.enums.BusinessType;
2 years ago
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.tcZz.domain.TcAqg;
2 years ago
import com.ruoyi.tcZz.domain.TcMtlx;
import com.ruoyi.tcZz.service.ITcMtlxService;
2 years ago
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
2 years ago
/**
* Controller
2 years ago
*
2 years ago
* @author ruoyi
* @date 2023-10-12
*/
@RestController
2 years ago
@Api(tags = "媒体类型")
2 years ago
@RequestMapping("/tcZz/netWorkYq/mtlx")
2 years ago
public class TcMtlxController extends BaseController {
2 years ago
@Autowired
private ITcMtlxService tcMtlxService;
/**
*
*/
2 years ago
@ApiOperation(value = "查询媒体类型列表", response = TcMtlx.class)
2 years ago
@GetMapping("/list")
2 years ago
public TableDataInfo list(TcMtlx tcMtlx) {
2 years ago
startPage();
List<TcMtlx> list = tcMtlxService.selectTcMtlxList(tcMtlx);
return getDataTable(list);
}
/**
*
*/
2 years ago
@ApiOperation(value = "导出媒体类型列表")
2 years ago
@PostMapping("/export")
2 years ago
public void export(HttpServletResponse response, TcMtlx tcMtlx) {
2 years ago
List<TcMtlx> list = tcMtlxService.selectTcMtlxList(tcMtlx);
ExcelUtil<TcMtlx> util = new ExcelUtil<TcMtlx>(TcMtlx.class);
util.exportExcel(response, list, "媒体类型数据");
}
/**
*
*/
2 years ago
@ApiOperation(value = "获取媒体类型详细信息")
2 years ago
@GetMapping(value = "/{id}")
2 years ago
public AjaxResult getInfo(@PathVariable("id") Long id) {
2 years ago
return success(tcMtlxService.selectTcMtlxById(id));
}
/**
*
*/
2 years ago
@ApiOperation(value = "新增媒体类型")
2 years ago
@PostMapping
2 years ago
public AjaxResult add(@RequestBody TcMtlx tcMtlx) {
2 years ago
return toAjax(tcMtlxService.insertTcMtlx(tcMtlx));
}
/**
*
*/
2 years ago
@ApiOperation(value = "修改媒体类型")
2 years ago
@PutMapping
2 years ago
public AjaxResult edit(@RequestBody TcMtlx tcMtlx) {
2 years ago
return toAjax(tcMtlxService.updateTcMtlx(tcMtlx));
}
/**
*
*/
2 years ago
@ApiOperation(value = "删除媒体类型")
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
2 years ago
return toAjax(tcMtlxService.deleteTcMtlxByIds(ids));
}
2 years ago
/**
*
*/
@ApiOperation("通用导入excel信息")
@PostMapping("/common/importExcel")
public AjaxResult importExcel(MultipartFile file) throws Exception {
ExcelUtil<TcMtlx> util = new ExcelUtil<TcMtlx>(TcMtlx.class);
List<TcMtlx> tcMtlxList = util.importExcel(file.getInputStream());
tcMtlxService.importUser(tcMtlxList);
return AjaxResult.success();
}
2 years ago
}