Commit 940bbe80 authored by honghuiliu's avatar honghuiliu 💬

日常提交

parent 3d013f62
package admin
type ApiGroup struct {
// Code generated by github.com/flipped-aurora/gin-vue-admin/server Begin; DO NOT EDIT.
QshToiletApi
QshPartolApi
// Code generated by github.com/flipped-aurora/gin-vue-admin/server End; DO NOT EDIT.
}
package admin
import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/admin"
adminReq "github.com/flipped-aurora/gin-vue-admin/server/model/admin/request"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/service"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
type QshPartolApi struct {
}
var qshPartolService = service.ServiceGroupApp.AdminServiceGroup.QshPartolService
// CreateQshPartol 创建QshPartol
// @Tags QshPartol
// @Summary 创建QshPartol
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body admin.QshPartol true "创建QshPartol"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /qshPartol/createQshPartol [post]
func (qshPartolApi *QshPartolApi) CreateQshPartol(c *gin.Context) {
var qshPartol admin.QshPatrol
_ = c.ShouldBindJSON(&qshPartol)
if err := qshPartolService.CreateQshPartol(qshPartol); err != nil {
global.GVA_LOG.Error("创建失败!", zap.Error(err))
response.FailWithMessage("创建失败", c)
} else {
response.OkWithMessage("创建成功", c)
}
}
// DeleteQshPartol 删除QshPartol
// @Tags QshPartol
// @Summary 删除QshPartol
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body admin.QshPartol true "删除QshPartol"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /qshPartol/deleteQshPartol [delete]
func (qshPartolApi *QshPartolApi) DeleteQshPartol(c *gin.Context) {
var qshPartol admin.QshPatrol
_ = c.ShouldBindJSON(&qshPartol)
if err := qshPartolService.DeleteQshPartol(qshPartol); err != nil {
global.GVA_LOG.Error("删除失败!", zap.Error(err))
response.FailWithMessage("删除失败", c)
} else {
response.OkWithMessage("删除成功", c)
}
}
// DeleteQshPartolByIds 批量删除QshPartol
// @Tags QshPartol
// @Summary 批量删除QshPartol
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除QshPartol"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"批量删除成功"}"
// @Router /qshPartol/deleteQshPartolByIds [delete]
func (qshPartolApi *QshPartolApi) DeleteQshPartolByIds(c *gin.Context) {
var IDS request.IdsReq
_ = c.ShouldBindJSON(&IDS)
if err := qshPartolService.DeleteQshPartolByIds(IDS); err != nil {
global.GVA_LOG.Error("批量删除失败!", zap.Error(err))
response.FailWithMessage("批量删除失败", c)
} else {
response.OkWithMessage("批量删除成功", c)
}
}
// UpdateQshPartol 更新QshPartol
// @Tags QshPartol
// @Summary 更新QshPartol
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body admin.QshPartol true "更新QshPartol"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /qshPartol/updateQshPartol [put]
func (qshPartolApi *QshPartolApi) UpdateQshPartol(c *gin.Context) {
var qshPartol admin.QshPatrol
_ = c.ShouldBindJSON(&qshPartol)
if err := qshPartolService.UpdateQshPartol(qshPartol); err != nil {
global.GVA_LOG.Error("更新失败!", zap.Error(err))
response.FailWithMessage("更新失败", c)
} else {
response.OkWithMessage("更新成功", c)
}
}
// FindQshPartol 用id查询QshPartol
// @Tags QshPartol
// @Summary 用id查询QshPartol
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query admin.QshPartol true "用id查询QshPartol"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /qshPartol/findQshPartol [get]
func (qshPartolApi *QshPartolApi) FindQshPartol(c *gin.Context) {
var qshPartol admin.QshPatrol
_ = c.ShouldBindQuery(&qshPartol)
if reqshPartol, err := qshPartolService.GetQshPartol(qshPartol.ID); err != nil {
global.GVA_LOG.Error("查询失败!", zap.Error(err))
response.FailWithMessage("查询失败", c)
} else {
response.OkWithData(gin.H{"reqshPartol": reqshPartol}, c)
}
}
// GetQshPartolList 分页获取QshPartol列表
// @Tags QshPartol
// @Summary 分页获取QshPartol列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query adminReq.QshPartolSearch true "分页获取QshPartol列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /qshPartol/getQshPartolList [get]
func (qshPartolApi *QshPartolApi) GetQshPartolList(c *gin.Context) {
var pageInfo adminReq.QshPartolSearch
_ = c.ShouldBindQuery(&pageInfo)
if list, total, err := qshPartolService.GetQshPartolInfoList(pageInfo); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(response.PageResult{
List: list,
Total: total,
Page: pageInfo.Page,
PageSize: pageInfo.PageSize,
}, "获取成功", c)
}
}
package admin
import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/admin"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
adminReq "github.com/flipped-aurora/gin-vue-admin/server/model/admin/request"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/service"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
type QshToiletApi struct {
}
var qshToiletService = service.ServiceGroupApp.AdminServiceGroup.QshToiletService
// CreateQshToilet 创建QshToilet
// @Tags QshToilet
// @Summary 创建QshToilet
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body admin.QshToilet true "创建QshToilet"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /qshToilet/createQshToilet [post]
func (qshToiletApi *QshToiletApi) CreateQshToilet(c *gin.Context) {
var qshToilet admin.QshToilet
_ = c.ShouldBindJSON(&qshToilet)
if err := qshToiletService.CreateQshToilet(qshToilet); err != nil {
global.GVA_LOG.Error("创建失败!", zap.Error(err))
response.FailWithMessage("创建失败", c)
} else {
response.OkWithMessage("创建成功", c)
}
}
// DeleteQshToilet 删除QshToilet
// @Tags QshToilet
// @Summary 删除QshToilet
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body admin.QshToilet true "删除QshToilet"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /qshToilet/deleteQshToilet [delete]
func (qshToiletApi *QshToiletApi) DeleteQshToilet(c *gin.Context) {
var qshToilet admin.QshToilet
_ = c.ShouldBindJSON(&qshToilet)
if err := qshToiletService.DeleteQshToilet(qshToilet); err != nil {
global.GVA_LOG.Error("删除失败!", zap.Error(err))
response.FailWithMessage("删除失败", c)
} else {
response.OkWithMessage("删除成功", c)
}
}
// DeleteQshToiletByIds 批量删除QshToilet
// @Tags QshToilet
// @Summary 批量删除QshToilet
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除QshToilet"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"批量删除成功"}"
// @Router /qshToilet/deleteQshToiletByIds [delete]
func (qshToiletApi *QshToiletApi) DeleteQshToiletByIds(c *gin.Context) {
var IDS request.IdsReq
_ = c.ShouldBindJSON(&IDS)
if err := qshToiletService.DeleteQshToiletByIds(IDS); err != nil {
global.GVA_LOG.Error("批量删除失败!", zap.Error(err))
response.FailWithMessage("批量删除失败", c)
} else {
response.OkWithMessage("批量删除成功", c)
}
}
// UpdateQshToilet 更新QshToilet
// @Tags QshToilet
// @Summary 更新QshToilet
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body admin.QshToilet true "更新QshToilet"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /qshToilet/updateQshToilet [put]
func (qshToiletApi *QshToiletApi) UpdateQshToilet(c *gin.Context) {
var qshToilet admin.QshToilet
_ = c.ShouldBindJSON(&qshToilet)
if err := qshToiletService.UpdateQshToilet(qshToilet); err != nil {
global.GVA_LOG.Error("更新失败!", zap.Error(err))
response.FailWithMessage("更新失败", c)
} else {
response.OkWithMessage("更新成功", c)
}
}
// FindQshToilet 用id查询QshToilet
// @Tags QshToilet
// @Summary 用id查询QshToilet
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query admin.QshToilet true "用id查询QshToilet"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /qshToilet/findQshToilet [get]
func (qshToiletApi *QshToiletApi) FindQshToilet(c *gin.Context) {
var qshToilet admin.QshToilet
_ = c.ShouldBindQuery(&qshToilet)
if reqshToilet, err := qshToiletService.GetQshToilet(qshToilet.ID); err != nil {
global.GVA_LOG.Error("查询失败!", zap.Error(err))
response.FailWithMessage("查询失败", c)
} else {
response.OkWithData(gin.H{"reqshToilet": reqshToilet}, c)
}
}
// GetQshToiletList 分页获取QshToilet列表
// @Tags QshToilet
// @Summary 分页获取QshToilet列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query adminReq.QshToiletSearch true "分页获取QshToilet列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /qshToilet/getQshToiletList [get]
func (qshToiletApi *QshToiletApi) GetQshToiletList(c *gin.Context) {
var pageInfo adminReq.QshToiletSearch
_ = c.ShouldBindQuery(&pageInfo)
if list, total, err := qshToiletService.GetQshToiletInfoList(pageInfo); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(response.PageResult{
List: list,
Total: total,
Page: pageInfo.Page,
PageSize: pageInfo.PageSize,
}, "获取成功", c)
}
}
package v1 package v1
import ( import (
"github.com/flipped-aurora/gin-vue-admin/server/api/v1/admin"
"github.com/flipped-aurora/gin-vue-admin/server/api/v1/example" "github.com/flipped-aurora/gin-vue-admin/server/api/v1/example"
"github.com/flipped-aurora/gin-vue-admin/server/api/v1/system" "github.com/flipped-aurora/gin-vue-admin/server/api/v1/system"
"github.com/flipped-aurora/gin-vue-admin/server/api/v1/web"
) )
type ApiGroup struct { type ApiGroup struct {
SystemApiGroup system.ApiGroup SystemApiGroup system.ApiGroup
ExampleApiGroup example.ApiGroup ExampleApiGroup example.ApiGroup
AdminApiGroup admin.ApiGroup
WebApiGroup web.ApiGroup
} }
var ApiGroupApp = new(ApiGroup) var ApiGroupApp = new(ApiGroup)
package web
type ApiGroup struct {
// Code generated by github.com/flipped-aurora/gin-vue-admin/server Begin; DO NOT EDIT.
// Code generated by github.com/flipped-aurora/gin-vue-admin/server End; DO NOT EDIT.
}
package web
import (
"gitee.com/zjlsliupei/ghelp"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/system"
"github.com/flipped-aurora/gin-vue-admin/server/request"
"github.com/flipped-aurora/gin-vue-admin/server/service"
"github.com/flipped-aurora/gin-vue-admin/server/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
"time"
)
var (
userService = service.ServiceGroupApp.SystemServiceGroup.UserService
loginService = service.ServiceGroupApp.WebServiceGroup.LoginService
)
func Login(c *gin.Context) {
var l request.Login
_ = c.ShouldBindJSON(&l)
if err := utils.Verify(l, utils.LoginVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
u := &system.SysUser{Username: l.Username, Password: l.Password}
key := ghelp.Md5(ghelp.CreateUnique())
prefixKey := "qsh_wc:" + key
if user, err := userService.Login(u); err != nil {
global.GVA_LOG.Error("登陆失败! 用户名不存在或者密码错误!", zap.Error(err))
response.FailWithMessage("用户名不存在或者密码错误", c)
} else {
if user.Enable != 1 {
global.GVA_LOG.Error("登陆失败! 用户被禁止登录!")
response.FailWithMessage("用户被禁止登录", c)
return
}
value := ghelp.MAP{
"user_id": user.ID,
}
if err = global.GVA_REDIS.Set(c, prefixKey, ghelp.JsonEncode(value), 86400*time.Second).Err(); err != nil {
response.FailWithMessage("登录失败,请联系管理人员!", c)
return
}
response.OkWithData(key, c)
}
}
package web
import (
"gitee.com/zjlsliupei/ghelp"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/request"
"github.com/flipped-aurora/gin-vue-admin/server/service"
"github.com/gin-gonic/gin"
)
var patrolService = service.ServiceGroupApp.WebServiceGroup.PatrolService
//GetPatrolList 获取工单列表
func GetPatrolList(c *gin.Context) {
var arg request.PatrolList
_ = c.ShouldBindJSON(&arg)
if list, total, err := patrolService.GetPatrolList(arg); err != nil {
response.FailWithMessage(err.Error(), c)
} else {
response.OkWithData(ghelp.MAP{
"list": list,
"total": total,
}, c)
}
}
func GetPatrolDetail(c *gin.Context) {
var arg request.GetPatrolId
_ = c.ShouldBindJSON(&arg)
//patrolService.GetPatrolDetail(arg)
}
package web
import (
"gitee.com/zjlsliupei/ghelp"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/request"
"github.com/flipped-aurora/gin-vue-admin/server/service"
"github.com/gin-gonic/gin"
)
var toiletService = service.ServiceGroupApp.WebServiceGroup.ToiletService
//GetToiletList 公厕点位列表
func GetToiletList(c *gin.Context) {
var toilet request.Toilet
_ = c.ShouldBindJSON(&toilet)
if list, total, err := toiletService.GetToiletList(toilet); err != nil {
response.FailWithMessage(err.Error(), c)
} else {
response.OkWithData(ghelp.MAP{
"list": list,
"total": total,
}, c)
}
}
//GetToiletDetail 公厕点位详情
func GetToiletDetail(c *gin.Context) {
var arg request.GetId
_ = c.ShouldBindJSON(&arg)
if data, err := toiletService.GetToiletDetail(arg); err != nil {
response.FailWithMessage(err.Error(), c)
} else {
response.OkWithData(data, c)
}
}
...@@ -119,8 +119,8 @@ qiniu: ...@@ -119,8 +119,8 @@ qiniu:
use-cdn-domains: false use-cdn-domains: false
redis: redis:
db: 0 db: 0
addr: 127.0.0.1:6379 addr: "r-bp1cm5ncyvq2hnul81pd.redis.rds.aliyuncs.com:16379"
password: "" password: "rRk2k3nf9JJi283lk119Jvwz"
system: system:
env: public env: public
addr: 8888 addr: 8888
...@@ -157,4 +157,4 @@ zap: ...@@ -157,4 +157,4 @@ zap:
stacktrace-key: stacktrace stacktrace-key: stacktrace
max-age: 30 max-age: 30
show-line: true show-line: true
log-in-console: true log-in-console: true
\ No newline at end of file
...@@ -3,6 +3,7 @@ module github.com/flipped-aurora/gin-vue-admin/server ...@@ -3,6 +3,7 @@ module github.com/flipped-aurora/gin-vue-admin/server
go 1.16 go 1.16
require ( require (
gitee.com/zjlsliupei/ghelp v0.0.16 // indirect
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
github.com/aliyun/aliyun-oss-go-sdk v2.1.6+incompatible github.com/aliyun/aliyun-oss-go-sdk v2.1.6+incompatible
github.com/aws/aws-sdk-go v1.42.27 github.com/aws/aws-sdk-go v1.42.27
......
...@@ -11,6 +11,8 @@ cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqCl ...@@ -11,6 +11,8 @@ cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqCl
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
gitee.com/zjlsliupei/ghelp v0.0.16 h1:JxWyobPGvO1YvLCVUn/+XGuRmn0N6aRtTdp0EohYFhU=
gitee.com/zjlsliupei/ghelp v0.0.16/go.mod h1:fap1kgFXS7J+dYdwyOy146v2FLdsg2QSwnzH4/dwm24=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
...@@ -465,6 +467,8 @@ github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzG ...@@ -465,6 +467,8 @@ github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzG
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
github.com/rs/xid v1.3.0 h1:6NjYksEUlhurdVehpc7S7dk6DAmcKv8V9gG0FsVN2U4=
github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
......
...@@ -7,6 +7,7 @@ import ( ...@@ -7,6 +7,7 @@ import (
"github.com/flipped-aurora/gin-vue-admin/server/model/example" "github.com/flipped-aurora/gin-vue-admin/server/model/example"
"github.com/flipped-aurora/gin-vue-admin/server/model/system" "github.com/flipped-aurora/gin-vue-admin/server/model/system"
"github.com/flipped-aurora/gin-vue-admin/server/model/admin"
"go.uber.org/zap" "go.uber.org/zap"
"gorm.io/gorm" "gorm.io/gorm"
) )
...@@ -52,6 +53,8 @@ func RegisterTables(db *gorm.DB) { ...@@ -52,6 +53,8 @@ func RegisterTables(db *gorm.DB) {
// 自动化模块表 // 自动化模块表
// Code generated by github.com/flipped-aurora/gin-vue-admin/server Begin; DO NOT EDIT. // Code generated by github.com/flipped-aurora/gin-vue-admin/server Begin; DO NOT EDIT.
admin.QshToilet{},
admin.QshPatrol{},
// Code generated by github.com/flipped-aurora/gin-vue-admin/server End; DO NOT EDIT. // Code generated by github.com/flipped-aurora/gin-vue-admin/server End; DO NOT EDIT.
) )
if err != nil { if err != nil {
......
...@@ -16,6 +16,7 @@ import ( ...@@ -16,6 +16,7 @@ import (
func Routers() *gin.Engine { func Routers() *gin.Engine {
Router := gin.Default() Router := gin.Default()
adminRouter := router.RouterGroupApp.Admin
systemRouter := router.RouterGroupApp.System systemRouter := router.RouterGroupApp.System
exampleRouter := router.RouterGroupApp.Example exampleRouter := router.RouterGroupApp.Example
// 如果想要不使用nginx代理前端网页,可以修改 web/.env.production 下的 // 如果想要不使用nginx代理前端网页,可以修改 web/.env.production 下的
...@@ -71,11 +72,13 @@ func Routers() *gin.Engine { ...@@ -71,11 +72,13 @@ func Routers() *gin.Engine {
// Code generated by github.com/flipped-aurora/gin-vue-admin/server Begin; DO NOT EDIT. // Code generated by github.com/flipped-aurora/gin-vue-admin/server Begin; DO NOT EDIT.
adminRouter.InitQshToiletRouter(PrivateGroup)
adminRouter.InitQshPartolRouter(PrivateGroup)
// Code generated by github.com/flipped-aurora/gin-vue-admin/server End; DO NOT EDIT. // Code generated by github.com/flipped-aurora/gin-vue-admin/server End; DO NOT EDIT.
} }
InstallPlugin(Router) // 安装插件 InstallPlugin(Router) // 安装插件
router.InitWebRouter(Router)
global.GVA_LOG.Info("router register success") global.GVA_LOG.Info("router register success")
return Router return Router
} }
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 10:35:22.359 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 net.Listen error: listen tcp :8888: bind: address already in use [github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 10:35:22.359 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 net.Listen error: listen tcp :8888: bind: address already in use
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:32:11.666 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:40:21.244 error /Users/honghuiliu/go/project/qsh-wc/server/api/v1/system/sys_dictionary.go:27 创建失败! {"error": "存在相同的type,不允许创建"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:42:33.362 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:47:54.232 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
...@@ -5,3 +5,15 @@ ...@@ -5,3 +5,15 @@
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 10:40:44.283 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:79 router register success [github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 10:40:44.283 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:79 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 10:40:44.283 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"} [github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 10:40:44.283 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 11:10:36.843 info /Users/honghuiliu/go/project/qsh-wc/server/api/v1/system/sys_initdb.go:57 前往初始化数据库 [github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 11:10:36.843 info /Users/honghuiliu/go/project/qsh-wc/server/api/v1/system/sys_initdb.go:57 前往初始化数据库
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:33:21.225 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:61 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:33:21.243 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:37 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:33:21.245 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:79 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:33:21.245 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:43:42.498 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:43:42.518 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:43:42.520 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:43:42.520 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:49:02.795 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:49:02.812 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:49:02.825 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/30 - 16:49:02.825 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 08:15:27.253 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 09:58:25.756 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:04:29.697 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:10:59.531 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:43:34.820 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:52:09.155 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:53:05.508 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:18.052 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:25.971 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:47.307 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:05:15.073 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:06:27.219 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:07:10.441 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:07:50.134 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:10:57.128 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 08:40:05.875 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 08:40:05.894 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 08:40:05.895 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 08:40:05.895 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 09:58:38.459 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 09:58:38.478 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 09:58:38.490 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 09:58:38.490 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:04:37.657 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:04:37.674 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:04:37.697 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:04:37.697 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:11:07.363 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:11:07.385 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:11:07.401 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:11:07.402 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:43:44.251 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:43:44.265 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:43:44.271 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:43:44.271 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:52:17.674 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:52:17.691 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:52:17.699 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:52:17.699 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:53:12.944 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:53:12.959 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:53:12.966 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:53:12.966 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:23.920 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:25.247 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:25.256 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:25.260 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:25.260 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:30.910 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:32.639 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:32.652 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:32.656 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:32.656 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:52.282 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:54.014 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:54.040 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:54.041 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 10:59:54.041 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:05:21.701 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:05:23.691 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:05:23.705 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:05:23.710 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:05:23.710 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:06:32.671 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:06:34.751 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:06:34.767 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:06:34.768 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:06:34.768 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:07:15.555 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:07:17.774 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:07:17.790 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:07:17.792 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:07:17.792 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:07:55.220 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:07:57.403 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:07:57.418 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:07:57.422 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:07:57.422 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:11:02.764 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:11:04.485 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:11:04.503 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:11:04.523 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/08/31 - 11:11:04.523 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:26:48.524 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:33:10.415 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:35:17.216 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:36:06.861 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:36:57.714 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:40.723 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:51.342 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:40:10.894 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:41:39.825 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:42:38.252 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:46:02.801 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 09:11:10.289 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:29:23.591 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 net.Listen error: listen tcp :8888: bind: address already in use
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:32:48.771 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 net.Listen error: listen tcp :8888: bind: address already in use
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:19:50.487 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:34:20.062 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:59:50.208 error /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:48 accept tcp [::]:8888: use of closed network connection
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:26:59.002 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:27:01.367 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:27:01.381 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:27:01.393 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:27:01.394 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:33:17.156 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:33:19.920 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:33:19.936 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:33:19.939 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:33:19.939 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:35:22.752 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:35:26.799 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:35:26.828 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:35:26.830 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:35:26.830 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:36:12.245 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:36:15.683 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:36:15.735 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:36:15.737 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:36:15.737 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:03.071 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:06.531 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:06.549 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:06.553 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:06.553 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:46.579 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:49.878 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:49.894 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:49.897 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:49.897 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:56.546 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:59.741 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:59.767 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:59.769 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:37:59.769 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:40:16.273 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:40:19.323 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:40:19.340 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:40:19.343 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:40:19.343 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:41:45.165 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:41:49.408 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:41:49.433 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:41:49.436 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:41:49.436 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:42:43.710 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:42:48.217 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:42:48.239 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:42:48.242 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:42:48.242 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:46:19.061 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:46:51.650 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:47:04.615 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:47:04.646 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:47:04.649 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 08:47:04.650 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:29:22.082 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:29:23.572 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:29:23.583 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:29:23.590 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:29:23.590 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:32:46.023 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:32:48.749 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:32:48.764 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:32:48.770 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:32:48.771 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:34:29.101 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:34:31.452 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:34:31.463 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:34:31.465 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 10:34:31.465 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:19:59.763 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:20:02.219 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:20:02.235 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:20:02.237 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:20:02.237 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:35:45.528 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:35:47.030 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:35:47.041 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:35:47.050 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:35:47.050 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:59:57.123 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:59:58.919 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/gorm.go:64 register table success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:59:58.931 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:38 register swagger handler
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:59:58.939 info /Users/honghuiliu/go/project/qsh-wc/server/initialize/router.go:82 router register success
[github.com/flipped-aurora/gin-vue-admin/server]2022/09/01 - 16:59:58.939 info /Users/honghuiliu/go/project/qsh-wc/server/core/server.go:36 server run success on {"address": ":8888"}
...@@ -24,6 +24,7 @@ func main() { ...@@ -24,6 +24,7 @@ func main() {
global.GVA_LOG = core.Zap() // 初始化zap日志库 global.GVA_LOG = core.Zap() // 初始化zap日志库
zap.ReplaceGlobals(global.GVA_LOG) zap.ReplaceGlobals(global.GVA_LOG)
global.GVA_DB = initialize.Gorm() // gorm连接数据库 global.GVA_DB = initialize.Gorm() // gorm连接数据库
initialize.Redis()
initialize.Timer() initialize.Timer()
initialize.DBList() initialize.DBList()
if global.GVA_DB != nil { if global.GVA_DB != nil {
......
package middleware
import (
"gitee.com/zjlsliupei/ghelp"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/gin-gonic/gin"
"github.com/songzhibin97/gkit/tools/gjson"
)
var exCheck = []string{"/web/login/login"}
func Token() gin.HandlerFunc {
return func(c *gin.Context) {
act := c.Request.URL.Path
if ghelp.InArray(act, exCheck) {
c.Next()
return
}
token := c.Query("access_token")
if token == "" {
response.Result(1000, "", "token不存在", c)
c.Abort()
return
}
res := global.GVA_REDIS.Get(c, "qsh_wc:"+token)
if res.Err() != nil {
response.Result(1000, "", "token不存在", c)
c.Abort()
return
}
c.Set("user_id", gjson.Get(res.Val(), "user_id").Int())
c.Next()
}
}
// 自动生成模板QshPartol
package admin
import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
)
// QshPartol 结构体
type QshPatrol struct {
global.GVA_MODEL
Content string `json:"content" form:"content" gorm:"column:content;comment:巡检内容;"`
Description string `json:"description" form:"description" gorm:"column:description;comment:异常描述;size:300;"`
Image string `json:"image" form:"image" gorm:"column:image;comment:巡检图片多个逗号分隔;"`
PartolName string `json:"partolName" form:"partolName" gorm:"column:partol_name;comment:巡视人;size:255;"`
Title string `json:"title" form:"title" gorm:"column:title;comment:工单标题;size:255;"`
ToiletId *int `json:"toiletId" form:"toiletId" gorm:"column:toilet_id;comment:巡检公厕;size:10;"`
Type *int `json:"type" form:"type" gorm:"column:type;comment:巡检类型 1=>一体化设备 2=>玻璃钢;"`
}
// TableName QshPartol 表名
func (QshPatrol) TableName() string {
return "qsh_patrol"
}
// 自动生成模板QshToilet
package admin
import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
)
// QshToilet 结构体
type QshToilet struct {
global.GVA_MODEL
Address string `json:"address" form:"address" gorm:"column:address;comment:公厕地址;size:255;"`
Image string `json:"image" form:"image" gorm:"column:image;comment:点位图片;size:5000;"`
Lat string `json:"lat" form:"lat" gorm:"column:lat;comment:纬度;size:255;"`
Lng string `json:"lng" form:"lng" gorm:"column:lng;comment:经度;size:255;"`
Manager string `json:"manager" form:"manager" gorm:"column:manager;comment:管理人员;size:200;"`
ManagerPhone string `json:"managerPhone" form:"managerPhone" gorm:"column:manager_phone;comment:管理员联系电话;size:100;"`
Monitor string `json:"monitor" form:"monitor" gorm:"column:monitor;comment:监控信息;size:255;"`
Name string `json:"name" form:"name" gorm:"column:name;comment:点位名称;size:198;"`
ShowImage string `json:"showImage" form:"showImage" gorm:"column:show_image;comment:展示图片;size:300;"`
Type *int `json:"type" form:"type" gorm:"column:type;comment:公厕类型 1=>有动力 2=>无动力;"`
}
// TableName QshToilet 表名
func (QshToilet) TableName() string {
return "qsh_toilet"
}
package request
import (
"github.com/flipped-aurora/gin-vue-admin/server/model/admin"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
)
type QshPartolSearch struct {
admin.QshPatrol
request.PageInfo
}
package request
import (
"github.com/flipped-aurora/gin-vue-admin/server/model/admin"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
)
type QshToiletSearch struct{
admin.QshToilet
request.PageInfo
}
package request
type Login struct {
Username string `json:"username"` // 用户名
Password string `json:"password"` // 密码
}
package request
import "github.com/flipped-aurora/gin-vue-admin/server/utils"
type PatrolList struct {
utils.PageInfo
StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
Type int `json:"type"`
}
type GetPatrolId struct {
ID string `json:"id"`
}
package request
import "github.com/flipped-aurora/gin-vue-admin/server/utils"
type Toilet struct {
utils.PageInfo
}
type GetId struct {
ID string `json:"id"`
}
package admin
type RouterGroup struct {
// Code generated by github.com/flipped-aurora/gin-vue-admin/server Begin; DO NOT EDIT.
QshToiletRouter
QshPartolRouter
// Code generated by github.com/flipped-aurora/gin-vue-admin/server End; DO NOT EDIT.
}
package admin
import (
"github.com/flipped-aurora/gin-vue-admin/server/api/v1"
"github.com/flipped-aurora/gin-vue-admin/server/middleware"
"github.com/gin-gonic/gin"
)
type QshPartolRouter struct {
}
// InitQshPartolRouter 初始化 QshPartol 路由信息
func (s *QshPartolRouter) InitQshPartolRouter(Router *gin.RouterGroup) {
qshPartolRouter := Router.Group("qshPartol").Use(middleware.OperationRecord())
qshPartolRouterWithoutRecord := Router.Group("qshPartol")
var qshPartolApi = v1.ApiGroupApp.AdminApiGroup.QshPartolApi
{
qshPartolRouter.POST("createQshPartol", qshPartolApi.CreateQshPartol) // 新建QshPartol
qshPartolRouter.DELETE("deleteQshPartol", qshPartolApi.DeleteQshPartol) // 删除QshPartol
qshPartolRouter.DELETE("deleteQshPartolByIds", qshPartolApi.DeleteQshPartolByIds) // 批量删除QshPartol
qshPartolRouter.PUT("updateQshPartol", qshPartolApi.UpdateQshPartol) // 更新QshPartol
}
{
qshPartolRouterWithoutRecord.GET("findQshPartol", qshPartolApi.FindQshPartol) // 根据ID获取QshPartol
qshPartolRouterWithoutRecord.GET("getQshPartolList", qshPartolApi.GetQshPartolList) // 获取QshPartol列表
}
}
package admin
import (
"github.com/flipped-aurora/gin-vue-admin/server/api/v1"
"github.com/flipped-aurora/gin-vue-admin/server/middleware"
"github.com/gin-gonic/gin"
)
type QshToiletRouter struct {
}
// InitQshToiletRouter 初始化 QshToilet 路由信息
func (s *QshToiletRouter) InitQshToiletRouter(Router *gin.RouterGroup) {
qshToiletRouter := Router.Group("qshToilet").Use(middleware.OperationRecord())
qshToiletRouterWithoutRecord := Router.Group("qshToilet")
var qshToiletApi = v1.ApiGroupApp.AdminApiGroup.QshToiletApi
{
qshToiletRouter.POST("createQshToilet", qshToiletApi.CreateQshToilet) // 新建QshToilet
qshToiletRouter.DELETE("deleteQshToilet", qshToiletApi.DeleteQshToilet) // 删除QshToilet
qshToiletRouter.DELETE("deleteQshToiletByIds", qshToiletApi.DeleteQshToiletByIds) // 批量删除QshToilet
qshToiletRouter.PUT("updateQshToilet", qshToiletApi.UpdateQshToilet) // 更新QshToilet
}
{
qshToiletRouterWithoutRecord.GET("findQshToilet", qshToiletApi.FindQshToilet) // 根据ID获取QshToilet
qshToiletRouterWithoutRecord.GET("getQshToiletList", qshToiletApi.GetQshToiletList) // 获取QshToilet列表
}
}
package router package router
import ( import (
"github.com/flipped-aurora/gin-vue-admin/server/router/admin"
"github.com/flipped-aurora/gin-vue-admin/server/router/example" "github.com/flipped-aurora/gin-vue-admin/server/router/example"
"github.com/flipped-aurora/gin-vue-admin/server/router/system" "github.com/flipped-aurora/gin-vue-admin/server/router/system"
"github.com/flipped-aurora/gin-vue-admin/server/router/web"
) )
type RouterGroup struct { type RouterGroup struct {
System system.RouterGroup System system.RouterGroup
Example example.RouterGroup Example example.RouterGroup
Admin admin.RouterGroup
Web web.RouterGroup
} }
var RouterGroupApp = new(RouterGroup) var RouterGroupApp = new(RouterGroup)
package router
import (
"github.com/flipped-aurora/gin-vue-admin/server/api/v1/web"
"github.com/flipped-aurora/gin-vue-admin/server/middleware"
"github.com/gin-gonic/gin"
)
func InitWebRouter(router *gin.Engine) {
webRouter := router.Group("/web")
webRouter.Use(middleware.Token())
login := webRouter.Group("/login")
{
login.POST("/login", web.Login) //登录
}
toilet := webRouter.Group("toilet")
{
toilet.POST("/toiletList", web.GetToiletList)
toilet.POST("/getToiletDetail", web.GetToiletDetail)
}
patrol := webRouter.Group("patrol")
{
patrol.POST("getPatrolList", web.GetPatrolList)
}
}
package web
type RouterGroup struct {
// Code generated by github.com/flipped-aurora/gin-vue-admin/server Begin; DO NOT EDIT.
// Code generated by github.com/flipped-aurora/gin-vue-admin/server End; DO NOT EDIT.
}
package admin
type ServiceGroup struct {
// Code generated by github.com/flipped-aurora/gin-vue-admin/server Begin; DO NOT EDIT.
QshToiletService
QshPartolService
// Code generated by github.com/flipped-aurora/gin-vue-admin/server End; DO NOT EDIT.
}
package admin
import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/admin"
adminReq "github.com/flipped-aurora/gin-vue-admin/server/model/admin/request"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
)
type QshPartolService struct {
}
// CreateQshPartol 创建QshPartol记录
// Author [piexlmax](https://github.com/piexlmax)
func (qshPartolService *QshPartolService) CreateQshPartol(qshPartol admin.QshPatrol) (err error) {
err = global.GVA_DB.Create(&qshPartol).Error
return err
}
// DeleteQshPartol 删除QshPartol记录
// Author [piexlmax](https://github.com/piexlmax)
func (qshPartolService *QshPartolService) DeleteQshPartol(qshPartol admin.QshPatrol) (err error) {
err = global.GVA_DB.Delete(&qshPartol).Error
return err
}
// DeleteQshPartolByIds 批量删除QshPartol记录
// Author [piexlmax](https://github.com/piexlmax)
func (qshPartolService *QshPartolService) DeleteQshPartolByIds(ids request.IdsReq) (err error) {
err = global.GVA_DB.Delete(&[]admin.QshPatrol{}, "id in ?", ids.Ids).Error
return err
}
// UpdateQshPartol 更新QshPartol记录
// Author [piexlmax](https://github.com/piexlmax)
func (qshPartolService *QshPartolService) UpdateQshPartol(qshPartol admin.QshPatrol) (err error) {
err = global.GVA_DB.Save(&qshPartol).Error
return err
}
// GetQshPartol 根据id获取QshPartol记录
// Author [piexlmax](https://github.com/piexlmax)
func (qshPartolService *QshPartolService) GetQshPartol(id uint) (qshPartol admin.QshPatrol, err error) {
err = global.GVA_DB.Where("id = ?", id).First(&qshPartol).Error
return
}
// GetQshPartolInfoList 分页获取QshPartol记录
// Author [piexlmax](https://github.com/piexlmax)
func (qshPartolService *QshPartolService) GetQshPartolInfoList(info adminReq.QshPartolSearch) (list interface{}, total int64, err error) {
limit := info.PageSize
offset := info.PageSize * (info.Page - 1)
// 创建db
db := global.GVA_DB.Model(&admin.QshPatrol{})
var qshPartols []admin.QshPatrol
// 如果有条件搜索 下方会自动创建搜索语句
if info.Title != "" {
db = db.Where("title LIKE ?", "%"+info.Title+"%")
}
if info.Type != nil {
db = db.Where("type = ?", info.Type)
}
err = db.Count(&total).Error
if err != nil {
return
}
err = db.Limit(limit).Offset(offset).Find(&qshPartols).Error
return qshPartols, total, err
}
package admin
import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/admin"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
adminReq "github.com/flipped-aurora/gin-vue-admin/server/model/admin/request"
)
type QshToiletService struct {
}
// CreateQshToilet 创建QshToilet记录
// Author [piexlmax](https://github.com/piexlmax)
func (qshToiletService *QshToiletService) CreateQshToilet(qshToilet admin.QshToilet) (err error) {
err = global.GVA_DB.Create(&qshToilet).Error
return err
}
// DeleteQshToilet 删除QshToilet记录
// Author [piexlmax](https://github.com/piexlmax)
func (qshToiletService *QshToiletService)DeleteQshToilet(qshToilet admin.QshToilet) (err error) {
err = global.GVA_DB.Delete(&qshToilet).Error
return err
}
// DeleteQshToiletByIds 批量删除QshToilet记录
// Author [piexlmax](https://github.com/piexlmax)
func (qshToiletService *QshToiletService)DeleteQshToiletByIds(ids request.IdsReq) (err error) {
err = global.GVA_DB.Delete(&[]admin.QshToilet{},"id in ?",ids.Ids).Error
return err
}
// UpdateQshToilet 更新QshToilet记录
// Author [piexlmax](https://github.com/piexlmax)
func (qshToiletService *QshToiletService)UpdateQshToilet(qshToilet admin.QshToilet) (err error) {
err = global.GVA_DB.Save(&qshToilet).Error
return err
}
// GetQshToilet 根据id获取QshToilet记录
// Author [piexlmax](https://github.com/piexlmax)
func (qshToiletService *QshToiletService)GetQshToilet(id uint) (qshToilet admin.QshToilet, err error) {
err = global.GVA_DB.Where("id = ?", id).First(&qshToilet).Error
return
}
// GetQshToiletInfoList 分页获取QshToilet记录
// Author [piexlmax](https://github.com/piexlmax)
func (qshToiletService *QshToiletService)GetQshToiletInfoList(info adminReq.QshToiletSearch) (list interface{}, total int64, err error) {
limit := info.PageSize
offset := info.PageSize * (info.Page - 1)
// 创建db
db := global.GVA_DB.Model(&admin.QshToilet{})
var qshToilets []admin.QshToilet
// 如果有条件搜索 下方会自动创建搜索语句
if info.Name != "" {
db = db.Where("name LIKE ?","%"+ info.Name+"%")
}
if info.Type != nil {
db = db.Where("type = ?",info.Type)
}
err = db.Count(&total).Error
if err!=nil {
return
}
err = db.Limit(limit).Offset(offset).Find(&qshToilets).Error
return qshToilets, total, err
}
package service package service
import ( import (
"github.com/flipped-aurora/gin-vue-admin/server/service/admin"
"github.com/flipped-aurora/gin-vue-admin/server/service/example" "github.com/flipped-aurora/gin-vue-admin/server/service/example"
"github.com/flipped-aurora/gin-vue-admin/server/service/system" "github.com/flipped-aurora/gin-vue-admin/server/service/system"
"github.com/flipped-aurora/gin-vue-admin/server/service/web"
) )
type ServiceGroup struct { type ServiceGroup struct {
SystemServiceGroup system.ServiceGroup SystemServiceGroup system.ServiceGroup
ExampleServiceGroup example.ServiceGroup ExampleServiceGroup example.ServiceGroup
AdminServiceGroup admin.ServiceGroup
WebServiceGroup web.ServiceGroup
} }
var ServiceGroupApp = new(ServiceGroup) var ServiceGroupApp = new(ServiceGroup)
package web
type ServiceGroup struct {
LoginService
ToiletService
PatrolService
// Code generated by github.com/flipped-aurora/gin-vue-admin/server Begin; DO NOT EDIT.
// Code generated by github.com/flipped-aurora/gin-vue-admin/server End; DO NOT EDIT.
}
package web
type LoginService struct {
}
package web
import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/admin"
"github.com/flipped-aurora/gin-vue-admin/server/request"
)
type PatrolService struct {
}
func (l *PatrolService) GetPatrolList(arg request.PatrolList) ([]admin.QshPatrol, int64, error) {
limit := arg.PageSize
offset := (arg.Page - 1) * arg.PageSize
var total int64
var patrolList []admin.QshPatrol
db := global.GVA_DB.Model(admin.QshPatrol{})
if arg.StartTime != "" {
db.Where("created_at >= ?", arg.StartTime)
}
if arg.EndTime != "" {
db.Where("created_at <= ?", arg.EndTime)
}
if arg.Type != 0 {
db.Where("type = ?", arg.Type)
}
err := db.Count(&total).Error
if err != nil {
return patrolList, total, err
}
err = db.Limit(limit).Offset(offset).Find(&patrolList).Error
if err != nil {
return patrolList, total, err
}
return patrolList, total, nil
}
package web
import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/admin"
"github.com/flipped-aurora/gin-vue-admin/server/request"
)
type ToiletService struct {
}
func (l *ToiletService) GetToiletList(toilet request.Toilet) ([]admin.QshToilet, int64, error) {
limit := toilet.PageSize
offset := (toilet.Page - 1) * toilet.PageSize
var total int64
var toiletList []admin.QshToilet
db := global.GVA_DB.Model(admin.QshToilet{})
db.Count(&total)
err := db.Limit(limit).Offset(offset).Find(&toiletList).Error
if err != nil {
return toiletList, total, err
}
return toiletList, total, nil
}
func (l *ToiletService) GetToiletDetail(toilet request.GetId) (admin.QshToilet, error) {
var toiletInfo admin.QshToilet
err := global.GVA_DB.Model(toiletInfo).First(&toiletInfo).Error
if err != nil {
return toiletInfo, err
}
return toiletInfo, nil
}
package utils
type PageInfo struct {
Page int `json:"page" form:"page"` // 页码
PageSize int `json:"page_size" form:"page_size"` // 每页大小
}
import service from '@/utils/request'
// @Tags QshPartol
// @Summary 创建QshPartol
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.QshPartol true "创建QshPartol"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /qshPartol/createQshPartol [post]
export const createQshPartol = (data) => {
return service({
url: '/qshPartol/createQshPartol',
method: 'post',
data
})
}
// @Tags QshPartol
// @Summary 删除QshPartol
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.QshPartol true "删除QshPartol"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /qshPartol/deleteQshPartol [delete]
export const deleteQshPartol = (data) => {
return service({
url: '/qshPartol/deleteQshPartol',
method: 'delete',
data
})
}
// @Tags QshPartol
// @Summary 删除QshPartol
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除QshPartol"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /qshPartol/deleteQshPartol [delete]
export const deleteQshPartolByIds = (data) => {
return service({
url: '/qshPartol/deleteQshPartolByIds',
method: 'delete',
data
})
}
// @Tags QshPartol
// @Summary 更新QshPartol
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.QshPartol true "更新QshPartol"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /qshPartol/updateQshPartol [put]
export const updateQshPartol = (data) => {
return service({
url: '/qshPartol/updateQshPartol',
method: 'put',
data
})
}
// @Tags QshPartol
// @Summary 用id查询QshPartol
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query model.QshPartol true "用id查询QshPartol"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /qshPartol/findQshPartol [get]
export const findQshPartol = (params) => {
return service({
url: '/qshPartol/findQshPartol',
method: 'get',
params
})
}
// @Tags QshPartol
// @Summary 分页获取QshPartol列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.PageInfo true "分页获取QshPartol列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /qshPartol/getQshPartolList [get]
export const getQshPartolList = (params) => {
return service({
url: '/qshPartol/getQshPartolList',
method: 'get',
params
})
}
import service from '@/utils/request'
// @Tags QshToilet
// @Summary 创建QshToilet
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.QshToilet true "创建QshToilet"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /qshToilet/createQshToilet [post]
export const createQshToilet = (data) => {
return service({
url: '/qshToilet/createQshToilet',
method: 'post',
data
})
}
// @Tags QshToilet
// @Summary 删除QshToilet
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.QshToilet true "删除QshToilet"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /qshToilet/deleteQshToilet [delete]
export const deleteQshToilet = (data) => {
return service({
url: '/qshToilet/deleteQshToilet',
method: 'delete',
data
})
}
// @Tags QshToilet
// @Summary 删除QshToilet
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除QshToilet"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /qshToilet/deleteQshToilet [delete]
export const deleteQshToiletByIds = (data) => {
return service({
url: '/qshToilet/deleteQshToiletByIds',
method: 'delete',
data
})
}
// @Tags QshToilet
// @Summary 更新QshToilet
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.QshToilet true "更新QshToilet"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /qshToilet/updateQshToilet [put]
export const updateQshToilet = (data) => {
return service({
url: '/qshToilet/updateQshToilet',
method: 'put',
data
})
}
// @Tags QshToilet
// @Summary 用id查询QshToilet
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query model.QshToilet true "用id查询QshToilet"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /qshToilet/findQshToilet [get]
export const findQshToilet = (params) => {
return service({
url: '/qshToilet/findQshToilet',
method: 'get',
params
})
}
// @Tags QshToilet
// @Summary 分页获取QshToilet列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.PageInfo true "分页获取QshToilet列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /qshToilet/getQshToiletList [get]
export const getQshToiletList = (params) => {
return service({
url: '/qshToilet/getQshToiletList',
method: 'get',
params
})
}
<template>
<div>
<div class="gva-search-box">
<el-form :inline="true" :model="searchInfo" class="demo-form-inline">
<el-form-item label="工单标题">
<el-input v-model="searchInfo.title" placeholder="搜索条件" />
</el-form-item>
<el-form-item label="巡检类型" prop="type">
<el-select v-model="searchInfo.type" clearable placeholder="请选择" @clear="()=>{searchInfo.type=undefined}">
<el-option v-for="(item,key) in partol_typeOptions" :key="key" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item>
<el-button size="small" type="primary" icon="search" @click="onSubmit">查询</el-button>
<el-button size="small" icon="refresh" @click="onReset">重置</el-button>
</el-form-item>
</el-form>
</div>
<div class="gva-table-box">
<div class="gva-btn-list">
<el-button size="small" type="primary" icon="plus" @click="openDialog">新增</el-button>
<el-popover v-model:visible="deleteVisible" placement="top" width="160">
<p>确定要删除吗?</p>
<div style="text-align: right; margin-top: 8px;">
<el-button size="small" type="primary" link @click="deleteVisible = false">取消</el-button>
<el-button size="small" type="primary" @click="onDelete">确定</el-button>
</div>
<template #reference>
<el-button icon="delete" size="small" style="margin-left: 10px;" :disabled="!multipleSelection.length" @click="deleteVisible = true">删除</el-button>
</template>
</el-popover>
</div>
<el-table
ref="multipleTable"
style="width: 100%"
tooltip-effect="dark"
:data="tableData"
row-key="ID"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" />
<el-table-column align="left" label="日期" width="180">
<template #default="scope">{{ formatDate(scope.row.CreatedAt) }}</template>
</el-table-column>
<el-table-column align="left" label="巡检内容" prop="content" width="120" />
<el-table-column align="left" label="异常描述" prop="description" width="120" />
<el-table-column align="left" label="巡检图片多个逗号分隔" prop="image" width="120" />
<el-table-column align="left" label="巡视人" prop="partolName" width="120" />
<el-table-column align="left" label="工单标题" prop="title" width="120" />
<el-table-column align="left" label="巡检公厕" prop="toiletId" width="120" />
<el-table-column align="left" label="巡检类型" prop="type" width="120">
<template #default="scope">
{{ filterDict(scope.row.type,partol_typeOptions) }}
</template>
</el-table-column>
<el-table-column align="left" label="按钮组">
<template #default="scope">
<el-button type="primary" link icon="edit" size="small" class="table-button" @click="updateQshPartolFunc(scope.row)">变更</el-button>
<el-button type="primary" link icon="delete" size="small" @click="deleteRow(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="gva-pagination">
<el-pagination
layout="total, sizes, prev, pager, next, jumper"
:current-page="page"
:page-size="pageSize"
:page-sizes="[10, 30, 50, 100]"
:total="total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
/>
</div>
</div>
<el-dialog v-model="dialogFormVisible" :before-close="closeDialog" title="弹窗操作">
<el-form :model="formData" label-position="right" label-width="80px">
<el-form-item label="巡检内容:">
<el-input v-model="formData.content" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="异常描述:">
<el-input v-model="formData.description" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="巡检图片多个逗号分隔:">
<el-input v-model="formData.image" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="巡视人:">
<el-input v-model="formData.partolName" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="工单标题:">
<el-input v-model="formData.title" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="巡检公厕:">
<el-input v-model.number="formData.toiletId" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="巡检类型:">
<el-select v-model="formData.type" placeholder="请选择" style="width:100%" clearable>
<el-option v-for="(item,key) in partol_typeOptions" :key="key" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button size="small" @click="closeDialog">取 消</el-button>
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'QshPartol'
}
</script>
<script setup>
import {
createQshPartol,
deleteQshPartol,
deleteQshPartolByIds,
updateQshPartol,
findQshPartol,
getQshPartolList
} from '@/api/qshPartol'
// 全量引入格式化工具 请按需保留
import { getDictFunc, formatDate, formatBoolean, filterDict } from '@/utils/format'
import { ElMessage, ElMessageBox } from 'element-plus'
import { ref } from 'vue'
// 自动化生成的字典(可能为空)以及字段
const partol_typeOptions = ref([])
const formData = ref({
content: '',
description: '',
image: '',
partolName: '',
title: '',
toiletId: 0,
type: undefined,
})
// =========== 表格控制部分 ===========
const page = ref(1)
const total = ref(0)
const pageSize = ref(10)
const tableData = ref([])
const searchInfo = ref({})
// 重置
const onReset = () => {
searchInfo.value = {}
}
// 搜索
const onSubmit = () => {
page.value = 1
pageSize.value = 10
getTableData()
}
// 分页
const handleSizeChange = (val) => {
pageSize.value = val
getTableData()
}
// 修改页面容量
const handleCurrentChange = (val) => {
page.value = val
getTableData()
}
// 查询
const getTableData = async() => {
const table = await getQshPartolList({ page: page.value, pageSize: pageSize.value, ...searchInfo.value })
if (table.code === 0) {
tableData.value = table.data.list
total.value = table.data.total
page.value = table.data.page
pageSize.value = table.data.pageSize
}
}
getTableData()
// ============== 表格控制部分结束 ===============
// 获取需要的字典 可能为空 按需保留
const setOptions = async () =>{
partol_typeOptions.value = await getDictFunc('partol_type')
}
// 获取需要的字典 可能为空 按需保留
setOptions()
// 多选数据
const multipleSelection = ref([])
// 多选
const handleSelectionChange = (val) => {
multipleSelection.value = val
}
// 删除行
const deleteRow = (row) => {
ElMessageBox.confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteQshPartolFunc(row)
})
}
// 批量删除控制标记
const deleteVisible = ref(false)
// 多选删除
const onDelete = async() => {
const ids = []
if (multipleSelection.value.length === 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
return
}
multipleSelection.value &&
multipleSelection.value.map(item => {
ids.push(item.ID)
})
const res = await deleteQshPartolByIds({ ids })
if (res.code === 0) {
ElMessage({
type: 'success',
message: '删除成功'
})
if (tableData.value.length === ids.length && page.value > 1) {
page.value--
}
deleteVisible.value = false
getTableData()
}
}
// 行为控制标记(弹窗内部需要增还是改)
const type = ref('')
// 更新行
const updateQshPartolFunc = async(row) => {
const res = await findQshPartol({ ID: row.ID })
type.value = 'update'
if (res.code === 0) {
formData.value = res.data.reqshPartol
dialogFormVisible.value = true
}
}
// 删除行
const deleteQshPartolFunc = async (row) => {
const res = await deleteQshPartol({ ID: row.ID })
if (res.code === 0) {
ElMessage({
type: 'success',
message: '删除成功'
})
if (tableData.value.length === 1 && page.value > 1) {
page.value--
}
getTableData()
}
}
// 弹窗控制标记
const dialogFormVisible = ref(false)
// 打开弹窗
const openDialog = () => {
type.value = 'create'
dialogFormVisible.value = true
}
// 关闭弹窗
const closeDialog = () => {
dialogFormVisible.value = false
formData.value = {
content: '',
description: '',
image: '',
partolName: '',
title: '',
toiletId: 0,
type: undefined,
}
}
// 弹窗确定
const enterDialog = async () => {
let res
switch (type.value) {
case 'create':
res = await createQshPartol(formData.value)
break
case 'update':
res = await updateQshPartol(formData.value)
break
default:
res = await createQshPartol(formData.value)
break
}
if (res.code === 0) {
ElMessage({
type: 'success',
message: '创建/更改成功'
})
closeDialog()
getTableData()
}
}
</script>
<style>
</style>
<template>
<div>
<div class="gva-form-box">
<el-form :model="formData" label-position="right" label-width="80px">
<el-form-item label="巡检内容:">
<el-input v-model="formData.content" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="异常描述:">
<el-input v-model="formData.description" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="巡检图片多个逗号分隔:">
<el-input v-model="formData.image" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="巡视人:">
<el-input v-model="formData.partolName" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="工单标题:">
<el-input v-model="formData.title" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="巡检公厕:">
<el-input v-model.number="formData.toiletId" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="巡检类型:">
<el-select v-model="formData.type" placeholder="请选择" clearable>
<el-option v-for="(item,key) in partol_typeOptions" :key="key" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item>
<el-button size="mini" type="primary" @click="save">保存</el-button>
<el-button size="mini" type="primary" @click="back">返回</el-button>
</el-form-item>
</el-form>
</div>
</div>
</template>
<script>
export default {
name: 'QshPartol'
}
</script>
<script setup>
import {
createQshPartol,
updateQshPartol,
findQshPartol
} from '@/api/qshPartol'
// 自动获取字典
import { getDictFunc } from '@/utils/format'
import { useRoute, useRouter } from "vue-router"
import { ElMessage } from 'element-plus'
import { ref } from 'vue'
const route = useRoute()
const router = useRouter()
const type = ref('')
const partol_typeOptions = ref([])
const formData = ref({
content: '',
description: '',
image: '',
partolName: '',
title: '',
toiletId: 0,
type: undefined,
})
// 初始化方法
const init = async () => {
// 建议通过url传参获取目标数据ID 调用 find方法进行查询数据操作 从而决定本页面是create还是update 以下为id作为url参数示例
if (route.query.id) {
const res = await findQshPartol({ ID: route.query.id })
if (res.code === 0) {
formData.value = res.data.reqshPartol
type.value = 'update'
}
} else {
type.value = 'create'
}
partol_typeOptions.value = await getDictFunc('partol_type')
}
init()
// 保存按钮
const save = async() => {
let res
switch (type.value) {
case 'create':
res = await createQshPartol(formData.value)
break
case 'update':
res = await updateQshPartol(formData.value)
break
default:
res = await createQshPartol(formData.value)
break
}
if (res.code === 0) {
ElMessage({
type: 'success',
message: '创建/更改成功'
})
}
}
// 返回按钮
const back = () => {
router.go(-1)
}
</script>
<style>
</style>
<template>
<div>
<div class="gva-search-box">
<el-form :inline="true" :model="searchInfo" class="demo-form-inline">
<el-form-item label="点位名称">
<el-input v-model="searchInfo.name" placeholder="搜索条件" />
</el-form-item>
<el-form-item label="公厕类型" prop="type">
<el-select v-model="searchInfo.type" clearable placeholder="请选择" @clear="()=>{searchInfo.type=undefined}">
<el-option v-for="(item,key) in typeOptions" :key="key" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item>
<el-button size="small" type="primary" icon="search" @click="onSubmit">查询</el-button>
<el-button size="small" icon="refresh" @click="onReset">重置</el-button>
</el-form-item>
</el-form>
</div>
<div class="gva-table-box">
<div class="gva-btn-list">
<el-button size="small" type="primary" icon="plus" @click="openDialog">新增</el-button>
<el-popover v-model:visible="deleteVisible" placement="top" width="160">
<p>确定要删除吗?</p>
<div style="text-align: right; margin-top: 8px;">
<el-button size="small" type="primary" link @click="deleteVisible = false">取消</el-button>
<el-button size="small" type="primary" @click="onDelete">确定</el-button>
</div>
<template #reference>
<el-button icon="delete" size="small" style="margin-left: 10px;" :disabled="!multipleSelection.length" @click="deleteVisible = true">删除</el-button>
</template>
</el-popover>
</div>
<el-table
ref="multipleTable"
style="width: 100%"
tooltip-effect="dark"
:data="tableData"
row-key="ID"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" />
<el-table-column align="left" label="日期" width="180">
<template #default="scope">{{ formatDate(scope.row.CreatedAt) }}</template>
</el-table-column>
<el-table-column align="left" label="公厕地址" prop="address" width="120" />
<el-table-column align="left" label="点位图片" prop="image" width="120" />
<el-table-column align="left" label="纬度" prop="lat" width="120" />
<el-table-column align="left" label="经度" prop="lng" width="120" />
<el-table-column align="left" label="管理人员" prop="manager" width="120" />
<el-table-column align="left" label="管理员联系电话" prop="managerPhone" width="120" />
<el-table-column align="left" label="监控信息" prop="monitor" width="120" />
<el-table-column align="left" label="点位名称" prop="name" width="120" />
<el-table-column align="left" label="展示图片" prop="showImage" width="120" />
<el-table-column align="left" label="公厕类型" prop="type" width="120">
<template #default="scope">
{{ filterDict(scope.row.type,typeOptions) }}
</template>
</el-table-column>
<el-table-column align="left" label="按钮组">
<template #default="scope">
<el-button type="primary" link icon="edit" size="small" class="table-button" @click="updateQshToiletFunc(scope.row)">变更</el-button>
<el-button type="primary" link icon="delete" size="small" @click="deleteRow(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="gva-pagination">
<el-pagination
layout="total, sizes, prev, pager, next, jumper"
:current-page="page"
:page-size="pageSize"
:page-sizes="[10, 30, 50, 100]"
:total="total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
/>
</div>
</div>
<el-dialog v-model="dialogFormVisible" :before-close="closeDialog" title="弹窗操作">
<el-form :model="formData" label-position="right" label-width="80px">
<el-form-item label="公厕地址:">
<el-input v-model="formData.address" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="点位图片:">
<el-input v-model="formData.image" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="纬度:">
<el-input v-model="formData.lat" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="经度:">
<el-input v-model="formData.lng" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="管理人员:">
<el-input v-model="formData.manager" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="管理员联系电话:">
<el-input v-model="formData.managerPhone" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="监控信息:">
<el-input v-model="formData.monitor" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="点位名称:">
<el-input v-model="formData.name" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="展示图片:">
<el-input v-model="formData.showImage" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="公厕类型:">
<el-select v-model="formData.type" placeholder="请选择" style="width:100%" clearable>
<el-option v-for="(item,key) in typeOptions" :key="key" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button size="small" @click="closeDialog">取 消</el-button>
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'QshToilet'
}
</script>
<script setup>
import {
createQshToilet,
deleteQshToilet,
deleteQshToiletByIds,
updateQshToilet,
findQshToilet,
getQshToiletList
} from '@/api/qshToilet'
// 全量引入格式化工具 请按需保留
import { getDictFunc, formatDate, formatBoolean, filterDict } from '@/utils/format'
import { ElMessage, ElMessageBox } from 'element-plus'
import { ref } from 'vue'
// 自动化生成的字典(可能为空)以及字段
const typeOptions = ref([])
const formData = ref({
address: '',
image: '',
lat: '',
lng: '',
manager: '',
managerPhone: '',
monitor: '',
name: '',
showImage: '',
type: undefined,
})
// =========== 表格控制部分 ===========
const page = ref(1)
const total = ref(0)
const pageSize = ref(10)
const tableData = ref([])
const searchInfo = ref({})
// 重置
const onReset = () => {
searchInfo.value = {}
}
// 搜索
const onSubmit = () => {
page.value = 1
pageSize.value = 10
getTableData()
}
// 分页
const handleSizeChange = (val) => {
pageSize.value = val
getTableData()
}
// 修改页面容量
const handleCurrentChange = (val) => {
page.value = val
getTableData()
}
// 查询
const getTableData = async() => {
const table = await getQshToiletList({ page: page.value, pageSize: pageSize.value, ...searchInfo.value })
if (table.code === 0) {
tableData.value = table.data.list
total.value = table.data.total
page.value = table.data.page
pageSize.value = table.data.pageSize
}
}
getTableData()
// ============== 表格控制部分结束 ===============
// 获取需要的字典 可能为空 按需保留
const setOptions = async () =>{
typeOptions.value = await getDictFunc('type')
}
// 获取需要的字典 可能为空 按需保留
setOptions()
// 多选数据
const multipleSelection = ref([])
// 多选
const handleSelectionChange = (val) => {
multipleSelection.value = val
}
// 删除行
const deleteRow = (row) => {
ElMessageBox.confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteQshToiletFunc(row)
})
}
// 批量删除控制标记
const deleteVisible = ref(false)
// 多选删除
const onDelete = async() => {
const ids = []
if (multipleSelection.value.length === 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
return
}
multipleSelection.value &&
multipleSelection.value.map(item => {
ids.push(item.ID)
})
const res = await deleteQshToiletByIds({ ids })
if (res.code === 0) {
ElMessage({
type: 'success',
message: '删除成功'
})
if (tableData.value.length === ids.length && page.value > 1) {
page.value--
}
deleteVisible.value = false
getTableData()
}
}
// 行为控制标记(弹窗内部需要增还是改)
const type = ref('')
// 更新行
const updateQshToiletFunc = async(row) => {
const res = await findQshToilet({ ID: row.ID })
type.value = 'update'
if (res.code === 0) {
formData.value = res.data.reqshToilet
dialogFormVisible.value = true
}
}
// 删除行
const deleteQshToiletFunc = async (row) => {
const res = await deleteQshToilet({ ID: row.ID })
if (res.code === 0) {
ElMessage({
type: 'success',
message: '删除成功'
})
if (tableData.value.length === 1 && page.value > 1) {
page.value--
}
getTableData()
}
}
// 弹窗控制标记
const dialogFormVisible = ref(false)
// 打开弹窗
const openDialog = () => {
type.value = 'create'
dialogFormVisible.value = true
}
// 关闭弹窗
const closeDialog = () => {
dialogFormVisible.value = false
formData.value = {
address: '',
image: '',
lat: '',
lng: '',
manager: '',
managerPhone: '',
monitor: '',
name: '',
showImage: '',
type: undefined,
}
}
// 弹窗确定
const enterDialog = async () => {
let res
switch (type.value) {
case 'create':
res = await createQshToilet(formData.value)
break
case 'update':
res = await updateQshToilet(formData.value)
break
default:
res = await createQshToilet(formData.value)
break
}
if (res.code === 0) {
ElMessage({
type: 'success',
message: '创建/更改成功'
})
closeDialog()
getTableData()
}
}
</script>
<style>
</style>
<template>
<div>
<div class="gva-form-box">
<el-form :model="formData" label-position="right" label-width="80px">
<el-form-item label="公厕地址:">
<el-input v-model="formData.address" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="点位图片:">
<el-input v-model="formData.image" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="纬度:">
<el-input v-model="formData.lat" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="经度:">
<el-input v-model="formData.lng" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="管理人员:">
<el-input v-model="formData.manager" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="管理员联系电话:">
<el-input v-model="formData.managerPhone" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="监控信息:">
<el-input v-model="formData.monitor" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="点位名称:">
<el-input v-model="formData.name" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="展示图片:">
<el-input v-model="formData.showImage" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="公厕类型:">
<el-select v-model="formData.type" placeholder="请选择" clearable>
<el-option v-for="(item,key) in typeOptions" :key="key" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item>
<el-button size="mini" type="primary" @click="save">保存</el-button>
<el-button size="mini" type="primary" @click="back">返回</el-button>
</el-form-item>
</el-form>
</div>
</div>
</template>
<script>
export default {
name: 'QshToilet'
}
</script>
<script setup>
import {
createQshToilet,
updateQshToilet,
findQshToilet
} from '@/api/qshToilet'
// 自动获取字典
import { getDictFunc } from '@/utils/format'
import { useRoute, useRouter } from "vue-router"
import { ElMessage } from 'element-plus'
import { ref } from 'vue'
const route = useRoute()
const router = useRouter()
const type = ref('')
const typeOptions = ref([])
const formData = ref({
address: '',
image: '',
lat: '',
lng: '',
manager: '',
managerPhone: '',
monitor: '',
name: '',
showImage: '',
type: undefined,
})
// 初始化方法
const init = async () => {
// 建议通过url传参获取目标数据ID 调用 find方法进行查询数据操作 从而决定本页面是create还是update 以下为id作为url参数示例
if (route.query.id) {
const res = await findQshToilet({ ID: route.query.id })
if (res.code === 0) {
formData.value = res.data.reqshToilet
type.value = 'update'
}
} else {
type.value = 'create'
}
typeOptions.value = await getDictFunc('type')
}
init()
// 保存按钮
const save = async() => {
let res
switch (type.value) {
case 'create':
res = await createQshToilet(formData.value)
break
case 'update':
res = await updateQshToilet(formData.value)
break
default:
res = await createQshToilet(formData.value)
break
}
if (res.code === 0) {
ElMessage({
type: 'success',
message: '创建/更改成功'
})
}
}
// 返回按钮
const back = () => {
router.go(-1)
}
</script>
<style>
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment