package com.iformall.controller;

import com.iformall.common.ResultData;
import com.iformall.domain.po.WxTopic;
import com.iformall.service.WxTopicService;
import io.swagger.annotations.Api;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/api/topic")
@Api(description = "专题相关接口")
public class WxTopicController extends BaseController {
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
    @Autowired
    private WxTopicService wxTopicService;

    @GetMapping("show")
    public ResultData show() {
        logger.debug("[" + getIpAddr() + "] WxTopicController::show");
        WxTopic wxTopic = new WxTopic();
        String tenantId = getTenantId();
        wxTopic.setTenantId(tenantId);
        return new ResultData(wxTopicService.show(wxTopic));
    }

    @GetMapping("findById")
    public ResultData findById(WxTopic wxTopic) {
        logger.debug("[" + getIpAddr() + "] WxTopicController::findById");
        String tenantId = getTenantId();
        wxTopic.setTenantId(tenantId);
        WxTopic queryTopic = wxTopicService.findById(wxTopic);
        return new ResultData(queryTopic);
    }
}
