package
0.0.0-20181114091942-10a0dfff86db
Repository: https://github.com/endlesscheng/echo-autodoc.git
Documentation: pkg.go.dev

# README

接口文档

HTTP 接口

上传一本书

POST /api/upload_book

表单参数

参数描述取值
file上传的文件file
file_name文件名string
delta偏移量int

返回字段

参数描述取值
content上传的内容string

返回示例:

{
	"content": "A"
}

获取一本书的信息

GET /api/book

相关出版社有:

  • 机械工业出版社
  • 电子工业出版社
  • 人民邮电出版社

URL 参数

参数描述取值
isbn书的 ISBNstring

返回字段

参数描述取值
id书籍 IDstring
created_at创建时间string
isbnISBNstring
title书名string
authors作者object array
authors.id作者 IDstring
authors.created_at创建时间string
authors.name姓名string
authors.age年龄int
authors.sex性别(0-男,1-女)int
press出版社string
publish_date出版日期string
price定价float

返回示例:

{
	"id": "xQ3Wmvrg",
	"created_at": "2018-11-14 11:31:35",
	"isbn": "9780262033848",
	"title": "Introduction to Algorithms, 3rd Edition",
	"authors": [
		{
			"id": "xQ3Wmvrg",
			"created_at": "2018-11-14T11:31:35.026345+08:00",
			"name": "Thomas H. Cormen",
			"age": 62,
			"sex": 0
		},
		{
			"id": "Rav4N3k2",
			"created_at": "2018-11-14T11:31:35.026345+08:00",
			"name": "Charles E. Leiserson",
			"age": 64,
			"sex": 0
		},
		{
			"id": "8rjZe3xL",
			"created_at": "2018-11-14T11:31:35.026345+08:00",
			"name": "Ronald L. Rivest",
			"age": 71,
			"sex": 0
		},
		{
			"id": "GV67K6zN",
			"created_at": "2018-11-14T11:31:35.026346+08:00",
			"name": "Clifford Stein",
			"age": 52,
			"sex": 0
		}
	],
	"press": "The MIT Press",
	"publish_date": "2009-07-31",
	"price": 94
}

更新一本书的信息

GET /api/update_book

POST 时注意作者需要存到一个数组中

JSON 参数

参数描述取值
id书籍 IDstring
created_at创建时间string
isbnISBNstring
title书名string
authors作者object array
authors.id作者 IDstring
authors.created_at创建时间string
authors.name姓名string
authors.age年龄int
authors.sex性别(0-男,1-女)int
press出版社string
publish_date出版日期string
price定价float

返回字段

参数描述取值
error_code错误码int
error_msg错误信息string

返回示例:

{
	"error_code": 1000,
	"error_msg": "OK"
}

# Structs

No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author