package com.tzld.piaoquan.api.controller.contentplatform;

import com.tzld.piaoquan.api.annotation.RequireSign;
import com.tzld.piaoquan.api.model.param.contentplatform.WxWebLoginParam;
import com.tzld.piaoquan.api.model.vo.contentplatform.WxBaseUserInfoVO;
import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformSettingService;
import com.tzld.piaoquan.growth.common.common.base.CommonResponse;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/contentPlatform/setting")
@CrossOrigin(origins = "*")
public class ContentPlatformSettingController {

    @Autowired
    ContentPlatformSettingService service;

    @ApiOperation(value = "票圈账号绑定")
    @PostMapping(value = "/webLogin")
    @RequireSign
    public CommonResponse<WxBaseUserInfoVO> wxLoginByWeb(@Validated WxWebLoginParam param) {
        return CommonResponse.success(service.wxLoginByWeb(param));
    }

    @ApiOperation(value = "获取票圈账户绑定信息")
    @GetMapping(value = "/getBindPQUserInfo")
    public CommonResponse<WxBaseUserInfoVO> getBindPQUserInfo() {
        return CommonResponse.success(service.getBindPQUserInfo());
    }
}
