|
|
|
package v1
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
|
|
"vistor/internal/model/entity"
|
|
|
|
)
|
|
|
|
|
|
|
|
type VisitorAccessReq struct {
|
|
|
|
g.Meta `path:"/visitor_access" tags:"visitor access" method:"post" summary:"visitor access"`
|
|
|
|
VisitorName string `p:"visitor_name" v:"required|max-length:10#请填写拜访人名称|访客名称过长"`
|
|
|
|
VisitorIdentity string `p:"visitor_identity" v:"required|max-length:18#请填写拜访人身份证号码|身份证号过长"`
|
|
|
|
VisitorPhone string `p:"visitor_phone" v:"required|phone#请填写拜访人手机|请填写正确的手机号码"`
|
|
|
|
VisitorDepartment string `p:"visitor_department" v:"required|max-length:30#请填写来访单位|请填写正确的来访单位"`
|
|
|
|
DstDepartment string `p:"dst_department" v:"required|max-length:20#请填写拜访人部门|请填写正确的拜访人部门"`
|
|
|
|
DstName string `p:"dst_name" v:"required|max-length:10#访客名称不能为空|拜访人姓名过长"`
|
|
|
|
DstLocation string `p:"dst_location" v:"required|max-length:10#拜访人地址不能为空|拜访人地址非法"`
|
|
|
|
Reason string `p:"reason" v:"required|max-length:255#请填写来访事由|来访事由过长"`
|
|
|
|
VehicleNumber string `p:"vehicle_number"`
|
|
|
|
Remark string `p:"remark"`
|
|
|
|
LeftAt int `p:"left_at" v:"required|max-length:10#请填写离场时间|请填写正确离场时间"`
|
|
|
|
VisitAt int `p:"visit_at" v:"required|max-length:10#请填写拜访时间|请填写正确拜访时间"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type VisitorAccessRes struct {
|
|
|
|
g.Meta `mime:"text/html" example:"string"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type VisitorStatisticReq struct {
|
|
|
|
g.Meta `path:"/visitor_statistic" tags:"visitor statistic" method:"post" summary:"visitor statistic"`
|
|
|
|
StatisticType string `p:"statistic_type" v:"required|in:day,week,month,year#请选择统计类型|非法统计类型"`
|
|
|
|
SubType string `p:"sub_type" v:"required-unless:statistic_type,day#请选择跨度"`
|
|
|
|
StartDate int `p:"start_date" v:"required-if:statistic_type,day|max-length:10#请选择起始日期|请选择正确的起始日期"`
|
|
|
|
EndDate int `p:"end_date" v:"required-if:statistic_type,day|max-length:10#请选择截止日期|请选择正确的截止日期"`
|
|
|
|
VisitorName string `p:"visitor_name"`
|
|
|
|
VisitorIdentity string `p:"visitor_identity"`
|
|
|
|
VisitorPhone string `p:"visitor_phone" v:"phone#请填写正确手机号"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type VisitorStatisticRes struct {
|
|
|
|
g.Meta `mime:"text/html" example:"string"`
|
|
|
|
XAxis g.SliceStr `p:"x_axis"`
|
|
|
|
YAxis g.SliceStr `p:"y_axis"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type VisitorListReq struct {
|
|
|
|
g.Meta `path:"/list" tags:"visitor list" method:"post" summary:"visitor list"`
|
|
|
|
VisitorName string `p:"visitor_name"`
|
|
|
|
VisitorIdentity string `p:"visitor_identity"`
|
|
|
|
VisitorPhone string `p:"visitor_phone" v:"phone#请填写正确手机号"`
|
|
|
|
StartDate int `p:"start_date" v:"required-with:end_date|max-length:10#请选择起始日期|请选择正确的起始日期"`
|
|
|
|
EndDate int `p:"end_date" v:"required-with:start_date|max-length:10#请选择截止日期|请选择正确的截止日期"`
|
|
|
|
PageReq
|
|
|
|
}
|
|
|
|
|
|
|
|
type VisitorListRes struct {
|
|
|
|
g.Meta `mime:"text/html" example:"string"`
|
|
|
|
List []*entity.VisitorRecord `json:"list"`
|
|
|
|
Current int `json:"current"`
|
|
|
|
Total int `json:"total"`
|
|
|
|
}
|