|  |  |  | 
|---|
|  |  |  | package com.ruoyi.other.controller; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 
|---|
|  |  |  | import com.ruoyi.common.core.domain.R; | 
|---|
|  |  |  | import com.ruoyi.common.core.web.controller.BaseController; | 
|---|
|  |  |  | import com.ruoyi.other.api.domain.PointSetting; | 
|---|
|  |  |  | import com.ruoyi.other.dto.PointSettingDto; | 
|---|
|  |  |  | import com.ruoyi.other.service.PointSettingService; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.GetMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestParam; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RestController; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.annotation.Resource; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * <p> | 
|---|
|  |  |  | 
|---|
|  |  |  | @Resource | 
|---|
|  |  |  | private PointSettingService pointSettingService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/getPointSetting") | 
|---|
|  |  |  | public R<PointSetting> getPointSetting(@RequestParam("id") Integer id) { | 
|---|
|  |  |  | PointSetting pointSetting = pointSettingService.getById(id); | 
|---|
|  |  |  | return R.ok(pointSetting); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @GetMapping("/getBaseSetting") | 
|---|
|  |  |  | public R<PointSetting> getBaseSetting(@RequestParam Integer id) { | 
|---|
|  |  |  | PointSetting pointSetting = pointSettingService.getById(id); | 
|---|
|  |  |  | return R.ok(pointSetting); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @GetMapping("/search") | 
|---|
|  |  |  | @ApiOperation(value = "积分配置查询", tags = {"后台"}) | 
|---|
|  |  |  | public R<List<PointSetting>> search() { | 
|---|
|  |  |  | List<PointSetting> list = pointSettingService.list(); | 
|---|
|  |  |  | return R.ok(list); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @PostMapping("/save") | 
|---|
|  |  |  | @ApiOperation(value = "积分配置", tags = {"后台"}) | 
|---|
|  |  |  | public R<PointSetting> save(@RequestBody PointSettingDto pointSettingDto) { | 
|---|
|  |  |  | pointSettingService.saveOrUpdateBatch(pointSettingDto.getPointSettings()); | 
|---|
|  |  |  | return R.ok(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|