package cn.pluss.platform.controller.merchant;

import cn.pluss.platform.api.Result;
import cn.pluss.platform.api.ResultGenerator;
import cn.pluss.platform.entity.MercMemberSet;
import cn.pluss.platform.entity.UserApp;
import cn.pluss.platform.merchant.MercMemberSetService;
import cn.pluss.platform.userApp.UserAppService;
import cn.pluss.platform.vo.MercMemberSetVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springframework.beans.factory.annotation.Autowired;
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.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/mercMemberSet")
public class MercMemberSetController {

    @Autowired
    private MercMemberSetService mmsService;

    @GetMapping("/data")
    public Result<MercMemberSetVO> mercMemberSet() {
        MercMemberSetVO vo = mmsService.apiSet();
        return ResultGenerator.genSuccessResult(vo);
    }

    @GetMapping("/allScopeType")
    public Result<List<Map<String, Object>>> allScopeType() {
        List<Map<String, Object>> result = new ArrayList<>();
        Map<String, Object> map = new HashMap<>();
        map.put("code", "1");
        map.put("desc", "线下扫码");
        result.add(map);

        map = new HashMap<>();
        map.put("code", "2");
        map.put("desc", "外卖和扫码点单");
        result.add(map);

        map = new HashMap<>();
        map.put("code", "3");
        map.put("desc", "全部");
        result.add(map);

        return ResultGenerator.genSuccessResult(result);
    }
}
