package com.bohuikeji.delivery.backstage.controller.views;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.bohuikeji.delivery.backstage.entity.*;
import com.bohuikeji.delivery.backstage.service.ITCourierService;
import com.bohuikeji.frame.module.admin.base.EntityBase;
import com.bohuikeji.frame.module.admin.component.RedisUtil;
import com.bohuikeji.frame.module.admin.entity.sys.SysConfig;
import com.bohuikeji.frame.module.admin.entity.sys.SysRole;
import com.bohuikeji.frame.module.admin.entity.sys.SysUser;
import com.bohuikeji.frame.module.admin.entity.web.TableModel;
import com.bohuikeji.frame.module.admin.entity.web.block.AddressBlock;
import com.bohuikeji.frame.module.admin.enums.ButtonBlockEnum;
import com.bohuikeji.frame.module.admin.base.PageTemplateControllerBase;
import com.bohuikeji.frame.module.admin.entity.back.PageEntity;
import com.bohuikeji.frame.module.admin.entity.web.block.ButtonBlock;
import com.bohuikeji.frame.module.admin.entity.web.template.TableTemplate;
import com.bohuikeji.frame.module.admin.service.ISysConfigService;
import com.bohuikeji.frame.module.admin.service.ISysUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 商家(加盟商)页面控制器
 *
 * 所有页面访问请求都在此包处理,禁止处理其他请求
 * /views对应resources下的templates文件夹
 *
 * @author 10552
 */
@Slf4j
@Controller
@RequestMapping("/views")
public class BusinessPage extends PageTemplateControllerBase {
    @Autowired RedisUtil redisUtil;
    @Autowired ISysConfigService configService;
    @Autowired ITCourierService courierService;
    @Autowired
    ISysUserService userService;

    /**
     * 账号管理
     * @return
     */
    @RequestMapping("/business/account")
    public PageEntity toAccount(){
        TableTemplate pageTemplate = (TableTemplate) createPage(TableTemplate.class);
        /*List<ButtonBlock> buttonBlocks = new ArrayList<>(0);
        pageTemplate.setBatchButton(buttonBlocks);*/
        QueryWrapper<SysUser> queryWrapper=getFranQueryWrapper();
        //queryWrapper.ne("order_batch_num","0");
        session.setAttribute("pageTemplate", pageTemplate.setQueryWrapper(queryWrapper));
        return PageEntity.page("/table/index");

    }


}
