国产精品,日韩av,hdsexvideos中国少妇,xxxxx性bbbbb欧美熟妇,波多野结衣乳巨码无在线,国产成人亚洲精品乱码

自定義函數(shù)-Fx.file

2020-12-29 10:12:15 1256 本站

      Fx.file:處理和文件有關(guān)的API

1、給圖片加水印-watermark

     定義:Fx.file.watermark(<String nPath>,<List<String> words>)

參數(shù)說(shuō)明
nPath圖片的npath
words水印的內(nèi)容

     data返回值類型:Map Key |Type|說(shuō)明| -|-|- path |String |執(zhí)行成功的path

     例:

def ret = Fx.file.watermark("N_202003_04_c706c31390b747408bfb5eef3b031f34",["test123","tyrdyz"])

2、文件上傳-uploadFile

     定義:Fx.file.uploadFile( <String extensionName>,<String fileSize>,<byte[] fileBytes> )

參數(shù)說(shuō)明
extensionName文件擴(kuò)展名
fileSize文件大小
fileBytes文件內(nèi)容byte數(shù)組

     data返回值類型:Map Key |Type|說(shuō)明| -|-|- path |String |文件npath size |long |文件大小 extensionName |String | 文件擴(kuò)展名

     例:

def text = "aaa" as String
def byteData = Strings.toUTF8Bytes(text)
def ret = Fx.file.uploadFile(".txt",byteData.size(),byteData)

3、文件下載-downloadFile

     定義:Fx.file.downloadFile( <String nPath>)

參數(shù)說(shuō)明
nPath圖片的npath

     data返回值類型:Map

KeyType說(shuō)明
fileDatabyte[]文件內(nèi)容
extensionNameString文件擴(kuò)展名
fileSizelong文件大小

     例:

def ret = Fx.file.downloadFile("N_202007_12_001731386ccf40698523c39744b0161c") def fileDowloadData = ret[1] def fileData = fileDowloadData['fileData'] as byte[] def str = Strings.toUTF8String(fileData) as String


4、文件打包發(fā)送給指定用戶-Fx.file.packedFile

     定義:Fx.file.packedFile( <List packFileList> ,<List userIdList>)

參數(shù)說(shuō)明
packFileList發(fā)送的文件List
userIdList發(fā)送的人員名單

     data返回值類型:Map

 例:

UserFile file = UserFile.of("文件1","N_201907_31_57a33fb0c999447bb93fa1e4cc6e649d","jpg","/image")
List packFileList = []
packFileList.add(file)

def (Boolean error,List data,String errorMessage)  = Fx.file.packedFile(packFileList,["1000"])



部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),如有侵權(quán),請(qǐng)聯(lián)系客服刪除處理。
在線咨詢 撥打電話