if else重复十多次的业务代码也是醉了

嗯,一个页面同时刷这8个接口,我说能不能合并到一个网络接口,不用一个页面并发8个请求,他说太长了,不好合并。

我看了一下他代码,也是醉了,写了8个接口,访问的都是一个表,然后每个接口重复if else十多次。

附上其中一个接口:

//移民生活
    public function immiLiving()
    {
        $cid = $_POST[‘cid‘];
        $db = M(‘infolist‘);

        if($cid == 1){
            $data[‘classid‘] = ‘183‘;
            $data[‘mainid‘] = ‘2‘;
            $data[‘delstate‘] = ‘‘;
            $data[‘checkinfo‘] = true;
            $insurance = $db->field(‘id,title,classid,posttime,linkurl‘)->where($data)->order(‘orderid desc‘)->limit(4)->select();
            if($insurance){
                $response[‘status‘] = ‘Y‘;
                $response[‘msg‘] = ‘成功‘;
                $response[‘data‘] = $insurance;
                echo json_encode($response);
            }else{
                $response[‘status‘] = ‘N‘;
                $response[‘msg‘] = ‘失败‘;
                echo json_encode($response);
            }
        }elseif($cid == 2){
            $data[‘classid‘] = ‘183‘;
            $data[‘mainid‘] = ‘3‘;
            $data[‘delstate‘] = ‘‘;
            $data[‘checkinfo‘] = true;
            $insurance = $db->field(‘id,title,classid,posttime,linkurl‘)->where($data)->order(‘orderid desc‘)->limit(4)->select();
            if($insurance){
                $response[‘status‘] = ‘Y‘;
                $response[‘msg‘] = ‘成功‘;
                $response[‘data‘] = $insurance;
                echo json_encode($response);
            }else{
                $response[‘status‘] = ‘N‘;
                $response[‘msg‘] = ‘失败‘;
                echo json_encode($response);
            }
        }elseif($cid == 3){
            $data[‘classid‘] = ‘183‘;
            $data[‘mainid‘] = ‘4‘;
            $data[‘delstate‘] = ‘‘;
            $data[‘checkinfo‘] = true;
            $insurance = $db->field(‘id,title,classid,posttime,linkurl‘)->where($data)->order(‘orderid desc‘)->limit(4)->select();
            if($insurance){
                $response[‘status‘] = ‘Y‘;
                $response[‘msg‘] = ‘成功‘;
                $response[‘data‘] = $insurance;
                echo json_encode($response);
            }else{
                $response[‘status‘] = ‘N‘;
                $response[‘msg‘] = ‘失败‘;
                echo json_encode($response);
            }
        }elseif($cid == 5){
            $data[‘classid‘] = ‘183‘;
            $data[‘mainid‘] = ‘8‘;
            $data[‘delstate‘] = ‘‘;
            $data[‘checkinfo‘] = true;
            $insurance = $db->field(‘id,title,classid,posttime,linkurl‘)->where($data)->order(‘orderid desc‘)->limit(4)->select();
            if($insurance){
                $response[‘status‘] = ‘Y‘;
                $response[‘msg‘] = ‘成功‘;
                $response[‘data‘] = $insurance;
                echo json_encode($response);
            }else{
                $response[‘status‘] = ‘N‘;
                $response[‘msg‘] = ‘失败‘;
                echo json_encode($response);
            }
        }elseif($cid == 6){
            $data[‘classid‘] = ‘183‘;
            $data[‘mainid‘] = ‘6‘;
            $data[‘delstate‘] = ‘‘;
            $data[‘checkinfo‘] = true;
            $insurance = $db->field(‘id,title,classid,posttime,linkurl‘)->where($data)->order(‘orderid desc‘)->limit(4)->select();
            if($insurance){
                $response[‘status‘] = ‘Y‘;
                $response[‘msg‘] = ‘成功‘;
                $response[‘data‘] = $insurance;
                echo json_encode($response);
            }else{
                $response[‘status‘] = ‘N‘;
                $response[‘msg‘] = ‘失败‘;
                echo json_encode($response);
            }
        }elseif($cid == 7){
            $data[‘classid‘] = ‘183‘;
            $data[‘mainid‘] = ‘9‘;
            $data[‘delstate‘] = ‘‘;
            $data[‘checkinfo‘] = true;
            $insurance = $db->field(‘id,title,classid,posttime,linkurl‘)->where($data)->order(‘orderid desc‘)->limit(4)->select();
            if($insurance){
                $response[‘status‘] = ‘Y‘;
                $response[‘msg‘] = ‘成功‘;
                $response[‘data‘] = $insurance;
                echo json_encode($response);
            }else{
                $response[‘status‘] = ‘N‘;
                $response[‘msg‘] = ‘失败‘;
                echo json_encode($response);
            }
        }elseif($cid == 8){
            $data[‘classid‘] = ‘183‘;
            $data[‘mainid‘] = ‘11‘;
            $data[‘delstate‘] = ‘‘;
            $data[‘checkinfo‘] = true;
            $insurance = $db->field(‘id,title,classid,posttime,linkurl‘)->where($data)->order(‘orderid desc‘)->limit(4)->select();
            if($insurance){
                $response[‘status‘] = ‘Y‘;
                $response[‘msg‘] = ‘成功‘;
                $response[‘data‘] = $insurance;
                echo json_encode($response);
            }else{
                $response[‘status‘] = ‘N‘;
                $response[‘msg‘] = ‘失败‘;
                echo json_encode($response);
            }
        }elseif($cid == 9){
            $data[‘classid‘] = ‘183‘;
            $data[‘mainid‘] = ‘5‘;
            $data[‘delstate‘] = ‘‘;
            $data[‘checkinfo‘] = true;
            $insurance = $db->field(‘id,title,classid,posttime,linkurl‘)->where($data)->order(‘orderid desc‘)->limit(4)->select();
            if($insurance){
                $response[‘status‘] = ‘Y‘;
                $response[‘msg‘] = ‘成功‘;
                $response[‘data‘] = $insurance;
                echo json_encode($response);
            }else{
                $response[‘status‘] = ‘N‘;
                $response[‘msg‘] = ‘失败‘;
                echo json_encode($response);
            }
        }elseif($cid == 10){
            $data[‘classid‘] = ‘183‘;
            $data[‘mainid‘] = ‘10‘;
            $data[‘delstate‘] = ‘‘;
            $data[‘checkinfo‘] = true;
            $insurance = $db->field(‘id,title,classid,posttime,linkurl‘)->where($data)->order(‘orderid desc‘)->limit(4)->select();
            if($insurance){
                $response[‘status‘] = ‘Y‘;
                $response[‘msg‘] = ‘成功‘;
                $response[‘data‘] = $insurance;
                echo json_encode($response);
            }else{
                $response[‘status‘] = ‘N‘;
                $response[‘msg‘] = ‘失败‘;
                echo json_encode($response);
            }
        }elseif($cid == 11){
            $data[‘classid‘] = ‘183‘;
            $data[‘mainid‘] = ‘22‘;
            $data[‘delstate‘] = ‘‘;
            $data[‘checkinfo‘] = true;
            $insurance = $db->field(‘id,title,classid,posttime,linkurl‘)->where($data)->order(‘orderid desc‘)->limit(4)->select();
            if($insurance){
                $response[‘status‘] = ‘Y‘;
                $response[‘msg‘] = ‘成功‘;
                $response[‘data‘] = $insurance;
                echo json_encode($response);
            }else{
                $response[‘status‘] = ‘N‘;
                $response[‘msg‘] = ‘失败‘;
                echo json_encode($response);
            }
        }elseif($cid == 12){
            $data[‘classid‘] = ‘183‘;
            $data[‘mainid‘] = ‘7‘;
            $data[‘delstate‘] = ‘‘;
            $data[‘checkinfo‘] = true;
            $insurance = $db->field(‘id,title,classid,posttime,linkurl‘)->where($data)->order(‘orderid desc‘)->limit(4)->select();
            if($insurance){
                $response[‘status‘] = ‘Y‘;
                $response[‘msg‘] = ‘成功‘;
                $response[‘data‘] = $insurance;
                echo json_encode($response);
            }else{
                $response[‘status‘] = ‘N‘;
                $response[‘msg‘] = ‘失败‘;
                echo json_encode($response);
            }
        }elseif($cid == 15){
            $data[‘classid‘] = ‘183‘;
            $data[‘mainid‘] = ‘19‘;
            $data[‘delstate‘] = ‘‘;
            $data[‘checkinfo‘] = true;
            $insurance = $db->field(‘id,title,classid,posttime,linkurl‘)->where($data)->order(‘orderid desc‘)->limit(4)->select();
            if($insurance){
                $response[‘status‘] = ‘Y‘;
                $response[‘msg‘] = ‘成功‘;
                $response[‘data‘] = $insurance;
                echo json_encode($response);
            }else{
                $response[‘status‘] = ‘N‘;
                $response[‘msg‘] = ‘失败‘;
                echo json_encode($response);
            }
        }elseif($cid == 16){
            $data[‘classid‘] = ‘183‘;
            $data[‘mainid‘] = ‘21‘;
            $data[‘delstate‘] = ‘‘;
            $data[‘checkinfo‘] = true;
            $insurance = $db->field(‘id,title,classid,posttime,linkurl‘)->where($data)->order(‘orderid desc‘)->limit(4)->select();
            if($insurance){
                $response[‘status‘] = ‘Y‘;
                $response[‘msg‘] = ‘成功‘;
                $response[‘data‘] = $insurance;
                echo json_encode($response);
            }else{
                $response[‘status‘] = ‘N‘;
                $response[‘msg‘] = ‘失败‘;
                echo json_encode($response);
            }
        }elseif($cid == 22){
            $data[‘classid‘] = ‘183‘;
            $data[‘mainid‘] = ‘29‘;
            $data[‘delstate‘] = ‘‘;
            $data[‘checkinfo‘] = true;
            $insurance = $db->field(‘id,title,classid,posttime,linkurl‘)->where($data)->order(‘orderid desc‘)->limit(4)->select();
            if($insurance){
                $response[‘status‘] = ‘Y‘;
                $response[‘msg‘] = ‘成功‘;
                $response[‘data‘] = $insurance;
                echo json_encode($response);
            }else{
                $response[‘status‘] = ‘N‘;
                $response[‘msg‘] = ‘失败‘;
                echo json_encode($response);
            }
        }elseif($cid == 23){
            $data[‘classid‘] = ‘183‘;
            $data[‘mainid‘] = ‘18‘;
            $data[‘delstate‘] = ‘‘;
            $data[‘checkinfo‘] = true;
            $insurance = $db->field(‘id,title,classid,posttime,linkurl‘)->where($data)->order(‘orderid desc‘)->limit(4)->select();
            if($insurance){
                $response[‘status‘] = ‘Y‘;
                $response[‘msg‘] = ‘成功‘;
                $response[‘data‘] = $insurance;
                echo json_encode($response);
            }else{
                $response[‘status‘] = ‘N‘;
                $response[‘msg‘] = ‘失败‘;
                echo json_encode($response);
            }
        }
    }

