package com.ruoyi.web.controller.weChat;

import com.ruoyi.weChat.service.WeChatService;
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;

@RestController
@RequestMapping("/system/weChat")
public class WeChatController {

    @Autowired
    private WeChatService weChatService;


    /**
     * 获取accessToken
     * @return
     */
    @GetMapping("/getAccessToken")
    public String getAccessToken() {
        return weChatService.getAccessToken();
    }

    /**
     * 获取openId
     * @return
     */
    @GetMapping("/getOpenId")
    public String getOpenId(String code) {
        return weChatService.getOpenId(code);
    }




}
