models

package
v0.0.0-...-d1f39bd Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 DomainMmodel

type DomainMmodel 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" dateType:"YYYY-MM-DD HH24:MM:SS"`
	User_id               string `json:"create_user_id"`
	Domain_maintance_date string `json:"domain_modify_date" dateType:"YYYY-MM-DD HH24:MM:SS"`
	Domain_maintance_user string `json:"domain_modify_user"`
	Domain_status_cd      string `json:"domain_status_cd"`
}

func (DomainMmodel) Delete

func (DomainMmodel) Delete(js []DomainMmodel) error

删除域信息 在controller中校验权限

func (DomainMmodel) Get

func (this DomainMmodel) Get() ([]DomainMmodel, error)

func (DomainMmodel) GetRow

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

获取指定域的详细信息

func (DomainMmodel) Post

func (DomainMmodel) Post(data url.Values, user_id string, user_domain_id string) (string, error)

新增域信息 并将新增的域授权个创建人

func (DomainMmodel) Update

func (DomainMmodel) Update(data url.Values, user_id string) (string, error)

更新域信息 只能更新名称和状态

type DomainShareData

type DomainShareData struct {
	Uuid                string `json:"uuid"`
	Target_domain_id    string `json:"target_domain_id"`
	Domain_name         string `json:"domain_name"`
	Authorization_level string `json:"auth_level"`
	Create_user         string `json:"create_user"`
	Create_date         string `json:"create_date"`
	Modify_user         string `json:"modify_user"`
	Modify_date         string `json:"modify_date"`
}

type DomainShareModel

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

func (DomainShareModel) Delete

func (DomainShareModel) Delete(data []DomainShareData, domain_id string) (string, error)

func (DomainShareModel) Get

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

获取指定域共享给了哪些对象

func (DomainShareModel) GetList

func (this DomainShareModel) GetList(domain_id string) ([]DomainMmodel, error)

func (DomainShareModel) GetOwner

func (this DomainShareModel) GetOwner(domain_id string) (domainDataSet, error)

func (DomainShareModel) Post

func (DomainShareModel) Post(data url.Values, user_id string) (string, error)

func (DomainShareModel) UnAuth

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

func (DomainShareModel) Update

func (DomainShareModel) Update(data url.Values, user_id string) (string, error)

type HandleLogMode

type HandleLogMode struct {
}

func (HandleLogMode) Download

func (this HandleLogMode) Download(domain_id string) ([]handleLogs, error)

func (HandleLogMode) Get

func (this HandleLogMode) Get(domain_id, offset, limit string) ([]handleLogs, int64, error)

func (HandleLogMode) Search

func (this HandleLogMode) Search(domain_id, userid, start, end string) ([]handleLogs, error)

type HomePageMenusModel

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

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, error)

type LoginModels

