package com.fs.app.controller;


import com.fs.his.param.FsAdvUParam;
import com.fs.app.utils.JwtUtils;
import com.fs.common.core.domain.R;
import com.fs.his.domain.FsAdv;
import com.fs.his.service.IFsAdvService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
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;


@Api("广告位接口")
@RestController
@RequestMapping(value="/app/adv")
public class AdvController {
	@Autowired
    JwtUtils jwtUtils;
	@Autowired
	private IFsAdvService advService;

	@Cacheable(value="getAdvList", key="#map")
	@ApiOperation("获取首页广告位")
	@GetMapping("/getAdvList")
	public R getAdvList(FsAdvUParam map){
		List<FsAdv> list=advService.selectFsAdvListUVO(map);
		return R.ok().put("data",list);
	}

	@Cacheable(value = "getAppAdvList" )
	@ApiOperation("获取App首页中部广告位")
	@GetMapping("/getAppAdvList")
	public R getAppAdvList(){
		List<FsAdv> list=advService.selectFsAppAdvList();
		return R.ok().put("data",list);
	}


}
