models

package
v0.0.0-...-56299ac Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuthModel = new(AuthorityModel)

Functions

func BasicAuth

func BasicAuth(ctx *context.Context) bool

func CheckDomain

func CheckDomain(ctx *context.Context, domain_id string, pattern string) bool

检查用户对指定的域的权限 第一个参数是上下文 context 第二个参数是用户想要访问的域 第三个参数是用户想要的权限,分两种情况,r 表示只读, w 表示读写

func CheckDomainByOrgId

func CheckDomainByOrgId(org_unit_id string) (string, error)

func CheckDomainByRoleId

func CheckDomainByRoleId(role_id string) (string, error)

func CheckDomainByUserId

func CheckDomainByUserId(user_id string) (string, error)

func CheckDomainRights

func CheckDomainRights(user_id string, domain_id string) int

check the user wheather handle the domain return value : -1 : have no right to handle the domain 1 : can read the domain info 2 : can read and wirte the domain info

func CheckPasswd

func CheckPasswd(user_id, user_passwd string) (bool, int, int64, string)

check user's passwd is right.

func DomainAuth

func DomainAuth(ctx *context.Context, domain_id string) int

返回值是-1 表示没有读写权限 返回值是1 表示有读取权限,没有写入权限 返回值是2 表示有读写权限

Types

type AuthorityModel

type AuthorityModel struct {
}

func (AuthorityModel) GetGrantRoles

func (AuthorityModel) GetGrantRoles(user_id, uid string) ([]gettedRoles, error)

func (AuthorityModel) GetOwnerRoles

func (AuthorityModel) GetOwnerRoles(user_id string) ([]gettedRoles, error)

func (AuthorityModel) Grants

func (AuthorityModel) Grants(users, roles, user_id string) ([]mbatchUsers, error)

type DomainShareModel

type DomainShareModel struct {
}

func (DomainShareModel) Delete

func (DomainShareModel) Delete(js string, domain_id string) error

func (DomainShareModel) Get

func (DomainShareModel) Get(domain_id string) ([]dsModel, error)

func (DomainShareModel) Post

func (DomainShareModel) Post(domain_id, target_domain_id, auth_level, user_id string) error

func (DomainShareModel) UnAuth

func (DomainShareModel) UnAuth(domain_id string) ([]dusModel, error)

func (DomainShareModel) Update

func (DomainShareModel) Update(uuid, user_id, auth_level string) error

type HomePageMenusModel

type HomePageMenusModel struct {
	Res_id       string
	Res_name     string
	Res_url      string
	Res_bg_color string
	Res_class    string
	Res_img      string
	Group_id     string
	Res_up_id    string
}

func (HomePageMenusModel) Get

func (this HomePageMenusModel) Get(id, typeId, useId string) ([]byte, error)

func (HomePageMenusModel) GetUrl

func (this HomePageMenusModel) GetUrl(user_id, id string) string

type LoginModels

type LoginModels struct {
}

func (LoginModels) GetDefaultDomainId

func (this LoginModels) GetDefaultDomainId(user_id string) (domain_id string, err error)

func (LoginModels) GetDefaultOrgId

func (this LoginModels) GetDefaultOrgId(user_id string) (org_id string, err error)

func (LoginModels) GetDefaultPage

func (this LoginModels) GetDefaultPage(user_id string) string

type OrgModel

type OrgModel struct {
}

func (OrgModel) Delete

func (OrgModel) Delete(mjs []SysOrgInfo) error

func (OrgModel) Get

func (OrgModel) Get(domain_id string) ([]SysOrgInfo, error)

获取域下边所有机构号

func (OrgModel) GetSubOrgInfo

func (this OrgModel) GetSubOrgInfo(domain_id string, org_id string) ([]SysOrgInfo, error)

func (OrgModel) Post

func (OrgModel) Post(org_unit_id, org_unit_desc, up_org_id, org_status_id, domain_id, create_user, maintance_user, id string) error

func (OrgModel) Update