类似的还有好几个,修正一下如下:

//生活百科
    public function life()
    {
        $cid = $_POST[‘cid‘];
        $db = M(‘infolist‘);
        //生活百科
        $arr1 = array(‘1‘=>array(‘classid‘=>‘180‘,‘mainid‘=>‘2‘),
                        ‘2‘=>array(‘classid‘=>‘180‘,‘mainid‘=>‘3‘),
                        ‘3‘=>array(‘classid‘=>‘180‘,‘mainid‘=>‘4‘),
                        ‘5‘=>array(‘classid‘=>‘180‘,‘mainid‘=>‘8‘),
                        ‘6‘=>array(‘classid‘=>‘180‘,‘mainid‘=>‘6‘),
                        ‘7‘=>array(‘classid‘=>‘180‘,‘mainid‘=>‘9‘),
                        ‘8‘=>array(‘classid‘=>‘180‘,‘mainid‘=>‘11‘),
                        ‘9‘=>array(‘classid‘=>‘180‘,‘mainid‘=>‘5‘),
                        ‘10‘=>array(‘classid‘=>‘180‘,‘mainid‘=>‘10‘),
                        ‘11‘=>array(‘classid‘=>‘180‘,‘mainid‘=>‘22‘),
                        ‘12‘=>array(‘classid‘=>‘180‘,‘mainid‘=>‘7‘),
                        ‘15‘=>array(‘classid‘=>‘180‘,‘mainid‘=>‘19‘),
                        ‘16‘=>array(‘classid‘=>‘180‘,‘mainid‘=>‘21‘),
                        ‘22‘=>array(‘classid‘=>‘180‘,‘mainid‘=>‘29‘),
                        ‘23‘=>array(‘classid‘=>‘180‘,‘mainid‘=>‘18‘));

                //移民生活
                $arr3 = array(‘1‘=>array(‘classid‘=>‘183‘,‘mainid‘=>‘2‘),
                        ‘2‘=>array(‘classid‘=>‘183‘,‘mainid‘=>‘3‘),
                        ‘3‘=>array(‘classid‘=>‘183‘,‘mainid‘=>‘4‘),
                        ‘5‘=>array(‘classid‘=>‘183‘,‘mainid‘=>‘8‘),
                        ‘6‘=>array(‘classid‘=>‘183‘,‘mainid‘=>‘6‘),
                        ‘7‘=>array(‘classid‘=>‘183‘,‘mainid‘=>‘9‘),
                        ‘8‘=>array(‘classid‘=>‘183‘,‘mainid‘=>‘11‘),
                        ‘9‘=>array(‘classid‘=>‘183‘,‘mainid‘=>‘5‘),
                        ‘10‘=>array(‘classid‘=>‘183‘,‘mainid‘=>‘10‘),
                        ‘11‘=>array(‘classid‘=>‘183‘,‘mainid‘=>‘22‘),
                        ‘12‘=>array(‘classid‘=>‘183‘,‘mainid‘=>‘7‘),
                        ‘15‘=>array(‘classid‘=>‘183‘,‘mainid‘=>‘19‘),
                        ‘16‘=>array(‘classid‘=>‘183‘,‘mainid‘=>‘21‘),
                        ‘22‘=>array(‘classid‘=>‘183‘,‘mainid‘=>‘29‘),
                        ‘23‘=>array(‘classid‘=>‘183‘,‘mainid‘=>‘18‘));

                 //当地教育
                 $arr4 = array(‘1‘=>array(‘classid‘=>‘181‘,‘mainid‘=>‘2‘),
                        ‘2‘=>array(‘classid‘=>‘181‘,‘mainid‘=>‘3‘),
                        ‘3‘=>array(‘classid‘=>‘181‘,‘mainid‘=>‘4‘),
                        ‘5‘=>array(‘classid‘=>‘181‘,‘mainid‘=>‘8‘),
                        ‘6‘=>array(‘classid‘=>‘181‘,‘mainid‘=>‘6‘),
                        ‘7‘=>array(‘classid‘=>‘181‘,‘mainid‘=>‘9‘),
                        ‘8‘=>array(‘classid‘=>‘181‘,‘mainid‘=>‘11‘),
                        ‘9‘=>array(‘classid‘=>‘181‘,‘mainid‘=>‘5‘),
                        ‘10‘=>array(‘classid‘=>‘181‘,‘mainid‘=>‘10‘),
                        ‘11‘=>array(‘classid‘=>‘181‘,‘mainid‘=>‘22‘),
                        ‘12‘=>array(‘classid‘=>‘181‘,‘mainid‘=>‘7‘),
                        ‘15‘=>array(‘classid‘=>‘181‘,‘mainid‘=>‘19‘),
                        ‘16‘=>array(‘classid‘=>‘181‘,‘mainid‘=>‘21‘),
                        ‘22‘=>array(‘classid‘=>‘181‘,‘mainid‘=>‘29‘),
                        ‘23‘=>array(‘classid‘=>‘181‘,‘mainid‘=>‘18‘));

              //移民政策
              $arr5 = array(‘1‘=>array(‘classid‘=>‘182‘,‘mainid‘=>‘2‘),
                        ‘2‘=>array(‘classid‘=>‘182‘,‘mainid‘=>‘3‘),
                        ‘3‘=>array(‘classid‘=>‘182‘,‘mainid‘=>‘4‘),
                        ‘5‘=>array(‘classid‘=>‘182‘,‘mainid‘=>‘8‘),
                        ‘6‘=>array(‘classid‘=>‘182‘,‘mainid‘=>‘6‘),
                        ‘7‘=>array(‘classid‘=>‘182‘,‘mainid‘=>‘9‘),
                        ‘8‘=>array(‘classid‘=>‘182‘,‘mainid‘=>‘11‘),
                        ‘9‘=>array(‘classid‘=>‘182‘,‘mainid‘=>‘5‘),
                        ‘10‘=>array(‘classid‘=>‘182‘,‘mainid‘=>‘10‘),
                        ‘11‘=>array(‘classid‘=>‘182‘,‘mainid‘=>‘22‘),
                        ‘12‘=>array(‘classid‘=>‘182‘,‘mainid‘=>‘7‘),
                        ‘15‘=>array(‘classid‘=>‘182‘,‘mainid‘=>‘19‘),
                        ‘16‘=>array(‘classid‘=>‘182‘,‘mainid‘=>‘21‘),
                        ‘22‘=>array(‘classid‘=>‘182‘,‘mainid‘=>‘29‘),
                        ‘23‘=>array(‘classid‘=>‘182‘,‘mainid‘=>‘18‘));

              //税收福利
              $arr6 = array(‘1‘=>array(‘classid‘=>‘184‘,‘mainid‘=>‘2‘),
                        ‘2‘=>array(‘classid‘=>‘184‘,‘mainid‘=>‘3‘),
                        ‘3‘=>array(‘classid‘=>‘184‘,‘mainid‘=>‘4‘),
                        ‘5‘=>array(‘classid‘=>‘184‘,‘mainid‘=>‘8‘),
                        ‘6‘=>array(‘classid‘=>‘184‘,‘mainid‘=>‘6‘),
                        ‘7‘=>array(‘classid‘=>‘184‘,‘mainid‘=>‘9‘),
                        ‘8‘=>array(‘classid‘=>‘184‘,‘mainid‘=>‘11‘),
                        ‘9‘=>array(‘classid‘=>‘184‘,‘mainid‘=>‘5‘),
                        ‘10‘=>array(‘classid‘=>‘184‘,‘mainid‘=>‘10‘),
                        ‘11‘=>array(‘classid‘=>‘184‘,‘mainid‘=>‘22‘),
                        ‘12‘=>array(‘classid‘=>‘184‘,‘mainid‘=>‘7‘),
                        ‘15‘=>array(‘classid‘=>‘184‘,‘mainid‘=>‘19‘),
                        ‘16‘=>array(‘classid‘=>‘184‘,‘mainid‘=>‘21‘),
                        ‘22‘=>array(‘classid‘=>‘184‘,‘mainid‘=>‘29‘),
                        ‘23‘=>array(‘classid‘=>‘184‘,‘mainid‘=>‘18‘));

                //常见问题
                $arr7 = array(‘1‘=>array(‘classid‘=>‘43‘,‘mainid‘=>‘2‘),
                        ‘2‘=>array(‘classid‘=>‘43‘,‘mainid‘=>‘2‘),          //原函数这里是2,不是3
                        ‘3‘=>array(‘classid‘=>‘43‘,‘mainid‘=>‘4‘),
                        ‘5‘=>array(‘classid‘=>‘43‘,‘mainid‘=>‘8‘),
                        ‘6‘=>array(‘classid‘=>‘43‘,‘mainid‘=>‘6‘),
                        ‘7‘=>array(‘classid‘=>‘43‘,‘mainid‘=>‘9‘),
                        ‘8‘=>array(‘classid‘=>‘43‘,‘mainid‘=>‘11‘),
                        ‘9‘=>array(‘classid‘=>‘43‘,‘mainid‘=>‘5‘),
                        ‘10‘=>array(‘classid‘=>‘43‘,‘mainid‘=>‘10‘),
                        ‘11‘=>array(‘classid‘=>‘43‘,‘mainid‘=>‘22‘),
                        ‘12‘=>array(‘classid‘=>‘43‘,‘mainid‘=>‘7‘),
                        ‘15‘=>array(‘classid‘=>‘43‘,‘mainid‘=>‘19‘),
                        ‘16‘=>array(‘classid‘=>‘43‘,‘mainid‘=>‘21‘),
                        ‘22‘=>array(‘classid‘=>‘43‘,‘mainid‘=>‘29‘),
                        ‘23‘=>array(‘classid‘=>‘43‘,‘mainid‘=>‘18‘));

                //where
                $data[‘delstate‘] = $val[‘dekstate‘];
        $data[‘checkinfo‘] = $val[‘checkinfo‘];

                //生活百科
        foreach($arr1 as $key => $val){
            if($key == $cid){
                //取数组里面的参数
                $data[‘classid‘] = $val[‘classid‘];
            $data[‘mainid‘] = $val[‘mainid‘];
            $life = $db->field(‘id,title,classid,posttime,linkurl‘)->where($data)->order(‘orderid desc‘)->limit(4)->select();
            break;
            }
        }

        //移民生活
        foreach($arr3 as $key => $val){
            if($key == $cid){
                //取数组里面的参数
                $data[‘classid‘] = $val[‘classid‘];
            $data[‘mainid‘] = $val[‘mainid‘];
            $immiLiving = $db->field(‘id,title,classid,posttime,linkurl‘)->where($data)->order(‘orderid desc‘)->limit(4)->select();
            break;
            }
        }

        //当地教育
        foreach($arr4 as $key => $val){
            if($key == $cid){
                //取数组里面的参数
                $data[‘classid‘] = $val[‘classid‘];
            $data[‘mainid‘] = $val[‘mainid‘];
            $localEducation = $db->field(‘id,title,classid,posttime,linkurl‘)->where($data)->order(‘orderid desc‘)->limit(4)->select();
            break;
            }
        }

        //移民政策
        foreach($arr5 as $key => $val){
            if($key == $cid){
                //取数组里面的参数
                $data[‘classid‘] = $val[‘classid‘];
            $data[‘mainid‘] = $val[‘mainid‘];
            $immiPolicy = $db->field(‘id,title,classid,posttime,linkurl‘)->where($data)->order(‘orderid desc‘)->limit(4)->select();
            break;
            }
        }

        //税收福利
        foreach($arr6 as $key => $val){
            if($key == $cid){
                //取数组里面的参数
                $data[‘classid‘] = $val[‘classid‘];
            $data[‘mainid‘] = $val[‘mainid‘];
            $taxBenefits = $db->field(‘id,title,classid,posttime,linkurl‘)->where($data)->order(‘orderid desc‘)->limit(4)->select();
            break;
            }
        }

        //常见问题
        foreach($arr7 as $key => $val){
            if($key == $cid){
                //取数组里面的参数
                $data[‘classid‘] = $val[‘classid‘];
            $data[‘mainid‘] = $val[‘mainid‘];
            $commProblems = $db->field(‘id,title,classid,posttime,linkurl‘)->where($data)->order(‘orderid desc‘)->limit(4)->select();
            break;
            }
        }

        if($cid == 1){
                //保险咨询
            $data[‘classid‘] = ‘53‘;
            $data[‘mainid‘] = ‘2‘;
            $insurance = $db->field(‘id,title,classid,posttime,linkurl‘)->where($data)->order(‘orderid desc‘)->limit(4)->select();   

            //文件下载
            $db2 = M(‘soft‘);
            $data2[‘delstate‘] = ‘‘;
            $data2[‘checkinfo‘] = true;
            $download = $db2->field(‘id,title,classid,posttime,dlurl‘)->where($data2)->order(‘orderid desc‘)->limit(4)->select();

        }

        if($life)
        {
            $response[‘status‘] = ‘Y‘;
            $response[‘msg‘] = ‘成功‘;
            $response[‘life‘] = $life;
            $response[‘immiLiving‘] = $immiLiving;
            $response[‘localEducation‘] = $localEducation;
            $response[‘immiPolicy‘] = $immiPolicy;
            $response[‘taxBenefits‘] = $taxBenefits;
            $response[‘commProblems‘] = $commProblems;
                        if($cid==1){
                $response[‘insurance‘] = $insurance;
                $response[‘download‘] = $download;
            }
            echo json_encode($response);
        }else{
            $response[‘status‘] = ‘N‘;
            $response[‘msg‘] = ‘失败‘;
            echo json_encode($response);
        }
    }
时间: 2024-11-09 07:39:52

if else重复十多次的业务代码也是醉了的相关文章

深信服模式(先做减法,必须拜访客户三次、研究需求方向,把产品的问题控制住,快速反应,在未来十年,绝大部分业务都会搬到Internet上来,实现All on Internet)good

深圳市盛凯信息科技有限公司与深信服合作多年,可以说是看着深信服“飞速”长大的.盛凯的总经理邓渊在采访中笑言:“他们(深信服)发展得太快,而我们发展得太慢.” 深信服的产品线已从最初只有VPN一条,到目前包括上网行为管理.广域网优化.应用交付.下一代防火墙.应用性能管理和虚拟化等多条产品线.根据IDC的报告,在中国的网络安全市场上,深信服已经进入前三甲.而这只是深信服其中内容安全管理和VPN两条产品线的成绩. 对复杂市场的精准定位:对需求趋势的精准解读:对客户及合作伙伴的深度沟通:对创新意识的极度

天天写业务代码,如何成为技术大牛

前序 在工作之余浏览公司的技术网站,看到了以下这篇文章,细细读来真心觉得不错,写得有价值很实在.于是想联系下作者,问一下是否可以转载.打开钉钉一搜,作者是资深技术专家,差不多就是技术总监级别啊,这也从侧面旁征了,以下的内容是有其亲身经历,切实体会的,而不是鸡汤口号之流.相较与作者的级别,自己确实惭愧汗颜,所以没好直接聊天询问而是在文章底下留言.在得到了作者的同意后将文章的内容贴到这里,作为分享也作为自己的鞭策和提醒.在这里谢谢我的大牛同事了^_^. ....................以下内

