master
wubin 5 years ago
parent 37486282bb
commit 9c509e7abf

@ -5,6 +5,7 @@ import (
"dsBaseWeb/Business/BaseBusiness/BaseBusinessProto"
"dsBaseWeb/Utils/GRpcUtil"
"dsBaseWeb/Utils/LogUtil"
"errors"
"time"
)
@ -18,6 +19,9 @@ func AddBaseBusiness(businessCode string, businessName string, sortId int32) (*B
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseBusinessProto.NewBaseBusinessManageClient(conn)
Reply, err := c.AddBaseBusiness(ctx, &BaseBusinessProto.ModelArg{BusinessCode: businessCode, BusinessName: businessName, SortId: sortId})
@ -37,6 +41,9 @@ func UpdateBaseBusiness(businessCode string, businessName string) (*BaseBusiness
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseBusinessProto.NewBaseBusinessManageClient(conn)
Reply, err := c.UpdateBaseBusiness(ctx, &BaseBusinessProto.ModelArg{BusinessCode: businessCode, BusinessName: businessName})
@ -56,6 +63,9 @@ func PageBaseBusiness(page int32, limit int32) (*BaseBusinessProto.Reply, error)
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseBusinessProto.NewBaseBusinessManageClient(conn)
Reply, err := c.PageBaseBusiness(ctx, &BaseBusinessProto.QueryArg{Page: page, Limit: limit})

@ -5,6 +5,7 @@ import (
"dsBaseWeb/Business/BaseClass/BaseClassProto"
"dsBaseWeb/Utils/GRpcUtil"
"dsBaseWeb/Utils/LogUtil"
"errors"
"time"
)
@ -18,6 +19,9 @@ func PageBaseClass(queryArg BaseClassProto.QueryArg) (*BaseClassProto.Reply, err
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseClassProto.NewBaseClassManageClient(conn)
Reply, err := c.PageBaseClass(ctx, &queryArg)
@ -37,6 +41,9 @@ func GetBaseClass(modelArg BaseClassProto.ModelArg) (*BaseClassProto.Reply, erro
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseClassProto.NewBaseClassManageClient(conn)
Reply, err := c.GetBaseClass(ctx, &modelArg)
@ -55,6 +62,9 @@ func AddBaseClass(modelArg BaseClassProto.ModelArg) (*BaseClassProto.Reply, erro
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseClassProto.NewBaseClassManageClient(conn)
Reply, err := c.AddBaseClass(ctx, &modelArg)
@ -74,6 +84,9 @@ func DeleteBaseClass(deleteIdsArg BaseClassProto.DeleteIdsArg) (*BaseClassProto.
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseClassProto.NewBaseClassManageClient(conn)
Reply, err := c.DeleteBaseClass(ctx, &deleteIdsArg)
@ -93,6 +106,9 @@ func UpdateBaseClass(modelArg BaseClassProto.ModelArg) (*BaseClassProto.Reply, e
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseClassProto.NewBaseClassManageClient(conn)
Reply, err := c.UpdateBaseClass(ctx, &modelArg)
@ -112,6 +128,9 @@ func GetStage(modelArg BaseClassProto.ModelArg) (*BaseClassProto.Reply, error) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseClassProto.NewBaseClassManageClient(conn)
Reply, err := c.GetStage(ctx, &modelArg)
@ -131,6 +150,9 @@ func GetRxnf(modelArg BaseClassProto.ModelArg) (*BaseClassProto.Reply, error) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseClassProto.NewBaseClassManageClient(conn)
Reply, err := c.GetRxnf(ctx, &modelArg)

@ -5,6 +5,7 @@ import (
"dsBaseWeb/Business/BaseGlobal/BaseGlobalProto"
"dsBaseWeb/Utils/GRpcUtil"
"dsBaseWeb/Utils/LogUtil"
"errors"
"time"
)
@ -18,7 +19,9 @@ func AddBaseGlobal(modelArg BaseGlobalProto.ModelArg) (*BaseGlobalProto.Reply, e
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
//2、
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
c := BaseGlobalProto.NewBaseGlobalManageClient(conn)
Reply, err := c.AddBaseGlobal(ctx, &modelArg)
if err != nil {
@ -37,7 +40,9 @@ func DeleteBaseGlobal(deleteIdsArg BaseGlobalProto.DeleteIdsArg) (*BaseGlobalPro
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
//2、
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
c := BaseGlobalProto.NewBaseGlobalManageClient(conn)
Reply, err := c.DeleteBaseGlobal(ctx, &deleteIdsArg)
if err != nil {
@ -56,7 +61,9 @@ func UpdateBaseGlobal(modelArg BaseGlobalProto.ModelArg) (*BaseGlobalProto.Reply
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
//2、
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
c := BaseGlobalProto.NewBaseGlobalManageClient(conn)
Reply, err := c.UpdateBaseGlobal(ctx, &modelArg)
if err != nil {
@ -75,7 +82,9 @@ func PageBaseGlobal(queryArg BaseGlobalProto.QueryArg) (*BaseGlobalProto.Reply,
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
//2、
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
c := BaseGlobalProto.NewBaseGlobalManageClient(conn)
Reply, err := c.PageBaseGlobal(ctx, &queryArg)
if err != nil {
@ -95,6 +104,9 @@ func GetBaseGlobal(modelArg BaseGlobalProto.ModelArg) (*BaseGlobalProto.Reply, e
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseGlobalProto.NewBaseGlobalManageClient(conn)
Reply, err := c.GetBaseGlobal(ctx, &modelArg)

@ -1,8 +1,2 @@
package BaseGlobalTypeService
import (
"context"
"dsBaseWeb/Business/BaseGlobalType/BaseGlobalTypeProto"
"dsBaseWeb/Utils/GRpcUtil"
"dsBaseWeb/Utils/LogUtil"
"time"
)

@ -5,6 +5,7 @@ import (
"dsBaseWeb/Business/BaseOrganization/BaseOrganizationProto"
"dsBaseWeb/Utils/GRpcUtil"
"dsBaseWeb/Utils/LogUtil"
"errors"
"time"
)
@ -18,6 +19,9 @@ func PageBaseOrganization(queryArg BaseOrganizationProto.QueryArg) (*BaseOrganiz
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseOrganizationProto.NewBaseOrganizationManageClient(conn)
Reply, err := c.PageBaseOrganization(ctx, &queryArg)
@ -37,6 +41,9 @@ func GetBaseOrganization(modelArg BaseOrganizationProto.ModelArg) (*BaseOrganiza
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseOrganizationProto.NewBaseOrganizationManageClient(conn)
Reply, err := c.GetBaseOrganization(ctx, &modelArg)
@ -56,6 +63,9 @@ func UpdateBaseOrganization(modelArg BaseOrganizationProto.ModelArg) (*BaseOrgan
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseOrganizationProto.NewBaseOrganizationManageClient(conn)
Reply, err := c.UpdateBaseOrganization(ctx, &modelArg)
@ -75,6 +85,9 @@ func AddBaseOrganization(modelArg BaseOrganizationProto.ModelArg) (*BaseOrganiza
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseOrganizationProto.NewBaseOrganizationManageClient(conn)
Reply, err := c.AddBaseOrganization(ctx, &modelArg)
@ -94,6 +107,9 @@ func DeleteBaseOrganization(deleteIdsArg BaseOrganizationProto.DeleteIdsArg) (*B
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseOrganizationProto.NewBaseOrganizationManageClient(conn)
Reply, err := c.DeleteBaseOrganization(ctx, &deleteIdsArg)
@ -108,6 +124,9 @@ func GetMultipleBaseOrganization(ids []string) (*BaseOrganizationProto.Reply, er
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseOrganizationProto.NewBaseOrganizationManageClient(conn)
Reply, err := c.GetMultipleBaseOrganization(ctx, &BaseOrganizationProto.MultipleQueryArg{Ids: ids})
@ -122,6 +141,9 @@ func GetBureauOrgTree(modelArg BaseOrganizationProto.ModelArg) (*BaseOrganizatio
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseOrganizationProto.NewBaseOrganizationManageClient(conn)
Reply, err := c.GetBureauOrgTree(ctx, &modelArg)
@ -136,6 +158,9 @@ func GetOrgManager(ids []string) (*BaseOrganizationProto.Reply, error) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseOrganizationProto.NewBaseOrganizationManageClient(conn)
Reply, err := c.GetOrgManager(ctx, &BaseOrganizationProto.MultipleQueryArg{Ids: ids})
@ -155,6 +180,9 @@ func SetEnableEdu(multipleQueryArg BaseOrganizationProto.MultipleQueryArg) (*Bas
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseOrganizationProto.NewBaseOrganizationManageClient(conn)
Reply, err := c.SetEnableEdu(ctx, &multipleQueryArg)
@ -174,6 +202,9 @@ func SetDisableEdu(multipleQueryArg BaseOrganizationProto.MultipleQueryArg) (*Ba
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseOrganizationProto.NewBaseOrganizationManageClient(conn)
Reply, err := c.SetDisableEdu(ctx, &multipleQueryArg)

@ -5,6 +5,7 @@ import (
"dsBaseWeb/Business/BasePurview/BasePurviewProto"
"dsBaseWeb/Utils/GRpcUtil"
"dsBaseWeb/Utils/LogUtil"
"errors"
"time"
)
@ -18,6 +19,9 @@ func AddBasePurview(modelArg BasePurviewProto.ModelArg) (*BasePurviewProto.Reply
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BasePurviewProto.NewBasePurviewManageClient(conn)
Reply, err := c.AddBasePurview(ctx, &modelArg)
@ -37,6 +41,9 @@ func DeleteBasePurview(deleteIdsArg BasePurviewProto.DeleteIdsArg) (*BasePurview
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BasePurviewProto.NewBasePurviewManageClient(conn)
Reply, err := c.DeleteBasePurview(ctx, &deleteIdsArg)
@ -56,6 +63,9 @@ func UpdateBasePurview(modelArg BasePurviewProto.ModelArg) (*BasePurviewProto.Re
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BasePurviewProto.NewBasePurviewManageClient(conn)
Reply, err := c.UpdateBasePurview(ctx, &modelArg)
@ -75,6 +85,9 @@ func GetBasePurview(modelArg BasePurviewProto.ModelArg) (*BasePurviewProto.Reply
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BasePurviewProto.NewBasePurviewManageClient(conn)
Reply, err := c.GetBasePurview(ctx, &modelArg)
@ -94,6 +107,9 @@ func PageBasePurview(queryArg BasePurviewProto.QueryArg) (*BasePurviewProto.Repl
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BasePurviewProto.NewBasePurviewManageClient(conn)
Reply, err := c.PageBasePurview(ctx, &queryArg)

@ -5,6 +5,7 @@ import (
"dsBaseWeb/Business/BaseRolePerson/BaseRolePersonProto"
"dsBaseWeb/Utils/GRpcUtil"
"dsBaseWeb/Utils/LogUtil"
"errors"
"time"
)
@ -18,6 +19,9 @@ func GetManageArea(getManageAreaArg BaseRolePersonProto.GetManageAreaArg) (*Base
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseRolePersonProto.NewBaseRolePersonManageClient(conn)
Reply, err := c.GetManageArea(ctx, &getManageAreaArg)
@ -37,6 +41,9 @@ func PageBaseRolePerson(queryArg BaseRolePersonProto.QueryArg) (*BaseRolePersonP
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseRolePersonProto.NewBaseRolePersonManageClient(conn)
Reply, err := c.PageBaseRolePerson(ctx, &queryArg)

@ -5,6 +5,7 @@ import (
"dsBaseWeb/Business/BaseStudent/BaseStudentProto"
"dsBaseWeb/Utils/GRpcUtil"
"dsBaseWeb/Utils/LogUtil"
"errors"
"strings"
"time"
)
@ -19,6 +20,9 @@ func PageBaseStudent(queryArg BaseStudentProto.QueryArg) (*BaseStudentProto.Repl
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseStudentProto.NewBaseStudentManageClient(conn)
Reply, err := c.PageBaseStudent(ctx, &queryArg)
@ -38,6 +42,9 @@ func GetBaseStudent(modelArg BaseStudentProto.ModelArg) (*BaseStudentProto.Reply
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseStudentProto.NewBaseStudentManageClient(conn)
Reply, err := c.GetBaseStudent(ctx, &modelArg)
@ -57,6 +64,9 @@ func AddBaseStudent(modelArg BaseStudentProto.ModelArg) (*BaseStudentProto.Reply
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseStudentProto.NewBaseStudentManageClient(conn)
Reply, err := c.AddBaseStudent(ctx, &modelArg)
@ -76,6 +86,9 @@ func DeleteBaseStudent(deleteIdsArg BaseStudentProto.DeleteIdsArg) (*BaseStudent
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseStudentProto.NewBaseStudentManageClient(conn)
Reply, err := c.DeleteBaseStudent(ctx, &deleteIdsArg)
@ -95,6 +108,9 @@ func UpdateBaseStudent(modelArg BaseStudentProto.ModelArg) (*BaseStudentProto.Re
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseStudentProto.NewBaseStudentManageClient(conn)
Reply, err := c.UpdateBaseStudent(ctx, &modelArg)
@ -115,6 +131,9 @@ func ReviseStudentClass(ids string, classId string) (*BaseStudentProto.Reply, er
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseStudentProto.NewBaseStudentManageClient(conn)
Reply, err := c.ReviseStudentClass(ctx, &BaseStudentProto.ReviseArg{Ids: idsArr, ClassId: classId})
@ -134,6 +153,9 @@ func ExportStudentAccountInfoExcel(modelArg BaseStudentProto.ModelArg) (*BaseStu
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseStudentProto.NewBaseStudentManageClient(conn)
Reply, err := c.ExportStudentAccountInfoExcel(ctx, &modelArg)
@ -153,6 +175,9 @@ func ExportStudentInfoExcel(modelArg BaseStudentProto.ModelArg) (*BaseStudentPro
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseStudentProto.NewBaseStudentManageClient(conn)
Reply, err := c.ExportStudentInfoExcel(ctx, &modelArg)
@ -172,6 +197,9 @@ func ImportStudentInfoExcel(importArg BaseStudentProto.ImportArg) (*BaseStudentP
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseStudentProto.NewBaseStudentManageClient(conn)
Reply, err := c.ImportStudentInfoExcel(ctx, &importArg)

@ -5,6 +5,7 @@ import (
"dsBaseWeb/Business/BaseTeacher/BaseTeacherProto"
"dsBaseWeb/Utils/GRpcUtil"
"dsBaseWeb/Utils/LogUtil"
"errors"
"strings"
"time"
)
@ -19,6 +20,9 @@ func PageBaseTeacher(queryArg BaseTeacherProto.QueryArg) (*BaseTeacherProto.Repl
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseTeacherProto.NewBaseTeacherManageClient(conn)
Reply, err := c.PageBaseTeacher(ctx, &queryArg)
@ -38,6 +42,9 @@ func GetBaseTeacher(modelArg BaseTeacherProto.ModelArg) (*BaseTeacherProto.Reply
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseTeacherProto.NewBaseTeacherManageClient(conn)
Reply, err := c.GetBaseTeacher(ctx, &modelArg)
@ -57,6 +64,9 @@ func AddBaseTeacher(modelArg BaseTeacherProto.ModelArg) (*BaseTeacherProto.Reply
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseTeacherProto.NewBaseTeacherManageClient(conn)
Reply, err := c.AddBaseTeacher(ctx, &modelArg)
@ -76,6 +86,9 @@ func DeleteBaseTeacher(deleteIdsArg BaseTeacherProto.DeleteIdsArg) (*BaseTeacher
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseTeacherProto.NewBaseTeacherManageClient(conn)
Reply, err := c.DeleteBaseTeacher(ctx, &deleteIdsArg)
@ -95,6 +108,9 @@ func UpdateBaseTeacher(modelArg BaseTeacherProto.ModelArg) (*BaseTeacherProto.Re
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseTeacherProto.NewBaseTeacherManageClient(conn)
Reply, err := c.UpdateBaseTeacher(ctx, &modelArg)
@ -115,6 +131,9 @@ func ReviseTeacherOrg(ids string, orgId string) (*BaseTeacherProto.Reply, error)
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseTeacherProto.NewBaseTeacherManageClient(conn)
Reply, err := c.ReviseTeacherOrg(ctx, &BaseTeacherProto.ReviseArg{Ids: idsArr, OrgId: orgId})
@ -134,6 +153,9 @@ func ExportTeacherAccountInfoExcel(modelArg BaseTeacherProto.ModelArg) (*BaseTea
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseTeacherProto.NewBaseTeacherManageClient(conn)
Reply, err := c.ExportTeacherAccountInfoExcel(ctx, &modelArg)
@ -153,6 +175,9 @@ func ExportTeacherInfoExcel(modelArg BaseTeacherProto.ModelArg) (*BaseTeacherPro
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseTeacherProto.NewBaseTeacherManageClient(conn)
Reply, err := c.ExportTeacherInfoExcel(ctx, &modelArg)
@ -172,6 +197,9 @@ func ImportTeacherInfoExcel(importArg BaseTeacherProto.ImportArg) (*BaseTeacherP
ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseTeacherProto.NewBaseTeacherManageClient(conn)
Reply, err := c.ImportTeacherInfoExcel(ctx, &importArg)

@ -5,6 +5,7 @@ import (
"dsBaseWeb/Business/GovArea/GovAreaProto"
"dsBaseWeb/Utils/GRpcUtil"
"dsBaseWeb/Utils/LogUtil"
"errors"
"strings"
"time"
)
@ -15,12 +16,13 @@ import (
2020-04-20
*/
func GetGovArea(areaCode string, actionPersonId string, actionIpAddress string) (*GovAreaProto.Reply, error) {
//1、准备动作连接服务器
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
//2、
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
c := GovAreaProto.NewGovAreaManageClient(conn)
Reply, err := c.GetGovArea(ctx, &GovAreaProto.ModelArg{AreaCode: areaCode, ActionPersonId: actionPersonId, ActionIpAddress: actionIpAddress})
if err != nil {
@ -40,7 +42,9 @@ func PageGovArea(page int32, limit int32, areaCode string, actionPersonId string
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
//2、
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
c := GovAreaProto.NewGovAreaManageClient(conn)
Reply, err := c.PageGovArea(ctx, &GovAreaProto.QueryArg{Page: page, Limit: limit, AreaCode: areaCode, ActionPersonId: actionPersonId, ActionIpAddress: actionIpAddress})
if err != nil {
@ -59,7 +63,9 @@ func AddGovArea(areaCode string, areaName string, masterCode string, areaLevelId
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
//2、
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
c := GovAreaProto.NewGovAreaManageClient(conn)
Reply, err := c.AddGovArea(ctx, &GovAreaProto.ModelArg{AreaCode: areaCode, AreaName: areaName, MasterCode: masterCode, AreaLevelId: areaLevelId, AreaTypeId: areaTypeId, ActionPersonId: actionPersonId, ActionIpAddress: actionIpAddress})
if err != nil {
@ -78,7 +84,9 @@ func UpdateGovArea(areaCode string, areaName string, masterCode string, areaType
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
//2、
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
c := GovAreaProto.NewGovAreaManageClient(conn)
Reply, err := c.UpdateGovArea(ctx, &GovAreaProto.ModelArg{AreaCode: areaCode, AreaName: areaName, MasterCode: masterCode, AreaTypeId: areaTypeId, ActionPersonId: actionPersonId, ActionIpAddress: actionIpAddress})
if err != nil {
@ -98,7 +106,9 @@ func DeleteGovArea(areaCode string, actionPersonId string, actionIpAddress strin
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
//2、
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
c := GovAreaProto.NewGovAreaManageClient(conn)
Reply, err := c.DeleteGovArea(ctx, &GovAreaProto.DeleteIdsArg{Ids: idsArr, ActionPersonId: actionPersonId, ActionIpAddress: actionIpAddress})
if err != nil {

@ -5,6 +5,7 @@ import (
"dsBaseWeb/Business/SysDict/SysDictProto"
"dsBaseWeb/Utils/GRpcUtil"
"dsBaseWeb/Utils/LogUtil"
"errors"
"time"
)
@ -18,6 +19,9 @@ func GetSysDict(modelArg SysDictProto.ModelArg) (*SysDictProto.Reply, error) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := SysDictProto.NewSysDictManageClient(conn)
Reply, err := c.GetSysDict(ctx, &modelArg)
@ -37,6 +41,9 @@ func PageSysDict(queryArg SysDictProto.QueryArg) (*SysDictProto.Reply, error) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := SysDictProto.NewSysDictManageClient(conn)
Reply, err := c.PageSysDict(ctx, &queryArg)
@ -51,6 +58,9 @@ func PageSysDictMultipleDictCode(multipleQueryArg SysDictProto.MultipleQueryArg)
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := SysDictProto.NewSysDictManageClient(conn)
Reply, err := c.PageSysDictMultipleDictCode(ctx, &multipleQueryArg)
@ -70,6 +80,9 @@ func GetStage() (*SysDictProto.Reply, error) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := SysDictProto.NewSysDictManageClient(conn)
Reply, err := c.GetStage(ctx, &SysDictProto.ModelArg{})
@ -89,6 +102,9 @@ func GetSubject(getSubjectArg SysDictProto.GetSubjectArg) (*SysDictProto.Reply,
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := SysDictProto.NewSysDictManageClient(conn)
Reply, err := c.GetSubject(ctx, &getSubjectArg)
@ -108,6 +124,9 @@ func GetMultipleDict(getMultipleDictArg SysDictProto.GetMultipleDictArg) (*SysDi
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := SysDictProto.NewSysDictManageClient(conn)
Reply, err := c.GetMultipleDict(ctx, &getMultipleDictArg)
@ -127,6 +146,9 @@ func GetStageName(getStageNameArg SysDictProto.GetStageNameArg) (*SysDictProto.R
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := SysDictProto.NewSysDictManageClient(conn)
Reply, err := c.GetStageName(ctx, &getStageNameArg)
@ -146,6 +168,9 @@ func GetSubjectName(getSubjectNameArg SysDictProto.GetSubjectNameArg) (*SysDictP
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := SysDictProto.NewSysDictManageClient(conn)
Reply, err := c.GetSubjectName(ctx, &getSubjectNameArg)

@ -5,6 +5,7 @@ import (
"dsBaseWeb/Business/SysLoginPerson/SysLoginpersonProto"
"dsBaseWeb/Utils/GRpcUtil"
"dsBaseWeb/Utils/LogUtil"
"errors"
"time"
)
@ -18,6 +19,9 @@ func PageAreaManager(areaManagerArg SysLoginpersonProto.AreaManagerArg) (*SysLog
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := SysLoginpersonProto.NewSysLoginpersonManageClient(conn)
Reply, err := c.PageAreaManager(ctx, &areaManagerArg)
@ -37,6 +41,9 @@ func PageAreaManagerExcel(areaManagerArg SysLoginpersonProto.AreaManagerArg) (*S
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := SysLoginpersonProto.NewSysLoginpersonManageClient(conn)
Reply, err := c.PageAreaManagerExcel(ctx, &areaManagerArg)
@ -56,6 +63,9 @@ func PageSysLoginperson(queryArg SysLoginpersonProto.QueryArg) (*SysLoginpersonP
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := SysLoginpersonProto.NewSysLoginpersonManageClient(conn)
Reply, err := c.PageSysLoginperson(ctx, &queryArg)
@ -75,6 +85,9 @@ func PageSysLoginpersonExcel(queryArg SysLoginpersonProto.QueryArg) (*SysLoginpe
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := SysLoginpersonProto.NewSysLoginpersonManageClient(conn)
Reply, err := c.PageSysLoginpersonExcel(ctx, &queryArg)
@ -94,6 +107,9 @@ func ResetPassWord(resetPassWordArg SysLoginpersonProto.ResetPassWordArg) (*SysL
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := SysLoginpersonProto.NewSysLoginpersonManageClient(conn)
Reply, err := c.ResetPassWord(ctx, &resetPassWordArg)
@ -113,6 +129,9 @@ func EnableAccount(accountArg SysLoginpersonProto.AccountArg) (*SysLoginpersonPr
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := SysLoginpersonProto.NewSysLoginpersonManageClient(conn)
Reply, err := c.EnableAccount(ctx, &accountArg)
@ -132,6 +151,9 @@ func DisableAccount(accountArg SysLoginpersonProto.AccountArg) (*SysLoginpersonP
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := SysLoginpersonProto.NewSysLoginpersonManageClient(conn)
Reply, err := c.DisableAccount(ctx, &accountArg)
@ -151,6 +173,9 @@ func UpdateLoginPassWord(updateLoginPassWordArg SysLoginpersonProto.UpdateLoginP
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := SysLoginpersonProto.NewSysLoginpersonManageClient(conn)
Reply, err := c.UpdateLoginPassWord(ctx, &updateLoginPassWordArg)

@ -124,6 +124,11 @@ func roleIdLimitIsLegal(c *gin.Context, interName string, n int) (bool, ResultSt
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
resultStruct.HttpType = httpType
resultStruct.Message = "RPC服务未启动"
return false, resultStruct
}
//2、业务传参
c1 := BaseRolePersonProto.NewBaseRolePersonManageClient(conn)
Reply, err := c1.CheckDataPrivilege(ctx, &arg)

Loading…
Cancel
Save