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)
- 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
- Run it with idea,can't start it HOT 2
- Update legacy docs HOT 1
- 压测 HOT 1
- 方案选择的思考 HOT 1
- Question:ack设计的问题 HOT 1
- Provide a WebSocket endpoint for admin APIs
- Add a property to enable notifying other nodes to clear the group member cache if a member is added or removed
- Unify usages of the factory method name `of` and `from` HOT 1
- Support creating records (e.g. users) in batch atomically
- Support continuing creating/updating remaining records if failed to create/update the previous records
- 怎么拓展业务信息,如群组标签等等 HOT 7
- Support getting the trace ID for admin APIs from the user-defined HTTP header
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.