deprecated comments update

This commit is contained in:
John Guo
2021-03-30 13:43:08 +08:00
parent d4e4b9addf
commit 78027d2ec6
8 changed files with 39 additions and 39 deletions

View File

@ -95,7 +95,7 @@ func (m *Model) Group(groupBy string) *Model {
// GroupBy is alias of Model.Group.
// See Model.Group.
// Deprecated.
// Deprecated, use Group instead.
func (m *Model) GroupBy(groupBy string) *Model {
return m.Group(groupBy)
}
@ -109,7 +109,7 @@ func (m *Model) Order(orderBy ...string) *Model {
// OrderBy is alias of Model.Order.
// See Model.Order.
// Deprecated.
// Deprecated, use Order instead.
func (m *Model) OrderBy(orderBy string) *Model {
return m.Order(orderBy)
}
@ -153,7 +153,7 @@ func (m *Model) Page(page, limit int) *Model {
// ForPage is alias of Model.Page.
// See Model.Page.
// Deprecated.
// Deprecated, use Page instead.
func (m *Model) ForPage(page, limit int) *Model {
return m.Page(page, limit)
}

View File

@ -6,22 +6,22 @@
package gdb
// Deprecated.
// Deprecated, use Json instead.
func (r Record) ToJson() string {
return r.Json()
}
// Deprecated.
// Deprecated, use Xml instead.
func (r Record) ToXml(rootTag ...string) string {
return r.Xml(rootTag...)
}
// Deprecated.
// Deprecated, use Map instead.
func (r Record) ToMap() Map {
return r.Map()
}
// Deprecated.
// Deprecated, use Struct instead.
func (r Record) ToStruct(pointer interface{}) error {
return r.Struct(pointer)
}

View File

@ -6,52 +6,52 @@
package gdb
// Deprecated.
// Deprecated, use Json instead.
func (r Result) ToJson() string {
return r.Json()
}
// Deprecated.
// Deprecated, use Xml instead.
func (r Result) ToXml(rootTag ...string) string {
return r.Xml(rootTag...)
}
// Deprecated.
// Deprecated, use List instead.
func (r Result) ToList() List {
return r.List()
}
// Deprecated.
// Deprecated, use MapKeyStr instead.
func (r Result) ToStringMap(key string) map[string]Map {
return r.MapKeyStr(key)
}
// Deprecated.
// Deprecated, use MapKetInt instead.
func (r Result) ToIntMap(key string) map[int]Map {
return r.MapKeyInt(key)
}
// Deprecated.
// Deprecated, use MapKeyUint instead.
func (r Result) ToUintMap(key string) map[uint]Map {
return r.MapKeyUint(key)
}
// Deprecated.
// Deprecated, use RecordKeyStr instead.
func (r Result) ToStringRecord(key string) map[string]Record {
return r.RecordKeyStr(key)
}
// Deprecated.
// Deprecated, use RecordKetInt instead.
func (r Result) ToIntRecord(key string) map[int]Record {
return r.RecordKeyInt(key)
}
// Deprecated.
// Deprecated, use RecordKetUint instead.
func (r Result) ToUintRecord(key string) map[uint]Record {
return r.RecordKeyUint(key)
}
// Deprecated.
// Deprecated, use Structs instead.
func (r Result) ToStructs(pointer interface{}) (err error) {
return r.Structs(pointer)
}

View File

@ -190,7 +190,7 @@ func (r *Redis) Conn() *Conn {
}
// Alias of Conn, see Conn.
// Deprecated.
// Deprecated, use Conn instead.
func (r *Redis) GetConn() *Conn {
return r.Conn()
}

View File

@ -139,14 +139,14 @@ func (r *Request) GetVar(key string, def ...interface{}) *gvar.Var {
// GetRaw is alias of GetBody.
// See GetBody.
// Deprecated.
// Deprecated, use GetBody instead.
func (r *Request) GetRaw() []byte {
return r.GetBody()
}
// GetRawString is alias of GetBodyString.
// See GetBodyString.
// Deprecated.
// Deprecated, use GetBodyString instead.
func (r *Request) GetRawString() string {
return r.GetBodyString()
}

View File

@ -18,7 +18,7 @@ import (
// Note that if there're multiple parameters with the same name, the parameters are retrieved
// and overwrote in order of priority: form > body.
//
// Deprecated.
// Deprecated, use GetForm instead.
func (r *Request) GetPost(key string, def ...interface{}) interface{} {
r.parseForm()
if len(r.formMap) > 0 {
@ -38,82 +38,82 @@ func (r *Request) GetPost(key string, def ...interface{}) interface{} {
return nil
}
// Deprecated.
// Deprecated, use GetFormVar instead.
func (r *Request) GetPostVar(key string, def ...interface{}) *gvar.Var {
return gvar.New(r.GetPost(key, def...))
}
// Deprecated.
// Deprecated, use GetFormString instead.
func (r *Request) GetPostString(key string, def ...interface{}) string {
return r.GetPostVar(key, def...).String()
}
// Deprecated.
// Deprecated, use GetFormBool instead.
func (r *Request) GetPostBool(key string, def ...interface{}) bool {
return r.GetPostVar(key, def...).Bool()
}
// Deprecated.
// Deprecated, use GetFormInt instead.
func (r *Request) GetPostInt(key string, def ...interface{}) int {
return r.GetPostVar(key, def...).Int()
}
// Deprecated.
// Deprecated, use GetFormInt32 instead.
func (r *Request) GetPostInt32(key string, def ...interface{}) int32 {
return r.GetPostVar(key, def...).Int32()
}
// Deprecated.
// Deprecated, use GetFormInt64 instead.
func (r *Request) GetPostInt64(key string, def ...interface{}) int64 {
return r.GetPostVar(key, def...).Int64()
}
// Deprecated.
// Deprecated, use GetFormInts instead.
func (r *Request) GetPostInts(key string, def ...interface{}) []int {
return r.GetPostVar(key, def...).Ints()
}
// Deprecated.
// Deprecated, use GetFormUint instead.
func (r *Request) GetPostUint(key string, def ...interface{}) uint {
return r.GetPostVar(key, def...).Uint()
}
// Deprecated.
// Deprecated, use GetFormUint32 instead.
func (r *Request) GetPostUint32(key string, def ...interface{}) uint32 {
return r.GetPostVar(key, def...).Uint32()
}
// Deprecated.
// Deprecated, use GetFormUint64 instead.
func (r *Request) GetPostUint64(key string, def ...interface{}) uint64 {
return r.GetPostVar(key, def...).Uint64()
}
// Deprecated.
// Deprecated, use GetFormFloat32 instead.
func (r *Request) GetPostFloat32(key string, def ...interface{}) float32 {
return r.GetPostVar(key, def...).Float32()
}
// Deprecated.
// Deprecated, use GetFormFloat64 instead.
func (r *Request) GetPostFloat64(key string, def ...interface{}) float64 {
return r.GetPostVar(key, def...).Float64()
}
// Deprecated.
// Deprecated, use GetFormFloats instead.
func (r *Request) GetPostFloats(key string, def ...interface{}) []float64 {
return r.GetPostVar(key, def...).Floats()
}
// Deprecated.
// Deprecated, use GetFormArray instead.
func (r *Request) GetPostArray(key string, def ...interface{}) []string {
return r.GetPostVar(key, def...).Strings()
}
// Deprecated.
// Deprecated, use GetFormStrings instead.
func (r *Request) GetPostStrings(key string, def ...interface{}) []string {
return r.GetPostVar(key, def...).Strings()
}
// Deprecated.
// Deprecated, use GetFormInterfaces instead.
func (r *Request) GetPostInterfaces(key string, def ...interface{}) []interface{} {
return r.GetPostVar(key, def...).Interfaces()
}

View File

@ -67,7 +67,7 @@ func GetArgAll() []string {
}
// GetWithEnv is alias of GetOptWithEnv.
// Deprecated.
// Deprecated, use GetOptWithEnv instead.
func GetWithEnv(key string, def ...interface{}) *gvar.Var {
return GetOptWithEnv(key, def...)
}

View File

@ -540,7 +540,7 @@ func SplitAndTrim(str, delimiter string, characterMask ...string) []string {
// SplitAndTrimSpace splits string <str> by a string <delimiter> to an array,
// and calls TrimSpace to every element of this array.
// Deprecated.
// Deprecated, use SplitAndTrim instead.
func SplitAndTrimSpace(str, delimiter string) []string {
array := make([]string, 0)
for _, v := range strings.Split(str, delimiter) {