[Update] Get staff info
This commit is contained in:
		
							parent
							
								
									1e02009620
								
							
						
					
					
						commit
						1b03ec9c79
					
				| 
						 | 
				
			
			@ -8,6 +8,7 @@ const (
 | 
			
		|||
	SubjectRequestNatsStaffCreate  = "authentication.request.staff.create"
 | 
			
		||||
	SubjectRequestNatsStaffUpdate  = "authentication.request.staff.update"
 | 
			
		||||
	SubjectRequestNatsStaffGetInfo = "authentication.request.staff.get_info"
 | 
			
		||||
	SubjectRequestNatsStaffGetList = "authentication.request.staff.list"
 | 
			
		||||
 | 
			
		||||
	SubjectRequestNatsAddLogs     = "authentication.request.logs.create"
 | 
			
		||||
	SubjectRequestNatsLogsGetList = "authentication.request.logs.list"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -34,6 +34,11 @@ func (Request) GetInfoStaff(payload GetInfoStaff) (*Response, error) {
 | 
			
		|||
	return requestNats(SubjectRequestNatsStaffGetInfo, toBytes(payload))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// GetListStaff ...
 | 
			
		||||
func (Request) GetListStaff(payload GetInfoStaff) (*Response, error) {
 | 
			
		||||
	return requestNats(SubjectRequestNatsStaffGetList, toBytes(payload))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// SaveLog ...
 | 
			
		||||
func (Request) SaveLog(payload Log) (*Response, error) {
 | 
			
		||||
	return requestNats(SubjectRequestNatsAddLogs, toBytes(payload))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										45
									
								
								struct.go
								
								
								
								
							
							
						
						
									
										45
									
								
								struct.go
								
								
								
								
							| 
						 | 
				
			
			@ -3,6 +3,8 @@ package authentication
 | 
			
		|||
import (
 | 
			
		||||
	"github.com/Selly-Modules/natsio"
 | 
			
		||||
	"go.mongodb.org/mongo-driver/bson"
 | 
			
		||||
	"go.mongodb.org/mongo-driver/bson/primitive"
 | 
			
		||||
	"time"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// CommonQuery ...
 | 
			
		||||
| 
						 | 
				
			
			@ -128,3 +130,46 @@ type Response struct {
 | 
			
		|||
	Data    []byte `json:"data,omitempty"`
 | 
			
		||||
	Message string `json:"message"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// StaffInfo ...
 | 
			
		||||
type StaffInfo struct {
 | 
			
		||||
	ID                   primitive.ObjectID `json:"_id"`
 | 
			
		||||
	Name                 string             `json:"name"`
 | 
			
		||||
	SearchString         string             `json:"searchString"`
 | 
			
		||||
	Email                string             `json:"email"`
 | 
			
		||||
	Phone                string             `json:"phone"`
 | 
			
		||||
	Active               bool               `json:"active"`
 | 
			
		||||
	Role                 primitive.ObjectID `json:"role,omitempty"`
 | 
			
		||||
	Avatar               *FilePhoto         `json:"avatar,omitempty"`
 | 
			
		||||
	CreatedAt            time.Time          `json:"createdAt"`
 | 
			
		||||
	UpdatedAt            time.Time          `json:"updatedAt"`
 | 
			
		||||
	IsRoot               bool               `json:"isRoot"`
 | 
			
		||||
	Permissions          []string           `json:"permissions"`
 | 
			
		||||
	Source               []string           `json:"source"`
 | 
			
		||||
	NotAllowedLoginAdmin bool               `json:"notAllowedLoginAdmin"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ListStaffInfo ...
 | 
			
		||||
type ListStaffInfo struct {
 | 
			
		||||
	Staffs []StaffInfo `json:"staff"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// FilePhoto ...
 | 
			
		||||
type FilePhoto struct {
 | 
			
		||||
	ID         primitive.ObjectID `json:"_id"`
 | 
			
		||||
	Name       string             `json:"name,omitempty"`
 | 
			
		||||
	Dimensions *FileDimensions    `json:"dimensions"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// FileSize ...
 | 
			
		||||
type FileSize struct {
 | 
			
		||||
	Width  int    `json:"width"`
 | 
			
		||||
	Height int    `json:"height"`
 | 
			
		||||
	URL    string `json:"url"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// FileDimensions ...
 | 
			
		||||
type FileDimensions struct {
 | 
			
		||||
	Small  *FileSize `json:"sm"`
 | 
			
		||||
	Medium *FileSize `json:"md"`
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue