model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

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 dataobj.Event
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"` //agent所在机器的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 dataobj.Strategy

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