v3

package
v0.15.98 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGroup

func CreateGroup(param Group) error

func CreateSchema

func CreateSchema(param Schema) error

func DelGroup

func DelGroup(tangentId, id, userId string) error

func DelSchema

func DelSchema(tangentId, id, userId string) error

func Destroy

func Destroy()

func Init

func Init(baseUrl string, timeoutSec time.Duration)

func Migrate added in v0.15.98

func Migrate() error

func UptGroup

func UptGroup(param Group) error

func UptSchema

func UptSchema(param Schema) error

Types

type ClockInMode

type ClockInMode struct {
	Id   string `json:"id"`
	Mode uint8  `json:"mode"`
	// Setting 打卡方式配置明细
	Setting []any `json:"setting"`
}

ClockInMode 打卡方式

type ConflictDetail

type ConflictDetail struct {
	User  string `json:"user"`
	Group string `json:"group"`
}

func InGroup

func InGroup(tangentId, groupId string, userIds []string) ([]ConflictDetail, error)

type DeptUser

type DeptUser struct {
	DeptId   string   `json:"deptId"`
	Num      int      `json:"num"`
	UserIds  []string `json:"userIds"`
	AutoJoin bool     `json:"autoJoin"`
}

DeptUser 部门考勤人员信息

type GetGroupParam

type GetGroupParam struct {
	Id        string `form:"id"`
	TangentId string `form:"tangentId"`
	Name      string `form:"name"`
	SchemaId  string `form:"schemaId"`
	UserId    string `form:"userId"`
	PageNo    int    `form:"pageNo"`
	PageSize  int    `form:"pageSize"`
}

type GetRecordParam added in v0.15.80

type GetRecordParam struct {
	TangentId   string `validate:"required,len=32" form:"tangentId"`
	UserId      string `validate:"required,len=32" form:"userId"`
	Start       string `form:"start"`
	End         string `form:"end"`
	CheckInDate string `form:"checkIndDate"`
	RecordType  uint8  `form:"recordType"`
	PageNo      int    `form:"pageNo"`
	PageSize    int    `form:"pageSize"`
}

type GetSchemaParam

type GetSchemaParam struct {
	Schema
	PageNo, PageSize int
}

type Group

type Group struct {
	Id        string        `form:"id" json:"id"`
	Name      string        `form:"name" json:"name"`
	TangentId string        `form:"tangentId" json:"tangentId"`
	Modes     []ClockInMode `form:"modes" json:"modes"`
	AllowOut  bool          `form:"allowOut" json:"allowOut"`
	UserId    string        `form:"userId" json:"userId"`
	Charge    string        `form:"charge" json:"charge"`
	User      `json:"user"`
	WorkSys   `json:"workSys"`
}

Group 考勤组

type GroupInfo

type GroupInfo struct {
	Id          string        `json:"id"`
	Name        string        `json:"name"`
	TangentId   string        `json:"tangentId"`
	Modes       []ClockInMode `json:"modes"`
	AllowOut    bool          `json:"allowOut"`
	Charge      string        `json:"charge"`
	CreateBy    string        `json:"createBy"`
	User        `json:"user"`
	WorkSysInfo `json:"workSys"`
}

func GroupDetail

func GroupDetail(tangentId, id string) (*GroupInfo, error)

type GroupSchema

type GroupSchema struct {
	Id    string `json:"id"`
	Name  string `json:"name"`
	Start string `json:"start"`
	End   string `json:"end"`
}

type MiniGroup

type MiniGroup struct {
	Id         string  `json:"id"`
	Name       string  `json:"name"`
	SchemaId   string  `json:"schemaId"`
	SchemaName string  `json:"schemaName"`
	UserNum    int     `json:"userNum"`
	TangentId  string  `json:"tangentId"`
	CreateBy   string  `json:"createBy"`
	Charge     string  `json:"charge"`
	CreatedAt  string  `json:"createdAt"`
	ClockModes []uint8 `json:"clockModes"`
	AllowOut   bool    `json:"allowOut"`
}

type MiniSchema

type MiniSchema struct {
	Id        string `json:"id"`
	Name      string `json:"name"`
	Start     string `json:"start"`
	End       string `json:"end"`
	TangentId string `json:"tangentId"`
	CreateBy  string `json:"createBy"`
	Charge    string `json:"charge"`
	CreatedAt string `json:"createdAt"`
}

type Must

type Must struct {
	Date     string `json:"date" form:"date"`
	SchemaId string `json:"schemaId" form:"schemaId"`
}

type MustInfo

type MustInfo struct {
	Id          string `json:"id"`
	Date        string `json:"date"`
	GroupSchema `json:"schema"`
}

type PlaceClockInSetting