func (OrgModel) Update(org_unit_desc, up_org_id, org_status_id, maintance_user, org_unit_id, domain_id string) error

type PasswdModels

type PasswdModels struct {
}

func (PasswdModels) UpdateMyPasswd

func (PasswdModels) UpdateMyPasswd(newPd, User_id, oriEn string) error

func (PasswdModels) UpdateUserPasswd

func (PasswdModels) UpdateUserPasswd(newPd, userid string) error

type ProjectMgr

type ProjectMgr struct {
	Project_id            string `json:"domain_id"`
	Project_name          string `json:"domain_desc"`
	Project_status        string `json:"domain_status"`
	Maintance_date        string `json:"maintance_date"`
	User_id               string `json:"create_user_id"`
	Domain_maintance_date string `json:"domain_modify_date"`
	Domain_maintance_user string `json:"domain_modify_user"`
	Domain_dept           string `json:"domain_dept"`
	Domain_up_id          string `json:"domain_up_id"`
}

func (ProjectMgr) Delete

func (ProjectMgr) Delete(js []ProjectMgr, user_id string, domain_id string) error

func (ProjectMgr) Get

func (ProjectMgr) Get(domain_id string) ([]ProjectMgr, error)

func (ProjectMgr) GetAll

func (ProjectMgr) GetAll(offset, limit string) ([]ProjectMgr, int64, error)

func (ProjectMgr) GetOwner

func (ProjectMgr) GetOwner(domain_id string) (domainDataModel, error)

func (ProjectMgr) GetRow

func (ProjectMgr) GetRow(domain_id string) (ProjectMgr, error)

func (ProjectMgr) Post

func (ProjectMgr) Post(domain_id, domain_desc, domain_status, user_id, did string) error

func (ProjectMgr) Update

func (ProjectMgr) Update(domainDesc, domainStatus, user_id, domainId string) error

type ResourceModel

type ResourceModel struct {
}

func (ResourceModel) AddThemeInfo

func (this ResourceModel) AddThemeInfo(theme_id, res_id, res_url, res_class, res_img, res_by_color, res_group_id, res_sort_id string) (string, error)

func (ResourceModel) CheckThemeExists

func (this ResourceModel) CheckThemeExists(theme_id string, res_id string) int

func (ResourceModel) Delete

func (this ResourceModel) Delete(res_id string) (string, error)

删除指定的资源

func (ResourceModel) Get

func (ResourceModel) Get() ([]resData, error)

查询所有的资源信息

func (ResourceModel) Post

func (ResourceModel) Post(res_id, res_name, res_attr, res_up_id, res_type, theme_id, res_url, res_bg_color, res_class, group_id, res_img, sort_id string) error

新增资源

func (ResourceModel) PostButton

func (this ResourceModel) PostButton(res_id, res_name, res_attr, res_up_id, res_type string) error

新增按钮

func (ResourceModel) Query

func (ResourceModel) Query(res_id string) ([]resData, error)

所有指定资源的详细信息

func (ResourceModel) QueryTheme

func (ResourceModel) QueryTheme(res_id string, theme_id string) ([]themeData, error)

查询指定资源,指定主题的详细信息

func (ResourceModel) UnGetted

func (this ResourceModel) UnGetted(role_id string) ([]resData, error)

查询没有获取到的资源信息

func (ResourceModel) Update

func (this ResourceModel) Update(res_id, res_name string) error

func (ResourceModel) UpdateTheme

func (this ResourceModel) UpdateTheme(res_url, res_by_color, res_class, res_img, res_group_id, res_sort_id, theme_id, res_id string) error

type RoleAndResourceModel

type RoleAndResourceModel struct {
	ResourceModel
}

func (RoleAndResourceModel) Auth

func (this RoleAndResourceModel) Auth(role_id, res_id string) error

func (RoleAndResourceModel) GetByRoleId

func (RoleAndResourceModel) GetByRoleId(role_id string) ([]resData, error)

查询角色已经拥有的资源信息

func (RoleAndResourceModel) Revoke

