model

package
v0.0.0-...-362a939 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: Apache-2.0 Imports: 10 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTeam

func AddTeam(name, resume string, creator int64, uids []int64) (int64, error)

func AdminRegister

func AdminRegister() error

func GetAllStrategyCount

func GetAllStrategyCount(mine int, query, username string) (int64, error)

func IsCreatorOfTeam

func IsCreatorOfTeam(uid, tid int64) (bool, error)

func IsMemberOfTeam

func IsMemberOfTeam(uid, tid int64) (bool, error)

func RemoveTeamById

func RemoveTeamById(tid int64) error

func TeamCountOfUser

func TeamCountOfUser(query string, uid int64) (int64, error)

func UserLogin

func UserLogin(name, password string) (int64, error)

func UserRegister

func UserRegister(name, password string) (int64, error)

Types

type Event

type Event struct {
	Id          int64  `json:"id"`
	EventId     string `json:"event_id"`
	Status      string `json:"status"`
	Url         string `json:"url"`
	Ip          string `json:"ip"`
	EventTime   int64  `json:"event_time"`
	StrategyId  int64  `json:"strategy_id"`
	RespTime    int    `json:"resp_time"`
	RespCode    string `json:"resp_code"`
	Result      int64  `json:"result"`
	CurrentStep int    `json:"current_step"`
	MaxStep     int    `json:"max_step"`
}
var EventRepo *Event

func (*Event) GetByStrategyId

func (this *Event) GetByStrategyId(strategyId int64, before int) ([]*Event, error)

func (*Event) Insert

func (this *Event) Insert() error

func (*Event) String

func (this *Event) String() string

type ItemStatus

type ItemStatus struct {
	Id       int64  `json:"id"`
	Sid      int64  `json:"sid"`
	Ip       string `json:"ip"`
	RespTime int    `json:"resp_time"`
	RespCode string `json:"resp_code"`
	PushTime int64  `json:"push_time"`
	Result   int64  `json:"result"`
}
var ItemStatusRepo *ItemStatus

func (*ItemStatus) DeleteOld

func (this *ItemStatus) DeleteOld(d int64) error

func (*ItemStatus) GetByIpAndSid

func (this *ItemStatus) GetByIpAndSid(ip string, sid int64) ([]*ItemStatus, error)

func (*ItemStatus) PK

func (this *ItemStatus) PK() string

func (*ItemStatus) Save

func (this *ItemStatus) Save() error

type RelSidIp

type RelSidIp struct {
	Id  int64  `json:"id"`
	Sid int64  `json:"sid"`
	Ip  string `json:"ip"`
	Ts  int64  `json:"ts"`
}
var RelSidIpRepo *RelSidIp

func (*RelSidIp) DeleteOld

func (this *RelSidIp) DeleteOld(d int64) error

func (*RelSidIp) GetBySid

func (this *RelSidIp) GetBySid(sid int64) ([]*RelSidIp, error)

func (*RelSidIp) Save

func (this *RelSidIp) Save() error

type RelTeamUser

type RelTeamUser struct {
	Id  int64 `json:"id"`
	Tid int64 `json:"tid"`
	Uid int64 `json:"uid"`
}

type Strategy

type Strategy struct {
	Id         int64  `json:"id"`
	Url        string `json:"url"`
	Enable     int    `json:"enable"`
	IP         string `json:"ip" xorm:"ip"`
	Keywords   string `json:"keywords"`
	Timeout    int    `json:"timeout"`
	Creator    string `json:"creator"`
	ExpectCode string `json:"expect_code"`
	Note       string `json:"note"`
	Data       string `json:"data"`
	Tag        string `json:"tag"`
	MaxStep    int    `json:"max_step"`
	Times      int    `json:"times"`
	Teams      string `json:"teams"`
}

func GetAllStrategy

func GetAllStrategy(mine, limit, offset int, query, username string) ([]*Strategy, error)

func GetAllStrategyByCron

func GetAllStrategyByCron() ([]*Strategy, error)

func GetStrategyById

func GetStrategyById(sid int64) (*Strategy, error)

func (*Strategy) Add

func (this *Strategy) Add() (int64, error)

func (*Strategy) Delete

func (this *Strategy) Delete() error

func (*Strategy) Update

func (this *Strategy) Update() error

type Team

type Team struct {
	Id          int64     `json:"id"`
	Name        string    `json:"name"`
	Resume      string    `json:"resume"`
	Creator     int64     `json:"creator"`
	Created     time.Time `json:"-" xorm:"<-"`
	CreatorName string    `json:"-" xorm:"-"`
}

func GetTeamById

func GetTeamById(id int64) (*Team, error)

func GetTeamsByIds

func GetTeamsByIds(ids string) ([]*Team, error)

func QueryTeams

func QueryTeams(query string, limit int) ([]*Team, error)

func TeamsOfUser

func TeamsOfUser(query string, uid int64, limit, offset int) ([]*Team, error)

func (*Team) Update

func (this *Team) Update(uids []int64) error

type User

type User struct {
	Id       int64     `json:"id"`
	Name     string    `json:"name"`
	Cnname   string    `json:"cnname"`
	Password string    `json:"-"`
	Email    string    `json:"email"`
	Phone    string    `json:"phone"`
	Wechat   string    `json:"wechat"`
	Role     int       `json:"role"`
	Created  time.Time `json:"-" xorm:"<-"`
}

func CheckPw

func CheckPw(name string, passwd string) (*User, error)

先根据name获取id,再根据id去查询

func GetUserById

func GetUserById(id int64) (*User, error)

func GetUserByName

func GetUserByName(name string) (*User, error)

先根据name获取id,再根据id去查询

func GetUserPwById

func GetUserPwById(id int64) (*User, error)

func QueryUsers

func QueryUsers(query string, limit int) ([]*User, error)

func UsersInfoOfTeam

func UsersInfoOfTeam(tid int64) ([]*User, error)

func UsersOfTeam

func UsersOfTeam(tid int64) ([]*User, error)

func (*User) ChangePasswd

func (this *User) ChangePasswd(oldPasswd, newPasswd string) error

func (*User) Save

func (this *User) Save() error

func (*User) UpdateProfile

func (this *User) UpdateProfile() error

Jump to

Keyboard shortcuts

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