package com.hc.gpweb.controller.front;

import com.hc.gpbusiness.service.WebNewsAttachmentService;
import com.hc.gpcore.utils.result.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 新闻附件表(NewsAttachment)表控制层
 *
 * @author makejava
 * @since 2024-01-20 11:48:47
 */

@RestController
@RequestMapping("/api/front/newsAttachment")
public class FrontNewsAttachmentController {

    /**
     * 服务对象
     */
    private final WebNewsAttachmentService newsAttachmentService;

    public FrontNewsAttachmentController(WebNewsAttachmentService newsAttachmentService) {
        this.newsAttachmentService = newsAttachmentService;
    }

    @GetMapping("/queryByNewsId")
    @ApiOperation(value = "根据newID获取他的附件", response = Result.class)
    public Result queryByNewsId(@RequestParam(defaultValue = "0") Integer newsId) {
        return Result.success(newsAttachmentService.queryByNewsId(newsId));
    }


}
