Initial commit: dating app backend (Go/Gin/GORM/Postgres)
Phone+OTP auth, staged onboarding, admin approval workflow, and a full discovery/swipe/match/chat system with photo upload and approximate distance (haversine) based on user location. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package utils
|
||||
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
// Response قالب استاندارد تمام پاسخهای API
|
||||
type Response struct {
|
||||
Success bool `json:"success"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Data interface{} `json:"data,omitempty"`
|
||||
Errors interface{} `json:"errors,omitempty"`
|
||||
}
|
||||
|
||||
func Success(c *gin.Context, code int, message string, data interface{}) {
|
||||
c.JSON(code, Response{
|
||||
Success: true,
|
||||
Message: message,
|
||||
Data: data,
|
||||
})
|
||||
}
|
||||
|
||||
func Fail(c *gin.Context, code int, message string, errs interface{}) {
|
||||
c.JSON(code, Response{
|
||||
Success: false,
|
||||
Message: message,
|
||||
Errors: errs,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user