authentication/request.go

66 lines
2.0 KiB
Go
Raw Permalink Normal View History

2022-05-23 07:04:01 +00:00
package authentication
// Request ...
type Request struct {
}
// CheckPermission ...
func (Request) CheckPermission(payload StaffCheckPermissionBody) (*Response, error) {
return requestNats(SubjectRequestNatsCheckPermission, toBytes(payload))
}
2022-08-23 02:13:59 +00:00
// VerifyCode ...
func (Request) VerifyCode(payload StaffVerifyCodeBody) (*Response, error) {
return requestNats(SubjectRequestNatsVerifyCode, toBytes(payload))
}
2022-05-23 07:04:01 +00:00
// GetPermission ...
func (Request) GetPermission(payload StaffGetPermissions) (*Response, error) {
return requestNats(SubjectRequestNatsGetPermission, toBytes(payload))
}
2022-05-24 03:14:51 +00:00
// SyncData ...
func (Request) SyncData(payload ListStaff) (*Response, error) {
return requestNats(SubjectRequestNatsSyncStaff, toBytes(payload))
}
2022-05-24 07:31:45 +00:00
// CreateStaff ...
func (Request) CreateStaff(payload Staff) (*Response, error) {
return requestNats(SubjectRequestNatsStaffCreate, toBytes(payload))
}
// UpdateStaff ...
func (Request) UpdateStaff(payload Staff) (*Response, error) {
return requestNats(SubjectRequestNatsStaffUpdate, toBytes(payload))
2022-05-24 07:31:45 +00:00
}
2022-05-27 07:45:10 +00:00
2022-06-30 04:20:00 +00:00
// GetInfoStaff ...
2022-06-30 04:26:22 +00:00
func (Request) GetInfoStaff(payload GetInfoStaff) (*Response, error) {
2022-07-01 02:20:57 +00:00
return requestNats(SubjectRequestNatsStaffGetInfo, bsonToBytes(payload))
2022-06-30 04:20:00 +00:00
}
2022-06-30 05:07:07 +00:00
// GetListStaff ...
func (Request) GetListStaff(payload GetInfoStaff) (*Response, error) {
2022-07-01 02:20:57 +00:00
return requestNats(SubjectRequestNatsStaffGetList, bsonToBytes(payload))
2022-06-30 05:07:07 +00:00
}
2022-05-27 07:45:10 +00:00
// SaveLog ...
func (Request) SaveLog(payload Log) (*Response, error) {
return requestNats(SubjectRequestNatsAddLogs, toBytes(payload))
}
2022-05-30 03:21:34 +00:00
// GetListLogs ...
2022-05-30 03:34:44 +00:00
func (Request) GetListLogs(payload *CommonQuery) (*Response, error) {
2022-05-30 03:21:34 +00:00
return requestNats(SubjectRequestNatsLogsGetList, toBytes(payload))
}
2022-06-03 06:53:17 +00:00
// GetTokenWithPhoneNumber ...
func (Request) GetTokenWithPhoneNumber(payload *GetTokenByPhoneBody) (*Response, error) {
return requestNats(SubjectRequestNatsGetTokenWithPhone, toBytes(payload))
}
2022-07-13 04:57:52 +00:00
// GetSecretKeyAuth ...
func (Request) GetSecretKeyAuth() (*Response, error) {
return requestNats(SubjectRequestGetSecretKey, toBytes(""))
}