go-zero
go-zero copied to clipboard
How can I get time.Time in types.go from goctl api generation?
Acoording to the documentation (), I cannot use time.Time in api file. But How can i get time.Time type in types.go from generation for CreatedAt, UpdatedAt
user.api file
type ( UserReq { Username string
json:"username"} UserCreateReq { Username string
json:"username"Name string
json:"name"Gender string
json:"gender"} UserReply { Id int64
json:"id"Username string
json:"username"Name string
json:"name"Gender string
json:"gender"CreatedAt string
json:"created_at"UpdatedAt string
json:"updated_at"`
}
)
@server( jwt: Auth )
service user-api { @doc "users" @handler getuser get /v1/users/:username (UserReq) returns (UserReply) }
service user-api { @doc "users" @handler getusers get /v1/users returns ([]UserReply) }
service user-api { @doc "users" @handler updateuser post /v1/users (UserCreateReq) returns (UserReply) } `