dayfastdfs服務(wù)器angularjs圖片商品錄入_第1頁(yè)
dayfastdfs服務(wù)器angularjs圖片商品錄入_第2頁(yè)
dayfastdfs服務(wù)器angularjs圖片商品錄入_第3頁(yè)
dayfastdfs服務(wù)器angularjs圖片商品錄入_第4頁(yè)
dayfastdfs服務(wù)器angularjs圖片商品錄入_第5頁(yè)
免費(fèi)預(yù)覽已結(jié)束,剩余28頁(yè)可下載查看

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

課程目目標(biāo)2:了解概念SPU和SKU3:掌握富文本編輯器的使用4FastDFS目標(biāo)5:掌握angularJS上傳商品分需求分表結(jié)構(gòu)分 后端代根據(jù)上級(jí)IDpublicList<TbItemCat>findByParentId(Long**根據(jù)上級(jí)IDpublicList<TbItemCat>findByParentId(LongparentId){TbItemCatExampleexample1=newTbItemCatExample();Criteriacriteria1=example1.createCriteria();return}根據(jù)上級(jí)ID@param publicList<TbItemCat>findByParentId(Longreturn}前端代////根據(jù)上級(jí)IDreturn}}}<script<scripttype="text/javascript"src="../plugins/angularjs/angular.min.js"><scripttype="text/javascript"src="../js/base.js"><scripttype="text/javascript"src="../js/service/itemCatService.js"><scripttype="text/javascript"src="../js/controller/baseController.js">ng-controller="itemCatController"ng-<tr<trng-repeat="entityin<td><inputtype="checkbox"<tdclass="text-<buttontype="button"class="btnbg-olivebtn-<buttontype="button"class="btnbg-olivebtn-xs"data-toggle="modal"data-target="#editModal">修改</button>itemCatController.js} }}} }<span<spanng-<buttontype="button"class="btnbg-olivebtn-ng-if3的時(shí)候才顯示“查詢下級(jí)”按<<ol<li><ahref=ng-click="grade=1;selectList({id:0})">頂級(jí)分類列表<li><ahref="#"ng-<li><a<li><ahref="#"ng-新增商品分類(學(xué)員實(shí)現(xiàn)實(shí)現(xiàn)思路:我們需要一個(gè)變量去記住上級(jí)ID,在保存的時(shí)候再根據(jù)這個(gè)ID來(lái)新增分類修改itemCatController.js, $scope.parentId=parentId;//記住上級(jí)ID}}varserviceObject;//服務(wù)層對(duì)if($scope.entity.id!=null){//如果有IDserviceObject=itemCatService.update$scope.entity修改$scope.entity.parentId=$scope.parentId;//賦予上級(jí)IDserviceObject=itemCatService.add$scope.entity);//增加}}}}<divclass="modal-<tableclass="tabletable-borderedtable-striped"{{entity_1.name}}>><td><inputclass="form-control"ng-model=""placeholder="商品分類名稱"></td>class="form-control"type="text"/><divclass="modal-<buttonclass="btnbtn-success"data-dismiss="modal"aria-關(guān)閉修改商品分類(學(xué)員實(shí)現(xiàn) data-target="#editModal"ng-click="findOne(entity.id)">修改</button>刪除商品分類(學(xué)員實(shí)現(xiàn)(代碼略概念及表結(jié)構(gòu)分SPUSPUStandardProductUnit(標(biāo)準(zhǔn)產(chǎn)品單位通俗點(diǎn)講,屬性值、特性相同的商品就可以稱為一個(gè)SPUSKUSKU是物理上不可分割的最小存貨單元。在使用時(shí)要根據(jù)不同業(yè)態(tài),不同管理模式來(lái)處理。Tb_goods商家-商品錄入【基本功能在商 實(shí)體publicpublicclassGoodsimplementsprivateTbGoodsgoods;//商品privateTbGoodsDescgoodsDesc;//商品擴(kuò)privateList<TbItemitemList;//商品SKU列//getterandsetter方法}數(shù)據(jù)ID,insert<selectKey<selectKeyresultType="java.lang.Long"order="AFTER"keyProperty="id">SELECTLAST_INSERT_ID()ASid服務(wù)接口pinyougou-sellergoods-interfaceGoodsServiceadd*publicvoidadd(Goods服務(wù)實(shí)現(xiàn)privateTbGoodsDescMapper*增publicvoidadd(Goodsgoods){}控制@param publicpublicResultadd(@RequestBodyGoodsStringsellerIdgoods.getGoods().setSellerId(sellerId);//IDtryreturnnewResult(true增加成功}catch(Exceptione){returnnewResult(false增加失敗}}控制goodsService.add($scope.entity}}}頁(yè)<script<scripttype="text/javascript"src="../plugins/angularjs/angular.min.js"><scripttype="text/javascript"src="../js/base.js"><scripttype="text/javascript"src="../js/service/goodsService.js"><scripttype="text/javascript"src="../js/controller/baseController.js"><scripttype="text/javascript"src="../js/controller/goodsController.js"><div<divclass="col-md-2title">商品名稱<divclass="col-md-10<inputtype="text"class="form-control"ng-model="entity.goods.goodsName"placeholder="商品名稱"value=""><divclass="col-md-2title">副標(biāo)題<divclass="col-md-10<inputtype="text"class="form-control"ng-model="entity.goods.caption"placeholder="副標(biāo)題"value=""><divclass="col-md-2title">價(jià)格<divclass="col-md-10<divclass="input-<spanclass="input-group-<inputtype="text"class="form-control"ng-model="entity.goods.price"placeholder="價(jià)格"value=""><divclass="col-md-2titlerowHeight2x">包裝列表<divclass="col-md-10data<textarearows="4"class="form-control"ng-model="entity.goodsDesc.packageList"<divclass="col-md-2title <divclass="col-md-10data<textarearows="4"class="form-control"ng-model="entity.goodsDesc.saleService" <<buttonclass="btnbtn-primary"ng-click="add()"><iclass="fafa-save"></i保存商家-商品錄入【商品介紹富文本編輯器,RichTextEditor,簡(jiǎn)稱RTE,它提供類似于 Word的編輯功能。常 http:/ kindeditor初始化kindeditor編輯<<scriptvarvareditor;KindEditor.ready(function(K){editor=K.create('textarea[name="content"]',{allowFileManager:trueallowFileManager提取kindeditor編輯器的內(nèi)清空kindeditor編輯器的內(nèi)}}分布式文件服務(wù)器FastDFSc語(yǔ)言編寫(xiě)的一款開(kāi)源的分布式文件系統(tǒng)。FastDFS為互聯(lián)網(wǎng)量身定制,F(xiàn)astDFS很容易搭建一套高性能的文件服務(wù)器集群提供文件上傳、等服務(wù)。FastDFSTrackerserverStorageserverTrackerserver進(jìn)行文件上傳、,通過(guò)Trackerserver調(diào)度最終由Storageserver完成文件上傳和。TrackerserverTrackerserver在文件上傳時(shí)可以根據(jù)一些策略找到Storageserver提供文件上傳服務(wù)??梢詫racker稱為追蹤服務(wù)器或調(diào)度服務(wù)Storageserver作用是文件,客戶端上傳的文件最終在Storage服務(wù)器上,Storageserverstorage稱為服務(wù)器。Storage:實(shí)際保存文件Storage分為多個(gè)組,每個(gè)組之間保存的文件是不同的。每文件上傳及的流文件上傳流客戶端上傳文件后服務(wù)器將文件ID返回給客戶端,此文件ID用于以后該文 組名storagestorage服務(wù)器返回,虛擬磁盤(pán)路徑:storagestore_path*對(duì)應(yīng)。如果配置了store_path0則是M00,如果配置了store_path1則是M01,以此類推。 :storage服務(wù)器在每個(gè)虛擬磁盤(pán)路徑下創(chuàng)建的兩級(jí) ,用于數(shù)據(jù)文件名:與文件上傳時(shí)不同。是由服務(wù)器根據(jù)特定信息生成,文件名包含:源服務(wù)器IP地址、文件創(chuàng)建時(shí)間戳、文件大小、隨機(jī)數(shù)和文件拓展名等信息。文件流FastDFSFastDFSIP地址已經(jīng)固定為33 ,請(qǐng)?jiān)O(shè)置你的僅主機(jī)網(wǎng)段為25。登錄名為root FastDFS需求:將本地上傳至服務(wù)器,再控制臺(tái)打印Maven由于FastDFS客戶端jar包并沒(méi)有在倉(cāng)庫(kù)中,所以需要使用下列命令手動(dòng)安裝jar包到Maven本地倉(cāng)庫(kù)(jardsetup)jar包,此步 - --Dpackaging=jar--pom.xmljava類,main1tracker2、創(chuàng)建一個(gè)TrackerClient對(duì)象。直接new一個(gè)TrackerClienttrackerClient=new3、使用TrackerClient對(duì)象創(chuàng)建連接,獲得一個(gè)TrackerServer對(duì)象TrackerServertrackerServer=//4、創(chuàng)建一個(gè)StorageServer的 ,值為nullStorageServerstorageServer=null;5一個(gè)StorageClientTrackerServer的//6、使用StorageClient對(duì)象上傳String[]strings=storageClient.upload_file("D:/pic/benchi.jpg",//7、返回?cái)?shù)組。包含組名和的路徑for(Stringstring:strings){}商家-商品錄入【商品上傳在商品錄入界面實(shí)現(xiàn)多上工具monpom.xml mon工配置文config<!--<!--配置 解析器--<beanid="multipartResolver"<property<propertyname="defaultEncoding"value="UTF-5MB,5*1024*1024<propertyname="maxUploadSize"控制packagepackageimportorg.springframework.beans.factory.annotation.Value;importorg.springframework.web.bind.annotation.RequestMap importorg.springframework.web.bind.annotation.RestController;importorg.springframework.web.multipart.MultipartFile;importentity.Result;import文件上傳@authorpublicclassUploadControllerprivateStringFILE_SERVER_URL;//文件服務(wù)器地 publicResultupload(MultipartFileStringoriginalFilename=+try//2FastDFSFastDFSClient=newStringpath=fastDFSClient.uploadFile(file.getBytes(),//4、拼接返回的urlip地址,拼裝成完整的urlStringurl=FILE_SERVER_URL+path;returnnew}catch(Exceptione){returnnewResult(false上傳失敗}}}服務(wù)varformData=newFormData();return$http({data:formData,headers:{'Content-Type':undefined},transformRequest:angular.identity}anjularjspostgetContent-Typeheaderapplication/json。通過(guò)設(shè)置transformRequest:angular.identity,anjularjstransformRequestfunction將序列化formdataobject.uploadServicegoodsController app.controller('goodsController',function($scope,$controller goods_edit.html引入<script<scripttype="text/javascript"src="../js/base.js"><scripttype="text/javascript"src="../js/service/goodsService.js"><scripttype="text/javascript"src="../js/service/itemCatService.js"><scripttype="text/javascript"src="../js/service/uploadService.js"><scripttype="text/javascript"src="../js/controller/baseController.js"><scripttype="text/javascript"src="../js/controller/goodsController.js">上傳*uploadService.uploadFile().success(function(response

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論