天天写业务代码的那些年,我们是如何成长过来的

比起写业务代码更不幸的是,主要工作是修 Bug,bug,buG, bUg. 在一家大的公司里,不同的人总会有不同的运气: 运气好的人遇上一个好的项目,升职加薪,从此就走上了人生的巅峰. 运气差的人摊上一个差的项目,升不了职,少加了薪,并且还获得不了技术成长. 我刚毕业那会儿,所在团队的主要工作是,维护一个『又老又旧』的系统.比起写业务代码更不幸的是,我们的主要工作是修 Bug,bug,buG, bUg. 那一年多里,尽管都是维护旧系统和少量的新需求,我们还是在飞速的成长~~.而来源主要是: 组内

天天写业务代码,如何成为技术大牛?

不管是开发.测试.运维,每个技术人员心理多多少少都有一个成为技术大牛的梦,毕竟"梦想总是要有的,万一实现了呢"!正是对技术梦的追求,促使我们不断地努力和提升自己. 然而"梦想是美好的,现实却是残酷的",很多同学在实际工作后就会发现,梦想是成为大牛,但做的事情看起来跟大牛都不沾边,例如,程序员说"天天写业务代码还加班,如何才能成为技术大牛",测试说"每天都有执行不完的测试用例",运维说"扛机器接网线敲shell命令,这

