MCPcopy Create free account
hub / github.com/TruthHun/DocHub / GetReportReasons

Method GetReportReasons

models/SysModel.go:81–92  ·  view source on GitHub ↗

获取举报原因

()

Source from the content-addressed store, hash-verified

79
80//获取举报原因
81func (this *Sys) GetReportReasons() (reasons map[string]string) {
82 reasons = make(map[string]string)
83 reasonStr := this.GetByField("ReportReasons").ReportReasons
84 if slice := strings.Split(reasonStr, "\n"); len(slice) > 0 {
85 for _, item := range slice {
86 if arr := strings.Split(item, ":"); len(arr) > 1 {
87 reasons[arr[0]] = strings.Join(arr[1:], ":")
88 }
89 }
90 }
91 return
92}
93
94//根据序号获取举报原因
95func (this *Sys) GetReportReason(num interface{}) (reason string) {

Callers 2

GetReportReasonMethod · 0.95
GetMethod · 0.80

Calls 1

GetByFieldMethod · 0.95

Tested by

no test coverage detected