yxh
3 天以前 1603d54adf0063eb01549e2bfa9ba5860ca3d863
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
package com.ruoyi.web.controller.smartor;
 
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.smartor.domain.BaseTagcategory;
import com.smartor.service.IBaseTagcategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
 
import javax.servlet.http.HttpServletResponse;
import java.util.List;
 
/**
 * 标签分类Controller
 *
 * @author ruoyi
 * @date 2023-06-15
 */
@Api(description = "标签分类")
@Slf4j
@RestController
@RequestMapping("/system/tagcategory")
public class BaseTagcategoryController extends BaseController {
    @Autowired
    private IBaseTagcategoryService baseTagcategoryService;
 
    /**
     * 查询标签分类列表
     */
    //@PreAuthorize("@ss.hasPermi('system:tagcategory:list')")
    @PostMapping("/list")
    public TableDataInfo list(@RequestBody BaseTagcategory baseTagcategory) {
        startPage();
        List<BaseTagcategory> list = baseTagcategoryService.selectBaseTagcategoryList(baseTagcategory);
        return getDataTable(list);
    }
 
    /**
     * 导出标签分类列表
     */
    //@PreAuthorize("@ss.hasPermi('system:tagcategory:export')")
    @Log(title = "标签分类", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, BaseTagcategory baseTagcategory) {
        List<BaseTagcategory> list = baseTagcategoryService.selectBaseTagcategoryList(baseTagcategory);
        ExcelUtil<BaseTagcategory> util = new ExcelUtil<BaseTagcategory>(BaseTagcategory.class);
        util.exportExcel(response, list, "标签分类数据");
    }
 
    /**
     * 获取标签分类详细信息
     */
    //@PreAuthorize("@ss.hasPermi('system:tagcategory:query')")
    @GetMapping(value = "/{tagcategoryid}")
    public AjaxResult getInfo(@PathVariable("tagcategoryid") Long tagcategoryid) {
        return success(baseTagcategoryService.selectBaseTagcategoryByTagcategoryid(tagcategoryid));
    }
 
    /**
     * 新增标签分类
     */
    //@PreAuthorize("@ss.hasPermi('system:tagcategory:add')")
    @Log(title = "标签分类", businessType = BusinessType.INSERT)
    @ApiOperation("新增标签分类")
    @PostMapping("/add")
    public AjaxResult add(@RequestBody BaseTagcategory baseTagcategory) {
        SysUser user = getLoginUser().getUser();
        baseTagcategory.setGuid(user.getGuid());
        return toAjax(baseTagcategoryService.insertBaseTagcategory(baseTagcategory));
    }
 
    /**
     * 修改标签分类
     */
    //@PreAuthorize("@ss.hasPermi('system:tagcategory:edit')")
    @Log(title = "标签分类", businessType = BusinessType.UPDATE)
    @ApiOperation("修改标签分类")
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody BaseTagcategory baseTagcategory) {
        return toAjax(baseTagcategoryService.updateBaseTagcategory(baseTagcategory));
    }
 
    /**
     * 根据分类ID删除标签分类
     */
    //@PreAuthorize("@ss.hasPermi('system:tagcategory:remove')")
    @Log(title = "标签分类", businessType = BusinessType.DELETE)
    @ApiOperation("根据分类ID删除标签分类")
    @GetMapping("/remove/{tagcategoryids}")
    public AjaxResult remove(@PathVariable Long[] tagcategoryids) {
        return toAjax(baseTagcategoryService.deleteBaseTagcategoryByTagcategoryids(tagcategoryids));
    }
 
    /**
     * 根据标签类别名获取标签分类信息
     */
    @ApiOperation("根据标签类别名获取标签分类信息(标签分类)")
    @PostMapping("/baseTagCategoryByName")
    public TableDataInfo baseTagCategoryByName(@RequestParam("name") String name) {
        return getDataTable(baseTagcategoryService.baseTagCategoryByName(name));
    }
 
 
}