package com.xindazhou.business.controller.app.community.topic;

import com.xindazhou.business.controller.admin.community.topic.vo.TopicRespVO;
import com.xindazhou.business.service.community.topic.TopicService;
import com.xindazhou.framework.common.pojo.CommonResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static com.xindazhou.framework.common.pojo.CommonResult.success;

/**
 * 移动端 - 话题 Controller
 *
 * @author xindazhou
 */
@Tag(name = "移动端 - 话题管理")
@RestController("appCommunityTopicController")
@RequestMapping("/app/community/topic")
@Validated
@Slf4j
public class TopicController {

    @Resource
    private TopicService topicService;

    @GetMapping("/listEnabled")
    @Operation(summary = "获得启用的话题列表")
    public CommonResult<List<TopicRespVO>> getEnabledTopicList() {
        List<TopicRespVO> topics = topicService.getEnabledTopicList();
        return success(topics);
    }

}

