| package com.mzl.flower.web.payment; | 
|   | 
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
| import com.mzl.flower.base.BaseController; | 
| import com.mzl.flower.base.R; | 
| import com.mzl.flower.base.ReturnDataDTO; | 
| import com.mzl.flower.dto.request.payment.FeeServiceCreateDTO; | 
| import com.mzl.flower.dto.request.payment.FeeServiceUpdateDTO; | 
| import com.mzl.flower.dto.response.payment.FeeServiceDTO; | 
| import com.mzl.flower.service.payment.FeeServiceService; | 
| import io.swagger.annotations.Api; | 
| import io.swagger.annotations.ApiImplicitParam; | 
| import io.swagger.annotations.ApiImplicitParams; | 
| import io.swagger.annotations.ApiOperation; | 
| import lombok.extern.slf4j.Slf4j; | 
| import org.springframework.beans.factory.annotation.Autowired; | 
| import org.springframework.http.ResponseEntity; | 
| import org.springframework.validation.annotation.Validated; | 
| import org.springframework.web.bind.annotation.*; | 
|   | 
| @RestController | 
| @RequestMapping("/api/fee/config") | 
| @Api(value = "平台服务费配置", tags = "平台服务费配置") | 
| @Validated | 
| @Slf4j | 
| public class FeeServiceController extends BaseController { | 
|   | 
|     @Autowired | 
|     private FeeServiceService feeServiceService; | 
|   | 
|     @PostMapping("/list/new") | 
|     @ApiOperation(value = "新增服务费") | 
|     public ResponseEntity<ReturnDataDTO> addConfig(@RequestBody FeeServiceCreateDTO dto) { | 
|         Long id = feeServiceService.addConfig(dto); | 
|         return returnData(R.SUCCESS.getCode(), id); | 
|     } | 
|   | 
|     @PostMapping("/list/edit") | 
|     @ApiOperation(value = "编辑服务费") | 
|     public ResponseEntity<ReturnDataDTO> updateConfig(@RequestBody FeeServiceUpdateDTO dto) { | 
|         Long id = feeServiceService.updateConfig(dto); | 
|         return returnData(R.SUCCESS.getCode(), id); | 
|     } | 
|   | 
|     @GetMapping("/list/view") | 
|     @ApiOperation(value = "查询服务费详情") | 
|     @ApiImplicitParams({ | 
|             @ApiImplicitParam(name = "id", value = "服务费id", required = true, dataType = "Long", paramType = "query") | 
|     }) | 
|     public ResponseEntity<ReturnDataDTO<FeeServiceDTO>> getConfig(Long id){ | 
|         return returnData(R.SUCCESS.getCode(), feeServiceService.getConfig(id)); | 
|     } | 
|      | 
|     @GetMapping("/list") | 
|     @ApiOperation(value = "获取服务费列表") | 
|     public ResponseEntity<ReturnDataDTO<Page<FeeServiceDTO>>> selectConfigList(){ | 
|         return returnData(R.SUCCESS.getCode(), feeServiceService.selectConfigList()); | 
|     } | 
|   | 
|     @GetMapping("/list/delete") | 
|     @ApiOperation(value = "删除服务费") | 
|     @ApiImplicitParams({ | 
|             @ApiImplicitParam(name = "id", value = "服务费id", required = true, dataType = "String", paramType = "query") | 
|     }) | 
|     public ResponseEntity<ReturnDataDTO<?>> deleteConfig(Long id){ | 
|         feeServiceService.deleteConfig(id); | 
|         return returnData(R.SUCCESS.getCode(), null); | 
|     } | 
|   | 
| } |