Giter Club home page Giter Club logo

insured-tree's Introduction

Insured Tree

此專案用於展示一個保戶的二叉樹結構。 要運行此專案請先安裝go ,詳細參考https://go.dev/doc/install

目前提供以下兩個API:

  1. 生成二元樹資料結構,以輸入的 id 為根節點,最多顯示四層15個用戶:
    [GET] /api/user/tree/{id}
    
  2. 用來搜尋用戶,帶入 id 即可搜尋用戶:
    [GET] /api/user/{id}
    

使用方法

  1. 複製專案:

    git clone https://github.com/TomasTangisCoding/insured-tree.git
  2. 進入專案目錄:

    cd insured-tree
  3. 根據本機DB環境設定 config.yaml 中的 dsn 參數:

    dsn: "user:password@tcp(localhost:3306)/your_database"
  4. 創建對應的資料庫表格,可以參考 user.sql 中的SQL script

  5. 執行服務:

    go run main.go
  6. 在瀏覽器訪問以下URL來使用API

    • 生成用戶樹:http://localhost:8080/api/user/tree/{id}
    • 搜尋用戶:http://localhost:8080/api/user/{id}

insured-tree's People

Contributors

tomastangiscoding avatar

Watchers

 avatar

Forkers

sidneyzz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.