This project is built for study
ireneliuqaq / goweb Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
This project is built for study
学习捕获持久层异常
将 #1 中的 username
置为主键,并执行以下两次 POST
POST /user/register?username=lucien&nickname=handsome
POST /user/register?username=lucien&nickname=handsome
第一次插入应该是成功的,第二次插入时数据库会抛出 error
,因为 username
是主键,数据库会 conflict,此时应返回相应的错误信息,例如:
{
"code": 409,
"message": "duplicated username"
}
将之前的所有从 form
获取数据的 API
改为从 body
获取数据
/user/register?username=&nickname=
注册一个用户名为 username
,昵称为 nickname
的用户,无需密码
code
和 message
字段/user/:username
查询 username
对应的 nickname
nickname
、code
、message
字段POST /user/register?username=lucien&nickname=handsom
注册一个 ID 为 lucien
昵称为 username
的用户
response
{
"code": 201,
"message": "success"
}
GET /user/lucien
查询 lucien
的 nickname
response
{
"code": 200,
"message": "success",
"nickname": "handsom"
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.