Browse Source

格式化代码

pull/10/head
zhangxin 3 years ago
parent
commit
b6c66960ed
11 changed files with 31 additions and 31 deletions
  1. +5
    -5
      container/DefaultInformationManager.go
  2. +1
    -1
      container/DefaultTransactionHandlerFactory.go
  3. +2
    -2
      container/ElementHandler.go
  4. +4
    -4
      container/ElementInformation.go
  5. +3
    -3
      container/LogBrokerBuilder.go
  6. +3
    -3
      container/NewSessionBrokerBuilder.go
  7. +3
    -3
      container/NewTransactionBrokerBuilder.go
  8. +3
    -3
      container/NoSessionBrokerBuilder.go
  9. +2
    -2
      container/ServiceHandler.go
  10. +4
    -4
      container/ServiceInformation.go
  11. +1
    -1
      container/container_test.go

+ 5
- 5
container/DefaultInformationManager.go View File

@ -7,7 +7,7 @@ import (
) )
// 默认组件信息管理器 // 默认组件信息管理器
// @Implement LAPP_GAAS_GFrame_BACKEND/container/InformationManager
// @Implement LAPP_ACURA_MOM_BACKEND/container/InformationManager
type DefaultInformationManager struct { type DefaultInformationManager struct {
// 组件信息映射: map[组件接口]组件信息 // 组件信息映射: map[组件接口]组件信息
informationMapping map[Interface]ComponentInformation informationMapping map[Interface]ComponentInformation
@ -20,7 +20,7 @@ func NewDefaultInformationManager() *DefaultInformationManager {
return &DefaultInformationManager{make(map[Interface]ComponentInformation, 100)} return &DefaultInformationManager{make(map[Interface]ComponentInformation, 100)}
} }
// @Reference LAPP_GAAS_GFrame_BACKEND/container/InformationManager.RegisterElement
// @Reference LAPP_ACURA_MOM_BACKEND/container/InformationManager.RegisterElement
// 异常: // 异常:
// 1.工厂不能为空 // 1.工厂不能为空
// 2.工厂必须是func // 2.工厂必须是func
@ -44,7 +44,7 @@ func (manager *DefaultInformationManager) RegisterElement(factory interface{}, i
manager.informationMapping[elementType] = elementInformation manager.informationMapping[elementType] = elementInformation
} }
// @Reference LAPP_GAAS_GFrame_BACKEND/container/InformationManager.RegisterService
// @Reference LAPP_ACURA_MOM_BACKEND/container/InformationManager.RegisterService
// 异常: // 异常:
// 1.工厂不能为空 // 1.工厂不能为空
// 2.工厂必须是func // 2.工厂必须是func
@ -69,7 +69,7 @@ func (manager *DefaultInformationManager) RegisterService(factory interface{}, i
return serviceInformation return serviceInformation
} }
// @Reference LAPP_GAAS_GFrame_BACKEND/container/InformationManager.Item
// @Reference LAPP_ACURA_MOM_BACKEND/container/InformationManager.Item
func (manager *DefaultInformationManager) Item(interfaceType Interface) ComponentInformation { func (manager *DefaultInformationManager) Item(interfaceType Interface) ComponentInformation {
if interfaceType == nil { if interfaceType == nil {
@ -82,7 +82,7 @@ func (manager *DefaultInformationManager) Item(interfaceType Interface) Componen
return nil return nil
} }
// @Reference LAPP_GAAS_GFrame_BACKEND/container/InformationManager.Items
// @Reference LAPP_ACURA_MOM_BACKEND/container/InformationManager.Items
func (manager *DefaultInformationManager) Items() []ComponentInformation { func (manager *DefaultInformationManager) Items() []ComponentInformation {
items := make([]ComponentInformation, len(manager.informationMapping)) items := make([]ComponentInformation, len(manager.informationMapping))


+ 1
- 1
container/DefaultTransactionHandlerFactory.go View File

@ -24,7 +24,7 @@ func NewDefaultTransactionHandlerFactory(engine *xorm.Engine) *DefaultTransactio
return &DefaultTransactionHandlerFactory{engine} return &DefaultTransactionHandlerFactory{engine}
} }
// @Reference LAPP_GAAS_GFrame_BACKEND/container/TransactionHandlerFactory.Create
// @Reference LAPP_ACURA_MOM_BACKEND/container/TransactionHandlerFactory.Create
func (impl *DefaultTransactionHandlerFactory) Create() (TransactionHandler, error) { func (impl *DefaultTransactionHandlerFactory) Create() (TransactionHandler, error) {
return NewTransactionHandler(impl.engine.NewSession()) return NewTransactionHandler(impl.engine.NewSession())
} }

+ 2
- 2
container/ElementHandler.go View File

@ -3,7 +3,7 @@
package container package container
// 基本组件句柄 // 基本组件句柄
// @Implement LAPP_GAAS_GFrame_BACKEND/container/ComponentHandler
// @Implement LAPP_ACURA_MOM_BACKEND/container/ComponentHandler
type ElementHandler struct { type ElementHandler struct {
// 组件实例 // 组件实例
instance Instance instance Instance
@ -18,7 +18,7 @@ func NewElementHandler(instance Instance) *ElementHandler {
return &ElementHandler{instance} return &ElementHandler{instance}
} }
// @Reference LAPP_GAAS_GFrame_BACKEND/container/ComponentHandler.Instance
// @Reference LAPP_ACURA_MOM_BACKEND/container/ComponentHandler.Instance
func (handler *ElementHandler) Instance() Instance { func (handler *ElementHandler) Instance() Instance {
return handler.instance return handler.instance
} }

+ 4
- 4
container/ElementInformation.go View File

@ -8,7 +8,7 @@ import (
) )
// 基本组件信息 // 基本组件信息
// @Implement LAPP_GAAS_GFrame_BACKEND/container/ComponentInformation
// @Implement LAPP_ACURA_MOM_BACKEND/container/ComponentInformation
type ElementInformation struct { type ElementInformation struct {
// 实例工厂 // 实例工厂
factory Factory factory Factory
@ -28,17 +28,17 @@ func NewElementInformation(factory interface{}) *ElementInformation {
return &ElementInformation{valueOfFactory, interfaceType} return &ElementInformation{valueOfFactory, interfaceType}
} }
// @Reference LAPP_GAAS_GFrame_BACKEND/container/ComponentInformation.Interface
// @Reference LAPP_ACURA_MOM_BACKEND/container/ComponentInformation.Interface
func (info *ElementInformation) Interface() Interface { func (info *ElementInformation) Interface() Interface {
return info.interfaceType return info.interfaceType
} }
// @Reference LAPP_GAAS_GFrame_BACKEND/container/ComponentInformation.IsGlobal
// @Reference LAPP_ACURA_MOM_BACKEND/container/ComponentInformation.IsGlobal
func (info *ElementInformation) IsGlobal() bool { func (info *ElementInformation) IsGlobal() bool {
return false return false
} }
// @Reference LAPP_GAAS_GFrame_BACKEND/container/ComponentInformation.BuildHandler
// @Reference LAPP_ACURA_MOM_BACKEND/container/ComponentInformation.BuildHandler
func (info *ElementInformation) BuildHandler(sessionContext *SessionContext) (ComponentHandler, error) { func (info *ElementInformation) BuildHandler(sessionContext *SessionContext) (ComponentHandler, error) {
if sessionContext == nil { if sessionContext == nil {


+ 3
- 3
container/LogBrokerBuilder.go View File

@ -8,7 +8,7 @@ import (
) )
// 日志代理创建器 // 日志代理创建器
// @Implement LAPP_GAAS_GFrame_BACKEND/container/CallerBrokerBuilder
// @Implement LAPP_ACURA_MOM_BACKEND/container/CallerBrokerBuilder
type LogBrokerBuilder struct { type LogBrokerBuilder struct {
// 代码文件 // 代码文件
codeFile string codeFile string
@ -40,7 +40,7 @@ func NewLogBrokerBuilder(codeFile string, method string, description string) *Lo
return &LogBrokerBuilder{codeFile, method, description} return &LogBrokerBuilder{codeFile, method, description}
} }
// @Reference LAPP_GAAS_GFrame_BACKEND/container/CallerBrokerBuilder.Check
// @Reference LAPP_ACURA_MOM_BACKEND/container/CallerBrokerBuilder.Check
func (builder *LogBrokerBuilder) Check(methodType Method) error { func (builder *LogBrokerBuilder) Check(methodType Method) error {
if methodType == nil { if methodType == nil {
return errors.New(fmt.Sprintf("方法类型不能为空!")) return errors.New(fmt.Sprintf("方法类型不能为空!"))
@ -48,7 +48,7 @@ func (builder *LogBrokerBuilder) Check(methodType Method) error {
return nil return nil
} }
// @Reference LAPP_GAAS_GFrame_BACKEND/container/CallerBrokerBuilder.Build
// @Reference LAPP_ACURA_MOM_BACKEND/container/CallerBrokerBuilder.Build
func (builder *LogBrokerBuilder) Build(_ *SessionContext, caller Caller) (Caller, error) { func (builder *LogBrokerBuilder) Build(_ *SessionContext, caller Caller) (Caller, error) {
if caller == nil { if caller == nil {
return nil, errors.New(fmt.Sprintf("调用器不能为空!")) return nil, errors.New(fmt.Sprintf("调用器不能为空!"))


+ 3
- 3
container/NewSessionBrokerBuilder.go View File

@ -8,7 +8,7 @@ import (
) )
// 新会话(XORM会话)代理创建器 // 新会话(XORM会话)代理创建器
// @Implement LAPP_GAAS_GFrame_BACKEND/container/CallerBrokerBuilder
// @Implement LAPP_ACURA_MOM_BACKEND/container/CallerBrokerBuilder
type NewSessionBrokerBuilder struct { type NewSessionBrokerBuilder struct {
} }
@ -19,7 +19,7 @@ func NewNewSessionBrokerBuilder() *NewSessionBrokerBuilder {
return &NewSessionBrokerBuilder{} return &NewSessionBrokerBuilder{}
} }
// @Reference LAPP_GAAS_GFrame_BACKEND/container/CallerBrokerBuilder.Check
// @Reference LAPP_ACURA_MOM_BACKEND/container/CallerBrokerBuilder.Check
func (builder *NewSessionBrokerBuilder) Check(methodType Method) error { func (builder *NewSessionBrokerBuilder) Check(methodType Method) error {
if methodType == nil { if methodType == nil {
return errors.New(fmt.Sprintf("方法类型不能为空!")) return errors.New(fmt.Sprintf("方法类型不能为空!"))
@ -39,7 +39,7 @@ func (builder *NewSessionBrokerBuilder) Check(methodType Method) error {
return nil return nil
} }
// @Reference LAPP_GAAS_GFrame_BACKEND/container/CallerBrokerBuilder.Build
// @Reference LAPP_ACURA_MOM_BACKEND/container/CallerBrokerBuilder.Build
func (builder *NewSessionBrokerBuilder) Build(sessionContext *SessionContext, caller Caller) (Caller, error) { func (builder *NewSessionBrokerBuilder) Build(sessionContext *SessionContext, caller Caller) (Caller, error) {
if sessionContext == nil { if sessionContext == nil {
return nil, errors.New(fmt.Sprintf("会话上下文不能为空!")) return nil, errors.New(fmt.Sprintf("会话上下文不能为空!"))


+ 3
- 3
container/NewTransactionBrokerBuilder.go View File

@ -8,7 +8,7 @@ import (
) )
// 新事务代理创建器 // 新事务代理创建器
// @Implement LAPP_GAAS_GFrame_BACKEND/container/CallerBrokerBuilder
// @Implement LAPP_ACURA_MOM_BACKEND/container/CallerBrokerBuilder
type NewTransactionBrokerBuilder struct { type NewTransactionBrokerBuilder struct {
} }
@ -19,7 +19,7 @@ func NewNewTransactionBrokerBuilder() *NewTransactionBrokerBuilder {
return &NewTransactionBrokerBuilder{} return &NewTransactionBrokerBuilder{}
} }
// @Reference LAPP_GAAS_GFrame_BACKEND/container/CallerBrokerBuilder.Check
// @Reference LAPP_ACURA_MOM_BACKEND/container/CallerBrokerBuilder.Check
func (builder *NewTransactionBrokerBuilder) Check(methodType Method) error { func (builder *NewTransactionBrokerBuilder) Check(methodType Method) error {
if methodType == nil { if methodType == nil {
return errors.New(fmt.Sprintf("方法类型不能为空!")) return errors.New(fmt.Sprintf("方法类型不能为空!"))
@ -39,7 +39,7 @@ func (builder *NewTransactionBrokerBuilder) Check(methodType Method) error {
return nil return nil
} }
// @Reference LAPP_GAAS_GFrame_BACKEND/container/CallerBrokerBuilder.Build
// @Reference LAPP_ACURA_MOM_BACKEND/container/CallerBrokerBuilder.Build
func (builder *NewTransactionBrokerBuilder) Build(sessionContext *SessionContext, caller Caller) (Caller, error) { func (builder *NewTransactionBrokerBuilder) Build(sessionContext *SessionContext, caller Caller) (Caller, error) {
if sessionContext == nil { if sessionContext == nil {
return nil, errors.New(fmt.Sprintf("会话上下文不能为空!")) return nil, errors.New(fmt.Sprintf("会话上下文不能为空!"))


+ 3
- 3
container/NoSessionBrokerBuilder.go View File

@ -8,7 +8,7 @@ import (
) )
// 无会话(XORM会话)代理创建器 // 无会话(XORM会话)代理创建器
// @Implement LAPP_GAAS_GFrame_BACKEND/container/CallerBrokerBuilder
// @Implement LAPP_ACURA_MOM_BACKEND/container/CallerBrokerBuilder
type NoSessionBrokerBuilder struct { type NoSessionBrokerBuilder struct {
} }
@ -19,7 +19,7 @@ func NewNoSessionBrokerBuilder() *NoSessionBrokerBuilder {
return &NoSessionBrokerBuilder{} return &NoSessionBrokerBuilder{}
} }
// @Reference LAPP_GAAS_GFrame_BACKEND/container/CallerBrokerBuilder.Check
// @Reference LAPP_ACURA_MOM_BACKEND/container/CallerBrokerBuilder.Check
func (builder *NoSessionBrokerBuilder) Check(methodType Method) error { func (builder *NoSessionBrokerBuilder) Check(methodType Method) error {
if methodType == nil { if methodType == nil {
return errors.New(fmt.Sprintf("方法类型不能为空!")) return errors.New(fmt.Sprintf("方法类型不能为空!"))
@ -39,7 +39,7 @@ func (builder *NoSessionBrokerBuilder) Check(methodType Method) error {
return nil return nil
} }
// @Reference LAPP_GAAS_GFrame_BACKEND/container/CallerBrokerBuilder.Build
// @Reference LAPP_ACURA_MOM_BACKEND/container/CallerBrokerBuilder.Build
func (builder *NoSessionBrokerBuilder) Build(_ *SessionContext, caller Caller) (Caller, error) { func (builder *NoSessionBrokerBuilder) Build(_ *SessionContext, caller Caller) (Caller, error) {
if caller == nil { if caller == nil {
return nil, errors.New(fmt.Sprintf("调用器不能为空!")) return nil, errors.New(fmt.Sprintf("调用器不能为空!"))


+ 2
- 2
container/ServiceHandler.go View File

@ -8,9 +8,9 @@ import (
) )
// 服务组件句柄 // 服务组件句柄
// @Implement LAPP_GAAS_GFrame_BACKEND/container/ComponentHandler
// @Implement LAPP_ACURA_MOM_BACKEND/container/ComponentHandler
type ServiceHandler struct { type ServiceHandler struct {
// @Inherit LAPP_GAAS_GFrame_BACKEND/container/ElementHandler
// @Inherit LAPP_ACURA_MOM_BACKEND/container/ElementHandler
ElementHandler ElementHandler
// 方法句柄映射: map[方法名]方法句柄 // 方法句柄映射: map[方法名]方法句柄
methodMapping map[string]*ServiceMethodHandler methodMapping map[string]*ServiceMethodHandler


+ 4
- 4
container/ServiceInformation.go View File

@ -8,9 +8,9 @@ import (
) )
// 服务组件信息 // 服务组件信息
// @Implement LAPP_GAAS_GFrame_BACKEND/container/ComponentInformation
// @Implement LAPP_ACURA_MOM_BACKEND/container/ComponentInformation
type ServiceInformation struct { type ServiceInformation struct {
// @Inherit LAPP_GAAS_GFrame_BACKEND/container/ElementInformation
// @Inherit LAPP_ACURA_MOM_BACKEND/container/ElementInformation
ElementInformation ElementInformation
// 方法信息映射: map[方法名]方法信息 // 方法信息映射: map[方法名]方法信息
methodMapping map[string]*ServiceMethodInformation methodMapping map[string]*ServiceMethodInformation
@ -28,8 +28,8 @@ func NewServiceInformation(factory interface{}) *ServiceInformation {
return &ServiceInformation{ElementInformation{valueOfFactory, interfaceType}, make(map[string]*ServiceMethodInformation, 10)} return &ServiceInformation{ElementInformation{valueOfFactory, interfaceType}, make(map[string]*ServiceMethodInformation, 10)}
} }
// @Reference LAPP_GAAS_GFrame_BACKEND/container/ComponentInformation.BuildHandler
// @Override LAPP_GAAS_GFrame_BACKEND/container/ElementInformation.BuildHandler
// @Reference LAPP_ACURA_MOM_BACKEND/container/ComponentInformation.BuildHandler
// @Override LAPP_ACURA_MOM_BACKEND/container/ElementInformation.BuildHandler
func (info *ServiceInformation) BuildHandler(sessionContext *SessionContext) (ComponentHandler, error) { func (info *ServiceInformation) BuildHandler(sessionContext *SessionContext) (ComponentHandler, error) {
if sessionContext == nil { if sessionContext == nil {


+ 1
- 1
container/container_test.go View File

@ -285,7 +285,7 @@ type TransactionHandlerFactoryMock struct {
createError error createError error
} }
// @Reference LAPP_GAAS_GFrame_BACKEND/container/TransactionHandlerFactory.Create
// @Reference LAPP_ACURA_MOM_BACKEND/container/TransactionHandlerFactory.Create
func (mock *TransactionHandlerFactoryMock) Create() (TransactionHandler, error) { func (mock *TransactionHandlerFactoryMock) Create() (TransactionHandler, error) {
return mock.handler, mock.createError return mock.handler, mock.createError
} }


Loading…
Cancel
Save