ntime

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package ntime ******************************************************************************

  • @DESC 为Beego的ORM,数据库字段中无法返回时间戳,定义的时间类型,用于API中时间为时间戳
  • @AUTH Neo
  • @DATE 2022-03-14
  • @CHANGE LOGS
  • DATE CHANGER DETAIL *****************************************************************************

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NTime

type NTime struct {
	time.Time
}

NTime ******************************************************************************

  • @DESC 扩展Time类型的处理方法 *****************************************************************************

func (*NTime) FieldType

func (t *NTime) FieldType() int

FieldType ******************************************************************************

  • @DESC 数据类型
  • @PARAMS
  • @RETURN int Beego的ORM中定义的时间类型TypeDateTimeField
  • @AUTH Neo
  • @DATE 2022-03-14
  • @CHANGE LOGS
  • DATE CHANGER DETAIL *****************************************************************************

func (NTime) MarshalJSON

func (t NTime) MarshalJSON() ([]byte, error)

MarshalJSON ******************************************************************************

  • @DESC 序列化为JSON
  • @PARAMS
  • @RETURN []byte 序列化后的JSON字节
  • @AUTH Neo
  • @DATE 2022-03-14
  • @CHANGE LOGS
  • DATE CHANGER DETAIL *****************************************************************************

func (*NTime) RawValue

func (t *NTime) RawValue() interface{}

RawValue ******************************************************************************

  • @DESC 写入数据库,写入数据库中,因此为Raw
  • @PARAMS
  • @RETURN interface{} 写入数据库中的值
  • @AUTH Neo
  • @DATE 2022-03-14
  • @CHANGE LOGS
  • DATE CHANGER DETAIL *****************************************************************************

func (*NTime) SetRaw

func (t *NTime) SetRaw(value interface{}) error

SetRaw ******************************************************************************

  • @DESC 读取数据库值,由数据库中读出设置到自身中,因此为Set
  • @PARAMS value interface{} 数据库中的值
  • @RETURN
  • @AUTH Neo
  • @DATE 2022-03-14
  • @CHANGE LOGS
  • DATE CHANGER DETAIL *****************************************************************************

func (*NTime) String

func (t *NTime) String() string

String ******************************************************************************

  • @DESC 相当于重写Time类型String方法
  • @PARAMS
  • @RETURN string 字符串化
  • @AUTH Neo
  • @DATE 2022-03-14
  • @CHANGE LOGS
  • DATE CHANGER DETAIL *****************************************************************************

func (*NTime) UnmarshalJSON

func (t *NTime) UnmarshalJSON(data []byte) error

UnmarshalJSON ******************************************************************************

  • @DESC 反序列化为JSON
  • @PARAMS data []byte 需要反序列化的JSON字节
  • @RETURN
  • @AUTH Neo
  • @DATE 2022-03-14
  • @CHANGE LOGS
  • DATE CHANGER DETAIL *****************************************************************************

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL