go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

How can I get time.Time in types.go from goctl api generation?

Open sithu-go opened this issue 1 year ago • 0 comments

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 stringjson:"username"} UserCreateReq { Username stringjson:"username"Name stringjson:"name"Gender stringjson:"gender"} UserReply { Id int64 json:"id"Username stringjson:"username"Name stringjson:"name"Gender stringjson:"gender"CreatedAt stringjson:"created_at"UpdatedAt stringjson:"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) } `

sithu-go avatar Sep 20 '22 05:09 sithu-go