package com.ruoyi.applet.contoller;


import com.ruoyi.applet.pojo.dto.ApiQueryIIdDTO;
import com.ruoyi.applet.pojo.dto.ApiQueryIIdMyUserDTO;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.model.domain.AppBanner;
import com.ruoyi.model.service.IAApiAppletHhrWorkOutService;
import com.ruoyi.model.service.IAApiAppletLoginService;
import com.ruoyi.model.service.IAppBannerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Api(description = "伴宠师-合伙人工作台内部流程")
@RestController
@RequestMapping("/applet/workOut")
public class ApiAppletHhrWorkOutController {

    //伴宠师-登录相关问题
    @Resource
    private IAApiAppletHhrWorkOutService apiAppletHhrWorkOutService;
    @Resource
    private IAppBannerService bannerService;


    //合伙人工作台 - 绑定用户基础信息
    @ApiOperation("合伙人工作台 - 绑定用户基础信息")
    @GetMapping("/hhrInfo/{appUserId}")
    public AjaxResult HhrInfo(@PathVariable("appUserId") Long appUserId){
        return  apiAppletHhrWorkOutService.HhrInfo(appUserId);
    }



    //合伙人工作台 - 绑定二维码
    @ApiOperation("合伙人工作台 - 绑定二维码")
    @GetMapping("/hhrCode/{appUserId}")
    public AjaxResult HhrCode(@PathVariable("appUserId") Long appUserId){
        return  apiAppletHhrWorkOutService.HhrCode(appUserId);
    }


    //合伙人工作台 - 我的用户列表 0 未下单 1已下单
    @ApiOperation("合伙人工作台 - 我的用户列表 0 未下单 1已下单")
    @PostMapping("/hhrMyUserList")
    public AjaxResult HhrMyUserList(@RequestBody ApiQueryIIdMyUserDTO dto, Pageable page){
        return  apiAppletHhrWorkOutService.HhrMyUserList(dto.getAppUserId(),dto.getState(),page);
    }


    //合伙人工作台 - 根据用户标识查询用户下单详细信息
    @ApiOperation("合伙人工作台 - 根据用户标识查询用户下单详细信息")
    @GetMapping("/hhrMyUserGetById/{appUserId}")
    public AjaxResult HhrMyUserGetById(@PathVariable("appUserId") Long appUserId){
        return  apiAppletHhrWorkOutService.HhrMyUserGetById(appUserId);
    }

    //获取bannerList
    @ApiOperation("合伙人工作台 - 获取bannerList")
    @GetMapping("/bannerList")
    public AjaxResult bannerList(){
        List<AppBanner> bannerList = bannerService.getBannerList();
        return  AjaxResult.success(bannerList);
    }










}
