"/>

閲嶅 Java 璁捐妯″紡锛氬疄鎴樺缓閫犺€呮ā寮?/h1>

Posted bugstack铏礊鏍?/a>

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了閲嶅 Java 璁捐妯″紡锛氬疄鎴樺缓閫犺€呮ā寮?/h1>

相关的知识,希望对你有一定的参考价值。

鎸佺画鍧氭寔鍘熷垱杈撳嚭锛岀偣鍑昏摑瀛楀叧娉ㄦ垜鍚?/span>

鉂?/span>

娌夋穩銆佸垎浜€佹垚闀匡紝璁╄嚜宸卞拰浠栦汉閮借兘鏈夋墍鏀惰幏锛侌煒?/p> 鉂?/span>

鐩綍


  • 涓€銆佸墠瑷€

  • 浜屻€佸紑鍙戠幆澧?/p>

  • 涓夈€佸缓閫犺€呮ā寮忎粙缁?/p>

  • 鍥涖€佹渚嬪満鏅ā鎷?/p>

    • 1. 鍦烘櫙妯℃嫙宸ョ▼

    • 2. 鍦烘櫙绠€杩?/p>

  • 浜斻€佺敤涓€鍧ㄥ潹浠g爜瀹炵幇

    • 1. 宸ョ▼缁撴瀯

    • 2. ifelse瀹炵幇闇€姹?/p>

    • 3. 娴嬭瘯楠岃瘉

  • 鍏€佸缓閫犺€呮ā寮忛噸鏋勪唬鐮?/p>

    • 1. 宸ョ▼缁撴瀯

    • 2. 浠g爜瀹炵幇

    • 3. 娴嬭瘯楠岃瘉

  • 涓冦€佹€荤粨


涓€銆佸墠瑷€

涔辩爜涓冪碂 [lu脿n q墨 b膩 z膩o]锛屾垜鏃跺父鎬€鐤戣繖涓垚璇槸鏉ュ舰瀹圭▼搴忕尶鐨勶紒

鏃犺鎵挎帴浠€涔堟牱鐨勯渶姹傦紝鏄笉鏄韩杈规€绘湁閭d箞鍑犱釜浜轰唬鐮佸啓鐨勭儌锛屼絾鏄嵈鏃跺父鏈夋祴璇曞皬濮愬杩囨潵鑱婂ぉ(姹傛敼bug)銆佹湁浜у搧灏忎紮浼撮€佸悆鐨?姹傚啓闇€姹?/span>)銆佹湁涓氬姟灏忓濡归櫔鐫€鏀逛唬鐮?姹備笂绾?/span>)锛岀洿鑷抽瀵奸兘璁や负浠栫殑宸ヤ綔寰堥噸瑕侊紝鑰屽湪鏃佽竟鐨勪綘鍙兘韫偣鍚冪殑銆?/p>

閭d綘璇达紝CRUD鐨勪唬鐮佽繕鎯宠鎴戞€庝箞鏍凤紵

杩欐牱鐨勫皬浼欎即锛屽彲鑳芥妸浠g爜鍐欑殑寰堢洿鎺ワ紝ifelse澶氱敤涓€鐐癸紝婊¤冻浜庡厛涓存椂鏀寔涓€涓嬶紝鎯崇潃杩欎篃娌′粈涔堢殑銆傝€屼笖杩欐牱鐨勪笟鍔¢渶姹傝鐨勬€ュ張閮芥槸澧炲垹鏀规煡鐨勫唴瀹癸紝瀹炲湪涓嶆兂鍋氳璁°€傝€屽鏋滄湁浜烘彁鍒拌濂藉ソ璁捐涓嬶紝鍙兘涔熶細琚弽瀵逛笉瑕佽繃娓¤璁°€?/p>

璐磋啅鑽技鐨勪慨淇ˉ琛ワ紝涓€娆℃瘮涓€娆℃亹鎬栵紒

绗竴娆″畬鎴愪骇鍝侀渶姹傚疄鍦ㄦ槸寰堝揩锛屼絾浜掕仈缃戠殑浠g爜涓嶆瘮浼犵粺浼佷笟銆傚湪浼犵粺琛屼笟鍙兘涓€濂椾唬鐮佽兘鐢ㄥ崄骞达紝浣嗗湪浜掕仈缃戦珮閫熺殑杩唬涓嬩綘鐨勫伐绋嬶紝涓€骞村氨瑕佸彉鍔ㄥ嚑鍗佹銆傚鏋滀粠涓€寮€濮嬪氨鎯崇潃鍙瀹屾垚鍔熻兘灏卞彲浠ワ紝閭d箞闅忎箣鑰屾潵鐨勬槸鍚庣画鐨勯渶姹傞毦浠ユ壙鎺ワ紝姣忔鐪嬬潃鎴愮墖鎴愮墖鐨勪唬鐮侊紝瀹炲湪涓嶇煡濡備綍涓嬫墜銆?/p>

鍦ㄧ爺鍙戞祦绋嬭鑼冧笅鎵ц锛屾墠鑳藉啓鍑哄ソ绋嬪簭锛?/code>

涓€涓」鐩殑涓婄嚎寰€寰€瑕佺粡鍘?code class="mq-42">涓氬姟闇€姹?/code>銆?code class="mq-43">浜у搧璁捐銆?code class="mq-44">鐮斿彂瀹炵幇銆?code class="mq-45">娴嬭瘯楠岃瘉銆?code class="mq-46">涓婄嚎閮ㄧ讲鍒?code class="mq-47">姝e紡寮€閲?/code>锛岃€岃繖鍏朵腑瀵圭爺鍙戦潪甯搁噸瑕佺殑涓€鎹㈠氨鏄爺鍙戝疄鐜扮殑杩囩▼锛屽張鍙互鍖呮嫭涓猴紱鏋舵瀯閫夊瀷銆?code class="mq-49">鍔熻兘璁捐銆?code class="mq-50">璁捐璇勫銆?code class="mq-51">浠g爜瀹炵幇銆?code class="mq-52">浠g爜璇勫銆?code class="mq-53">鍗曟祴瑕嗙洊鐜囨鏌?/code>銆?code class="mq-54">缂栧啓鏂囨。銆?code class="mq-55">鎻愪氦娴嬭瘯銆傛墍浠ュ湪涓€浜涙祦绋嬭鑼冧笅锛屽叾瀹炲緢闅捐浣犻殢鎰忓紑鍙戜唬鐮併€?/p>

寮€鍙戜唬鐮佺殑杩囩▼涓嶆槸鐐妧锛屽氨鍍忕洊鎴垮瓙濡傛灉涓嶆寜鐓у浘绾告潵淇缓锛屽洖棣栧氨鍦ㄥ北澧欎笂鎼竴涓帹鎴垮崼娴达紒鍙兘鍦ㄧ幇瀹炲満鏅腑杩欏緢鑽掑攼锛屼絾鍦ㄥ姛鑳藉紑鍙戜腑鍗存€绘湁杩欐牱鐨勪唬鐮併€?/p>

銆屾墍浠ユ垜浠篃闇€瑕佷竴浜涜璁℃ā寮忕殑鏍囧噯鎬濇兂锛屽幓寤鸿浠g爜缁撴瀯锛屾彁鍗囧叏灞€鎶婃帶鑳藉姏銆傘€?/strong>

浜屻€佸紑鍙戠幆澧?/span>

  1. JDK 1.8
  2. Idea + Maven
  3. 娑夊強宸ョ▼涓変釜锛屽彲浠ラ€氳繃鍏虫敞 銆屽叕浼楀彿銆?/strong>锛? bugstack铏礊鏍?/code>锛屽洖澶? 婧愮爜涓嬭浇鑾峰彇(鎵撳紑鑾峰彇鐨勯摼鎺ワ紝鎵惧埌搴忓彿18)
宸ョ▼ 鎻忚堪
itstack-demo-design-3-00 鍦烘櫙妯℃嫙宸ョ▼锛屾ā鎷熻淇繃绋嬩腑鐨勫椁愰€夋嫨(璞崕銆佺敯鍥€佺畝绾?
itstack-demo-design-3-01 浣跨敤涓€鍧ㄤ唬鐮佸疄鐜颁笟鍔¢渶姹傦紝涔熸槸瀵筰felse鐨勪娇鐢?/td>
itstack-demo-design-3-02 閫氳繃璁捐妯″紡浼樺寲鏀归€犱唬鐮侊紝浜х敓瀵规瘮鎬т粠鑰屽涔?/td>

涓夈€佸缓閫犺€呮ā寮忎粙缁?/span>

閲嶅 Java 璁捐妯″紡锛氬疄鎴樺缓閫犺€呮ā寮? class=
寤洪€犺€呮ā寮忥紝鍥剧墖鏉ヨ嚜 refactoringguru.cn

銆屽缓閫犺€呮ā寮忔墍瀹屾垚鐨勫唴瀹瑰氨鏄€氳繃灏嗗涓畝鍗曞璞¢€氳繃涓€姝ユ鐨勭粍瑁呮瀯寤哄嚭涓€涓鏉傚璞$殑杩囩▼銆傘€?/strong>

閭d箞锛屽摢閲屾湁杩欐牱鐨勫満鏅憿锛?/code>

渚嬪浣犵帺鐜嬭€呰崳鑰€鐨勬椂鐨勫垵濮嬪寲鐣岄潰锛涙湁涓夋潯璺€佹湁鏍戞湪銆佹湁閲庢€€佹湁瀹堝崼濉旂瓑绛夛紝鐢氳嚦渚濊禆浜庝綘鐨勭綉缁滄儏鍐典細鎺у埗娓呮櫚搴︺€傝€屽綋浣犳崲涓€涓満鏅繘琛屽叾浠栦笉鍚屾ā寮忕殑閫夋嫨鏃讹紝鍚屾牱浼氬缓璁鹃亾璺€佹爲鏈ㄣ€侀噹鎬瓑绛夛紝浣嗘槸浠栦滑鐨勬憜鏀惧拰澶у皬閮芥湁涓嶅悓銆傝繖閲屽氨鍙互鐢ㄥ埌寤洪€犺€呮ā寮忔潵鍒濆鍖栨父鎴忓厓绱犮€?/p>

鑰岃繖鏍风殑鏍规嵁鐩稿悓鐨?code class="mq-98">鐗╂枡锛屼笉鍚岀殑缁勮鎵€浜х敓鍑虹殑鍏蜂綋鐨勫唴瀹癸紝灏辨槸寤洪€犺€呮ā寮忕殑鏈€缁堟剰鍥撅紝涔熷氨鏄紱銆屽皢涓€涓鏉傜殑鏋勫缓涓庡叾琛ㄧず鐩稿垎绂伙紝浣垮緱鍚屾牱鐨勬瀯寤鸿繃绋嬪彲浠ュ垱寤轰笉鍚岀殑琛ㄧず銆傘€?/strong>

鍥涖€佹渚嬪満鏅ā鎷?/span>

閲嶅 Java 璁捐妯″紡锛氬疄鎴樺缓閫犺€呮ā寮? class=
鍦烘櫙妯℃嫙锛涜淇椁愰€夋嫨(璞崕銆佺敯鍥€佺畝绾?

銆岃繖閲屾垜浠ā鎷熻淇叕鍙稿浜庤璁″嚭涓€浜涘椁愯淇湇鍔$殑鍦烘櫙銆傘€?/strong>

寰堝瑁呬慨鍏徃閮戒細缁欏嚭鑷鐨勫椁愭湇鍔★紝涓€鑸湁锛涙寮忚豹鍗庛€佽交濂㈢敯鍥€佺幇浠g畝绾︾瓑绛夛紝鑰岃繖浜涘椁愮殑鍚庨潰鏄笉鍚岀殑鍟嗗搧鐨勭粍鍚堛€備緥濡傦紱涓€绾?amp;浜岀骇鍚婇《銆佸涔愬+娑傛枡銆佸湥璞″湴鏉裤€侀┈鍙尝缃楀湴鐮栫瓑绛夛紝鎸夌収涓嶅悓鐨勫椁愮殑浠锋牸閫夊彇涓嶅悓鐨勫搧鐗岀粍鍚堬紝鏈€缁堝啀鎸夌収瑁呬慨闈㈢Н缁欏嚭涓€涓暣浣撶殑鎶ヤ环銆?/p>

杩欓噷鎴戜滑灏辨ā鎷熻淇叕鍙告兂鎺ㄥ嚭涓€浜涘椁愯淇湇鍔★紝鎸夌収涓嶅悓鐨勪环鏍艰瀹氬搧鐗岄€夋嫨缁勫悎锛屼互杈惧埌浣跨敤寤洪€犺€呮ā寮忕殑杩囩▼銆?/p>

1. 鍦烘櫙妯℃嫙宸ョ▼

itstack-demo-design-3-00
鈹斺攢鈹€ src
    鈹斺攢鈹€ main
        鈹斺攢鈹€ java
            鈹斺攢鈹€ org.itstack.demo.design
                鈹溾攢鈹€ ceilling
                鈹?nbsp;  鈹溾攢鈹€ LevelOneCeiling.java
                鈹?nbsp;  鈹斺攢鈹€ LevelTwoCeiling.java
                鈹溾攢鈹€ coat
                鈹?nbsp;  鈹溾攢鈹€ DuluxCoat.java
                鈹?nbsp;  鈹斺攢鈹€ LiBangCoat.java
                鈹?nbsp;  鈹斺攢鈹€ LevelTwoCeiling.java
                鈹溾攢鈹€ floor
                鈹?nbsp;  鈹溾攢鈹€ DerFloor.java
                鈹?nbsp;  鈹斺攢鈹€ ShengXiangFloor.java
                鈹溾攢鈹€ tile
                鈹?nbsp;  鈹溾攢鈹€ DongPengTile.java
                鈹?nbsp;  鈹斺攢鈹€ MarcoPoloTile.java
                鈹斺攢鈹€ Matter.java

鍦ㄦā鎷熷伐绋嬩腑鎻愪緵浜嗚淇腑鎵€闇€瑕佺殑鐗╂枡锛?code class="mq-123">ceilling(鍚婇《)銆?code class="mq-124">coat(娑傛枡)銆?code class="mq-125">floor(鍦版澘)銆?code class="mq-126">tile(鍦扮爾)锛岃繖涔堝洓椤瑰唴瀹广€傦紙瀹為檯鐨勮淇墿鏂欒姣旇繖涓鐨勫锛?/p>

2. 鍦烘櫙绠€杩?/span>

2.1 鐗╂枡鎺ュ彛

public interface Matter {

    String scene();      // 鍦烘櫙锛涘湴鏉裤€佸湴鐮栥€佹秱鏂欍€佸悐椤?/span>

    String brand();      // 鍝佺墝

    String model();      // 鍨嬪彿

    BigDecimal price();  // 浠锋牸

    String desc();       // 鎻忚堪

}
  • 鐗╂枡鎺ュ彛鎻愪緵浜嗗熀鏈殑淇℃伅锛屼互淇濊瘉鎵€鏈夌殑瑁呬慨鏉愭枡閮藉彲浠ユ寜鐓х粺涓€鏍囧噯杩涜鑾峰彇銆?

2.2 鍚婇《(ceiling)

銆屼竴绾ч《銆?/strong>

public class LevelOneCeiling implements Matter {

    public String scene() {
        return "鍚婇《";
    }

    public String brand() {
        return "瑁呬慨鍏徃鑷甫";
    }

    public String model() {
        return "涓€绾ч《";
    }

    public BigDecimal price() {
        return new BigDecimal(260);
    }

    public String desc() {
        return "閫犲瀷鍙仛浣庝竴绾э紝鍙湁涓€涓眰娆$殑鍚婇《锛屼竴鑸椤?20-150mm";
    }

}

銆屼簩绾ч《銆?/strong>

public class LevelTwoCeiling  implements Matter {

    public String scene() {
        return "鍚婇《";
    }

    public String brand() {
        return "瑁呬慨鍏徃鑷甫";
    }

    public String model() {
        return "浜岀骇椤?;
    }

    public BigDecimal price() {
        return new BigDecimal(850);
    }

    public String desc() {
        return "涓や釜灞傛鐨勫悐椤讹紝浜岀骇鍚婇《楂樺害涓€鑸氨寰€涓嬪悐20cm锛岃鏄眰楂樺緢楂橈紝涔熷彲澧炲姞姣忕骇鐨勫帤搴?;
    }
    
}

2.3 娑傛枡(coat)

銆屽涔愬+銆?/strong>

public class DuluxCoat  implements Matter {

    public String scene() {
        return "娑傛枡";
    }

    public String brand() {
        return "澶氫箰澹?Dulux)";
    }

    public String model() {
        return "绗簩浠?;
    }

    public BigDecimal price() {
        return new BigDecimal(719);
    }

    public String desc() {
        return "澶氫箰澹槸闃垮厠鑻忚璐濆皵鏃椾笅鐨勮憲鍚嶅缓绛戣楗版补婕嗗搧鐗岋紝浜у搧鐣呴攢浜庡叏鐞?00涓浗瀹讹紝姣忓勾鍏ㄧ悆鏈?000涓囨埛瀹跺涵浣跨敤澶氫箰澹补婕嗐€?;
    }
    
}

銆岀珛閭︺€?/strong>

public class LiBangCoat implements Matter {

    public String scene() {
        return "娑傛枡";
    }

    public String brand() {
        return "绔嬮偊";
    }

    public String model() {
        return "榛樿绾у埆";
    }

    public BigDecimal price() {
        return new BigDecimal(650);
    }

    public String desc() {
        return "绔嬮偊濮嬬粓浠ュ紑鍙戠豢鑹蹭骇鍝併€佹敞閲嶉珮绉戞妧銆侀珮鍝佽川涓虹洰鏍囷紝浠ユ妧鏈姏閲忎笉鏂帹杩涚鐮斿拰寮€鍙戯紝婊¤冻娑堣垂鑰呴渶姹傘€?;
    }

}

2.4 鍦版澘(floor)

銆屽痉灏斻€?/strong>

public class DerFloor implements Matter {

    public String scene() {
        return "鍦版澘";
    }

    public String brand() {
        return "寰峰皵(Der)";
    }

    public String model() {
        return "A+";
    }

    public BigDecimal price() {
        return new BigDecimal(119);
    }

    public String desc() {
        return "DER寰峰皵闆嗗洟鏄叏鐞冮鍏堢殑涓撲笟鏈ㄥ湴鏉垮埗閫犲晢锛屽寳浜?008骞村ゥ杩愪細瀹惰鍜屽叕瑁呭湴鏉夸緵搴斿晢";
    }
    
}

銆屽湥璞°€?/strong>

public class ShengXiangFloor implements Matter {

    public String scene() {
        return "鍦版澘";
    }

    public String brand() {
        return "鍦h薄";
    }

    public String model() {
        return "涓€绾?;
    }

    public BigDecimal price() {
        return new BigDecimal(318);
    }

    public String desc() {
        return "鍦h薄鍦版澘鏄腑鍥藉湴鏉胯涓氳憲鍚嶅搧鐗屻€傚湥璞″湴鏉挎嫢鏈変腑鍥介┌鍚嶅晢鏍囥€佷腑鍥藉悕鐗屻€佸浗瀹跺厤妫€銆佷腑鍥界幆澧冩爣蹇楄璇佺瓑澶氶」鑽h獕銆?;
    }

}

2.5 鍦扮爾(tile)

銆屼笢楣忋€?/strong>

public class DongPengTile implements Matter {

    public String scene() {
        return "鍦扮爾";
    }

    public String brand() {
        return "涓滈箯鐡风爾";
    }

    public String model() {
        return "10001";
    }

    public BigDecimal price() {
        return new BigDecimal(102);
    }

    public String desc() {
        return "涓滈箯鐡风爾浠ュ搧璐ㄩ摳灏卞搧鐗岋紝绉戞妧鎺ㄥ姩鍝佺墝锛屽彛纰戜紶鎾搧鐗屼负瀹楁棬锛?014骞村搧鐗屼环鍊?32.35浜垮厓锛屼綅鍒楀缓闄惰涓氭棣栥€?;
    }

}

銆岄┈鍙尝缃椼€?/strong>

public class MarcoPoloTile implements Matter {

    public String scene() {
        return "鍦扮爾";
    }

    public String brand() {
        return "椹彲娉㈢綏(MARCO POLO)";
    }

    public String model() {
        return "缂虹渷";
    }

    public BigDecimal price() {
        return new BigDecimal(140);
    }

    public String desc() {
        return "鈥滈┈鍙尝缃椻€濆搧鐗岃癁鐢熶簬1996骞达紝浣滀负鍥藉唴鏈€鏃╁搧鐗屽寲鐨勫缓闄跺搧鐗岋紝浠モ€滄枃鍖栭櫠鐡封€濆崰棰嗗競鍦猴紝浜湁鈥滀豢鍙ょ爾鑷冲皧鈥濈殑缇庤獕銆?;
    }

}
  • 浠ヤ笂灏辨槸鏈瑁呬慨鍏徃鎵€鎻愪緵鐨? 瑁呬慨閰嶇疆鍗?/code>锛屾帴涓嬫垜浠細閫氳繃妗堜緥鍘讳娇鐢ㄤ笉鍚岀殑鐗╂枡缁勫悎鍑轰笉鍚岀殑濂楅鏈嶅姟銆?

浜斻€佺敤涓€鍧ㄥ潹浠g爜瀹炵幇

璁查亾鐞嗘病鏈塱felse瑙e喅涓嶄簡鐨勯€昏緫锛屼笉琛屽氨鍦ㄥ姞涓€琛岋紒

姣忎竴涓珷鑺備腑鎴戜滑閮戒細浣跨敤杩欐牱寰堢洿鐧界殑鏂瑰紡鍘绘妸鍔熻兘瀹炵幇鍑烘潵锛屽湪閫氳繃璁捐妯″紡鍘讳紭鍖栧畬鍠勩€傝繖鏍风殑浠g爜缁撴瀯涔熼兘鏄潪甯哥畝鍗曠殑锛屾病鏈夊鏉傜殑绫诲叧绯荤粨鏋勶紝閮芥槸鐩存潵鐩村幓鐨勪唬鐮併€傞櫎浜嗘垜浠粡甯稿己璋冪殑杩欐牱鐨勪唬鐮佷笉鑳藉緢濂界殑鎵╁睍澶栵紝鍋氫竴浜涗緥瀛恉emo宸ョ▼杩樻槸鍙互鐨勩€?/p>

1. 宸ョ▼缁撴瀯

itstack-demo-design-3-01
鈹斺攢鈹€ src
    鈹斺攢鈹€ main
        鈹斺攢鈹€ java
            鈹斺攢鈹€ org.itstack.demo.design
                鈹斺攢鈹€ DecorationPackageController.java

涓€涓被鍑犲崈琛岀殑浠g爜浣犳槸鍚﹁杩囷紝鍤紵閭d粖澶╁氨璁╀綘瑙佽瘑涓€涓嬫湁杩欐牱娼滆川鐨勭被锛?/p>

2. ifelse瀹炵幇闇€姹?/span>

public class DecorationPackageController {

    public String getMatterList(BigDecimal area, Integer level) {

        List<Matter> list = new ArrayList<Matter>(); // 瑁呬慨娓呭崟
        BigDecimal price = BigDecimal.ZERO;          // 瑁呬慨浠锋牸

        // 璞崕娆у紡
        if (1 == level) {

            LevelTwoCeiling levelTwoCeiling = new LevelTwoCeiling(); // 鍚婇《锛屼簩绾ч《
            DuluxCoat duluxCoat = new DuluxCoat();                   // 娑傛枡锛屽涔愬+
            ShengXiangFloor shengXiangFloor = new ShengXiangFloor(); // 鍦版澘锛屽湥璞?/span>

            list.add(levelTwoCeiling);
            list.add(duluxCoat);
            list.add(shengXiangFloor);

            price = price.add(area.multiply(new BigDecimal("0.2")).multiply(levelTwoCeiling.price()));
            price = price.add(area.multiply(new BigDecimal("1.4")).multiply(duluxCoat.price()));
            price = price.add(area.multiply(shengXiangFloor.price()));

        }

        // 杞诲ア鐢板洯
        if (2 == level) {

            LevelTwoCeiling levelTwoCeiling = new LevelTwoCeiling(); // 鍚婇《锛屼簩绾ч《
            LiBangCoat liBangCoat = new LiBangCoat();                // 娑傛枡锛岀珛閭?/span>
            MarcoPoloTile marcoPoloTile = new MarcoPoloTile();       // 鍦扮爾锛岄┈鍙尝缃?/span>

            list.add(levelTwoCeiling);
            list.add(liBangCoat);
            list.add(marcoPoloTile);

            price = price.add(area.multiply(new BigDecimal("0.2")).multiply(levelTwoCeiling.price()));
            price = price.add(area.multiply(new BigDecimal("1.4")).multiply(liBangCoat.price()));
            price = price.add(area.multiply(marcoPoloTile.price()));

        }

        // 鐜颁唬绠€绾?/span>
        if (3 == level) {

            LevelOneCeiling levelOneCeiling = new LevelOneCeiling();  // 鍚婇《锛屼簩绾ч《
            LiBangCoat liBangCoat = new LiBangCoat();                 // 娑傛枡锛岀珛閭?/span>
            DongPengTile dongPengTile = new DongPengTile();           // 鍦扮爾锛屼笢楣?/span>

            list.add(levelOneCeiling);
            list.add(liBangCoat);
            list.add(dongPengTile);

            price = price.add(area.multiply(new BigDecimal("0.2")).multiply(levelOneCeiling.price()));
            price = price.add(area.multiply(new BigDecimal("1.4")).multiply(liBangCoat.price()));
            price = price.add(area.multiply(dongPengTile.price()));
        }

        StringBuilder detail = new StringBuilder("\r\n-------------------------------------------------------\r\n" +
                "瑁呬慨娓呭崟" + "\r\n" +
                "濂楅绛夌骇锛? + level + "\r\n" +
                "濂楅浠锋牸锛? + price.setScale(2, BigDecimal.ROUND_HALF_UP) + " 鍏僜r\n" +
                "鎴垮眿闈㈢Н锛? + area.doubleValue() + " 骞崇背\r\n" +
                "鏉愭枡娓呭崟锛歕r\n");

        for (Matter matter: list) {
            detail.append(matter.scene()).append("锛?).append(matter.brand()).append("銆?).append(matter.model()).append("銆佸钩绫充环鏍硷細").append(matter.price()).append(" 鍏冦€俓n");
        }

        return detail.toString();

    }

}
  • 棣栧厛杩欐浠g爜鎵€瑕佽В鍐崇殑闂灏辨槸鎺ユ敹鍏ュ弬锛涜淇潰绉?area)銆佽淇瓑绾?level)锛屾牴鎹笉鍚岀被鍨嬬殑瑁呬慨绛夌骇閫夋嫨涓嶅悓鐨勬潗鏂欍€?
  • 鍏舵鍦ㄥ疄鐜拌繃绋嬩腑鍙互鐪嬪埌姣忎竴娈? if鍧楅噷锛岄兘鍖呭惈鐫€涓嶉€氱殑鏉愭枡( 鍚婇《锛屼簩绾ч《銆佹秱鏂欙紝绔嬮偊銆佸湴鐮栵紝椹彲娉㈢綏)锛屾渶缁堢敓鎴愯淇竻鍗曞拰瑁呬慨鎴愭湰銆?
  • 鏈€鍚庢彁渚涜幏鍙栬淇缁嗕俊鎭殑鏂规硶锛岃繑鍥炵粰璋冪敤鏂癸紝鐢ㄤ簬鐭ラ亾瑁呬慨娓呭崟銆?

3. 娴嬭瘯楠岃瘉

鎺ヤ笅鏉ユ垜浠€氳繃junit鍗曞厓娴嬭瘯鐨勬柟寮忛獙璇佹帴鍙f湇鍔★紝寮鸿皟鏃ュ父缂栧啓濂藉崟娴嬪彲浠ユ洿濂界殑鎻愰珮绯荤粺鐨勫仴澹害銆?/p>

銆岀紪鍐欐祴璇曠被锛氥€?/strong>

@Test
public void test_DecorationPackageController(){
    DecorationPackageController decoration = new DecorationPackageController();
    // 璞崕娆у紡
    System.out.println(decoration.getMatterList(new BigDecimal("132.52"),1));
    // 杞诲ア鐢板洯
    System.out.println(decoration.getMatterList(new BigDecimal("98.25"),2));
    // 鐜颁唬绠€绾?/span>
    System.out.println(decoration.getMatterList(new BigDecimal("85.43"),3));
}

銆岀粨鏋滐細銆?/strong>

-------------------------------------------------------
瑁呬慨娓呭崟
濂楅绛夌骇锛?span class="mq-661">1
濂楅浠锋牸锛?span class="mq-662">198064.39 鍏?br>鎴垮眿闈㈢Н锛?span class="mq-663">132.52 骞崇背
鏉愭枡娓呭崟锛?br>鍚婇《锛氳淇叕鍙歌嚜甯︺€佷簩绾ч《銆佸钩绫充环鏍硷細850 鍏冦€?br>娑傛枡锛氬涔愬+(Dulux)銆佺浜屼唬銆佸钩绫充环鏍硷細719 鍏冦€?br>鍦版澘锛氬湥璞°€佷竴绾с€佸钩绫充环鏍硷細318 鍏冦€?br>

-------------------------------------------------------
瑁呬慨娓呭崟
濂楅绛夌骇锛?span class="mq-667">2
濂楅浠锋牸锛?span class="mq-668">119865.00 鍏?br>鎴垮眿闈㈢Н锛?span class="mq-669">98.25 骞崇背
鏉愭枡娓呭崟锛?br>鍚婇《锛氳淇叕鍙歌嚜甯︺€佷簩绾ч《銆佸钩绫充环鏍硷細850 鍏冦€?br>娑傛枡锛氱珛閭︺€侀粯璁ょ骇鍒€佸钩绫充环鏍硷細650 鍏冦€?br>鍦扮爾锛氶┈鍙尝缃?MARCO POLO)銆佺己鐪併€佸钩绫充环鏍硷細140 鍏冦€?br>

-------------------------------------------------------
瑁呬慨娓呭崟
濂楅绛夌骇锛?span class="mq-673">3
濂楅浠锋牸锛?span class="mq-674">90897.52 鍏?br>鎴垮眿闈㈢Н锛?span class="mq-675">85.43 骞崇背
鏉愭枡娓呭崟锛?br>鍚婇《锛氳淇叕鍙歌嚜甯︺€佷竴绾ч《銆佸钩绫充环鏍硷細260 鍏冦€?br>娑傛枡锛氱珛閭︺€侀粯璁ょ骇鍒€佸钩绫充环鏍硷細650 鍏冦€?br>鍦扮爾锛氫笢楣忕摲鐮栥€?span class="mq-678">10001銆佸钩绫充环鏍硷細102 鍏冦€?br>