type PlaceClockInSetting struct {
	Id        string  `json:"id"`
	Lat       float64 `json:"lat"`
	Lng       float64 `json:"lng"`
	ShortName string  `json:"shortName"`
	Addr      string  `json:"addr"`
	Range     int     `json:"range"`
}

PlaceClockInSetting 地点打卡配置

type RecordInfo added in v0.15.80

type RecordInfo struct {
	Id          string  `json:"id"`
	TangentId   string  `json:"tangentId"`
	UserId      string  `json:"userId"`
	CheckInTime string  `json:"checkInTime"`
	Img         string  `json:"img"`
	Lat         float64 `json:"lat"`
	Lng         float64 `json:"lng"`
	Addr        string  `json:"addr"`
	Type        uint8   `json:"type"`
	Status      uint8   `json:"status"`
	SchemaId    string  `json:"schemaId"`
	SlotId      string  `json:"slotId"`
	GroupId     string  `json:"groupId"`
	TimeOffset  float64 `json:"timeOffset"`
	Way         uint8   `json:"way"`
	Remark      string  `json:"remark"`
}

type Resp

type Resp[T any] struct {
	Data T      `json:"data"`
	Code int    `json:"code"`
	Suc  bool   `json:"success"`
	Msg  string `json:"msg"`
}

type Result

type Result[T any] struct {
	Info       []T `json:"info"`
	TotalCount int `json:"totalCount"`
	PageNo     int `json:"pageNo"`
}

func GetBigDataRecords added in v0.15.81

func GetBigDataRecords(param GetRecordParam) (Result[RecordInfo], error)

func GetGroup

func GetGroup(param GetGroupParam) (Result[MiniGroup], error)

func GetRecords added in v0.15.80

func GetRecords(param GetRecordParam) (Result[RecordInfo], error)

func GetSchema

func GetSchema(param GetSchemaParam) (Result[MiniSchema], error)

type Schema

type Schema struct {
	Id             string `json:"id" form:"id"`
	Name           string `json:"name" form:"name"`
	TangentId      string `json:"tangentId" form:"tangentId"`
	LunchRestStart string `json:"lunchRestStart" form:"lunchRestStart"`
	LunchRestEnd   string `json:"lunchRestEnd" form:"lunchRestEnd"`
	Slots          []Slot `json:"slots" form:"slots"`
	Charge         string `json:"charge" form:"charge"`
	Start          string `json:"start" form:"start"`
	End            string `json:"end" form:"end"`
	CreateBy       string `json:"createBy" form:"createBy"`
	CreatedAt      string `json:"createdAt" form:"createdAt"`
}

func SchemaDetail

func SchemaDetail(tangentId, id string) (*Schema, error)

type Slot

type Slot struct {
	Id                     string `json:"id"`
	GoWorkTime             string `json:"goWorkTime"`
	GoWorkTimeOffsetStart  string `json:"goWorkTimeOffsetStart"`
	GoWorkTimeOffsetEnd    string `json:"goWorkTimeOffsetEnd"`
	OffWorkTime            string `json:"offWorkTime"`
	OffWorkTimeOffsetStart string `json:"offWorkTimeOffsetStart"`
	OffWorkTimeOffsetEnd   string `json:"offWorkTimeOffsetEnd"`
}

type User

type User struct {
	JoinUser []string   `json:"joinUser"`
	Ignore   []string   `json:"ignore"`
	Dept     []DeptUser `json:"dept"`
}

User 考勤人员配置

type WorkSys

type WorkSys struct {
	DefSchemaId string   `json:"defSchemaId"`
	Monday      string   `json:"monday"`
	Tuesday     string   `json:"tuesday"`
	Wednesday   string   `json:"wednesday"`
	Thursday    string   `json:"thursday"`
	Friday      string   `json:"friday"`
	Saturday    string   `json:"saturday"`
	Sunday      string   `json:"sunday"`
	Rest        []string `json:"rest"`
	Holidays    bool     `json:"holidays"`
	Musts       []Must   `json:"musts"`
	Skips       []string `json:"skips"`
}

WorkSys 班制

type WorkSysInfo

type WorkSysInfo struct {
	Id        string      `json:"id"`
	Name      string      `json:"name"`
	DefSchema GroupSchema `json:"defSchema"`
	Monday    GroupSchema `json:"monday"`
	Tuesday   GroupSchema `json:"tuesday"`
	Wednesday GroupSchema `json:"wednesday"`
	Thursday  GroupSchema `json:"thursday"`
	Friday    GroupSchema `json:"friday"`
	Saturday  GroupSchema `json:"saturday"`
	Sunday    GroupSchema `json:"sunday"`
	Rest      []string    `json:"rest"`
	Holidays  bool        `json:"holidays"`
	Musts     []MustInfo  `json:"musts"`
	Skips     []string    `json:"skips"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL