当前位置: 首页 > news >正文

用狐狸做logo的网站企业网站建设的可行性

用狐狸做logo的网站,企业网站建设的可行性,建工网校官网登录入口,网站如何进行代码优化大家好#xff0c;我是雄雄#xff0c;欢迎关注微信公众号#xff1a;雄雄的小课堂 现在是#xff1a;2022年7月7日13:46:07 前言 今天有个这样的需求#xff0c;PC端需要查看一下哪些天有数据#xff0c;但是哪些有有没有数据我这边还看不出来#xff0c;得请求别的系… 大家好我是雄雄欢迎关注微信公众号雄雄的小课堂 现在是2022年7月7日13:46:07 前言 今天有个这样的需求PC端需要查看一下哪些天有数据但是哪些有有没有数据我这边还看不出来得请求别的系统的接口去看。且团组和会员请求的接口和请求方式均不一样。 前端说为了方便团组和个人都走一个接口吧让我这边封装一下…… 实现 如何区分前台请求的是会员的还是团组的 让前台这样传如果不传groupId,传memberId则我就知道了请求的是查询会员的信息。反之则请求的是团组的接口。 代码如下 if(Strings.isNotBlank(groupId)){//是团组//查询这个团组下面的人LambdaQueryWrapperGroupUser groupUserLambdaQueryWrapper new LambdaQueryWrapper();groupUserLambdaQueryWrapper.eq(GroupUser::getGroupId, groupId);ListGroupUser groupUserList groupUserService.list(groupUserLambdaQueryWrapper);ListLong userList new ArrayList();groupUserList.forEach(group-{userList.add(group.getUserId());});//集合去重ListLong memberIdList userList.stream().distinct().collect(Collectors.toList());url ServicePathConstant.HBV_GATAWAY/doctor/api/doctor/getMemberDataDays;body HttpUtil.createPost(url).contentType(application/json).body(JSON.toJSONString(memberIdList)).execute().body();}else if(Strings.isNotBlank(memberId)){//是会员url ServicePathConstant.HBV_GATAWAY/doctor/api/doctor/getMemberDataDays/memberId;body HttpUtil.createGet(url).execute().body();}里面涉及到了些别的代码集合去重 //集合去重ListLong memberIdList userList.stream().distinct().collect(Collectors.toList());还别说这个地方用的还挺多的不过每次用到了之后都是翻之前的代码。。。。。 完整代码如下 /*** 获取有日期的报告吗返回一个集合* param groupId* return*/GetMapping(/getReportHaveDateList)public Object getReportHaveDateList(String groupId,String memberId) {cn.hutool.json.JSONObject jsonObjectResult new cn.hutool.json.JSONObject();//请求接口地址String url ;String body ;if(Strings.isNotBlank(groupId)){//是团组//查询这个团组下面的人LambdaQueryWrapperGroupUser groupUserLambdaQueryWrapper new LambdaQueryWrapper();groupUserLambdaQueryWrapper.eq(GroupUser::getGroupId, groupId);ListGroupUser groupUserList groupUserService.list(groupUserLambdaQueryWrapper);ListLong userList new ArrayList();groupUserList.forEach(group-{userList.add(group.getUserId());});//集合去重ListLong memberIdList userList.stream().distinct().collect(Collectors.toList());url ServicePathConstant.HBV_GATAWAY/doctor/api/doctor/getMemberDataDays;body HttpUtil.createPost(url).contentType(application/json).body(JSON.toJSONString(memberIdList)).execute().body();}else if(Strings.isNotBlank(memberId)){//是会员url ServicePathConstant.HBV_GATAWAY/doctor/api/doctor/getMemberDataDays/memberId;body HttpUtil.createGet(url).execute().body();}if (StringUtils.isBlank(body)) {jsonObjectResult.putOpt(code, 500);jsonObjectResult.putOpt(data, null);jsonObjectResult.putOpt(msg, 操作失败);return jsonObjectResult;}cn.hutool.json.JSONObject obj JSONUtil.parseObj(body);if (obj null) {jsonObjectResult.putOpt(code, 500);jsonObjectResult.putOpt(data, null);jsonObjectResult.putOpt(msg, 操作失败);return jsonObjectResult;}String code obj.get(code).toString();String msg obj.get(msg).toString();System.out.println(调用doctor系统返回的信息msg);if (200.equals(code)) {jsonObjectResult.putOpt(code, 200);jsonObjectResult.putOpt(data, obj.get(data));jsonObjectResult.putOpt(msg, 操作成功);//标记有没有记录jsonObjectResult.putOpt(count, obj.getJSONArray(data).size());return jsonObjectResult;}else{jsonObjectResult.putOpt(code, 200);jsonObjectResult.putOpt(data, new ArrayListString());jsonObjectResult.putOpt(msg, 操作成功);//标记有没有记录jsonObjectResult.putOpt(count, 0);return jsonObjectResult;}}顺便在记录一下糊涂工具类请求接口的几种方式吧 post方法form传参 //接口地址String url ;//请求参数MapString, Object paramMap new HashMap();map.put(groupId, 1506254142554785);//请求头HashMapString, String headers new HashMap();headers.put(Authorization, token);String result HttpUtil.createPost(url).addHeaders(headers).form(map).execute().body(); post方法json传参 //接口地址String url ;//请求参数MapString, Object paramMap new HashMap();map.put(groupId, 1506254142554785);//请求头HashMapString, String headers new HashMap();headers.put(Authorization, token);String body HttpUtil.createPost(url).contentType(application/json).body(JSON.toJSONString(projectVo)).execute().body(); projectVo就是一个json格式的数据。 get方法form传参 //接口地址String url ;//请求参数MapString, Object paramMap new HashMap();map.put(groupId, 1506254142554785);//请求头HashMapString, String headers new HashMap();headers.put(Authorization, token);String body HttpUtil.createGet(url).header(Authorization, token).form(paramMap).execute().body(); 这就是今天分享的内容谢谢大家的捧场
http://www.pierceye.com/news/893631/

相关文章:

  • 2017做哪些网站致富邢台市行政区划图
  • 深圳和海枫建设集团有限公司网站国内外基于vue框架的网站建设现状
  • 珠海免费网站制作购物网站前台模板
  • 小程序软件制作网站捷克注册公司网站
  • 做网站细节电商网站建设 平台
  • 网站建设方案书1500全国中小企业网站
  • 阳江市建设局网站合肥最新消息今天
  • 做关于什么样的网站好货代去什么网站开发客户
  • 中国工程建设造价管理协会网站漳州seo顾问
  • 什么网站可以做2.5D场景网站过程建设
  • google移动网站建站十大原则室内装修工人培训班
  • 自己做网站要会什么软件下载搭建网站有什么用
  • 天津做网站找谁网站如何做首面关键词
  • 微信小程序做链接网站做catalog的免费网站
  • 呼市网站制作招聘建设网站 托管 费用
  • dede自适应网站模板济南著名网站建设
  • 旅游网站排名榜手机开发网站工具
  • 饰品公司网站建设策划书百度seo优化收费标准
  • wordpress企业建站5网站建设
  • 网站运营解决方案皮具网站设计
  • 地宝网 网站建设上海网站制作网站开发
  • 有哪些出名的工业设计网站做废钢铁生意在哪个网站了解
  • wordpress 根目录函数深圳债务优化公司
  • 基于android的app的设计与开发seo链接优化
  • 怎么用优盘做网站登录密钥百度收录网站名字
  • 网站制作的一般步骤网站域名备案需要多长时间
  • 运城市住房与城乡建设局网站郑州百姓网招聘
  • 网站调用网页怎么做重庆手机网站方案设计
  • 购物 网站建设的市场分析泰兴网站建设吧
  • 企业网站代运营微信网页登录wordpress