diff --git a/main.go b/main.go index e9147c7..e587e59 100644 --- a/main.go +++ b/main.go @@ -5,6 +5,7 @@ import ( "github.com/dutroctu/go-webservice/database" "github.com/dutroctu/go-webservice/product" + "github.com/dutroctu/go-webservice/receipt" _ "github.com/go-sql-driver/mysql" ) @@ -24,6 +25,7 @@ const apiBasePath = "/api" func main() { database.SetupDatabase() + receipt.SetupRoutes(apiBasePath) product.SetupRoutes(apiBasePath) http.ListenAndServe(":5000", nil) diff --git a/receipt/receipt.go b/receipt/receipt.go new file mode 100644 index 0000000..b439610 --- /dev/null +++ b/receipt/receipt.go @@ -0,0 +1,26 @@ +package receipt + +import ( + "io/ioutil" + "path/filepath" + "time" +) + +var ReceiptDirectory string = filepath.Join("uploads") + +type Receipt struct { + ReceiptName string `json:"name"` + UploadDate time.Time `json:"uploadDate"` +} + +func GetReceipts() ([]Receipt, error) { + receipts := make([]Receipt, 0) + files, err := ioutil.ReadDir(ReceiptDirectory) + if err != nil { + return nil, err + } + for _, f := range files { + receipts = append(receipts, Receipt{ReceiptName: f.Name(), UploadDate: f.ModTime()}) + } + return receipts, nil +} diff --git a/receipt/receipt.service.go b/receipt/receipt.service.go new file mode 100644 index 0000000..f31c543 --- /dev/null +++ b/receipt/receipt.service.go @@ -0,0 +1,95 @@ +package receipt + +import ( + "encoding/json" + "fmt" + "io" + "log" + "net/http" + "os" + "path/filepath" + "strconv" + "strings" + + "github.com/dutroctu/go-webservice/cors" +) + +const receiptPath = "receipts" + +func handleReceipts(w http.ResponseWriter, r *http.Request) { + switch r.Method { + case http.MethodGet: + receiptList, err := GetReceipts() + if err != nil { + w.WriteHeader(http.StatusInternalServerError) + return + } + j, err := json.Marshal(receiptList) + if err != nil { + log.Fatal(err) + } + _, err = w.Write(j) + if err != nil { + log.Fatal(err) + } + case http.MethodPost: + r.ParseMultipartForm(5 << 20) //5Mb + file, handler, err := r.FormFile("receipt") + if err != nil { + w.WriteHeader(http.StatusBadRequest) + return + } + defer file.Close() + f, err := os.OpenFile(filepath.Join(ReceiptDirectory, handler.Filename), + os.O_WRONLY|os.O_CREATE, 0666) + if err != nil { + w.WriteHeader(http.StatusBadRequest) + return + } + defer f.Close() + io.Copy(f, file) + w.WriteHeader(http.StatusCreated) + + case http.MethodOptions: + return + default: + w.WriteHeader(http.StatusMethodNotAllowed) + return + } +} + +func SetupRoutes(apiBasePath string) { + receiptHandler := http.HandlerFunc(handleReceipts) + downloadHandler := http.HandlerFunc(handleDownload) + http.Handle(fmt.Sprintf("%s/%s", apiBasePath, receiptPath), cors.Middleware(receiptHandler)) + http.Handle(fmt.Sprintf("%s/%s/", apiBasePath, receiptPath), cors.Middleware(downloadHandler)) +} + +func handleDownload(w http.ResponseWriter, r *http.Request) { + urlPathSegments := strings.Split(r.URL.Path, fmt.Sprintf("%s/", receiptPath)) + if len(urlPathSegments[1:]) > 1 { + w.WriteHeader(http.StatusBadRequest) + return + } + fileName := urlPathSegments[1:][0] + file, err := os.Open(filepath.Join(ReceiptDirectory, fileName)) + if err != nil { + w.WriteHeader(http.StatusNotFound) + return + } + defer file.Close() + fHeader := make([]byte, 512) + file.Read(fHeader) + fContentType := http.DetectContentType(fHeader) + stat, err := file.Stat() + if err != nil { + w.WriteHeader(http.StatusInternalServerError) + return + } + fSize := strconv.FormatInt(stat.Size(), 10) + w.Header().Set("Content-Disposition", "attachment; filename="+fileName) + w.Header().Set("Content-Type", fContentType) + w.Header().Set("Content-Length", fSize) + file.Seek(0, 0) + io.Copy(w, file) +} diff --git a/uploads/.viminfo b/uploads/.viminfo new file mode 100644 index 0000000..be44dfe --- /dev/null +++ b/uploads/.viminfo @@ -0,0 +1,712 @@ +# This viminfo file was generated by Vim 8.1. +# You may edit it if you're careful! + +# Viminfo version +|1,4 + +# Value of 'encoding' when this file was written +*encoding=utf-8 + + +# hlsearch on (H) or off (h): +~h +# Last Search Pattern: +~MSle0~/VIOLATION_THRES + +# Command Line History (newest to oldest): +:wq +|2,0,1627560163,,"wq" +:ưq +|2,0,1627436452,,"ưq" +:q +|2,0,1591611506,,"q" +:¿q +|2,0,1586239824,,"¿q" +:Wq +|2,0,1585395537,,"Wq" +:q! +|2,0,1583472061,,"q!" +:wq +|2,0,1568190437,,"wq " +:w +|2,0,1562130633,,"w" + +# Search String History (newest to oldest): +?/VIOLATION_THRES +|2,1,1570155987,47,"VIOLATION_THRES" +?/ODOofIPK +|2,1,1565082617,47,"ODOofIPK" +?/dbc +|2,1,1565082482,47,"dbc" +?/== +|2,1,1561363731,47,"==" +?/=== +|2,1,1561363682,47,"===" + +# Expression History (newest to oldest): + +# Input Line History (newest to oldest): + +# Debug Line History (newest to oldest): + +# Registers: +"0 LINE 0 + uint8_t buf[] = {0x34, 0x28, 0x00, 0x02, 0x71}; +|3,0,0,1,1,0,1560335981,"uint8_t buf[] = {0x34, 0x28, 0x00, 0x02, 0x71};" +""1 LINE 0 + fetch = +refs/heads/*:refs/remotes/–rigin/* +|3,1,1,1,1,0,1584627770," fetch = +refs/heads/*:refs/remotes/–rigin/*" +"2 LINE 0 + url = git@github.com:lmtan91/vfengineermode.git +|3,0,2,1,1,0,1584627769," url = git@github.com:lmtan91/vfengineermode.git" +"3 LINE 0 + [remote "–rigin"] +|3,0,3,1,1,0,1584627769,"[remote \"–rigin\"]" +"4 LINE 0 + <<<<<<< HEAD +|3,0,4,1,1,0,1570156003,"<<<<<<< HEAD" +"5 LINE 0 + >>>>>>> f8eb46afa70047acc24e5abc0f01e7dff604b860 +|3,0,5,1,1,0,1570156001,">>>>>>> f8eb46afa70047acc24e5abc0f01e7dff604b860" +"6 LINE 0 + VIOLATION_THRES = 277 +|3,0,6,1,1,0,1570156001,"VIOLATION_THRES = 277" +"7 LINE 0 + ======= +|3,0,7,1,1,0,1570156000,"=======" +"8 LINE 0 + <<<<<<< HEAD +|3,0,8,1,1,0,1563946479,"<<<<<<< HEAD" +"9 LINE 0 + ======= + srcDir "System_Test/common" + srcDir "System_Test/ST_BasicDiag" + srcDir "System_Test/ST_BasicDiag/cfg" + srcDir "System_Test/ST_Callback" + srcDir "System_Test/ST_DtcMon" + srcDir "System_Test/ST_Libraries" + srcDir "System_Test/ST_RoutineControl" + srcDir "System_Test/ST_RoutineControl/cfg" + srcDir "System_Test/ST_SecurityAccess" + srcDir "System_Test/ST_SecurityAccess/cfg" + srcDir "System_Test/ST_ModMgr/cfg" + srcDir "System_Test/ST_SimExec" + srcDir "System_Test/ST_SysTime" + srcDir "System_Test/ST_ModMgr" + srcDir "System_Test/ST_ModMgr/cfg" + srcDir "Demo/Demo_1" + >>>>>>> origin/XGW-427 +|3,0,9,1,18,0,1563946476,"======="," srcDir \"System_Test/common\""," srcDir \"System_Test/ST_BasicDiag\""," srcDir \"System_Test/ST_BasicDiag/cfg\""," srcDir \"System_Test/ST_Callback\""," srcDir \"System_Test/ST_DtcMon\""," srcDir \"System_Test/ST_Libraries\"",>66 +|<" srcDir \"System_Test/ST_RoutineControl\""," srcDir \"System_Test/ST_RoutineControl/cfg\""," srcDir \"System_Test/ST_SecurityAccess\""," srcDir \"System_Test/ST_SecurityAccess/cfg\""," srcDir \"System_Test/ST_ModMgr/cfg\""," srcDir \"System_Test/ST_SimExec\""," srcDir \"System_Test/ST_SysTime\"",>58 +|<" srcDir \"System_Test/ST_ModMgr\""," srcDir \"System_Test/ST_ModMgr/cfg\""," srcDir \"Demo/Demo_1\"",">>>>>>> origin/XGW-427" +"- CHAR 0 + # +|3,0,36,0,1,0,1583471051,"#" + +# File marks: +'0 2 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,48,2,0,1627560163,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +'1 3 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,49,3,0,1627544181,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +'2 2 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,50,2,0,1627544181,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +'3 4 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,51,4,0,1627544085,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +'4 3 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,52,3,0,1627544085,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +'5 3 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,53,3,0,1627544085,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +'6 2 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,54,2,0,1627544085,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +'7 5 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,55,5,0,1627543910,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +'8 4 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,56,4,0,1627543910,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +'9 4 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,57,4,0,1627543910,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" + +# Jumplist (newest first): +-' 2 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,2,0,1627560163,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 1 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,1,0,1627560150,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 3 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,3,0,1627544181,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 2 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,2,0,1627544181,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 1 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,1,0,1627544172,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 4 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,4,0,1627544085,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 3 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,3,0,1627544085,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 2 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,2,0,1627544085,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 1 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,1,0,1627544074,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 5 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,5,0,1627543910,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 4 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,4,0,1627543910,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 3 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,3,0,1627543910,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 2 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,2,0,1627543910,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 1 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,1,0,1627543895,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 6 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,6,0,1627457133,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 5 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,5,0,1627457133,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 4 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,4,0,1627457133,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 3 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,3,0,1627457133,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 2 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,2,0,1627457133,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 1 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,1,0,1627457109,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 8 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,8,0,1627436453,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 7 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,7,0,1627436453,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 7 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,7,0,1627436453,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 6 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,6,0,1627436453,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 6 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,6,0,1627436453,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 5 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,5,0,1627436453,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 5 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,5,0,1627436453,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 4 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,4,0,1627436453,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 2 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,2,0,1627436453,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 1 0 /d/go/src/go-webservice/.git/COMMIT_EDITMSG +|4,39,1,0,1627436447,"/d/go/src/go-webservice/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 2 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,2,0,1626946149,"/d/test/go/.git/COMMIT_EDITMSG" +-' 1 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,1,0,1626946144,"/d/test/go/.git/COMMIT_EDITMSG" +-' 1 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,1,0,1626946144,"/d/test/go/.git/COMMIT_EDITMSG" +-' 1 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,1,0,1626946144,"/d/test/go/.git/COMMIT_EDITMSG" +-' 1 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,1,0,1626946144,"/d/test/go/.git/COMMIT_EDITMSG" +-' 1 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,1,0,1626946144,"/d/test/go/.git/COMMIT_EDITMSG" +-' 1 0 /d/test/go/.git/COMMIT_EDITMSG +|4,39,1,0,1626946144,"/d/test/go/.git/COMMIT_EDITMSG" + +# History of marks within files (newest to oldest): + +> /d/go/src/go-webservice/.git/COMMIT_EDITMSG + * 1627560162 0 + " 2 0 + ^ 2 0 + . 1 37 + + 1 16 + + 6 0 + + 1 37 + +> /d/test/go/.git/COMMIT_EDITMSG + * 1626946148 0 + " 2 0 + ^ 2 0 + . 1 4 + + 1 4 + +> /d/helloworld/.git/COMMIT_EDITMSG + * 1622211682 0 + " 1 31 + ^ 1 32 + . 1 31 + + 1 13 + + 1 31 + +> /d/android-calendar/.git/COMMIT_EDITMSG + * 1615952075 0 + " 1 3 + ^ 1 4 + . 1 4 + + 1 4 + +> ~/.gitconfig + * 1615951907 0 + " 8 1 + ^ 8 2 + . 8 1 + + 17 4 + + 16 4 + + 8 1 + +> /d/tanlm2/TBox/1_Repository/tbox_development/.git/COMMIT_EDITMSG + * 1591611503 0 + " 1 0 + +> /d/tanlm2/TBox/1_Repository/tbox_development/.git/MERGE_MSG + * 1591583871 0 + " 1 0 + +> /s/.git/COMMIT_EDITMSG + * 1586490498 0 + " 4 0 + ^ 4 0 + . 3 21 + + 8 0 + + 7 35 + + 3 21 + +> //192.168.1.61/WFHvfengineermode/.git/COMMIT_EDITMSG + * 1585891632 0 + " 4 0 + ^ 4 0 + . 5 0 + + 6 26 + + 5 0 + +> //192.168.1.61/WFHvfengineermode/tests/Server/VariantCodingServ.py + * 1585891562 0 + " 176 0 + ^ 176 0 + . 175 17 + + 175 17 + +> //192.168.1.61/WFHvfengineermode/.git/config + * 1585890159 0 + " 1 5 + +> /d/tanlm2/011_IVI/ivi_doc/.git/COMMIT_EDITMSG + * 1585730672 0 + " 5 0 + ^ 5 0 + . 4 27 + + 1 45 + + 23 0 + + 1 36 + + 11 0 + + 9 19 + + 3 42 + + 4 27 + +> /d/tanlm2/011_IVI/010_SourceCode/packages_services_vfengineermode/.git/COMMIT_EDITMSG + * 1585457992 0 + " 4 0 + ^ 4 0 + . 3 21 + + 1 39 + + 10 20 + + 6 22 + + 3 21 + +> /d/tanlm2/011_IVI/010_SourceCode/packages_services_vfengineermode/em-lib/src/android/vf/engineermode/EMListenerInterface.java + * 1585361862 0 + " 1 0 + +> /d/tanlm2/011_IVI/010_SourceCode/packages_services_vfengineermode/.git/config + * 1584627770 0 + " 8 0 + . 8 0 + + 8 0 + +> /d/tanlm2/011_IVI/vinfast_tanlinh-20200306-0452/.git/COMMIT_EDITMSG + * 1583472200 0 + " 1 20 + ^ 1 21 + . 1 20 + + 1 1 + + 6 0 + + 1 6 + + 2 0 + + 1 20 + +> /d/tanlm2/011_IVI/vinfast_tanlinh-20200306-0452/newfile.txt + * 1583472157 0 + " 4 8 + ^ 4 9 + . 4 8 + + 2 3 + + 2 13 + + 3 6 + + 4 8 + +> /d/tanlm2/011_IVI/ivi_doc/.git/MERGE_MSG + * 1583298301 0 + " 1 0 + +> ~/workspace/packages_services_car/.git/COMMIT_EDITMSG + * 1576570247 0 + " 2 0 + ^ 2 0 + . 1 56 + + 1 56 + +> /d/tanlm2/011_IVI/010_SourceCode/vf_vehicle_interface/default/impl/vhal_v2_0/CommBase.h + * 1575606246 0 + " 43 0 + +> ~/.AndroidStudio3.5/config/options/studioFlags.xml + * 1574148317 0 + " 9 12 + ^ 9 14 + . 9 13 + + 9 13 + +> ~/.gradle/gradle.properties + * 1574133834 0 + " 19 0 + ^ 19 1 + . 19 0 + + 14 0 + + 15 0 + + 16 0 + + 17 0 + + 18 0 + + 19 0 + +> /d/tanlm2/.git/COMMIT_EDITMSG + * 1573806695 0 + " 2 0 + ^ 2 0 + . 1 4 + + 1 4 + +> /d/003_SourceCode/001_XGW/xgwdocs/.git/MERGE_MSG + * 1570522809 0 + " 1 0 + +> /d/003_SourceCode/001_XGW/vehiclecentralgateway/.git/COMMIT_EDITMSG + * 1570505229 0 + " 2 0 + ^ 2 0 + . 1 31 + + 1 44 + + 212 16 + + 209 0 + + 210 30 + + 212 17 + + 1 44 + + 207 30 + + 204 45 + + 201 16 + + 198 19 + + 1 18 + + 195 30 + + 192 25 + + 189 37 + + 186 13 + + 183 16 + + 180 37 + + 178 37 + + 175 30 + + 1 66 + + 1 36 + + 168 0 + + 1 46 + + 165 0 + + 1 35 + + 161 15 + + 159 0 + + 1 24 + + 1 19 + + 142 0 + + 1 61 + + 100 32 + + 101 36 + + 1 1 + + 1 36 + + 60 0 + + 1 34 + + 18 0 + + 1 24 + + 5 0 + + 1 31 + +> /d/003_SourceCode/001_XGW/vehiclecentralgateway/.git/MERGE_MSG + * 1570422658 0 + " 1 0 + +> /d/003_SourceCode/001_XGW/vehiclecentralgateway/Scripts/python/QACConfig.txt + * 1570156003 0 + " 1 0 + . 1 0 + + 2 0 + + 1 0 + +> /d/003_SourceCode/001_XGW/vehiclecentralgateway/QAC/REPORT/QACConfig.txt + * 1570155829 0 + " 1 0 + +> /d/003_SourceCode/001_XGW/gatewayintegration/.git/COMMIT_EDITMSG + * 1569918764 0 + " 2 0 + ^ 2 0 + . 1 42 + + 1 42 + +> /d/003_SourceCode/001_XGW/xgwdocs/.git/COMMIT_EDITMSG + * 1569644065 0 + " 2 0 + ^ 2 0 + . 1 29 + + 1 66 + + 18 0 + + 1 29 + +> /d/003_SourceCode/001_XGW/gatewayintegration/.git/MERGE_MSG + * 1568717050 0 + " 1 0 + +> /d/003_SourceCode/001_XGW/vehiclecentralgateway/test.c + * 1567656966 0 + " 9 23 + ^ 9 24 + . 9 23 + + 10 0 + + 2 19 + + 9 23 + +> /d/003_SourceCode/Demo/Config/System/Communication.arxml + * 1565082632 0 + " 29790 26 + +> /d/003_SourceCode/Demo/Appl/Source/Vfx_Application/VF_BasicDiag/inc/VF_BasicDiag.h + * 1565082482 0 + " 1010 64 + +> /d/003_SourceCode/001_XGW/vehiclecentralgateway/build.gradle + * 1563946485 0 + " 416 0 + . 208 0 + + 55 0 + + 40 0 + + 94 0 + + 78 0 + + 158 0 + + 142 0 + + 224 0 + + 208 0 + +> /d/003_SourceCode/001_XGW/vehiclecentralgateway/README.md + * 1563946349 0 + " 33 52 + ^ 33 19 + . 33 18 + + 1 0 + + 56 0 + + 1 0 + + 2 0 + + 31 17 + + 33 18 + +> /d/003_SourceCode/001_XGW/test.c + * 1562299951 0 + " 4 63 + ^ 4 64 + . 10 17 + + 16 0 + + 15 0 + + 14 12 + + 4 54 + + 5 20 + + 10 61 + + 13 0 + + 12 18 + + 4 60 + + 7 11 + + 10 23 + + 10 17 + +> /d/003_SourceCode/001_XGW/vehiclecentralgateway/Application/VF_BasicDiag/src/VF_BasicDiag.c + * 1561363824 0 + " 686 4 + . 681 0 + + 680 0 + + 681 0 + +> /d/003_SourceCode/001_XGW/vehiclecentralgateway/Application/VF_BasicDiag/inc/VF_BasicDiag.h + * 1561363692 0 + " 604 0 + . 596 0 + + 595 0 + + 596 0 + +> /d/003_SourceCode/001_XGW/vehiclecentralgateway/Scripts/gradle/build.gradle + * 1561181508 0 + " 234 0 + ^ 234 1 + . 141 2 + + 44 0 + + 45 0 + + 44 3 + + 46 0 + + 47 3 + + 48 3 + + 49 3 + + 51 3 + + 29 3 + + 30 3 + + 31 3 + + 32 3 + + 33 3 + + 59 1 + + 60 1 + + 72 3 + + 73 3 + + 85 3 + + 86 3 + + 87 3 + + 88 3 + + 99 1 + + 100 2 + + 112 3 + + 114 3 + + 125 3 + + 131 3 + + 140 2 + + 141 2 + +> /d/003_SourceCode/crc8.c + * 1560336339 0 + " 11 38 + ^ 11 39 + . 11 38 + + 39 0 + + 11 0 + + 10 1 + + 11 0 + + 10 1 + + 11 38 + +> /d/003_SourceCode/python-udsoncan/README.rst + * 1558496845 0 + " 1 0 diff --git a/uploads/server_static.json b/uploads/server_static.json new file mode 100644 index 0000000..a00ee00 --- /dev/null +++ b/uploads/server_static.json @@ -0,0 +1,55 @@ +{ + "address": "192.168.225.55", + "logging" : + { + "level" : "info", + "console" : "true", + "file" : { + "enable" : "false", + "path" : "/tmp/vsomeip.log", + "sd_stub_path": "/tmp/sd_stub_path.log", + "max_file": "5", + "max_file_size": "32768" + } + }, + "services": [ + { + "id": "0x2000", + "instance": "0x2000", + "local_enable": "false", + "ext_enable": "true", + "udp_port":"12348", + "tcp_port": "12349", + "thread_pool_size": "2", + "client_config": [ + { + "addr": "192.168.225.1", + "is_local":"false", + "id": "0x1235", + "udp_port":"56791", + "tcp_port":"56790" + }, + { + "addr": "192.168.225.1", + "is_local":"false", + "id": "0x1236", + "udp_port":"56781", + "tcp_port":"56780" + } + ] + } + ], + "service-discovery" : + { + "enable" : "true", + "multicast" : "224.224.224.245", + "port" : "30490", + "initial_delay_min" : "10", + "initial_delay_max" : "100", + "repetitions_base_delay" : "200", + "repetitions_max" : "3", + "ttl" : "3", + "cyclic_offer_delay" : "2000", + "request_response_delay" : "1500" + } +}