package com.zhongshu.card.server.core.controller;

import com.github.microservice.net.ResultContent;
import com.zhongshu.card.client.model.operLogs.OperationLogsAddParam;
import com.zhongshu.card.client.model.org.OrganizationUserModel;
import com.zhongshu.card.client.model.wechat.UnlimitedQRCodeParam;
import com.zhongshu.card.server.core.service.wxQRCode.WeChatService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("wechat")
@Tag(name = "微信小程序服务")
public class WeChatController {

    @Autowired
    WeChatService weChatService;


    @Operation(summary = "获取小程序二维码", description = "获取小程序二维码")
    @RequestMapping(value = "unlimitedQRCode", method = {RequestMethod.POST})
    public void unlimitedQRCode(@RequestBody UnlimitedQRCodeParam param, HttpServletResponse response) {
        weChatService.UnlimitedQRCode(param, response);
    }

    @Operation(summary = "获取小程序二维码scene", description = "获取小程序二维码")
    @RequestMapping(value = "getScene", method = {RequestMethod.GET})
    public ResultContent getScene(@RequestParam("sceneId") String sceneId){
        return weChatService.getScene(sceneId);
    }
}
