client

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChaosURL = "http://localhost:6666/init"
)

ChaoURL

Variables

This section is empty.

Functions

This section is empty.

Types

type AddDep

type AddDep struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	UseStatus int    `json:"useStatus"` //1 Normal, -1 true deletion, -2 disabled
	Attr      int    `json:"attr"`      //1 company, 2 department
	PID       string `json:"pid"`       //The upper ID
	SuperPID  string `json:"superID"`   //ID of the top-level parent
	CompanyID string `json:"companyID"` //Id of Company
	Grade     int    `json:"grade"`     //Department level
	CreatedAt int64  `json:"createdAt"`
	UpdatedAt int64  `json:"updatedAt"`
	CreatedBy string `json:"createdBy"`        //The creator
	UpdatedBy string `json:"updatedBy"`        //The modifier
	Remark    string `json:"remark,omitempty"` //Note
}

AddDep other server add department to org

type AddDepartmentRequest

type AddDepartmentRequest struct {
	Deps       []AddDep `json:"deps"`
	SyncDep    int      `json:"syncDep"`    //Department 1 is synchronized. -1 is not synchronized
	IsUpdate   int      `json:"isUpdate"`   //Whether to update existing data. 1 is updated and -1 is not updated
	SyncID     string   `json:"syncID"`     //Synchronization center ID
	SyncSource string   `json:"syncSource"` //Synchronization source
}

AddDepartmentRequest other server add department to org request

type AddListResponse

type AddListResponse struct {
	Result map[int]*Result `json:"result"`
}

AddListResponse other server add user or dep to org response

type AddUser

type AddUser struct {
	ID        string   `json:"id,omitempty"`
	Name      string   `json:"name,omitempty"`
	Phone     string   `json:"phone,omitempty"`
	Email     string   `json:"email,omitempty"`
	AccountID string   `json:"-"`
	SelfEmail string   `json:"selfEmail,omitempty"`
	IDCard    string   `json:"idCard,omitempty"`
	Address   string   `json:"address,omitempty"`
	UseStatus int      `json:"useStatus,omitempty"` //Status: 1 Normal, -2 Disabled, -1 Deleted, 2 Activated ==1, -3 deactivated (same as account library)
	Gender    int      `json:"gender,omitempty"`    //Gender: 0 None, 1 male, 2 female
	CompanyID string   `json:"companyID,omitempty"` //Id of Company
	Position  string   `json:"position,omitempty"`  //Position
	Avatar    string   `json:"avatar,omitempty"`    //Head
	Remark    string   `json:"remark,omitempty"`    //Note
	JobNumber string   `json:"jobNumber,omitempty"` //Work number
	DepIDs    []string `json:"depIDs,omitempty"`
	EntryTime int64    `json:"entryTime,omitempty" ` //Hiredate
	Source    string   `json:"source,omitempty" `    //Source of information
	SourceID  string   `json:"sourceID,omitempty" `  //The ID of the source of the information to be returned to the service
}

AddUser other server add user to org

type AddUsersRequest

type AddUsersRequest struct {
	Users      []AddUser `json:"users"`
	IsUpdate   int       `json:"isUpdate"`   //Whether to update existing data,1:true,-1:not
	SyncID     string    `json:"syncID"`     //Synchronization center ID
	SyncSource string    `json:"syncSource"` //Synchronization source
}

AddUsersRequest other server add user request

type AppCenter

type AppCenter interface {
	CheckIsAdmin(ctx context.Context, appID, userID string) (CheckAppAdmin, error)
}

AppCenter AppCenter

func NewAppCenter

func NewAppCenter(conf client.Config) AppCenter

NewAppCenter NewAppCenter

type Chaos added in v1.1.0

type Chaos interface {
	Init(ctx context.Context, req *InitReq) error
}

Chaos Chaos

func NewChaos added in v1.1.0

func NewChaos(c *config.Configs) Chaos

NewChaos new

type CheckAppAdmin

type CheckAppAdmin struct {
	IsAdmin bool
}

CheckAppAdmin CheckAppAdmin

type DelResp

type DelResp struct {
	Errors []*ErrNode `json:"errors"`
}

DelResp DelResp

type DepOneResponse

type DepOneResponse struct {
	ID        string `json:"id,omitempty"`
	Name      string `json:"name"`
	LeaderID  string `json:"leaderID"`
	UseStatus int    `json:"useStatus,omitempty"`
	PID       string `json:"pid"`               //The upper ID
	SuperPID  string `json:"superID,omitempty"` //ID of the top-level parent
	Grade     int    `json:"grade,omitempty"`   //Department level
	Attr      int    `json:"attr"`              //1 company, 2 department
}

