package com.ruoyi.applet.contoller;

import com.ruoyi.applet.pojo.dto.ApiAppletLoginDTO;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.model.service.IAApiAppletLoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(description = "伴宠师-登录流程")
@RestController
@RequestMapping("/applet/login")
public class ApiAppletLoginController {

    //伴宠师-登录相关问题
    @Autowired
    private IAApiAppletLoginService apiAppletLoginService;


    //伴宠师-微信授权登录
    @ApiOperation("伴宠师-微信授权登录")
    @PostMapping("/wechatLogin")
    public AjaxResult wechatLogin(@RequestBody ApiAppletLoginDTO params){
        return apiAppletLoginService.wechatLogin(params);
    }


    //伴宠师-获取手机号码
    @ApiOperation("伴宠师-获取手机号码")
    @PostMapping("/bindPhone")
    public AjaxResult bindPhone(@RequestBody ApiAppletLoginDTO params){
        return apiAppletLoginService.bindPhone(params);
    }


    //伴宠师-登录页基础信息
    @ApiOperation("伴宠师-登录页基础信息")
    @GetMapping("/loginConf")
    public AjaxResult loginConf(){
        return apiAppletLoginService.loginConf();
    }



    //伴宠师-获取用户基本能信息
    @ApiOperation("伴宠师-获取用户基本能信息")
    @GetMapping("/getAppletUserInfo/{appUserId}")
    public AjaxResult getAppletUserInfo(@PathVariable("appUserId") Long appUserId){
        return apiAppletLoginService.getAppletUserInfo(appUserId);
    }
}