关于知乎《四十岁还在写代码,是幸福还是悲哀?》的不同看法

 今天看了知乎上的文章关于<四十岁还在写代码,是幸福还是悲哀?>.但是我不太赞成作者的观点,我想表达自己的一些看法.我们本着以目前中国IT的现状出发.目前我认为中国的程序员很努力,很上进,并且很有想法.假如四十岁还是写代码的话,我们就把他当做资深工程师,就是比高级程序员好一点的程序员,但是达不到架构师水平.假如达到,那么就和我们的命题有矛盾.我认为目前中国的架构师几乎是不怎么写代码的,最多写核心的代码.那么这样40岁的程序员还在写代码的话,我认为应该从如下方面去考虑,并且每个方面要占一些不同的

如何从业务代码中抽离出可复用的微组件

背景 很多业务代码,掺杂着一些通用的大段逻辑:容易导致的后果是,当需要类似功能时,不得不重新写一道,或者复制出几乎相同的代码块,让系统的无序性蹭蹭蹭往上涨. 具有良好抽象思维的有心的开发者,则会仔细观察到这种现象,将这些通用的大块逻辑抽离出来,做成一个可复用的微组件,使得以后再做类似的事情,只需要付出很小的工作即可. 那么,如何从业务代码中抽离出可复用的微组件,使得一类事情只需要做一次,今后可以反复地复用呢? 本文将以一个例子来说明. 在业务开发中,常常需要根据一批 id 查到相对应的 name