type LoginModels struct {
}

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 (this OrgModel) Delete(mjs []SysOrgInfo, domain_id string) (string, 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(data url.Values, user_id string) (string, error)

func (OrgModel) Update

func (this OrgModel) Update(data url.Values, user_id string) (string, error)

func (OrgModel) Upload

func (this OrgModel) Upload(data []SysOrgInfo) (string, error)

type PasswdModels

type PasswdModels struct {
}

func (PasswdModels) UpdateMyPasswd

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

func (PasswdModels) UpdateUserPasswd

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

type ResourceModel

type ResourceModel struct {
	Mtheme ThemeResourceModel
}

func (*ResourceModel) Delete

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

删除指定的资源

func (*ResourceModel) Get

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

查询所有的资源信息

func (*ResourceModel) GetChildren

func (this *ResourceModel) GetChildren(res_id string) ([]resData, error)

func (*ResourceModel) Post

func (this *ResourceModel) Post(data url.Values) (string, error)

新增资源

func (*ResourceModel) Query

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

所有指定资源的详细信息

func (*ResourceModel) Update

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

type RoleAndResourceModel

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

func (RoleAndResourceModel) Delete

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

func (RoleAndResourceModel) Get

func (this RoleAndResourceModel) Get(role_id string) ([]resData, error)

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

func (RoleAndResourceModel) Gets

func (this RoleAndResourceModel) Gets(roles []string, res_id ...string) ([]resData, error)

获取某些角色,指定资源的所有下级资源

func (RoleAndResourceModel) Post

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

func (RoleAndResourceModel) UnGetted

func (this RoleAndResourceModel) UnGetted(role_id string) ([]resData, 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) (string, error)

func (RoleModel) Get

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

func (RoleModel) GetRow

func (this RoleModel) GetRow(role_id string) (RoleInfo, error)

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

func (RoleModel) Post

func (RoleModel) Post(data url.Values, user_id string) (string, error)

func (RoleModel) Update

func (RoleModel) Update(data url.Values, user_id string) (string, error)

type RoleResourceRelData

type RoleResourceRelData struct {
	Role_id string `json:"role_id"`
	Res_id  string `json:"res_id"`
}

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"`
	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 ThemeResourceModel

type ThemeResourceModel struct {
}

func (ThemeResourceModel) CheckThemeExists

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

func (ThemeResourceModel) Get

func (this ThemeResourceModel) Get(theme_id string) ([]themeData, error)

func (ThemeResourceModel) GetDetails

func (this ThemeResourceModel) GetDetails(res_id string, theme_id string) ([]themeData, error)

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

func (ThemeResourceModel) Post

func (this ThemeResourceModel) Post(theme_id, res_id, res_url, res_class, res_img, res_by_color, res_group_id, res_sort_id, res_type string) (string, error)

func (ThemeResourceModel) Update

func (this ThemeResourceModel) Update(res_url, res_by_color, res_class, res_img, res_group_id, res_sort_id, theme_id, res_id, res_open_type string) error

type UserInfo

type UserInfo struct {
	User_id             string `json:"user_id"`
	User_name           string `json:"user_name"`
	User_status_desc    string `json:"status_desc"`
	User_create_date    string `json:"create_date"`
	User_owner          string `json:"create_user"`
	User_email          string `json:"user_email"`
	User_phone          string `json:"user_phone"`
	Org_unit_id         string `json:"org_unit_id"`
	Org_unit_desc       string `json:"org_unit_desc"`
	Domain_id           string `json:"domain_id"`
	Domain_name         string `json:"domain_name"`
	User_maintance_date string `json:"modify_date"`
	User_maintance_user string `json:"modify_user"`
	User_status_id      string `json:"status_cd"`
}

type UserModel

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

func (UserModel) Delete

func (UserModel) Delete(data []UserInfo) (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(data url.Values) (string, error)

func (UserModel) ModifyStatus

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

func (UserModel) Post

func (UserModel) Post(data url.Values, user_id string) (string, error)

新增用户信息

func (UserModel) Put

func (this UserModel) Put(data url.Values, modify_user 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 `json:"user_id"`
	Role_id     string `json:"role_id"`
	Code_number string `json:"code_number"`
	Role_name   string `json:"role_name"`
	Role_status string `json:"role_status"`
}

func (UserRolesModel) Auth

func (UserRolesModel) Auth(data []UserRolesModel, user_id string) (string, error)

对这个域中的用户进行授权

func (UserRolesModel) GetOtherRoles

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

获取这个用户id,还没有获取的角色信息

func (UserRolesModel) GetRolesByUser

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

根据用户id,获取这个用户已经拥有的角色

func (UserRolesModel) Revoke

func (UserRolesModel) Revoke(rst []UserRolesModel) (string, error)

移除这个用户拥有的角色信息

type UserThemeModel

type UserThemeModel struct {
}

func (UserThemeModel) Get

func (this UserThemeModel) Get(user_id string) ([]userThemeData, error)

func (UserThemeModel) Put

func (this UserThemeModel) Put(user_id, theme_id string) error

Jump to

Keyboard shortcuts

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