package com.bohuikeji.frame.module.admin.entity.auth;

import com.bohuikeji.frame.module.admin.entity.sys.SysUser;
import com.bohuikeji.frame.module.admin.service.ITFranchiseeInformationService;

import java.util.StringJoiner;

/**
 * 加盟商权限处理
 * @author 10552
 */
public class FranAuth2 extends BaseAuth{
    private ITFranchiseeInformationService franchiseeInformationService;

    @Override
    public String getValue(SysUser user) {
        if(user.getRoleId().equals(1)){
            return " 1=1 ";
        }
        return " fran_id in("+(new FranAuth(this.franchiseeInformationService)).getValue(user)+")";
    }
    public FranAuth2(ITFranchiseeInformationService franchiseeInformationService){
        this.franchiseeInformationService=franchiseeInformationService;
    }
}
