goravel icon indicating copy to clipboard operation
goravel copied to clipboard

✨ [Feature] Add json tag for orm.Model

Open hwbrzzl opened this issue 2 years ago • 1 comments

Before feedback (在反馈之前)

  • [X] There are no features that I want to submit in Issues (当前 Issues 中没有我将要提交的新功能)

Describe Feature (描述功能)

type Model struct {
	ID uint `gorm:"primaryKey" json:"id"`
	Timestamps
}

type SoftDeletes struct {
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
}

type Timestamps struct {
	CreatedAt carbon.DateTime `gorm:"autoCreateTime;column:created_at" json:"created_at"`
	UpdatedAt carbon.DateTime `gorm:"autoUpdateTime;column:updated_at" json:"updated_at"`
}

hwbrzzl avatar Mar 27 '24 11:03 hwbrzzl

Hi @hwbrzzl 👋

We think your feedback is very valuable! If you are interested, please submit a PR, please include test cases, documentation, etc., and ensure that the CI is passed, thank you and look forward to your contribution! 我们认为您的反馈非常有价值!如果有兴趣欢迎提交 PR,请包含相应的测试用例、文档等,并确保 CI 通过,感谢和期待您的贡献!

github-actions[bot] avatar Mar 27 '24 11:03 github-actions[bot]