张天森
2022-10-08 86c38d586645e8ed14c32e1a69faf5540a27ff61
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java
@@ -23,6 +23,9 @@
import java.util.Date;
import java.util.List;
import static java.util.Objects.isNull;
import static java.util.Objects.nonNull;
/**
 * 三说会堂调解专家控制器
 * */
@@ -55,9 +58,8 @@
     * 小程序获取可选择专家
     * */
    @GetMapping("/appletsList")
    public R appList(){
        comSanShuoExpertService.selectExpertList();
        return R.ok(comSanShuoExpertService.list(new QueryWrapper<ComSanshuoExpert>().eq("status",1).eq("del_flag",1)));
    public R appList(@RequestParam (value = "type",required = false)Integer type,@RequestParam(value = "id",required = false)Long id){
        return comSanShuoExpertService.selectExpertList(type, id,this.getLoginUserInfo().getCommunityId());
    }
    /**
@@ -70,6 +72,7 @@
        expert.setUpdateTime(new Date());
        return R.ok(comSanShuoExpertService.updateById(expert));
    }
    /**
     * 后台获取列表
@@ -95,7 +98,12 @@
        ComSanshuoExpert expert = comSanShuoExpertService.getById(id);
        expert.setStatus(0);
        expert.setDelFlag(0);
        return R.ok(comSanShuoExpertService.updateById(expert));
        boolean b = comSanShuoExpertService.updateById(expert);
        if (b){
            //删除专家账号的权限
            userService.removeExpertRole(expert.getPhone());
        }
        return R.ok();
    }
    /**
@@ -118,6 +126,9 @@
    }
    /**
     * 专家范围
     * */
@@ -135,4 +146,20 @@
                            @RequestParam(value = "id",required = false)Long id){
        return comSanShuoExpertService.expertShowList(level,id);
    }
    /**
     * 是否为专家登陆小程序
     * */
    @GetMapping("/checkExpert")
    public R checkExpert(@RequestParam("number") String number){
        ComSanshuoExpert expert = comSanShuoExpertService.getOne(new QueryWrapper<ComSanshuoExpert>().lambda().eq(ComSanshuoExpert::getPhone, number));
        if (nonNull(expert)){
            return R.ok();
        }
        return R.fail();
    }
}