package org.jeecg.modules.api.cheeroncontroller;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.apiservice.LoginApiService;
import org.jeecg.modules.bean.LoginReq;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags="加油小程序-登录相关接口")
@RestController
@RequestMapping("/cheer/login")
@Slf4j
public class CheerLoginApiController {

    //授权登录
    @Resource
    private LoginApiService loginApiService;


    //小程序授权登录
    @ApiOperation(value="小程序-登录接口", notes="小程序-登录接口")
    @GetMapping("/login")
    public Result<?> login(LoginReq loginReq){
        return loginApiService.login(loginReq);
    }


    //获取用户协议
    @ApiOperation(value="小程序-获取用户协议", notes="小程序-获取用户协议")
    @GetMapping("/getUserAgreement")
    public Result<?> getUserAgreement(){
        return loginApiService.getUserAgreement();
    }


    //获取隐私政策
    @ApiOperation(value="小程序-获取隐私政策", notes="小程序-获取隐私政策")
    @GetMapping("/getPrivacyPolicy")
    public Result<?> getPrivacyPolicy(){
        return loginApiService.getPrivacyPolicy();
    }

}
