| | |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.dto.SysVisitorConfigSaveRequest; |
| | | import com.ruoyi.system.service.ISysVisitorConfigService; |
| | | import com.ruoyi.system.vo.SysVisitorConfigVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/visitor/config") |
| | | @Api(tags = "访客系统配置接口") |
| | | public class SysVisitorConfigController extends BaseController |
| | | { |
| | | @Autowired |
| | |
| | | * 查询当前配置 |
| | | */ |
| | | @Log(title = "访客系统配置", businessType = BusinessType.SELECT) |
| | | @PreAuthorize("@ss.hasPermi('visitor:config:view')") |
| | | @PostMapping("/detail") |
| | | public AjaxResult detail() |
| | | @ApiOperation(value = "查询访客系统配置") |
| | | @ApiResponses({ |
| | | @ApiResponse( |
| | | code = 200, message = "查询成功", response = SysVisitorConfigVO.class, responseContainer = "Data" // 指定数据在 data 字段中 |
| | | ) |
| | | }) |
| | | public AjaxResult<SysVisitorConfigVO> detail() |
| | | { |
| | | return success(visitorConfigService.selectConfig()); |
| | | return AjaxResult.success(visitorConfigService.selectConfig()); |
| | | } |
| | | |
| | | /** |
| | | * 保存配置,支持全量或局部 JSON 更新 |
| | | */ |
| | | @Log(title = "访客系统配置", businessType = BusinessType.UPDATE) |
| | | @PreAuthorize("@ss.hasPermi('visitor:config:edit')") |
| | | @PostMapping("/save") |
| | | @ApiOperation( |
| | | value = "设置访客系统配置", |
| | | response = AjaxResult.class |
| | | ) |
| | | public AjaxResult save(@RequestBody SysVisitorConfigSaveRequest request) |
| | | { |
| | | return success(visitorConfigService.saveConfig(request, getUsername())); |
| | | visitorConfigService.saveConfig(request, getUsername()); |
| | | return success(); |
| | | } |
| | | } |