【更新】更新restful

This commit is contained in:
PandaGoAdmin
2022-08-03 17:21:07 +08:00
parent 249ddd80b2
commit 518a3de903
18 changed files with 68 additions and 892 deletions

View File

@@ -11,17 +11,7 @@ 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
// GetJobLogList Job日志列表
func (l *LogJobApi) GetJobLogList(rc *restfulx.ReqCtx) {
pageNum := restfulx.QueryInt(rc, "pageNum", 1)
pageSize := restfulx.QueryInt(rc, "pageSize", 10)
@@ -38,25 +28,14 @@ func (l *LogJobApi) GetJobLogList(rc *restfulx.ReqCtx) {
}
}
// @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]
// DeleteJobLog 批量删除登录日志
func (l *LogJobApi) DeleteJobLog(rc *restfulx.ReqCtx) {
logIds := restfulx.QueryParam(rc, "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]
// DeleteAll 清空登录日志
func (l *LogJobApi) DeleteAll(rc *restfulx.ReqCtx) {
l.LogJobApp.DeleteAll()
}

View File

@@ -11,16 +11,6 @@ type LogLoginApi struct {
LogLoginApp services.LogLoginModel
}
// @Summary 登录日志列表
// @Description 获取JSON
// @Tags 登录日志
// @Param status query string false "status"
// @Param username query string false "username"
// @Param pageSize query int false "页条数"
// @Param pageNum query int false "页码"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /log/logLogin/list [get]
// @Security
func (l *LogLoginApi) GetLoginLogList(rc *restfulx.ReqCtx) {
pageNum := restfulx.QueryInt(rc, "pageNum", 1)
pageSize := restfulx.QueryInt(rc, "pageSize", 10)
@@ -35,53 +25,23 @@ func (l *LogLoginApi) GetLoginLogList(rc *restfulx.ReqCtx) {
}
}
// @Summary 通过编码获取登录日志
// @Description 获取JSON
// @Tags 登录日志
// @Param infoId path int true "infoId"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /log/logLogin/{infoId} [get]
// @Security
func (l *LogLoginApi) GetLoginLog(rc *restfulx.ReqCtx) {
infoId := restfulx.PathParamInt(rc, "infoId")
rc.ResData = l.LogLoginApp.FindOne(int64(infoId))
}
// @Summary 修改登录日志
// @Description 获取JSON
// @Tags 登录日志
// @Accept application/json
// @Product application/json
// @Param data body entity.LogLogin true "body"
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
// @Router /log/logLogin [put]
// @Security X-TOKEN
func (l *LogLoginApi) UpdateLoginLog(rc *restfulx.ReqCtx) {
var log entity.LogLogin
restfulx.BindQuery(rc, &log)
l.LogLoginApp.Update(log)
}
// @Summary 批量删除登录日志
// @Description 删除数据
// @Tags 登录日志
// @Param infoId path string true "以逗号(,分割的infoId"
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
// @Router /log/logLogin/{infoId} [delete]
func (l *LogLoginApi) DeleteLoginLog(rc *restfulx.ReqCtx) {
infoIds := restfulx.PathParam(rc, "infoId")
group := utils.IdsStrToIdsIntGroup(infoIds)
l.LogLoginApp.Delete(group)
}
// @Summary 清空登录日志
// @Description 删除数据
// @Tags 登录日志
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
// @Router /log/logLogin/all [delete]
func (l *LogLoginApi) DeleteAll(rc *restfulx.ReqCtx) {
l.LogLoginApp.DeleteAll()
}

View File

@@ -12,16 +12,6 @@ type LogOperApi struct {
LogOperApp services.LogOperModel
}
// @Summary 操作日志列表
// @Description 获取JSON
// @Tags 操作日志
// @Param status query string false "status"
// @Param operName query string false "operName"
// @Param pageSize query int false "页条数"
// @Param pageNum query int false "页码"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /log/logOper/list [get]
// @Security
func (l *LogOperApi) GetOperLogList(rc *restfulx.ReqCtx) {
pageNum := restfulx.QueryInt(rc, "pageNum", 1)
pageSize := restfulx.QueryInt(rc, "pageSize", 10)
@@ -37,25 +27,11 @@ func (l *LogOperApi) GetOperLogList(rc *restfulx.ReqCtx) {
}
}
// @Summary 通过编码获取操作日志
// @Description 获取JSON
// @Tags 操作日志
// @Param operId path int true "operId"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /log/logOper/{operId} [get]
// @Security
func (l *LogOperApi) GetOperLog(rc *restfulx.ReqCtx) {
operId := restfulx.PathParamInt(rc, "operId")
rc.ResData = l.LogOperApp.FindOne(int64(operId))
}
// @Summary 批量删除操作日志
// @Description 删除数据
// @Tags 操作日志
// @Param operId path string true "以逗号(,分割的operId"
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
// @Router /log/logOper/{operId} [delete]
func (l *LogOperApi) DeleteOperLog(rc *restfulx.ReqCtx) {
operIds := restfulx.PathParam(rc, "operId")
group := utils.IdsStrToIdsIntGroup(operIds)
@@ -63,12 +39,6 @@ func (l *LogOperApi) DeleteOperLog(rc *restfulx.ReqCtx) {
l.LogOperApp.Delete(group)
}
// @Summary 清空操作日志
// @Description 删除数据
// @Tags 操作日志
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
// @Router /log/logOper/all [delete]
func (l *LogOperApi) DeleteAll(rc *restfulx.ReqCtx) {
l.LogOperApp.DeleteAll()
}