123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 |
- {
- "swagger": "2.0",
- "info": {
- "description": "This is a sample server celler server.",
- "title": "Nunu Example API",
- "termsOfService": "http://swagger.io/terms/",
- "contact": {
- "name": "API Support",
- "url": "http://www.swagger.io/support",
- "email": "support@swagger.io"
- },
- "license": {
- "name": "Apache 2.0",
- "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
- },
- "version": "1.0.0"
- },
- "host": "localhost:8000",
- "paths": {
- "/login": {
- "post": {
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "用户模块"
- ],
- "summary": "账号登录",
- "parameters": [
- {
- "description": "params",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.LoginRequest"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "$ref": "#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.LoginResponse"
- }
- }
- }
- }
- },
- "/register": {
- "post": {
- "description": "目前只支持邮箱登录",
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "用户模块"
- ],
- "summary": "用户注册",
- "parameters": [
- {
- "description": "params",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.RegisterRequest"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "$ref": "#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.Response"
- }
- }
- }
- }
- },
- "/user": {
- "get": {
- "security": [
- {
- "Bearer": []
- }
- ],
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "用户模块"
- ],
- "summary": "获取用户信息",
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "$ref": "#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.GetProfileResponse"
- }
- }
- }
- },
- "put": {
- "security": [
- {
- "Bearer": []
- }
- ],
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "用户模块"
- ],
- "summary": "修改用户信息",
- "parameters": [
- {
- "description": "params",
- "name": "request",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.UpdateProfileRequest"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "$ref": "#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.Response"
- }
- }
- }
- }
- }
- },
- "definitions": {
- "github_com_go-nunu_nunu-layout-advanced_api_v1.GetProfileResponse": {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer"
- },
- "data": {
- "$ref": "#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.GetProfileResponseData"
- },
- "message": {
- "type": "string"
- }
- }
- },
- "github_com_go-nunu_nunu-layout-advanced_api_v1.GetProfileResponseData": {
- "type": "object",
- "properties": {
- "nickname": {
- "type": "string",
- "example": "alan"
- },
- "userId": {
- "type": "string"
- }
- }
- },
- "github_com_go-nunu_nunu-layout-advanced_api_v1.LoginRequest": {
- "type": "object",
- "required": [
- "email",
- "password"
- ],
- "properties": {
- "email": {
- "type": "string",
- "example": "1234@gmail.com"
- },
- "password": {
- "type": "string",
- "example": "123456"
- }
- }
- },
- "github_com_go-nunu_nunu-layout-advanced_api_v1.LoginResponse": {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer"
- },
- "data": {
- "$ref": "#/definitions/github_com_go-nunu_nunu-layout-advanced_api_v1.LoginResponseData"
- },
- "message": {
- "type": "string"
- }
- }
- },
- "github_com_go-nunu_nunu-layout-advanced_api_v1.LoginResponseData": {
- "type": "object",
- "properties": {
- "accessToken": {
- "type": "string"
- }
- }
- },
- "github_com_go-nunu_nunu-layout-advanced_api_v1.RegisterRequest": {
- "type": "object",
- "required": [
- "email",
- "password"
- ],
- "properties": {
- "email": {
- "type": "string",
- "example": "1234@gmail.com"
- },
- "password": {
- "type": "string",
- "example": "123456"
- }
- }
- },
- "github_com_go-nunu_nunu-layout-advanced_api_v1.Response": {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer"
- },
- "data": {},
- "message": {
- "type": "string"
- }
- }
- },
- "github_com_go-nunu_nunu-layout-advanced_api_v1.UpdateProfileRequest": {
- "type": "object",
- "required": [
- "email"
- ],
- "properties": {
- "email": {
- "type": "string",
- "example": "1234@gmail.com"
- },
- "nickname": {
- "type": "string",
- "example": "alan"
- }
- }
- }
- },
- "securityDefinitions": {
- "Bearer": {
- "type": "apiKey",
- "name": "Authorization",
- "in": "header"
- }
- }
- }
|