Documentation
¶
Index ¶
- Constants
- type AddDep
- type AddDepartmentRequest
- type AddListResponse
- type AddUser
- type AddUsersRequest
- type AppCenter
- type Chaos
- type CheckAppAdmin
- type DelResp
- type DepOneResponse
- type ErrNode
- type Flow
- type GetDepByIDsRequest
- type GetDepByIDsResponse
- type GetDepMaxGradeRequest
- type GetDepMaxGradeResponse
- type GetUserByIDsRequest
- type GetUserByIDsResponse
- type GetUsersByDepIDRequest
- type GetUsersByDepIDResponse
- type InitReq
- type InitResp
- type Msg
- type OneUserRequest
- type OneUserResponse
- type PolyAPI
- type RequestPathResp
- type Result
- type ScopesVO
- type Structor
- type User
Constants ¶
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 ¶
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
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 GetDepByIDsRequest ¶
type GetDepByIDsRequest struct {
IDs []string `json:"ids" binding:"required"`
}
GetDepByIDsRequest GetDepByIDsRequest
type GetDepByIDsResponse ¶
type GetDepByIDsResponse struct {
Deps []DepOneResponse `json:"deps"`
}
GetDepByIDsResponse GetDepByIDsResponse
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 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
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 Structor ¶
type Structor interface { RemoveTable(ctx context.Context, appID string) (*DelResp, error) RemovePer(ctx context.Context, appID string) (*DelResp, error) }
Structor Structor
type User ¶
type User interface { OthAddUsers(ctx context.Context, r *AddUsersRequest) (*AddListResponse, error) OthAddDeps(ctx context.Context, r *AddDepartmentRequest) (*AddListResponse, error) GetUserInfo(ctx context.Context, r *OneUserRequest) (*OneUserResponse, error) GetUserByIDs(ctx context.Context, r *GetUserByIDsRequest) (*GetUserByIDsResponse, error) GetDepByIDs(ctx context.Context, r *GetDepByIDsRequest) (*GetDepByIDsResponse, error) GetUsersByDepID(ctx context.Context, r *GetUsersByDepIDRequest) (*GetUsersByDepIDResponse, error) GetDepMaxGrade(ctx context.Context, r *GetDepMaxGradeRequest) (*GetDepMaxGradeResponse, error) }
User organization service