云
2 天以前 87733eb3623593da247c051593d64b8ff9e1d3a4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package cn.iocoder.yudao.module.system.controller.admin.appearance;
 
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.system.controller.admin.appearance.vo.SystemAppearanceRespVO;
import cn.iocoder.yudao.module.system.controller.admin.appearance.vo.SystemAppearanceSaveReqVO;
import cn.iocoder.yudao.module.system.service.appearance.SystemAppearanceService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.annotation.security.PermitAll;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
 
/**
 * 管理后台 - 系统外观(登录背景图、企业 Logo)
 *
 * @author 超级管理员
 */
@Tag(name = "管理后台 - 系统外观")
@RestController
@RequestMapping("/system/appearance")
@Validated
public class SystemAppearanceController {
 
    @Resource
    private SystemAppearanceService appearanceService;
 
    @GetMapping("/get")
    @Operation(summary = "获得系统外观")
    @PermitAll
    public CommonResult<SystemAppearanceRespVO> getAppearance() {
        return success(appearanceService.getAppearance());
    }
 
    @PostMapping("/save")
    @Operation(summary = "保存系统外观")
    @PreAuthorize("@ss.hasPermission('system:appearance:update')")
    public CommonResult<Boolean> saveAppearance(@Valid @RequestBody SystemAppearanceSaveReqVO reqVO) {
        appearanceService.saveAppearance(reqVO);
        return success(true);
    }
 
}