python利用apidoc生成接口文档操作

python利用apidoc生成接口文档操作

2023年7月10日发(作者:)

python利⽤apidoc⽣成接⼝⽂档操作apidoc安装,适⽤于mac与linuxsudo npm install apidoc -g

# ⽤户注册路由@('/user_manager/user_', methods=['GET', 'POST'])# @login_requireddef user_register(): """ @api {GET,POST} /user_manager/user_ 获取客户数据路由 @apiGroup user_manager @apiDescription 客户数据页展⽰路由 @apiName user_register @apiParam behavior ⾏为 behavior = 1 注册 behavior = 2 登录(设计注册和登录按钮) @apiParam name ⽤户名字 @apiParam password ⽤户密码 # 帐号或者密码错误 @apiSuccessExample {json} 成功返回: { "message": "", "code": 200, "data": { "records": [{ "status":"1" status = 1 表⽰注册成功,直接跳转登录成功界⾯ status = 2 登录成功跳转 status = 3 注册失败 status = 4 登录失败(帐号或密码错误) }], } } """ return user__register()需要在指定路径下⾯新建doc⽂件夹/home/python/Desktop/DMP/dmp_admin 在路径下⾯输出⽂档:apidoc --input ./app/ --output './doc'#必需配置的⽂件{"name":"DMP管理后台API接⼝⽂档","version":"1.0.0","title":"API⽂档","url":"127.0.0.1", 可选择指定url,这⾥为本地"order": [ "portraitbi_activate_user_month", "portraitbi_activate_user_week", "portraitbi_all_user_num", "operatingbi_set_custom_channel_setting", "operatingbi_list_custom_channel_budget", "operatingbi_list_custom_bi"]}

⽣成的接⼝⽂档为html类型,可利⽤浏览器进⾏打开file:///home/python/Desktop/DMP/dmp_admin/doc/

发布者:admin,转转请注明出处:http://www.yc00.com/news/1688932256a184925.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信