package com.crunii.micro.service.sysmgr.controller;

import com.crunii.micro.common.dto.Result;
import com.crunii.micro.domain.dto.Worker;
import com.crunii.micro.service.sysmgr.service.ThemeService;
import com.crunii.micro.web.mvc.CurrWorker;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * @author wangchen create 2023/7/28 11:16
 */
@Api(tags = "主题管理")
@Slf4j
@RestController
@RequestMapping("/auth/ThemeController")
public class ThemeController {

    private final ThemeService themeService;

    public ThemeController(ThemeService themeService) {
        this.themeService = themeService;
    }

    @ApiOperation("更新主题")
    @GetMapping("/updateTheme")
    public Result<Integer> updateTheme(int sysTheme,@CurrWorker @ApiIgnore Worker worker){
       return Result.ofSuccess( themeService.updateTheme(sysTheme,worker));
    }
}