Process finished with exit code 0
  • 鐪嬪埌杈撳嚭鐨勮繖涓粨鏋滐紝宸茬粡寰堟湁瑁呬慨鍏徃鎻愪緵鎶ヤ环鍗曠殑鎰熻浜嗐€備互涓婅繖娈典娇鐢? ifelse鏂瑰紡瀹炵幇鐨勪唬鐮侊紝鐩墠宸茬粡婊¤冻鐨勬垜浠殑涔熻鍔熻兘銆備絾闅忕潃鑰佹澘瀵逛笟鍔$殑蹇€熷彂灞曡姹傦紝浼氭彁渚涘緢澶氱殑濂楅閽堝涓嶅悓鐨勬埛鍨嬨€傞偅涔堣繖娈靛疄鐜颁唬鐮佸皢杩呴€熸墿澧炲埌鍑犲崈琛岋紝鐢氳嚦鍦ㄤ慨淇敼鏀逛腑锛屽凡缁忓儚鑶忚嵂涓€鏍烽毦浠ョ淮鎶ゃ€?

鍏€佸缓閫犺€呮ā寮忛噸鏋勪唬鐮?/span>

鎺ヤ笅鏉ヤ娇鐢ㄥ缓閫犺€呮ā寮忔潵杩涜浠g爜浼樺寲锛屼篃绠楁槸涓€娆″緢灏忕殑閲嶆瀯銆?/code>

寤洪€犺€呮ā寮忎富瑕佽В鍐崇殑闂鏄湪杞欢绯荤粺涓紝鏈夋椂鍊欓潰涓寸潃"涓€涓鏉傚璞?鐨勫垱寤哄伐浣滐紝鍏堕€氬父鐢卞悇涓儴鍒嗙殑瀛愬璞$敤涓€瀹氱殑杩囩▼鏋勬垚锛涚敱浜庨渶姹傜殑鍙樺寲锛岃繖涓鏉傚璞$殑鍚勪釜閮ㄥ垎缁忓父闈复鐫€閲嶅ぇ鐨勫彉鍖栵紝浣嗘槸灏嗗畠浠粍鍚堝湪涓€璧风殑杩囩▼鍗寸浉瀵圭ǔ瀹氥€?/p>

杩欓噷鎴戜滑浼氭妸鏋勫缓鐨勮繃绋嬩氦缁?code class="mq-692">鍒涘缓鑰?/code>绫伙紝鑰屽垱寤鸿€呴€氳繃浣跨敤鎴戜滑鐨?code class="mq-693">鏋勫缓宸ュ叿鍖?/code>锛屽幓鏋勫缓鍑轰笉鍚岀殑瑁呬慨濂楅銆?/p>

1. 宸ョ▼缁撴瀯

itstack-demo-design-3-02
鈹斺攢鈹€ src
    鈹溾攢鈹€ main
    鈹?nbsp;  鈹斺攢鈹€ java
    鈹?nbsp;      鈹斺攢鈹€ org.itstack.demo.design
    鈹?nbsp;          鈹溾攢鈹€ Builder.java    
    鈹?nbsp;          鈹溾攢鈹€ DecorationPackageMenu.java
    鈹?nbsp;          鈹斺攢鈹€ IMenu.java 
    鈹斺攢鈹€ test
         鈹斺攢鈹€ java
             鈹斺攢鈹€ org.itstack.demo.design.test
                 鈹斺攢鈹€ ApiTest.java

銆屽缓閫犺€呮ā鍨嬬粨鏋勩€?/strong>

閲嶅 Java 璁捐妯″紡锛氬疄鎴樺缓閫犺€呮ā寮? class=
寤洪€犺€呮ā鍨嬬粨鏋?

宸ョ▼涓湁涓変釜鏍稿績绫诲拰涓€涓祴璇曠被锛屾牳蹇冪被鏄缓閫犺€呮ā寮忕殑鍏蜂綋瀹炵幇銆備笌ifelse瀹炵幇鏂瑰紡鐩告瘮锛屽鍑烘潵浜嗕袱涓簩澶栫殑绫汇€傚叿浣撳姛鑳藉涓嬶紱

  • Builder锛屽缓閫犺€呯被鍏蜂綋鐨勫悇绉嶇粍瑁呯敱姝ょ被瀹炵幇銆?
  • DecorationPackageMenu锛屾槸 IMenu鎺ュ彛鐨勫疄鐜扮被锛屼富瑕佹槸鎵胯浇寤洪€犺繃绋嬩腑鐨勫~鍏呭櫒銆傜浉褰撲簬杩欐槸涓€濂楁壙杞界墿鏂欏拰鍒涘缓鑰呬腑闂磋鎺ョ殑鍐呭銆?

銆屽ソ銆?/strong>锛岄偅涔堟帴涓嬫潵浼氬垎鍒瑙e嚑涓被鐨勫叿浣撳疄鐜般€?/p>

2. 浠g爜瀹炵幇

2.1 瀹氫箟瑁呬慨鍖呮帴鍙?/span>

public interface IMenu {

    IMenu appendCeiling(Matter matter)// 鍚婇《

    IMenu appendCoat(Matter matter);    // 娑傛枡

    IMenu appendFloor(Matter matter);   // 鍦版澘

    IMenu appendTile(Matter matter);    // 鍦扮爾

    String getDetail();                 // 鏄庣粏 

}
  • 鎺ュ彛绫讳腑瀹氫箟浜嗗~鍏呭悇椤圭墿鏂欑殑鏂规硶锛? 鍚婇《銆? 娑傛枡銆? 鍦版澘銆? 鍦扮爾锛屼互鍙婃渶缁堟彁渚涜幏鍙栧叏閮ㄦ槑缁嗙殑鏂规硶銆?

2.2 瑁呬慨鍖呭疄鐜?/span>

public class DecorationPackageMenu implements IMenu {

    private List<Matter> list = new ArrayList<Matter>();  // 瑁呬慨娓呭崟
    private BigDecimal price = BigDecimal.ZERO;      // 瑁呬慨浠锋牸

    private BigDecimal area;  // 闈㈢Н
    private String grade;     // 瑁呬慨绛夌骇锛涜豹鍗庢寮忋€佽交濂㈢敯鍥€佺幇浠g畝绾?/span>

    private DecorationPackageMenu() {
    }

    public DecorationPackageMenu(Double area, String grade) {
        this.area = new BigDecimal(area);
        this.grade = grade;
    }

    public IMenu appendCeiling(Matter matter) {
        list.add(matter);
        price = price.add(area.multiply(new BigDecimal("0.2")).multiply(matter.price()));
        return this;
    }