DepOneResponse DepOneResponse

type ErrNode

type ErrNode struct {
	DB    string `json:"db"`
	Table string `json:"table"`
	SQL   string `json:"sql"`
	Err   error  `json:"err"`
}

ErrNode ErrNode

type Flow

type Flow interface {
	RemoveApp(ctx context.Context, appID, status string) (*DelResp, error)
}

Flow Flow

func NewFlow

func NewFlow(conf *config.Configs) Flow

NewFlow NewFlow

type GetDepByIDsRequest

type GetDepByIDsRequest struct {
	IDs []string `json:"ids" binding:"required"`
}

GetDepByIDsRequest GetDepByIDsRequest

type GetDepByIDsResponse

type GetDepByIDsResponse struct {
	Deps []DepOneResponse `json:"deps"`
}

GetDepByIDsResponse GetDepByIDsResponse

type GetDepMaxGradeRequest

type GetDepMaxGradeRequest struct {
}

GetDepMaxGradeRequest request

type GetDepMaxGradeResponse

type GetDepMaxGradeResponse struct {
	Grade int64 `json:"grade"`
}

GetDepMaxGradeResponse response

type GetUserByIDsRequest

type GetUserByIDsRequest struct {
	IDs []string `json:"ids"`
}

GetUserByIDsRequest get user by ids request

type GetUserByIDsResponse

type GetUserByIDsResponse struct {
	Users []OneUserResponse `json:"users"`
}

GetUserByIDsResponse get user by ids response

type GetUsersByDepIDRequest

type GetUsersByDepIDRequest struct {
	DepID          string `json:"depID"`
	IsIncludeChild int    `json:"isIncludeChild"`
}

GetUsersByDepIDRequest GetUsersByDepIDRequest

type GetUsersByDepIDResponse

type GetUsersByDepIDResponse struct {
	Users []OneUserResponse `json:"users"`
}

GetUsersByDepIDResponse GetUsersByDepIDResponse

type InitReq added in v1.1.0

type InitReq = []Msg

InitReq req

type InitResp added in v1.1.0

type InitResp = define.Response

InitResp InitResp

type Msg added in v1.1.0

type Msg = define.Msg

Msg msg

type OneUserRequest

type OneUserRequest struct {
	ID string `json:"id" form:"id"  binding:"required,max=64"`
}

OneUserRequest Query one

type OneUserResponse

type OneUserResponse struct {
	ID        string              `json:"id,omitempty" `
	Name      string              `json:"name,omitempty" `
	Phone     string              `json:"phone,omitempty" `
	Email     string              `json:"email,omitempty" `
	SelfEmail string              `json:"selfEmail,omitempty" `
	UseStatus int                 `json:"useStatus,omitempty" ` // Status: 1 Normal, -2 disabled, -3 demission, -1 Deleted, 2 Active ==1 (same as account library)
	TenantID  string              `json:"tenantID,omitempty" `  // the tenant id
	Position  string              `json:"position,omitempty" `  // position
	Avatar    string              `json:"avatar,omitempty" `    //
	JobNumber string              `json:"jobNumber,omitempty" `
	Status    int                 `json:"status"`
	Dep       [][]DepOneResponse  `json:"deps,omitempty"`
	Leader    [][]OneUserResponse `json:"leaders,omitempty"`
}

OneUserResponse OneUserResponse

type PolyAPI

type PolyAPI interface {
	RequestPath(ctx context.Context, appID, name, description string, types int64, scopes []*ScopesVO) (*RequestPathResp, error)
	DeleteAPP(ctx context.Context, appID string) (*DelResp, error)
}

PolyAPI PolyAPI

func NewPolyAPI

func NewPolyAPI(conf *config.Configs) PolyAPI

NewPolyAPI NewPolyAPI

type RequestPathResp

type RequestPathResp struct {
}

RequestPathResp RequestPathResp

type Result

type Result struct {
	ID     string `json:"id"`
	Remark string `json:"remark"`
	Attr   int    `json:"attr"` //11 add ok,0fail,12, update ok
}

Result list add response

type ScopesVO

type ScopesVO struct {
	Type int16  `json:"type"`
	ID   string `json:"id"`
	Name string `json:"name"`
}

ScopesVO ScopesVO

type Structor

type Structor interface {
	RemoveTable(ctx context.Context, appID string) (*DelResp, error)
	RemovePer(ctx context.Context, appID string) (*DelResp, error)
}

Structor Structor

func NewStructor

func NewStructor(conf *config.Configs) Structor

NewStructor NewStructor

type User

User organization service

func NewUser

func NewUser(conf client.Config) User

NewUser init instance

Jump to

Keyboard shortcuts

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