package com.ruoyi.web.controller.smartor;
|
|
import java.util.List;
|
import javax.servlet.http.HttpServletResponse;
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
import com.smartor.domain.HeLibraryTag;
|
import com.smartor.service.IHeLibraryTagService;
|
import io.swagger.annotations.Api;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PutMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
/**
|
* 指标标签Controller
|
*
|
* @author ruoyi
|
* @date 2023-12-24
|
*/
|
@Api(description = "指标标签")
|
@RestController
|
@RequestMapping("/smartor/heLibraryTag")
|
public class HeLibraryTagController extends BaseController {
|
@Autowired
|
private IHeLibraryTagService heLibraryTagService;
|
|
/**
|
* 查询指标标签列表
|
*/
|
//@PreAuthorize("@ss.hasPermi('system:tag:list')")
|
@GetMapping("/list")
|
public TableDataInfo list(HeLibraryTag heLibraryTag) {
|
startPage();
|
List<HeLibraryTag> list = heLibraryTagService.selectHeLibraryTagList(heLibraryTag);
|
return getDataTable(list);
|
}
|
|
/**
|
* 导出指标标签列表
|
*/
|
//@PreAuthorize("@ss.hasPermi('system:tag:export')")
|
@Log(title = "指标标签", businessType = BusinessType.EXPORT)
|
@PostMapping("/export")
|
public void export(HttpServletResponse response, HeLibraryTag heLibraryTag) {
|
List<HeLibraryTag> list = heLibraryTagService.selectHeLibraryTagList(heLibraryTag);
|
ExcelUtil<HeLibraryTag> util = new ExcelUtil<HeLibraryTag>(HeLibraryTag.class);
|
util.exportExcel(response, list, "指标标签数据");
|
}
|
|
/**
|
* 获取指标标签详细信息
|
*/
|
//@PreAuthorize("@ss.hasPermi('system:tag:query')")
|
@GetMapping(value = "/{id}")
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
return success(heLibraryTagService.selectHeLibraryTagById(id));
|
}
|
|
/**
|
* 新增指标标签
|
*/
|
//@PreAuthorize("@ss.hasPermi('system:tag:add')")
|
@Log(title = "指标标签", businessType = BusinessType.INSERT)
|
@PostMapping
|
public AjaxResult add(@RequestBody HeLibraryTag heLibraryTag) {
|
SysUser user = getLoginUser().getUser();
|
heLibraryTag.setOrgid(user.getOrgid());
|
return toAjax(heLibraryTagService.insertHeLibraryTag(heLibraryTag));
|
}
|
|
/**
|
* 修改指标标签
|
*/
|
//@PreAuthorize("@ss.hasPermi('system:tag:edit')")
|
@Log(title = "指标标签", businessType = BusinessType.UPDATE)
|
@PutMapping
|
public AjaxResult edit(@RequestBody HeLibraryTag heLibraryTag) {
|
return toAjax(heLibraryTagService.updateHeLibraryTag(heLibraryTag));
|
}
|
|
/**
|
* 删除指标标签
|
*/
|
//@PreAuthorize("@ss.hasPermi('system:tag:remove')")
|
@Log(title = "指标标签", businessType = BusinessType.DELETE)
|
@DeleteMapping("/{ids}")
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
return toAjax(heLibraryTagService.deleteHeLibraryTagByIds(ids));
|
}
|
}
|