Skip to content

v1.2.5

Choose a tag to compare

@Fromsko Fromsko released this 19 Jan 04:49
· 11 commits to main since this release
823ae62
// ReplyData 定义数据返回格式
func Client(ctx *gin.Context, jm *JsonMsg, opts ...Option) {
	if jm == nil {
		jm = &JsonMsg{}
		for _, opt := range opts {
			opt(*jm)
		}
	}

	if jm.flag {
		ctx.JSON(jm.Code, jm)
	} else {
		ctx.JSON(http.StatusOK, jm)
	}
}