Coder Social home page Coder Social logo

announcements_service's Introduction

客製化貼文 API

EN? (None)

Docs

提供簡單可自定格式與簡單審查服務的API,使用Redis做資料儲存。

並且支援貼文標籤,標籤查詢等功能。

大致可以獲的的貼文內容:

GET /announcements/1

{
    "title": "....A ... A    shark :)",
    "id": 1,
    "publishedAt": "2020-09-18T16:31:20Z",
    "weight": 1,
    "imgUrl": "",
    "url": "",
    "description": "some description",
    "expireTime": "2020-09-26T16:31:20H",
    "nextId": 2,
    "lastId": null
}

目前僅有開發版本。

release setup

....

develop setup

  1. 安裝好redis-server

    如果皆採用預設並在local架設Redis,並不需要特別指定Redis URL

    如有自行更動port,或是使用外部Redis

    export REDIS_URL=redis://127.0.0.1:6379
  2. 安裝python 第三方套件

    cd src
    pip3 install -r requirements.txt
  3. 執行

    # on src 
    gunicorn -c gunicorn_config.py web_server:app

功能修改

Auth

在預設條件下的註冊,密碼僅支援50~80位,推薦使用SHA-256

採用JWT的驗證方式,如果有要客製化可以參考src/auth/auth.py and src/view/auth_view.py

Posts field

可以在src/utils/config.pyANNOUNCEMENT_FIELD進行欄位修正

目前強制使用的欄位publishedAt expireTime applicant tag id

其餘欄位可以做修改

TODO

  • Oauth
  • Docker
  • API Docs
  • requirements.txt

announcements_service's People

Contributors

takidog avatar

Stargazers

RainVisitor avatar

Watchers

James Cloos avatar  avatar

announcements_service's Issues

User info API

GET /user/info

"username":"account",
"login_type":"Google Oauth2"
"username":"account",
"login_type":"Normal"

for check login status.

貼文沒有正確過期

as title

有發現到貼文沒有正確過期,導致貼文一直存在
需要檢查或是在API有新增動作時,去清理.

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.