Comments (1)
Draft notes:
- Use singular nouns always because:
- Using plural nouns is confusing for some resources like cluster leader because there is only one cluster and leader for any turms servers. If there is more than one leader or cluster, it's a bug, so it is more reasonable to use singular nouns here, i.e.:
/cluster/member
. - Using consistent names, so using singular nouns always.
- It has no benefit to use plural nouns.
- Using plural nouns is confusing for some resources like cluster leader because there is only one cluster and leader for any turms servers. If there is more than one leader or cluster, it's a bug, so it is more reasonable to use singular nouns here, i.e.:
- Move query filters from the URL query params into the request body in JSON because:
- Using URL query params is painful to construct and parse complex filters, e.g.
?mylist%5B0%5D.name=abc&mylist%5B0%5D.age=123&mylist%5B1%5D&name="zxc"
. - It's consistent and easy to use JSON in any programming language.
- Using URL query params is painful to construct and parse complex filters, e.g.
- Always use a map/object as the value of the response
data
, and never use a list because of its schema flexibility. - Use POST consistently and move the action to the URL because:
- Some proxies and companies disable HTTP request methods like
DELETE
by default, which will cause troubles for Turms users. - Many HTTP clients don't allow sending request body when using
GET
andDELETE
.
- Some proxies and companies disable HTTP request methods like
- The endpoints should follow the pattern
<domain>/<resource>/<action>
(e.g.business/group/member/create
) - One endpoint should have only one request/response schema (it is the same as before, I mention it again because it's a very important principle)
- Represent datetime values in int64 number (millis since unix epoch) instead of string because millis since unix epoch is: 1. easy and convenient to parse by any programming language; 2. no ambiguity compared to string.
I mark this issue as a high priority because there are many new endpoints that can only be published after these changes.
from turms.
Related Issues (20)
- UserAuthenticator plugin gateway error HOT 6
- 镜像启动后报错,导致minio初始化失败 HOT 1
- Help! How can i get the messages sent by me HOT 1
- Throw an exception to notify plugin users to upgrade Turms servers or plugins proactively if detecting the plugin overrides non-existent methods when loading HOT 1
- Add service APIs for clients to CRUD meetings
- Train a model to support creating user personas based on Turms data
- master分支代码插入数据好像有点儿问题 HOT 1
- 自定义组件位置 HOT 3
- Add docs on how turms servers manage properties in source code so that users can know what properties Turms has from source code
- Support users in specifying the preferred languages for push notifications
- Compile simple push notification templates to Java class files HOT 1
- Migrate to Java as the template engine HOT 1
- 好友之间在线状态的查询实现
- 聊天室turms-service对外提供http接口如何设置超时时间? HOT 2
- 业务交互 HOT 5
- turms-service的进程 fd一直增加,一天就到了4万,socket大量未关闭 目前同时在线人数最多2000 HOT 2
- Support RAG
- Unify the logic to respond with status codes when the target resource doesn't exist
- Remove controllers registered by a plugin automatically when the plugin is stopped
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from turms.