package com.mcwl.web.controller.memberCenter;

import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.common.core.domain.R;
import com.mcwl.memberCenter.domain.MemberBenefit;
import com.mcwl.memberCenter.domain.MemberLevel;
import com.mcwl.memberCenter.service.MemberBenefitService;
import com.mcwl.memberCenter.service.MemberLevelService;
import com.mcwl.memberCenter.domain.vo.MemberBenefitVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/***
 * 会员等级
 */
@RestController
@RequestMapping("memberLevel")
@RequiredArgsConstructor
@Api(tags = "会员中心")
public class MemberLevelController {

    private final MemberLevelService memberLevelService;

    private final MemberBenefitService memberBenefitService;

    /**
     * 获取会员等级列表
     *
     * @return 会员等级列表
     */
    @GetMapping("list")
    @ApiOperation(value = "获取会员等级列表")
    public R<List<MemberLevel>> list() {

        List<MemberLevel> memberLevelList = memberLevelService.list();

        return R.ok(memberLevelList);
    }


    /**
     * 获取会员等级及权益列表
     */
    @GetMapping("getMemberBenefitList")
    @ApiOperation(value = "获取会员等级及权益列表")
    public R<List<MemberBenefitVO>> getMemberBenefitList() {

        return R.ok(memberBenefitService.getMemberBenefitList());
    }

}
