Documentation ¶
Index ¶
- type BaseAction
- func (cli *BaseAction) CallResponse(callfunc func() (string, error), resp *restful.Response)
- func (cli *BaseAction) CallResponseEx(callfunc func() (httpcode int, reply interface{}, err error), ...)
- func (cli *BaseAction) CreateAction() error
- func (cli *BaseAction) GetParams(cc *api.APIResource, keyvalues *map[string]string, key string, ...) error
- func (cli *BaseAction) IsSuccess(rst []byte) (*api.APIRsp, bool)
- func (cli *BaseAction) Response(rst *api.APIRsp, resp *restful.Response)
- func (cli *BaseAction) ResponseFailed(errno int, errmsg interface{}, resp *restful.Response)
- func (cli *BaseAction) ResponseFailedEx(httpcode int, errno int, errmsg interface{}, resp *restful.Response)
- func (cli *BaseAction) ResponseFailedWithData(errno int, errmsg, data interface{}, resp *restful.Response)
- func (cli *BaseAction) ResponseNative(datamsg string, resp *restful.Response)
- func (cli *BaseAction) ResponseRspString(resp *restful.Response, data string, errno int, err string)
- func (cli *BaseAction) ResponseSuccess(datamsg interface{}, resp *restful.Response)
- func (cli *BaseAction) ResponseSuccessData(datamsg interface{}, resp *restful.Response) bool
- type BaseLogic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseAction ¶
type BaseAction struct {
CC *api.APIResource
}
BaseAction 所有Action 的基类
func (*BaseAction) CallResponse ¶
func (cli *BaseAction) CallResponse(callfunc func() (string, error), resp *restful.Response)
CallResponse execute and deal with the response
func (*BaseAction) CallResponseEx ¶
func (cli *BaseAction) CallResponseEx(callfunc func() (httpcode int, reply interface{}, err error), resp *restful.Response)
CallResponseEx execute and deal with the response
func (*BaseAction) CreateAction ¶
func (cli *BaseAction) CreateAction() error
CreateAction 执行Action 初始化
func (*BaseAction) GetParams ¶
func (cli *BaseAction) GetParams(cc *api.APIResource, keyvalues *map[string]string, key string, result interface{}, resp *restful.Response) error
GetParams parse the params
func (*BaseAction) IsSuccess ¶
func (cli *BaseAction) IsSuccess(rst []byte) (*api.APIRsp, bool)
IsSuccess check the response
func (*BaseAction) Response ¶
func (cli *BaseAction) Response(rst *api.APIRsp, resp *restful.Response)
Response execute the response
func (*BaseAction) ResponseFailed ¶
func (cli *BaseAction) ResponseFailed(errno int, errmsg interface{}, resp *restful.Response)
ResponseFailed deal with the http code and response
func (*BaseAction) ResponseFailedEx ¶
func (cli *BaseAction) ResponseFailedEx(httpcode int, errno int, errmsg interface{}, resp *restful.Response)
ResponseFailedEx deal with the http code and response
func (*BaseAction) ResponseFailedWithData ¶
func (cli *BaseAction) ResponseFailedWithData(errno int, errmsg, data interface{}, resp *restful.Response)
ResponseFailedWithData deal with the failed response
func (*BaseAction) ResponseNative ¶
func (cli *BaseAction) ResponseNative(datamsg string, resp *restful.Response)
ResponseNative return Native data
func (*BaseAction) ResponseRspString ¶
func (cli *BaseAction) ResponseRspString(resp *restful.Response, data string, errno int, err string)
ResponseRspString parse the api.APIRsp struct
func (*BaseAction) ResponseSuccess ¶
func (cli *BaseAction) ResponseSuccess(datamsg interface{}, resp *restful.Response)
ResponseSuccess deal with the success response
func (*BaseAction) ResponseSuccessData ¶
func (cli *BaseAction) ResponseSuccessData(datamsg interface{}, resp *restful.Response) bool
ResponseSuccessData only response the success data
type BaseLogic ¶
type BaseLogic struct {
HttpCli *httpclient.HttpClient
}
BaseLogic logic 实现的基类
func (*BaseLogic) CreateHttpClient ¶
CreateHttpClient create the default http client and set the header