package com.ruoyi.applet.contoller;

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

import java.util.List;

@Api(description = "小程序-配置信息")
@RestController
@RequestMapping("/applet/config")
public class ApiAppletConfigController {
    //配置信息
    @Autowired
    private IAppletConfigService appletConfigService;

    //增值服务
    @Autowired
    private IAppletIncreaseService appletIncreaseService;

    //平台&服务介绍
    @Autowired
    private IAppletServiceService appletServiceService;

    //服务培训
    @Autowired
    private IAppletTrainService appletTrainService;

    @ApiOperation("小程序-配置信息列表数据查询")
    @GetMapping("/configList")
    public AjaxResult configList(AppletConfig appletConfig){
        List<AppletConfig> configList = appletConfigService.selectAppletConfigList(appletConfig);
        return AjaxResult.success("配置信息列表数据",configList);
    }

    @ApiOperation("小程序-增值服务列表数据查询")
    @GetMapping("/increaseServiceList")
    public AjaxResult increaseServiceList(AppletIncrease appletIncrease){
        List<AppletIncrease> increaseList = appletIncreaseService.selectAppletIncreaseList(appletIncrease);
        return AjaxResult.success("增值服务列表数据",increaseList);
    }

    @ApiOperation("小程序-平台&服务介绍列表数据查询")
    @GetMapping("/serviceList")
    public AjaxResult serviceList(AppletService appletService){
        List<AppletService> serviceList = appletServiceService.selectAppletServiceList(appletService);
        return AjaxResult.success("台&服务介绍列表数据",serviceList);
    }

    @ApiOperation("小程序-服务培训列表数据查询")
    @GetMapping("/trainList")
    public AjaxResult trainList(AppletTrain appletTrain){
        List<AppletTrain> trainList = appletTrainService.selectAppletTrainList(appletTrain);
        return AjaxResult.success("服务培训列表数据",trainList);
    }

}
