package org.jeecg.modules.adweb.site.controller;


import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.adweb.site.dto.WordPressConfig;
import org.springframework.beans.factory.annotation.Autowired;
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 org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.adweb.site.entity.AdwebSite;
import org.jeecg.modules.adweb.site.service.IAdwebSiteService;

/**
 * @Description: adweb_site
 * @Author: jeecg-boot
 * @Date: 2020-12-24
 * @Version: V1.0
 */
@Tag(name="adweb站点配置表单")
@RestController
@RequestMapping("/adweb/adwebSiteManage")
@Slf4j
public class AdwebSiteManageController extends JeecgController<AdwebSite, IAdwebSiteService> {

    @Autowired
    private IAdwebSiteService adwebSiteManageService;


    /**
     * 查询wordpress站点配置
     * @param wordPressConfig
     * @return
     */
    @PostMapping(value = "/queryWordPressConfig")
    public Result<?> queryWordPressConfig(@RequestBody WordPressConfig wordPressConfig) {
        WordPressConfig config = this.adwebSiteManageService.queryWordPressConfig(wordPressConfig.getSiteCode());
        return Result.OK(config);
    }
}
