Bläddra i källkod

更新

master
huangjiajun 2 månader sedan
förälder
incheckning
f120af0d8a
2 ändrade filer med 14 tillägg och 2 borttagningar
  1. +2
    -1
      src/dao/admin_role_dao.go
  2. +12
    -1
      src/implement/admin_role_implement.go

+ 2
- 1
src/dao/admin_role_dao.go Visa fil

@@ -1,4 +1,4 @@
package dao
package dao

import (
"code.fnuoos.com/zhimeng/model.git/src/model"
@@ -10,6 +10,7 @@ type AdminRoleDao interface {
FindAdminRoleByRoleId(id int) (*[]model.AdminRole, error)
AdminDeleteBySessionForAdmId(session *xorm.Session, admId interface{}) (int64, error)
GetAdminRoleByRole(id int) (m *model.AdminRole, err error)
GetAdminRoleByAdminId(id int) (m *model.AdminRole, err error)
AdminRoleDeleteForRoleBySession(session *xorm.Session, roleId interface{}) (int64, error)
AdminRoleDeleteBySession(session *xorm.Session, id interface{}) (int64, error)
BatchAddAdminRoleBySession(session *xorm.Session, mm []*model.AdminRole) (int64, error)


+ 12
- 1
src/implement/admin_role_implement.go Visa fil

@@ -1,4 +1,4 @@
package implement
package implement

import (
"code.fnuoos.com/zhimeng/model.git/src/dao"
@@ -51,6 +51,17 @@ func (a AdminRoleDb) GetAdminRoleByRole(id int) (m *model.AdminRole, err error)
}
return m, nil
}
func (a AdminRoleDb) GetAdminRoleByAdminId(id int) (m *model.AdminRole, err error) {
m = new(model.AdminRole)
has, err := a.Db.Where("adm_id =?", id).Get(m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return m, nil
}

func (a AdminRoleDb) AdminRoleDeleteForRoleBySession(session *xorm.Session, roleId interface{}) (int64, error) {
if reflect.TypeOf(roleId).Kind() == reflect.Slice {


Laddar…
Avbryt
Spara