package com.yj.earth.business.controller; import com.yj.earth.annotation.CheckAuth; import com.yj.earth.business.domain.BusinessConfig; import com.yj.earth.business.service.BusinessConfigService; import com.yj.earth.common.util.ApiResponse; import com.yj.earth.dto.businessConfig.AddBusinessConfigDto; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.BeanUtils; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @Tag(name = "业务配置管理") @CheckAuth @RestController @RequestMapping("/businessConfig") public class BusinessConfigController { @Resource private BusinessConfigService businessConfigService; @Operation(summary = "业务配置列表") @GetMapping("/list") public ApiResponse list() { return ApiResponse.success(businessConfigService.list()); } @PostMapping("/addBusinessConfig") @Operation(summary = "新增业务配置") public ApiResponse addBusinessConfig(@RequestBody AddBusinessConfigDto addBusinessConfigDto) { BusinessConfig businessConfig = new BusinessConfig(); BeanUtils.copyProperties(addBusinessConfigDto, businessConfig); return ApiResponse.success(businessConfigService.save(businessConfig)); } }