package com.ruoyi.web.app;

import com.ruoyi.bst.ad.domain.AdQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ruoyi.bst.ad.service.AdService;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;

import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/app/ad")
public class AppAdController extends BaseController {

    @Autowired
    private AdService adService;

    @ApiOperation("获取广告")
    @GetMapping
    @Anonymous
    public AjaxResult getAd(AdQuery query) {
        query.setUserId(getUserId());
        return success(adService.toAppVOList(query));
    }

}
