package com.iformall.controller;

import com.iformall.annotation.AuthIgnore;
import com.iformall.common.Result;
import com.iformall.common.ResultData;
import com.iformall.domain.po.WxFloatingLayer;
import com.iformall.service.WxCuserFloatingLayerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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;

/**
 * @author gongbiao
 */
@RestController
@RequestMapping("/api/floatingLayer")
@Api(description = "首页浮层")
public class WxCuserFloatingLayerController extends BaseController {
    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    WxCuserFloatingLayerService wxCuserFloatingLayerService;

    @AuthIgnore
    @ApiOperation("获取浮层")
    @GetMapping("/getFloatingLayer")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "openId", value = "openId", dataType = "String", paramType = "query", required = true),
            @ApiImplicitParam(name = "appId", value = "appId", dataType = "String", paramType = "query", required = true)})
    public ResultData getAppIcon(String openId, String appId) {
        WxFloatingLayer wxFloatingLayer = wxCuserFloatingLayerService.getFloatingLayer(openId, appId);
        return new ResultData(Result.SUCCESS, "查询成功", wxFloatingLayer);
    }


}