func (this RoleAndResourceModel) Revoke(role_id, res_id string) error

type RoleInfo

type RoleInfo struct {
	Code_number         string `json:"code_number"`
	Role_name           string `json:"role_name"`
	Role_owner          string `json:"create_user"`
	Role_create_date    string `json:"create_date"`
	Role_status_desc    string `json:"role_status_desc"`
	Role_status         string `json:"role_status_code"`
	Domain_id           string `json:"domain_id"`
	Domain_desc         string `json:"domain_desc"`
	Role_maintance_date string `json:"modify_date"`
	Role_maintance_user string `json:"modify_user"`
	Role_id             string `json:"role_id"`
}

type RoleModel

type RoleModel struct {
}

func (RoleModel) Delete

func (RoleModel) Delete(allrole []RoleInfo, user_id, domain_id string) error

func (RoleModel) Get

func (RoleModel) Get(domain_id string) ([]RoleInfo, error)

func (RoleModel) GetRow

func (RoleModel) GetRow(role_id string) ([]RoleInfo, error)

查询某一个角色的具体信息

func (RoleModel) Post

func (RoleModel) Post(id, rolename, user_id, rolestatus, domainid, roleid string) error

func (RoleModel) Update

func (RoleModel) Update(Role_name, Role_status, Role_id, User_id, domain_id string) error

type SysOrgInfo

type SysOrgInfo struct {
	Org_unit_id     string `json:"org_id"`
	Org_unit_desc   string `json:"org_desc"`
	Up_org_id       string `json:"up_org_id"`
	Org_status_id   string `json:"status_id"`
	Org_status_desc string `json:"status_desc"`
	Domain_id       string `json:"domain_id"`
	Create_date     string `json:"create_date"`
	Maintance_date  string `json:"modify_date"`
	Create_user     string `json:"create_user"`
	Maintance_user  string `json:"modify_user"`
	Code_number     string `json:"code_number"`
	Org_dept        string `json:"org_dept,omitempty"`
}

type ThemeModel

type ThemeModel struct {
}

func (ThemeModel) Post

func (ThemeModel) Post(user_id, theme_id string) error

type UserModel

type UserModel struct {
	// contains filtered or unexported fields
}

func (UserModel) Delete

func (UserModel) Delete(ijs []byte, user_id, domain_id string) (string, error)

删除用户信息

func (UserModel) GetDefault

func (UserModel) GetDefault(domain_id string) ([]userInfo, error)

查询域中所有的用户信息

func (UserModel) GetOwnerDetails

func (UserModel) GetOwnerDetails(user_id string) ([]userInfo, error)

查询用户自己的详细信息

func (UserModel) ModifyPasswd

func (this UserModel) ModifyPasswd(passwd, user_id string) (string, error)

func (UserModel) ModifyStatus

func (this UserModel) ModifyStatus(status_id, user_id string) (string, error)

func (UserModel) Post

func (UserModel) Post(userId, userPasswd, userDesc, userStatus, id, userEmail, userPhone, userOrgUnitId, domain_id string) error

新增用户信息

func (UserModel) Put

func (this UserModel) Put(user_name, org_id, phone, email, uid, user_id, domain_id string) (string, error)

修改用户信息

func (UserModel) Search

func (this UserModel) Search(org_id string, status_id string, domain_id string) ([]userInfo, error)

搜索用户信息

type UserRolesModel

type UserRolesModel struct {
	User_id string
}

func (UserRolesModel) Auth

func (UserRolesModel) Auth(domain_id, user_id, ijs string) (string, error)

func (UserRolesModel) GetOtherRoles

func (UserRolesModel) GetOtherRoles(user_id string) ([]userRoleData, error)

func (UserRolesModel) GetRolesByUser

func (UserRolesModel) GetRolesByUser(user_id string) ([]userRoleData, error)

func (UserRolesModel) Revoke

func (UserRolesModel) Revoke(user_id string, role_id string, uid, did string) (string, error)

Jump to

Keyboard shortcuts

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