package com.sonic.frog.controller.web;

import com.sonic.common.auth.domains.Session;
import com.sonic.common.rpc.Result;
import com.sonic.frog.domain.output.ExploreInfoOutput;
import com.sonic.frog.service.ExploreService;
import com.sonic.sdk.api.annotation.IgnoreAuth;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * Web-发现
 * @author code
 */
@Slf4j
@Validated
@RestController
public class ExploreWeb {

    @Autowired
    private ExploreService exploreService;

    @IgnoreAuth
    @ApiOperation(value = "发现", tags = {"Web-发现"})
    @PostMapping("/web/explore/info")
    public Result<ExploreInfoOutput> exploreInfo(@ApiParam(hidden = true) Session session, @ApiParam(hidden = true) HttpServletRequest request) {
        return Result.success(exploreService.exploreInfo(session.getUserId()));
    }

}
