Apply .gitignore rules
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
package remark
|
||||
|
||||
import (
|
||||
"common/httpServer"
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"common/webServer"
|
||||
)
|
||||
|
||||
// init
|
||||
// @description: init
|
||||
// parameter:
|
||||
// return:
|
||||
func init() {
|
||||
webServer.RegisterRemarkFunc(remarkdCallback)
|
||||
httpServer.RegisterRemarkFunc(remarkdCallback)
|
||||
}
|
||||
|
||||
// remarkdCallback
|
||||
// @description: remarkdCallback
|
||||
// parameter:
|
||||
// @w: w
|
||||
// @r: r
|
||||
// return:
|
||||
func remarkdCallback(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
for index, moduleItem := range remarksSlice {
|
||||
// 输出模块信息
|
||||
fmt.Fprintf(w, fmt.Sprintf("%d、%s【Name:%s Author:%s Mendor:%s Date:%s】\n", index+1, moduleItem.Desc, moduleItem.Name, moduleItem.Author, moduleItem.Mendor, moduleItem.Date))
|
||||
|
||||
// 输出方法列表信息
|
||||
for subIndex, methodItem := range moduleItem.MethodRemarkSlice {
|
||||
fmt.Fprintf(w, fmt.Sprintf(" %d.%d、%s【Name:%s Author:%s Mendor:%s Date:%s】\n", index+1, subIndex+1, methodItem.Desc, methodItem.Name, methodItem.Author, methodItem.Mendor, methodItem.Date))
|
||||
|
||||
fmt.Fprintln(w, " \t输入参数:")
|
||||
if len(methodItem.InParam) > 0 {
|
||||
for _, param := range methodItem.InParam {
|
||||
fmt.Fprintln(w, " ", param)
|
||||
}
|
||||
} else {
|
||||
fmt.Fprintln(w, " ", "无")
|
||||
}
|
||||
|
||||
fmt.Fprintln(w, " \t输出参数:")
|
||||
if methodItem.OutParam != "" {
|
||||
fmt.Fprintln(w, " ", methodItem.OutParam)
|
||||
} else {
|
||||
fmt.Fprintln(w, " ", "无")
|
||||
}
|
||||
|
||||
fmt.Fprintln(w)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
// ************************************
|
||||
// @package: handleMgr
|
||||
// @description: 反射类-请求对象
|
||||
// @author:
|
||||
// @revision history:
|
||||
// @create date: 2022-02-23 16:33:53
|
||||
// ************************************
|
||||
|
||||
package handleMgr
|
||||
|
||||
// RequestObject 请求对象
|
||||
type RequestObject struct {
|
||||
// 请求的模块名称
|
||||
ModuleName string
|
||||
|
||||
// 请求的方法名称
|
||||
MethodName string
|
||||
|
||||
// 请求的参数数组
|
||||
Parameters []interface{}
|
||||
|
||||
// 是否处理返回值
|
||||
IsHaveResult bool
|
||||
|
||||
// 执行完成,返回chan监控
|
||||
ResultChan chan *ResponseObject
|
||||
}
|
||||
|
||||
// NewRequestObject
|
||||
// @description:
|
||||
// parameter:
|
||||
// @moduleName:模块名名称
|
||||
// @methodName:执行方法名称
|
||||
// @parameters:方法参数
|
||||
// @isHaveResult:是否处理返回值
|
||||
// return:
|
||||
// @*RequestObject:
|
||||
func NewRequestObject(moduleName string, methodName string, parameters []interface{}, isHaveResult bool) *RequestObject {
|
||||
return &RequestObject{
|
||||
ModuleName: moduleName,
|
||||
MethodName: methodName,
|
||||
Parameters: parameters,
|
||||
IsHaveResult: isHaveResult,
|
||||
ResultChan: make(chan *ResponseObject, 1),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user