goProject/trunk/center/common/remark/webApi.go
皮蛋13361098506 1b77f62820 初始化项目
2025-01-06 16:01:02 +08:00

57 lines
1.4 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
}