记一次完整的系统业务代码重构(1)——why

记一次完整的系统业务代码重构(1)——why 0.为什么烂 优秀的代码优秀的出奇一致,烂代码却烂的千奇百怪.至于原因嘛,无非如下几种: 1.迭代和变更需求快,比翻书变脸还快,而且没有统一规划和为未来预留考虑. 2.公司人员流动快,代码换了一届又一届的主人,七朝元老都没站出来,三朝元老的代码都弱爆了. 3.神坑的技术人员,零注释.迷魂阵.障眼法没有最晕的代码只有更晕的代码. 1.烂在何处 让所有的开发人员吐槽自己维护的代码烂在何处,估计说个3天3夜都说不完.这里总结下自身项目的缺点.由于项目内容涉

Cocos2d-x 3.x 开发(十八)10行代码看自动Batch,10行代码看自动剔除

1.概述 在游戏的运行过程中,图形的绘制是非常大的开销.对于良莠不齐的Android手机市场,绘制优化较好的游戏,可以在更多的手机上运行,因此也是优化的重中之重.图形方面的优化主要体现在减少GUP的绘制次数上.这里我们分别从自动优化渲染批次和绘制剔除两个方面来看新版本在绘制上的优化. 2.自动batch 在Cocos2d-x 3.x中,抛弃了先前手动编写BatchNode,采用自动管理的方式.说起BatchNode,就难免涉及到显卡底层的绘制原理.简单的说,每提交一条绘制指令到显卡都会产生消耗,

CSDN日报20170413 ——《天天写业务代码的那些年,我们是如何成长过来的》

[程序人生]天天写业务代码的那些年,我们是如何成长过来的 作者:Phodal 比起写业务代码更不幸的是,主要工作是修 Bug , bug , buG , bUg. [Java 编程]Springboot实战:我们的第一款开源软件 作者:纯洁的微笑 在信息爆炸时代,如何避免持续性信息过剩,使自己变得专注而不是被纷繁的信息所累?每天会看到各种各样的新闻,各种新潮的技术层出不穷,如何筛选出自己所关心的? [物联网]Android Things:外设I/O接口-I2C 作者:1024工场 内部集成电路(