package com.template.controller;


import com.template.annotation.DESRespondSecret;
import com.template.annotation.PassToken;
import com.template.api.SmartNewsControllerAPI;
import com.template.model.pojo.SmartNews;
import com.template.model.result.CommonResult;
import com.template.services.SmartNewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ceshi
 * @since 2024-06-12
 */
@RestController
@DESRespondSecret
public class SmartNewsController implements SmartNewsControllerAPI {

    @Autowired
    SmartNewsService smartNewsService;

    @Override
    @DESRespondSecret(validated = true)
    @PassToken
    public CommonResult newsList() {
        List<SmartNews> smartNews=smartNewsService.newsList();

        return CommonResult.ok(smartNews);
    }
}

