Files
yjearth/src/main/java/com/yj/earth/business/controller/BusinessConfigController.java
2025-09-26 13:46:54 +08:00

37 lines
1.3 KiB
Java

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));
}
}