    public IMenu appendCoat(Matter matter) {
        list.add(matter);
        price = price.add(area.multiply(new BigDecimal("1.4")).multiply(matter.price()));
        return this;
    }

    public IMenu appendFloor(Matter matter) {
        list.add(matter);
        price = price.add(area.multiply(matter.price()));
        return this;
    }

    public IMenu appendTile(Matter matter) {
        list.add(matter);
        price = price.add(area.multiply(matter.price()));
        return this;
    }

    public String getDetail() {

        StringBuilder detail = new StringBuilder("\r\n-------------------------------------------------------\r\n" +
                "瑁呬慨娓呭崟" + "\r\n" +
                "濂楅绛夌骇锛? + grade + "\r\n" +
                "濂楅浠锋牸锛? + price.setScale(2, BigDecimal.ROUND_HALF_UP) + " 鍏僜r\n" +
                "鎴垮眿闈㈢Н锛? + area.doubleValue() + " 骞崇背\r\n" +
                "鏉愭枡娓呭崟锛歕r\n");

        for (Matter matter: list) {
            detail.append(matter.scene()).append("锛?).append(matter.brand()).append("銆?).append(matter.model()).append("銆佸钩绫充环鏍硷細").append(matter.price()).append(" 鍏冦€俓n");
        }

        return detail.toString();
    }

}
  • 瑁呬慨鍖呯殑瀹炵幇涓瘡涓€涓柟娉曢兘浼氫簡 this锛屼篃灏卞彲浠ラ潪甯告柟渚跨殑鐢ㄤ簬杩炵画濉厖鍚勯」鐗╂枡銆?
  • 鍚屾椂鍦ㄥ~鍏呮椂涔熶細鏍规嵁鐗╂枡璁$畻骞崇背鏁颁笅鐨勬姤浠凤紝鍚婇《鍜屾秱鏂欐寜鐓у钩绫虫暟閫傞噺涔樹互甯哥啛璁$畻銆?
  • 鏈€鍚庡悓鏍锋彁渚涗簡缁熶竴鐨勮幏鍙栬淇竻鍗曠殑鏄庣粏鏂规硶銆?

2.3 寤洪€犺€呮柟娉?/span>

public class Builder {

    public IMenu levelOne(Double area) {
        return new DecorationPackageMenu(area, "璞崕娆у紡")
                .appendCeiling(new LevelTwoCeiling())    // 鍚婇《锛屼簩绾ч《
                .appendCoat(new DuluxCoat())             // 娑傛枡锛屽涔愬+
                .appendFloor(new ShengXiangFloor());     // 鍦版澘锛屽湥璞?/span>
    }

    public IMenu levelTwo(Double area){
        return new DecorationPackageMenu(area, "杞诲ア鐢板洯")
                .appendCeiling(new LevelTwoCeiling())   // 鍚婇《锛屼簩绾ч《
                .appendCoat(new LiBangCoat())           // 娑傛枡锛岀珛閭?/span>
                .appendTile(new MarcoPoloTile());       // 鍦扮爾锛岄┈鍙尝缃?/span>
    }

    public IMenu levelThree(Double area){
        return new DecorationPackageMenu(area, "鐜颁唬绠€绾?)
                .appendCeiling(new LevelOneCeiling())   // 鍚婇《锛屼簩绾ч《
                .appendCoat(new LiBangCoat())           // 娑傛枡锛岀珛閭?/span>
                .appendTile(new DongPengTile());        // 鍦扮爾锛屼笢楣?/span>
    }

}
  • 寤洪€犺€呯殑浣跨敤涓氨宸茬粡闈炲父瀹规槗浜嗭紝缁熶竴鐨勫缓閫犳柟寮忥紝閫氳繃涓嶅悓鐗╂枡濉厖鍑轰笉鍚岀殑瑁呬慨椋庢牸锛? 璞崕娆у紡銆? 杞诲ア鐢板洯銆? 鐜颁唬绠€绾?/code>锛屽鏋滃皢鏉ヤ笟鍔℃墿灞曚篃鍙互灏嗚繖閮ㄥ垎鍐呭閰嶇疆鍒版暟鎹簱鑷姩鐢熸垚銆備絾鏁翠綋鐨勬€濇兂杩樺彲浠ヤ娇鐢ㄥ垱寤鸿€呮ā寮忚繘琛屾惌寤恒€?

3. 娴嬭瘯楠岃瘉

銆岀紪鍐欐祴璇曠被锛氥€?/strong>

@Test
public void test_Builder(){
    Builder builder = new Builder();
    // 璞崕娆у紡
    System.out.println(builder.levelOne(132.52D).getDetail());
    // 杞诲ア鐢板洯
    System.out.println(builder.levelTwo(98.25D).getDetail());
    // 鐜颁唬绠€绾?/span>
    System.out.println(builder.levelThree(85.43D).getDetail());
}

銆岀粨鏋滐細銆?/strong>

-------------------------------------------------------
瑁呬慨娓呭崟
濂楅绛夌骇锛氳豹鍗庢寮?br>濂楅浠锋牸锛?span class="mq-937">198064.39 鍏?br>鎴垮眿闈㈢Н锛?span class="mq-938">132.52 骞崇背
鏉愭枡娓呭崟锛?br>鍚婇《锛氳淇叕鍙歌嚜甯︺€佷簩绾ч《銆佸钩绫充环鏍硷細850 鍏冦€?br>娑傛枡锛氬涔愬+(Dulux)銆佺浜屼唬銆佸钩绫充环鏍硷細719 鍏冦€?br>鍦版澘锛氬湥璞°€佷竴绾с€佸钩绫充环鏍硷細318 鍏冦€?br>

-------------------------------------------------------
瑁呬慨娓呭崟
濂楅绛夌骇锛氳交濂㈢敯鍥?br>濂楅浠锋牸锛?span class="mq-942">119865.00 鍏?br>鎴垮眿闈㈢Н锛?span class="mq-943">98.25 骞崇背
鏉愭枡娓呭崟锛?br>鍚婇《锛氳淇叕鍙歌嚜甯︺€佷簩绾ч《銆佸钩绫充环鏍硷細850 鍏冦€?br>娑傛枡锛氱珛閭︺€侀粯璁ょ骇鍒€佸钩绫充环鏍硷細650 鍏冦€?br>鍦扮爾锛氶┈鍙尝缃?MARCO POLO)銆佺己鐪併€佸钩绫充环鏍硷細140 鍏冦€?br>

