package com.njcn.product.system.theme.controller;


import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.constant.OperateType;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;

import com.njcn.product.system.theme.pojo.po.Theme;
import com.njcn.product.system.theme.service.IThemeService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hongawen
 * @since 2021-12-13
 */
@Validated
@Slf4j
@RestController
@RequestMapping("/theme")
@Api(tags = "主题管理")
@AllArgsConstructor
public class ThemeController extends BaseController {

    private final IThemeService themeService;



    @OperateInfo(info = LogEnum.SYSTEM_COMMON)
    @GetMapping("/getTheme")
    @ApiOperation("当前主题")
    public HttpResult<Theme> getTheme(){
        String methodDescribe = getMethodDescribe("getTheme");
        Theme theme = themeService.getTheme();
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,theme,methodDescribe);
    }


}

