优化功能,通知功能,任务功能

This commit is contained in:
PandaGoAdmin
2021-12-24 16:50:06 +08:00
parent d71b0154f6
commit 816791f148
31 changed files with 521 additions and 72 deletions

63
apps/log/api/log_job.go Normal file
View File

@@ -0,0 +1,63 @@
package api
import (
"pandax/apps/log/entity"
"pandax/apps/log/services"
"pandax/base/ctx"
"pandax/base/ginx"
"pandax/base/utils"
)
type LogJobApi struct {
LogJobApp services.LogJobModel
}
// @Summary Job日志列表
// @Description 获取JSON
// @Tags 任务日志
// @Param status query string false "status"
// @Param jobGroup query string false "jobGroup"
// @Param name query string false "name"
// @Param pageSize query int false "页条数"
// @Param pageNum query int false "页码"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /log/logJob/list [get]
// @Security
func (l *LogJobApi) GetJobLogList(rc *ctx.ReqCtx) {
pageNum := ginx.QueryInt(rc.GinCtx, "pageNum", 1)
pageSize := ginx.QueryInt(rc.GinCtx, "pageSize", 10)
name := rc.GinCtx.Query("name")
jobGroup := rc.GinCtx.Query("jobGroup")
status := rc.GinCtx.Query("status")
list, total := l.LogJobApp.FindListPage(pageNum, pageSize, entity.LogJob{Name: name, JobGroup: jobGroup, Status: status})
rc.ResData = map[string]interface{}{
"data": list,
"total": total,
"pageNum": pageNum,
"pageSize": pageSize,
}
}
// @Summary 批量删除登录日志
// @Description 删除数据
// @Tags 任务日志
// @Param logId path string true "以逗号(,分割的logId"
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
// @Router /log/logJob/{logId} [delete]
func (l *LogJobApi) DeleteJobLog(rc *ctx.ReqCtx) {
logIds := rc.GinCtx.Param("logId")
group := utils.IdsStrToIdsIntGroup(logIds)
l.LogJobApp.Delete(group)
}
// @Summary 清空登录日志
// @Description 删除数据
// @Tags 任务日志
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
// @Router /log/logJob/all [delete]
func (l *LogJobApi) DeleteAll(rc *ctx.ReqCtx) {
l.LogJobApp.DeleteAll()
}

View File

@@ -20,7 +20,7 @@ type LogLoginApi struct {
// @Param pageSize query int false "页条数"
// @Param pageNum query int false "页码"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/log/list [get]
// @Router /log/logLogin/list [get]
// @Security
func (l *LogLoginApi) GetLoginLogList(rc *ctx.ReqCtx) {
pageNum := ginx.QueryInt(rc.GinCtx, "pageNum", 1)
@@ -42,7 +42,7 @@ func (l *LogLoginApi) GetLoginLogList(rc *ctx.ReqCtx) {
// @Tags 登录日志
// @Param infoId path int true "infoId"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/log/logLogin/{infoId} [get]
// @Router /log/logLogin/{infoId} [get]
// @Security
func (l *LogLoginApi) GetLoginLog(rc *ctx.ReqCtx) {
infoId := ginx.PathParamInt(rc.GinCtx, rc.GinCtx.Param("infoId"))
@@ -57,7 +57,7 @@ func (l *LogLoginApi) GetLoginLog(rc *ctx.ReqCtx) {
// @Param data body entity.LogLogin true "body"
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
// @Router /system/log/logLogin [put]
// @Router /log/logLogin [put]
// @Security X-TOKEN
func (l *LogLoginApi) UpdateLoginLog(rc *ctx.ReqCtx) {
var log entity.LogLogin
@@ -71,7 +71,7 @@ func (l *LogLoginApi) UpdateLoginLog(rc *ctx.ReqCtx) {
// @Param infoId path string true "以逗号(,分割的infoId"
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
// @Router /system/log/logLogin/{infoId} [delete]
// @Router /log/logLogin/{infoId} [delete]
func (l *LogLoginApi) DeleteLoginLog(rc *ctx.ReqCtx) {
infoIds := rc.GinCtx.Param("infoId")
group := utils.IdsStrToIdsIntGroup(infoIds)
@@ -83,7 +83,7 @@ func (l *LogLoginApi) DeleteLoginLog(rc *ctx.ReqCtx) {
// @Tags 登录日志
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
// @Router /system/log/logLogin/all [delete]
// @Router /log/logLogin/all [delete]
func (l *LogLoginApi) DeleteAll(rc *ctx.ReqCtx) {
l.LogLoginApp.DeleteAll()
}

View File

@@ -21,7 +21,7 @@ type LogOperApi struct {
// @Param pageSize query int false "页条数"
// @Param pageNum query int false "页码"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/log/list [get]
// @Router /log/logOper/list [get]
// @Security
func (l *LogOperApi) GetOperLogList(rc *ctx.ReqCtx) {
pageNum := ginx.QueryInt(rc.GinCtx, "pageNum", 1)
@@ -44,7 +44,7 @@ func (l *LogOperApi) GetOperLogList(rc *ctx.ReqCtx) {
// @Tags 操作日志
// @Param operId path int true "operId"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/log/logOper/{operId} [get]
// @Router /log/logOper/{operId} [get]
// @Security
func (l *LogOperApi) GetOperLog(rc *ctx.ReqCtx) {
operId := ginx.PathParamInt(rc.GinCtx, rc.GinCtx.Param("operId"))
@@ -57,7 +57,7 @@ func (l *LogOperApi) GetOperLog(rc *ctx.ReqCtx) {
// @Param operId path string true "以逗号(,分割的operId"
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
// @Router /system/log/logOper/{operId} [delete]
// @Router /log/logOper/{operId} [delete]
func (l *LogOperApi) DeleteOperLog(rc *ctx.ReqCtx) {
operIds := rc.GinCtx.Param("operId")
group := utils.IdsStrToIdsIntGroup(operIds)
@@ -70,7 +70,7 @@ func (l *LogOperApi) DeleteOperLog(rc *ctx.ReqCtx) {
// @Tags 操作日志
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
// @Router /system/log/logOper/all [delete]
// @Router /log/logOper/all [delete]
func (l *LogOperApi) DeleteAll(rc *ctx.ReqCtx) {
l.LogOperApp.DeleteAll()
}