package com.boman.wechat.controller;

import com.boman.domain.dto.AjaxResult;
import com.boman.domain.form.LoginBody;
import com.boman.wechat.service.WechatService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 微信登录验证
 *
 * @author zhong.h
 */
@RequestMapping("/wechat/p/c")
@RestController
public class WechatInfoController {

    @Autowired
    private WechatService wechatService;

    @ApiOperation(value = "小程序相关信息获取")
    @RequestMapping(value = "/wechatInfo", method = RequestMethod.POST)
    public AjaxResult getWechatInfo(@RequestBody LoginBody loginBody) {
        return wechatService.getWechatInfo(loginBody);
    }

    @ApiOperation(value = "小程序模板id获取")
    @GetMapping("/tmpIds")
    public AjaxResult getTmpIds() {
        return wechatService.getTmpIds();
    }
}