package com.cpop.jambox.business.controller.website;

import com.cpop.core.base.R;
import com.cpop.jambox.business.service.*;
import com.mybatisflex.core.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Api(tags = "果酱官网接口")
@RequestMapping("/website")
public class WebsiteController {

    @Autowired
    private NavigationService navigationService;
    @Autowired
    private BusinessDataService businessDataService;
    @Autowired
    private WebProductService productService;
    @Autowired
    private WebsiteService websiteService;

    /**
     * @description:获取导航栏
     * @author: Yxz
     * @date: 2024/1/19 17:37
     * @param: []
     * @return: com.cpop.core.base.R
     **/
    @ApiOperation("获取导航栏")
    @GetMapping("/getNavigationList")
    public R getNavigationList(){
        return R.ok(navigationService.list());
    }


    /**
     * @description: 获取公司简介
     * @author: Yxz
     * @date: 2024/1/19 17:37
     * @param: []
     * @return: com.cpop.core.base.R
     **/
    @ApiOperation("获取公司简介")
    @GetMapping("/getCompanyIntro")
    public R getCompanyIntro(){
        return R.ok(websiteService.getCompanyIntro());
    }

    /**
     * @description: 获取公司业务数据
     * @author: Yxz
     * @date: 2024/1/19 17:38
     * @param: []
     * @return: com.cpop.core.base.R
     **/
    @ApiOperation("获取公司业务数据")
    @GetMapping("/getBusinessData")
    public R getBusinessData(){
        return R.ok(businessDataService.list());
    }

    /**
     * @description: 获取公司业务介绍
     * @author: Yxz
     * @date: 2024/1/19 17:38
     * @param: []
     * @return: com.cpop.core.base.R
     **/
    @ApiOperation("获取公司业务介绍")
    @GetMapping("/getBusinessIntro")
    public R getBusinessIntro(){
        return R.ok(websiteService.getBusinessIntro());
    }

    /**
     * 获取核心产品列表
     *
     * @author: Yxz
     * @date: 2024/1/21 18:01
     * @param: []
     * @return: com.cpop.core.base.R
     **/
    @ApiOperation("获取核心产品列表")
    @GetMapping("/getProductList")
    public R getProductList(){
        return R.ok(productService.list(QueryWrapper.create().orderBy("create_time")));
    }

    /**
     * @description: 获取合作平台
     * @author: Yxz
     * @date: 2024/1/19 17:38
     * @param: []
     * @return: com.cpop.core.base.R
     **/
    @ApiOperation("获取合作平台")
    @GetMapping("/getCooperationPlatform")
    public R getCooperationPlatform(){
        return R.ok(websiteService.getCooperationPlatform());
    }

    /**
     * 获取发展历程
     *
     * @author: Yxz
     * @date: 2024/1/21 11:55
     * @param: []
     * @return: com.cpop.core.base.R
     **/
    @ApiOperation("获取发展历程")
    @GetMapping("/getDevelopmentCourse")
    public R getDevelopmentCourse(){
        return websiteService.getDevelopmentCourse();
    }



}
