mirror of https://github.com/bjdgyc/anylink.git
上传活动日志API的代码
This commit is contained in:
parent
b1ae25ae2f
commit
ea5e31fd39
server/admin
|
@ -0,0 +1,34 @@
|
||||||
|
package admin
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/bjdgyc/anylink/dbdata"
|
||||||
|
)
|
||||||
|
|
||||||
|
func UserActLogList(w http.ResponseWriter, r *http.Request) {
|
||||||
|
_ = r.ParseForm()
|
||||||
|
pageS := r.FormValue("page")
|
||||||
|
page, _ := strconv.Atoi(pageS)
|
||||||
|
if page < 1 {
|
||||||
|
page = 1
|
||||||
|
}
|
||||||
|
var datas []dbdata.UserActLog
|
||||||
|
session := dbdata.UserActLogIns.GetSession(r.Form)
|
||||||
|
count, err := dbdata.FindAndCount(session, &datas, dbdata.PageSize, page)
|
||||||
|
if err != nil && !dbdata.CheckErrNotFound(err) {
|
||||||
|
RespError(w, RespInternalErr, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
data := map[string]interface{}{
|
||||||
|
"count": count,
|
||||||
|
"page_size": dbdata.PageSize,
|
||||||
|
"datas": datas,
|
||||||
|
"statusOps": dbdata.UserActLogIns.GetStatusOpsWithTag(),
|
||||||
|
"osOps": dbdata.UserActLogIns.OsOps,
|
||||||
|
"clientOps": dbdata.UserActLogIns.ClientOps,
|
||||||
|
}
|
||||||
|
|
||||||
|
RespSucess(w, data)
|
||||||
|
}
|
|
@ -63,6 +63,7 @@ func StartAdmin() {
|
||||||
r.HandleFunc("/user/policy/detail", PolicyDetail)
|
r.HandleFunc("/user/policy/detail", PolicyDetail)
|
||||||
r.HandleFunc("/user/policy/set", PolicySet)
|
r.HandleFunc("/user/policy/set", PolicySet)
|
||||||
r.HandleFunc("/user/policy/del", PolicyDel)
|
r.HandleFunc("/user/policy/del", PolicyDel)
|
||||||
|
r.HandleFunc("/user/act_log/list", UserActLogList)
|
||||||
|
|
||||||
r.HandleFunc("/group/list", GroupList)
|
r.HandleFunc("/group/list", GroupList)
|
||||||
r.HandleFunc("/group/names", GroupNames)
|
r.HandleFunc("/group/names", GroupNames)
|
||||||
|
|
Loading…
Reference in New Issue