Add License Integration

This commit is contained in:
aditya.siregar
2024-08-02 00:51:54 +07:00
parent 5e26402c10
commit c1ae2fd14a
9 changed files with 92 additions and 29 deletions
+4
View File
@@ -82,6 +82,10 @@ func (h *AuthHandler) AuthLogin(c *gin.Context) {
},
Site: site,
ResetPassword: authUser.ResetPassword,
PartnerLicense: &response.PartnerLicense{
DaysToExpire: authUser.PartnerLicense.DaysToExpire,
Status: authUser.PartnerLicense.LicenseStatus,
},
}
c.JSON(http.StatusOK, response.BaseResponse{
+12 -6
View File
@@ -1,15 +1,21 @@
package response
type LoginResponse struct {
Token string `json:"token"`
Name string `json:"name"`
Role Role `json:"role"`
Partner *Partner `json:"partner"`
Site *SiteName `json:"site,omitempty"`
ResetPassword bool `json:"reset_password"`
Token string `json:"token"`
Name string `json:"name"`
Role Role `json:"role"`
Partner *Partner `json:"partner"`
Site *SiteName `json:"site,omitempty"`
ResetPassword bool `json:"reset_password"`
PartnerLicense *PartnerLicense `json:"partner_license,omitempty"`
}
type Role struct {
ID int64 `json:"id"`
Role string `json:"role_name"`
}
type PartnerLicense struct {
DaysToExpire int64 `json:"days_to_expire,omitempty"`
Status string `json:"status,omitempty"`
}