-------------------------------------------------------
瑁呬慨娓呭崟
濂楅绛夌骇锛氱幇浠g畝绾?br>濂楅浠锋牸锛?span class="mq-947">90897.52 鍏?br>鎴垮眿闈㈢Н锛?span class="mq-948">85.43 骞崇背
鏉愭枡娓呭崟锛?br>鍚婇《锛氳淇叕鍙歌嚜甯︺€佷竴绾ч《銆佸钩绫充环鏍硷細260 鍏冦€?br>娑傛枡锛氱珛閭︺€侀粯璁ょ骇鍒€佸钩绫充环鏍硷細650 鍏冦€?br>鍦扮爾锛氫笢楣忕摲鐮栥€?span class="mq-951">10001銆佸钩绫充环鏍硷細102 鍏冦€?br>       

Process finished with exit code 0
  • 娴嬭瘯缁撴灉鏄竴鏍风殑锛岃皟鐢ㄦ柟寮忎篃鍩烘湰绫讳技銆備絾鏄洰鍓嶇殑浠g爜缁撴瀯鍗村彲浠ヨ浣犲緢鏂逛究鐨勫緢鏈夎皟鐞嗙殑杩涜鎵╁睍涓氬姟寮€鍙戙€傝€屼笉鏄互寰€涓€鏍锋妸鎵€鏈変唬鐮侀兘鍐欏埌 ifelse閲岄潰銆?

涓冦€佹€荤粨

  • 閫氳繃涓婇潰瀵瑰缓閫犺€呮ā寮忕殑浣跨敤锛屽凡缁忓彲浠ユ懜绱㈠嚭涓€鐐瑰績寰椼€傞偅灏辨槸浠€涔堟椂鍊欎細閫夋嫨杩欐牱鐨勮璁℃ā寮忥紝褰擄細 涓€浜涘熀鏈墿鏂欎笉浼氬彉锛岃€屽叾缁勫悎缁忓父鍙樺寲鐨勬椂鍊?/code>锛屽氨鍙互閫夋嫨杩欐牱鐨勮璁℃ā寮忔潵鏋勫缓浠g爜銆?
  • 姝よ璁℃ā寮忔弧瓒充簡鍗曚竴鑱岃矗鍘熷垯浠ュ強鍙鐢ㄧ殑鎶€鏈€佸缓閫犺€呯嫭绔嬨€佹槗鎵╁睍銆佷究浜庢帶鍒剁粏鑺傞闄┿€備絾鍚屾椂褰撳嚭鐜扮壒鍒鐨勭墿鏂欎互鍙婂緢澶氱殑缁勫悎鍚庯紝绫荤殑涓嶆柇鎵╁睍涔熶細閫犳垚闅句互缁存姢鐨勯棶棰樸€備絾杩欑璁捐缁撴瀯妯″瀷鍙互鎶婇噸澶嶇殑鍐呭鎶借薄鍒版暟鎹簱涓紝鎸夌収闇€瑕侀厤缃€傝繖鏍峰氨鍙互鍑忓皯浠g爜涓ぇ閲忕殑閲嶅銆?
  • 璁捐妯″紡鑳藉甫缁欎綘鐨勬槸涓€浜涙€濇兂锛屼絾鍦ㄥ钩鏃剁殑寮€鍙戜腑鎬庝箞鏍锋竻鏅扮殑鎻愮偧鍑虹鍚堟鎬濊矾鐨勫缓閫犳ā鍧楋紝鏄瘮杈冮毦鐨勩€傞渶瑕佺粡杩囦竴浜涢敾鐐煎拰涓嶆柇鎵挎帴鏇村鐨勯」鐩紝浠庤€岃幏寰楄繖閮ㄥ垎缁忛獙銆傛湁鐨勬椂鍊欎綘鐨勪唬鐮佸啓鐨勫ソ锛屽線寰€鏄€掗€肩殑锛屽鏉傜殑涓氬姟棰戠箒鐨勫彉鍖栵紝涓嶆柇鐨勬寫鎴橈紒


bugstack铏礊鏍?/strong>

娌夋穩銆佸垎浜€佹垚闀匡紝璁╄嚜宸卞拰浠栦汉閮借兘鏈夋墍鏀惰幏锛?/span>

浣滆€呭皬鍌呭摜澶氬勾浠庝簨涓€绾夸簰鑱旂綉Java寮€鍙戯紝浠?9骞村紑濮嬬紪鍐欏伐浣滃拰瀛︿範鍘嗙▼鐨勬妧鏈眹鎬伙紝鏃ㄥ湪涓哄ぇ瀹舵彁渚涗竴涓緝娓呮櫚璇︾粏鐨勬牳蹇冩妧鑳藉涔犳枃妗c€傚鏋滄湰鏂囪兘涓烘偍鎻愪緵甯姪锛岃缁欎簣鏀寔(鍏虫敞銆佺偣璧炪€佸垎浜?锛?img data-ratio="1" src="/img?url=https://mmbiz.qpic.cn/sz_mmbiz_png/zTfAIs5rNXhtVo05UmoZNnvLvKGeqE0WvuoZxaObGdmonPb9tZ9RpSOlBeRc2SXmrTG0baJdccBYiaMicFnPYdDA/640?wx_fmt=png" data-type="png" data-w="20" alt="閲嶅 Java 璁捐妯″紡锛氬疄鎴樺缓閫犺€呮ā寮? class="mq-977">

鎰熻阿鏀寔灏忓倕鍝ュ師鍒涳紝娆㈣繋鐐瑰嚮鍦ㄧ湅鍜?/span>杞彂

以上是关于閲嶅 Java 璁捐妯″紡锛氬疄鎴樺缓閫犺€呮ā寮?/h1>

的主要内容,如果未能解决你的问题,请参考以下文章

鏂规璁捐锛氬熀浜嶪DEA鎻掍欢寮€鍙戝拰瀛楄妭鐮佹彃妗╂妧鏈紝瀹炵幇鐮斿彂浜や粯璐ㄩ噺鑷姩鍒嗘瀽

璁捐妯″紡璇剧▼ 璁捐妯″紡绮捐 10-2 澶栬妯″紡coding

璁捐妯″紡

璁捐妯″紡-浠g悊妯″紡

甯歌璁捐妯″瀷

妯℃澘锛氬苟鏌ラ泦

(c)2006-2024 SYSTEM All Rights Reserved IT常识