mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
【更新】更新restful
This commit is contained in:
@@ -23,11 +23,11 @@ type LogJobApi struct {
|
||||
// @Router /log/logJob/list [get]
|
||||
// @Security
|
||||
func (l *LogJobApi) GetJobLogList(rc *restfulx.ReqCtx) {
|
||||
pageNum := restfulx.QueryInt(rc.GinCtx, "pageNum", 1)
|
||||
pageSize := restfulx.QueryInt(rc.GinCtx, "pageSize", 10)
|
||||
name := rc.GinCtx.Query("name")
|
||||
jobGroup := rc.GinCtx.Query("jobGroup")
|
||||
status := rc.GinCtx.Query("status")
|
||||
pageNum := restfulx.QueryInt(rc, "pageNum", 1)
|
||||
pageSize := restfulx.QueryInt(rc, "pageSize", 10)
|
||||
name := restfulx.QueryParam(rc, "name")
|
||||
jobGroup := restfulx.QueryParam(rc, "jobGroup")
|
||||
status := restfulx.QueryParam(rc, "status")
|
||||
|
||||
list, total := l.LogJobApp.FindListPage(pageNum, pageSize, entity.LogJob{Name: name, JobGroup: jobGroup, Status: status})
|
||||
rc.ResData = map[string]any{
|
||||
@@ -46,7 +46,7 @@ func (l *LogJobApi) GetJobLogList(rc *restfulx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
|
||||
// @Router /log/logJob/{logId} [delete]
|
||||
func (l *LogJobApi) DeleteJobLog(rc *restfulx.ReqCtx) {
|
||||
logIds := rc.GinCtx.Param("logId")
|
||||
logIds := restfulx.QueryParam(rc, "logId")
|
||||
group := utils.IdsStrToIdsIntGroup(logIds)
|
||||
l.LogJobApp.Delete(group)
|
||||
}
|
||||
|
||||
@@ -22,10 +22,10 @@ type LogLoginApi struct {
|
||||
// @Router /log/logLogin/list [get]
|
||||
// @Security
|
||||
func (l *LogLoginApi) GetLoginLogList(rc *restfulx.ReqCtx) {
|
||||
pageNum := restfulx.QueryInt(rc.GinCtx, "pageNum", 1)
|
||||
pageSize := restfulx.QueryInt(rc.GinCtx, "pageSize", 10)
|
||||
loginLocation := rc.GinCtx.Query("loginLocation")
|
||||
username := rc.GinCtx.Query("username")
|
||||
pageNum := restfulx.QueryInt(rc, "pageNum", 1)
|
||||
pageSize := restfulx.QueryInt(rc, "pageSize", 10)
|
||||
loginLocation := restfulx.QueryParam(rc, "loginLocation")
|
||||
username := restfulx.QueryParam(rc, "username")
|
||||
list, total := l.LogLoginApp.FindListPage(pageNum, pageSize, entity.LogLogin{LoginLocation: loginLocation, Username: username})
|
||||
rc.ResData = map[string]any{
|
||||
"data": list,
|
||||
@@ -43,7 +43,7 @@ func (l *LogLoginApi) GetLoginLogList(rc *restfulx.ReqCtx) {
|
||||
// @Router /log/logLogin/{infoId} [get]
|
||||
// @Security
|
||||
func (l *LogLoginApi) GetLoginLog(rc *restfulx.ReqCtx) {
|
||||
infoId := restfulx.PathParamInt(rc.GinCtx, rc.GinCtx.Param("infoId"))
|
||||
infoId := restfulx.PathParamInt(rc, "infoId")
|
||||
rc.ResData = l.LogLoginApp.FindOne(int64(infoId))
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ func (l *LogLoginApi) GetLoginLog(rc *restfulx.ReqCtx) {
|
||||
// @Security X-TOKEN
|
||||
func (l *LogLoginApi) UpdateLoginLog(rc *restfulx.ReqCtx) {
|
||||
var log entity.LogLogin
|
||||
restfulx.BindJsonAndValid(rc.GinCtx, &log)
|
||||
restfulx.BindQuery(rc, &log)
|
||||
l.LogLoginApp.Update(log)
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ func (l *LogLoginApi) UpdateLoginLog(rc *restfulx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
|
||||
// @Router /log/logLogin/{infoId} [delete]
|
||||
func (l *LogLoginApi) DeleteLoginLog(rc *restfulx.ReqCtx) {
|
||||
infoIds := rc.GinCtx.Param("infoId")
|
||||
infoIds := restfulx.PathParam(rc, "infoId")
|
||||
group := utils.IdsStrToIdsIntGroup(infoIds)
|
||||
l.LogLoginApp.Delete(group)
|
||||
}
|
||||
|
||||
@@ -23,12 +23,11 @@ type LogOperApi struct {
|
||||
// @Router /log/logOper/list [get]
|
||||
// @Security
|
||||
func (l *LogOperApi) GetOperLogList(rc *restfulx.ReqCtx) {
|
||||
pageNum := restfulx.QueryInt(rc.GinCtx, "pageNum", 1)
|
||||
pageSize := restfulx.QueryInt(rc.GinCtx, "pageSize", 10)
|
||||
|
||||
businessType := rc.GinCtx.Query("businessType")
|
||||
operName := rc.GinCtx.Query("operName")
|
||||
title := rc.GinCtx.Query("title")
|
||||
pageNum := restfulx.QueryInt(rc, "pageNum", 1)
|
||||
pageSize := restfulx.QueryInt(rc, "pageSize", 10)
|
||||
businessType := restfulx.QueryParam(rc, "businessType")
|
||||
operName := restfulx.QueryParam(rc, "operName")
|
||||
title := restfulx.QueryParam(rc, "title")
|
||||
list, total := l.LogOperApp.FindListPage(pageNum, pageSize, entity.LogOper{BusinessType: businessType, OperName: operName, Title: title})
|
||||
rc.ResData = map[string]any{
|
||||
"data": list,
|
||||
@@ -46,7 +45,7 @@ func (l *LogOperApi) GetOperLogList(rc *restfulx.ReqCtx) {
|
||||
// @Router /log/logOper/{operId} [get]
|
||||
// @Security
|
||||
func (l *LogOperApi) GetOperLog(rc *restfulx.ReqCtx) {
|
||||
operId := restfulx.PathParamInt(rc.GinCtx, rc.GinCtx.Param("operId"))
|
||||
operId := restfulx.PathParamInt(rc, "operId")
|
||||
rc.ResData = l.LogOperApp.FindOne(int64(operId))
|
||||
}
|
||||
|
||||
@@ -58,7 +57,7 @@ func (l *LogOperApi) GetOperLog(rc *restfulx.ReqCtx) {
|
||||
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
|
||||
// @Router /log/logOper/{operId} [delete]
|
||||
func (l *LogOperApi) DeleteOperLog(rc *restfulx.ReqCtx) {
|
||||
operIds := rc.GinCtx.Param("operId")
|
||||
operIds := restfulx.PathParam(rc, "operId")
|
||||
group := utils.IdsStrToIdsIntGroup(operIds)
|
||||
log.Println("group", group)
|
||||
l.LogOperApp.Delete(group)
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/XM-GO/PandaKit/restfulx"
|
||||
"github.com/gin-gonic/gin"
|
||||
"pandax/apps/log/api"
|
||||
"pandax/apps/log/services"
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
)
|
||||
|
||||
func InitLogRouter(router *gin.RouterGroup) {
|
||||
// 登录日志
|
||||
func InitLogRouter(container *restful.Container) {
|
||||
/*// 登录日志
|
||||
login := &api.LogLoginApi{
|
||||
LogLoginApp: services.LogLoginModelDao,
|
||||
}
|
||||
@@ -72,5 +69,5 @@ func InitLogRouter(router *gin.RouterGroup) {
|
||||
|
||||
logJob.DELETE(":logId", func(c *gin.Context) {
|
||||
restfulx.NewReqCtx(c).WithLog("删除操作日志信息").Handle(job.DeleteJobLog)
|
||||
})
|
||||
})*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user