實戰 後續模組的一些實用寫法概述

2021-09-02 01:43:00 字數 2519 閱讀 3228

自己學習這套課程,到畢業季找到工作,再到入職幾個月,已經過去好長時間了,現在還沒有學完這個課程也是慚愧,現在準備把這部分課程補完,不過不會像以前那樣寫的那麼細了,畢竟自己工作那麼一段時間,裡面有些東西已經爛熟於心了,那麼接下來就會記錄課程中一些自己不太熟悉的內容,作為查漏補缺吧~

自己現在的專案是使用spring cloud的配置中心,寫配置只需要bean加個註解就好了,現在再看這個課程的寫法還是有可以借鑑的地方的。

/**

*/public

class

propertiesutil

catch

(ioexception e)

}public

static string getproperty

(string key)

return value.

trim()

;}public

static string getproperty

(string key,string defaultvalue)

return value.

trim()

;}}

//startpage-start

pagehelper.

startpage

(pagenum, pagesize)

;//填充自己的sql查詢邏輯

list

selectlist()

;//pagehelper-收尾

pageinfo pageresult =

newpageinfo

(productlist)

;

mybatis 的where標籤,這個之前用的少,突然發現還是有點用的,記錄一下,where標籤會自動將第乙個and或者or去掉,方便我們拼裝多種條件判斷

<

if test=

"productname != null"

>

and name like #

>

<

if test=

"productid != null"

>

and id = #

>

<

/where>

public

class

ftputil

public

static

boolean

upload

(list

filelist)

throws ioexception "

, result)

;return result;

}private

boolean

upload

(string remotepath, list

filelist)

throws ioexception

}catch

(ioexception e)

finally

}return uploaded;

}private

boolean

connectserver

(string ip,

int port, string user, string pwd)

catch

(ioexception e)

return issuccess;

}private string ip;

private

int port;

private string user;

private string pwd;

private ftpclient ftpclient;

public string getip()

public

void

setip

(string ip)

public

intgetport()

public

void

setport

(int port)

public string getuser()

public

void

setuser

(string user)

public string getpwd()

public

void

setpwd

(string pwd)

public ftpclient getftpclient()

public

void

setftpclient

(ftpclient ftpclient)

}

這裡我沒有試過前端的simditor,這裡做個記錄,可以使用這個玩意兒。

畢竟我本人也工作一年左右了,現在回顧起來這些內容,大部分在工作中也碰到過了,值得記錄的東西不多了,但還是感謝這個實戰專案把我領進門的。後續還有一點雲伺服器的部署課程,看情況再補充一些吧。

一些巨集的寫法

1.宣告乙個常數用以表示1年中有多少秒 忽略閏年問題 define seconds per year 60 60 24 365 ul 2.返回兩個數的較大數 不能使用大於 小於 if語句 define max a,b abs a b a b a b 3.返回兩個數的較小數 define min a,...

一些實用的模板

1 floyd判最小環 注 包含基本的floyd演算法。最好寫的單源最短路徑演算法。但時間複雜度o n 3 n 1000基本就用不了了。void floyd 3 dijkstra 迪傑斯特拉 演算法 單源最短路徑演算法 基本思路 每次確定到起點距離最短且距離尚未確定的點的dis,並對其所有鄰邊進行鬆...

JS原生的一些寫法

今天在寫頁面的時候,因為不想使用jquery了,所以想用原生js寫一下,發現原生的js都差不多忘記了,所以來補習一下 slice 如果接收的是負數,會將它字串的長度與對應的負數相加,接收的是起始位置和結束位置 不包括結束位置 substring 以兩個引數中較小乙個作為起始位置,較大的引數作為結束位...