Documentation ¶
Overview ¶
@group account
Index ¶
- type AccountHandler
- type AddressHandler
- func (h *AddressHandler) Create(w http.ResponseWriter, r *http.Request)
- func (h *AddressHandler) Delete(w http.ResponseWriter, r *http.Request)
- func (h *AddressHandler) Get(w http.ResponseWriter, r *http.Request)
- func (h *AddressHandler) List(w http.ResponseWriter, r *http.Request)
- func (h *AddressHandler) Time(w http.ResponseWriter, r *http.Request)
- func (h *AddressHandler) Update(w http.ResponseWriter, r *http.Request)
- func (h *AddressHandler) XML(w http.ResponseWriter, r *http.Request)
- type AddressResponse
- type CreateAddressRequest
- type DeleteAddressRequest
- type DemoData
- type DemoHandler
- func (h *DemoHandler) Int(w http.ResponseWriter, r *http.Request)
- func (h *DemoHandler) IntArray(w http.ResponseWriter, r *http.Request)
- func (h *DemoHandler) Map(w http.ResponseWriter, r *http.Request)
- func (h *DemoHandler) StructArray(w http.ResponseWriter, r *http.Request)
- func (h *DemoHandler) StructNested(w http.ResponseWriter, r *http.Request)
- type DemoMap
- type DemoObject
- type DemoTime
- type DemoXMLRequest
- type DemoXMLResponse
- type DemoXMLResponse2
- type GetAddressRequest
- type LoginRequest
- type LoginResponse
- type MenuHandler
- type MyTime
- type Node
- type ProfileHandler
- type ProfileResponse
- type RegisterRequest
- type RegisterResponse
- type Struct1
- type Struct2
- type UpdateAddressRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountHandler ¶
type AccountHandler struct { }
func NewAccountHandler ¶
func NewAccountHandler() *AccountHandler
func (*AccountHandler) Login ¶
func (h *AccountHandler) Login(w http.ResponseWriter, r *http.Request)
@title 用户登录接口 @api POST /account/login @request LoginRequest @response 200 common.Response{code=0,msg="success",data=LoginResponse} "登录成功返回数据" @response 200 common.Response{code=10020,msg="password_error"} "密码错误" @author alovn
func (*AccountHandler) Register ¶
func (h *AccountHandler) Register(w http.ResponseWriter, r *http.Request)
@api POST /account/register @title 用户注册接口 @request RegisterRequest @header x-request-id string false "request id" @query from string false "test" @response 200 common.Response{code=0,msg="success",data=RegisterResponse} "注册成功返回数据" @response 200 common.Response{code=10011,msg="password format error"} "密码格式错误" @author alovn @desc 用户注册接口说明 @order -1
type AddressHandler ¶
type AddressHandler struct { }
func NewAddressHandler ¶
func NewAddressHandler() *AddressHandler
func (*AddressHandler) Create ¶
func (h *AddressHandler) Create(w http.ResponseWriter, r *http.Request)
@api POST /address/create @title 添加地址接口 @group address @request CreateAddressRequest @response 200 common.Response{code=0,msg="success"} @author alovn
func (*AddressHandler) Delete ¶
func (h *AddressHandler) Delete(w http.ResponseWriter, r *http.Request)
@api POST /address/delete @title 删除地址接口 @group address @request DeleteAddressRequest @response 200 common.Response{code=0,msg="success"} @author alovn
func (*AddressHandler) Get ¶
func (h *AddressHandler) Get(w http.ResponseWriter, r *http.Request)
@api GET /address/get/:id @title 获取地址信息 @group address @request GetAddressRequest @response 200 common.Response{code=0,msg="success",data=AddressResponse} @author alovn
func (*AddressHandler) List ¶
func (h *AddressHandler) List(w http.ResponseWriter, r *http.Request)
@api GET /address/list @title 获取地址列表 @group address @response 200 common.Response{code=0,msg="success",data=[]AddressResponse} @author alovn @desc 获取收货地址列表 Deprecated: or use @deprecated
func (*AddressHandler) Time ¶
func (h *AddressHandler) Time(w http.ResponseWriter, r *http.Request)
@api GET /demo/time @title time @group demo @accept xml @format json @response 200 common.Response{code=0,msg="success",data=DemoTime} @author alovn
func (*AddressHandler) Update ¶
func (h *AddressHandler) Update(w http.ResponseWriter, r *http.Request)
@api POST /address/update @title 更新地址接口 @group address @request UpdateAddressRequest @response 200 common.Response{code=0,msg="success"} @author alovn
func (*AddressHandler) XML ¶
func (h *AddressHandler) XML(w http.ResponseWriter, r *http.Request)
@api GET /demo/xml @title xml @group demo @accept xml @request DemoXMLRequest @format xml @response 200 common.Response{code=0,msg="success",data=DemoXMLResponse} @response 200 common.Response{code=0,msg="success",data=DemoXMLResponse2} @response 200 common.Response{code=10010,msg="sme error"} @author alovn
type AddressResponse ¶
type CreateAddressRequest ¶
type DeleteAddressRequest ¶
type DeleteAddressRequest struct { ID int64 `form:"id" validate:"required"` //地址ID } //添加地址请求参数
type DemoData ¶
type DemoData struct { Title string `json:"title,omitempty"` //标题 Description string `json:"description,omitempty"` Count int `json:"count,omitempty"` IntArray []int `json:"int_array,omitempty"` FloatArray []float64 `json:"float_array,omitempty"` IntPointer *int `json:"int_pointer,omitempty"` Map map[string]int `json:"map,omitempty"` Object1 DemoObject `json:"object_1,omitempty"` Object2 *DemoObject `json:"object_2,omitempty"` }
type DemoHandler ¶
type DemoHandler struct{}
func NewDemoHandler ¶
func NewDemoHandler() *DemoHandler
func (*DemoHandler) Int ¶
func (h *DemoHandler) Int(w http.ResponseWriter, r *http.Request)
@api GET /demo/int @title int @group demo @response 200 int "demo int"
func (*DemoHandler) IntArray ¶
func (h *DemoHandler) IntArray(w http.ResponseWriter, r *http.Request)
@api GET /demo/int_array @title int数组 @group demo @response 200 []int "demo int array"
func (*DemoHandler) Map ¶
func (h *DemoHandler) Map(w http.ResponseWriter, r *http.Request)
@api GET /demo/map @title map @group demo @response 200 DemoMap "demo map"
func (*DemoHandler) StructArray ¶
func (h *DemoHandler) StructArray(w http.ResponseWriter, r *http.Request)
@api GET /demo/struct_array @title struct数组 @group demo @response 200 []DemoData "demo struct array" @version 1.0.2.1
func (*DemoHandler) StructNested ¶
func (h *DemoHandler) StructNested(w http.ResponseWriter, r *http.Request)
@api GET /demo/struct_nested @title struct嵌套 @group demo @response 200 Struct1 "nested struct"
type DemoObject ¶
type DemoObject struct {
Name string `json:"name,omitempty"`
}
type DemoXMLRequest ¶
type DemoXMLResponse ¶
type DemoXMLResponse2 ¶
type GetAddressRequest ¶
type GetAddressRequest struct { ID int64 `param:"id"` //地址ID } //获取地址请求参数
type LoginRequest ¶
type LoginResponse ¶
type LoginResponse struct { WelcomeMsg string `json:"welcome_msg,omitempty"` //登录成功欢迎语 } //登录返回数据
type MenuHandler ¶
type MenuHandler struct{}
func NewMenuHandler ¶
func NewMenuHandler() *MenuHandler
func (*MenuHandler) Nodes ¶
func (h *MenuHandler) Nodes(w http.ResponseWriter, r *http.Request)
@api GET /menu/nodes @title 获取菜单节点 @group menu @response 200 common.Response{code=0,msg="success",data=[]Node} @author alovn @desc 测试数组、递归结构体
type ProfileHandler ¶
type ProfileHandler struct { }
func NewProfileHandler ¶
func NewProfileHandler() *ProfileHandler
func (*ProfileHandler) Get ¶
func (p *ProfileHandler) Get(w http.ResponseWriter, r *http.Request)
@api GET /profile/get @title 获取用户资料 @group profile @response 200 common.Response{code=0,msg="success",data=ProfileResponse} @author alovn