无关风月
2025-01-22 99367ea1c11a68b420936e7f7db5fa7367da4f44
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
package com.xinquan.system.controller;
 
 
import com.xinquan.common.core.domain.R;
import com.xinquan.common.log.annotation.Log;
import com.xinquan.common.log.enums.BusinessType;
import com.xinquan.system.api.domain.vo.UpdateTreeGroupVO;
import com.xinquan.system.api.domain.TreeLevelSetting;
import com.xinquan.system.service.TreeLevelSettingService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
 
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
import java.util.List;
 
/**
 * <p>
 * 树苗音频表 前端控制器
 * </p>
 *
 * @author mitao
 * @since 2024-08-21
 */
@RestController
@RequestMapping("/system/tree-level-setting")
public class TreeLevelSettingController {
    @Resource
    private TreeLevelSettingService treeLevelSettingService;
    @PostMapping("/updateTreeGroup")
    @ApiOperation(value = "修改树苗等级音频",tags = "管理后台-树苗音频设置")
    @Log(title = "【树苗音频设置】修改", businessType = BusinessType.UPDATE)
 
    public R updateTreeGroup(@RequestBody UpdateTreeGroupVO vo) {
        TreeLevelSetting one = treeLevelSettingService.lambdaQuery()
                .eq(TreeLevelSetting::getTreeLevelType, vo.getTreeLevelType()).one();
        one.setGrowUpMusic(vo.getGrow_up_music());
        treeLevelSettingService.updateById(one);
        return R.ok();
    }
    @PostMapping("/getTreeGroup")
    @ApiOperation(value = "获取树苗音频等级列表",tags = "管理后台-树苗音频设置")
    public R<List<TreeLevelSetting>> getTreeGroup() {
        List<TreeLevelSetting> list = treeLevelSettingService.lambdaQuery().
        orderByAsc(TreeLevelSetting::getTreeLevelType).list();
        return R.ok(list);
    }
}