package com.stylefeng.guns.modular.api;
|
|
import com.stylefeng.guns.modular.system.service.IAdvertisementService;
|
import com.stylefeng.guns.modular.system.util.ResultUtil;
|
import com.stylefeng.guns.modular.system.warpper.AdvertisementWarpper;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import java.util.List;
|
|
/**
|
* 广告控制器
|
*/
|
@Api
|
@RestController
|
@RequestMapping("/base/advertisement")
|
public class AdvertisementController {
|
|
@Autowired
|
private IAdvertisementService advertisementService;
|
|
|
|
@ResponseBody
|
@PostMapping("/queryByType")
|
@ApiOperation(value = "1.0-获取广告列表", tags = {"用户端-首页"}, notes = "")
|
@ApiImplicitParams({
|
@ApiImplicitParam(value = "数据类型(1=弹窗,2=首页底部,3=订单结束弹窗)", name = "type", required = true, dataType = "int"),
|
@ApiImplicitParam(value = "当前定位城市code(510100)", name = "code", required = true, dataType = "string")
|
})
|
public ResultUtil<List<AdvertisementWarpper>> queryAdvertisement(String code, Integer type){
|
try {
|
System.out.println("code:"+code);
|
List<AdvertisementWarpper> advertisementWarpper = advertisementService.queryAdvertisement(code, type);
|
return ResultUtil.success(advertisementWarpper);
|
}catch (Exception e){
|
e.printStackTrace();
|
return ResultUtil.runErr();
|
}
|
}
|
|
}
|