摘要: package response import ( "fmt" "time" ) type JsonTime time.Time func (j JsonTime) MarshalJSON() ([]byte, error) { // 重写time转换成json之后的格式 var stmp = fm 阅读全文
posted @ 2022-02-20 15:00 专职 阅读(395) 评论(0) 推荐(0) 编辑
摘要: func HandleGrpcErrorToHttp(err error, c *gin.Context) { // 将grpc的code转换成http的状态码 if err != nil { if e, ok := status.FromError(err); ok { switch e.Code 阅读全文
posted @ 2022-02-20 14:16 专职 阅读(414) 评论(0) 推荐(0) 编辑