1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-13 10:40:39 +00:00

Refactor orm filter

This commit is contained in:
Ming Deng
2020-08-18 14:31:06 +00:00
parent 63599c0032
commit 7fe4eaef50
54 changed files with 269 additions and 256 deletions

View File

@ -1,4 +1,4 @@
// Copyright 2020
// Copyright 2020
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -17,5 +17,4 @@ package bean
// ApplicationContext define for future
// when we decide to support DI, IoC, this will be core API
type ApplicationContext interface {
}

View File

@ -1,4 +1,4 @@
// Copyright 2020
// Copyright 2020
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright 2020
// Copyright 2020
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -22,4 +22,4 @@ import (
type AutoWireBeanFactory interface {
// AutoWire will wire the bean.
AutoWire(ctx context.Context, appCtx ApplicationContext, bean interface{}) error
}
}

View File

@ -1,4 +1,4 @@
// Copyright 2020
// Copyright 2020
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright 2020
// Copyright 2020
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright 2020
// Copyright 2020
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright 2020
// Copyright 2020
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -17,7 +17,6 @@ package bean
import (
"context"
"time"
)
// TimeTypeAdapter process the time.Time
@ -29,7 +28,7 @@ type TimeTypeAdapter struct {
// and if the DftValue == now
// time.Now() is returned
func (t *TimeTypeAdapter) DefaultValue(ctx context.Context, dftValue string) (interface{}, error) {
if dftValue == "now"{
if dftValue == "now" {
return time.Now(), nil
}
return time.Parse(t.Layout, dftValue)

View File

@ -1,4 +1,4 @@
// Copyright 2020
// Copyright 2020
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
// Copyright 2020
// Copyright 2020
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.