Compare commits
26 Commits
feat/authF
...
0057a2d260
| Author | SHA1 | Date | |
|---|---|---|---|
| 0057a2d260 | |||
| 854db39f30 | |||
| f79fa4ca27 | |||
| 55822047bc | |||
| de360968dc | |||
| 06303ec2b5 | |||
| 437f33a323 | |||
| 963ab12488 | |||
| df24905a0e | |||
| 0659734346 | |||
| 9af19713a0 | |||
| 06ad3516f1 | |||
| 23c7b7a293 | |||
| 53bfc4a413 | |||
| 3de7e64f85 | |||
| 39a9181257 | |||
| 5d3f73bb13 | |||
| bc44de63ee | |||
| b1075c8b82 | |||
| 40deb9968f | |||
| 182771afd2 | |||
| 668eef2a4d | |||
| e9527ca61e | |||
| 8f2ec82d4f | |||
| cc708cae0c | |||
| b936677c16 |
@@ -3,7 +3,8 @@
|
|||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve --ssl -o",
|
"start:ssl": "ng serve --ssl -o",
|
||||||
|
"start": "ng serve -o",
|
||||||
"build": "ng build --configuration production",
|
"build": "ng build --configuration production",
|
||||||
"watch": "ng build --watch --configuration development",
|
"watch": "ng build --watch --configuration development",
|
||||||
"test": "ng test",
|
"test": "ng test",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"/api": {
|
"/api": {
|
||||||
"target": "https://localhost:7103",
|
"target": "https://localhost:7052",
|
||||||
"secure": false,
|
"secure": false,
|
||||||
"changeOrigin": true
|
"changeOrigin": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Component, inject, signal } from '@angular/core';
|
import { Component, inject, signal } from '@angular/core';
|
||||||
import { Group } from '../../../models/user-management.api.models';
|
import { Group } from '../../../services/api/api-models';
|
||||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||||
import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Component, inject, ChangeDetectionStrategy, signal, OnInit, computed } from '@angular/core';
|
import { Component, inject, ChangeDetectionStrategy, signal, OnInit, computed } from '@angular/core';
|
||||||
import { UserRep } from '../../../models/user-management.api.models';
|
import { UserRep } from '../../../services/api/api-models';
|
||||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||||
import { UserRepService } from '../../../services/api/user-representation.service';
|
import { UserRepService } from '../../../services/api/user-representation.service';
|
||||||
import { GroupUpdateFormComponent } from '../group-update-form/group-update-form.component';
|
import { GroupUpdateFormComponent } from '../group-update-form/group-update-form.component';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Component, inject, signal } from '@angular/core';
|
import { Component, inject, signal } from '@angular/core';
|
||||||
import { User } from '../../../models/user-management.api.models';
|
import { User } from '../../../services/api/api-models';
|
||||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||||
import { FormControl, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
|
import { FormControl, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { GroupService } from '../../services/api/group.service';
|
|||||||
import { Observable, forkJoin, of } from 'rxjs';
|
import { Observable, forkJoin, of } from 'rxjs';
|
||||||
import { catchError, finalize } from 'rxjs/operators';
|
import { catchError, finalize } from 'rxjs/operators';
|
||||||
import { DirGroupTableComponent } from '../tables/dir-group-table/dir-group-table.component';
|
import { DirGroupTableComponent } from '../tables/dir-group-table/dir-group-table.component';
|
||||||
import { DirGroup } from '../../models/user-management.api.models';
|
import { DirGroup } from '../../services/api/api-models';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
standalone: true,
|
standalone: true,
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export class NavMenuComponent {
|
|||||||
isChecked = true;
|
isChecked = true;
|
||||||
|
|
||||||
constructor(private dialog: MatDialog, private authService: AuthenticationService, public refreshService: RefreshService, public creationService: CreationService, public updateService: UpdateService, public transferService: TransferService, public buttonVisibilityService: ButtonVisibilityService, public deletionService: DeletionService) {
|
constructor(private dialog: MatDialog, private authService: AuthenticationService, public refreshService: RefreshService, public creationService: CreationService, public updateService: UpdateService, public transferService: TransferService, public buttonVisibilityService: ButtonVisibilityService, public deletionService: DeletionService) {
|
||||||
this.authService.isAuthenticated().then().catch()
|
this.authService.isAuthenticated()
|
||||||
this.updateActCount = this.updateService.totalCount;
|
this.updateActCount = this.updateService.totalCount;
|
||||||
this.updateService.addChangeListener(UpdateEvent.CountChange, () => {
|
this.updateService.addChangeListener(UpdateEvent.CountChange, () => {
|
||||||
this.updateActCount = updateService.totalCount;
|
this.updateActCount = updateService.totalCount;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Component, Inject } from '@angular/core';
|
import { Component, Inject } from '@angular/core';
|
||||||
import { MatListModule } from '@angular/material/list';
|
import { MatListModule } from '@angular/material/list';
|
||||||
import { User } from '../../../models/user-management.api.models'
|
import { User } from '../../../services/api/api-models'
|
||||||
import { MAT_BOTTOM_SHEET_DATA } from '@angular/material/bottom-sheet';
|
import { MAT_BOTTOM_SHEET_DATA } from '@angular/material/bottom-sheet';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { BaseTableComponent } from './base-table.component';
|
import { BaseTableComponent } from './base-table.component';
|
||||||
import { ApiService } from '../../../services/api/user-management.api.service';
|
import { ApiService } from '../../../services/api/api-service';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
|
|
||||||
describe('BaseTableComponent', () => {
|
describe('BaseTableComponent', () => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Component, Inject, Input, OnDestroy, OnInit, ViewChild, input } from '@angular/core';
|
import { Component, Inject, Input, OnDestroy, OnInit, ViewChild, input } from '@angular/core';
|
||||||
import { ApiService } from '../../../services/api/user-management.api.service';
|
import { ApiService } from '../../../services/api/api-service';
|
||||||
import { GuiGridModule, GuiColumn, GuiColumnMenu, GuiSorting, GuiRowDetail, GuiPaging, GuiPagingDisplay, GuiSearching, GuiCellEdit, GuiInfoPanel, GuiTitlePanel, GuiRowSelection, GuiSelectedRow, GuiGridComponent, GuiGridApi, GuiTheme, GuiRowStyle, GuiRowClass } from '@generic-ui/ngx-grid';
|
import { GuiGridModule, GuiColumn, GuiColumnMenu, GuiSorting, GuiRowDetail, GuiPaging, GuiPagingDisplay, GuiSearching, GuiCellEdit, GuiInfoPanel, GuiTitlePanel, GuiRowSelection, GuiSelectedRow, GuiGridComponent, GuiGridApi, GuiTheme, GuiRowStyle, GuiRowClass } from '@generic-ui/ngx-grid';
|
||||||
import { Subscription } from 'rxjs/internal/Subscription';
|
import { Subscription } from 'rxjs/internal/Subscription';
|
||||||
import { ColorModeService, Theme } from '../../../services/button/color-mode.service';
|
import { ColorModeService, Theme } from '../../../services/button/color-mode.service';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Component, Inject } from '@angular/core';
|
import { Component, Inject } from '@angular/core';
|
||||||
import { BaseTableComponent } from '../base-table/base-table.component';
|
import { BaseTableComponent } from '../base-table/base-table.component';
|
||||||
import { DirGroupService } from '../../../services/api/dir-group.service';
|
import { DirGroupService } from '../../../services/api/dir-group.service';
|
||||||
import { DirGroup } from '../../../models/user-management.api.models';
|
import { DirGroup } from '../../../services/api/api-models';
|
||||||
import { GuiGridModule } from '@generic-ui/ngx-grid';
|
import { GuiGridModule } from '@generic-ui/ngx-grid';
|
||||||
import { ColorModeService } from '../../../services/button/color-mode.service';
|
import { ColorModeService } from '../../../services/button/color-mode.service';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Component, Inject } from '@angular/core';
|
import { Component, Inject } from '@angular/core';
|
||||||
import { DirUser } from '../../../models/user-management.api.models';
|
import { DirUser } from '../../../services/api/api-models';
|
||||||
import { DirUserService } from '../../../services/api/dir-user.service';
|
import { DirUserService } from '../../../services/api/dir-user.service';
|
||||||
import { BaseTableComponent } from '../base-table/base-table.component';
|
import { BaseTableComponent } from '../base-table/base-table.component';
|
||||||
import { GuiGridModule, GuiColumn } from '@generic-ui/ngx-grid';
|
import { GuiGridModule, GuiColumn } from '@generic-ui/ngx-grid';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Component, Inject } from '@angular/core';
|
import { Component, Inject } from '@angular/core';
|
||||||
import { GroupService } from '../../../services/api/group.service';
|
import { GroupService } from '../../../services/api/group.service';
|
||||||
import { Group } from '../../../models/user-management.api.models';
|
import { Group } from '../../../services/api/api-models';
|
||||||
import { GuiGridModule, GuiColumn } from '@generic-ui/ngx-grid';
|
import { GuiGridModule, GuiColumn } from '@generic-ui/ngx-grid';
|
||||||
import { BaseTableComponent } from '../base-table/base-table.component';
|
import { BaseTableComponent } from '../base-table/base-table.component';
|
||||||
import { ColorModeService } from '../../../services/button/color-mode.service';
|
import { ColorModeService } from '../../../services/button/color-mode.service';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Component, Inject } from '@angular/core';
|
import { Component, Inject } from '@angular/core';
|
||||||
import { GroupOfUserService } from '../../../services/group-of-user.service';
|
import { GroupOfUserService } from '../../../services/group-of-user.service';
|
||||||
import { GroupOfUser } from '../../../models/user-management.api.models';
|
import { GroupOfUser } from '../../../services/api/api-models';
|
||||||
import { GuiGridModule, GuiColumn } from '@generic-ui/ngx-grid';
|
import { GuiGridModule, GuiColumn } from '@generic-ui/ngx-grid';
|
||||||
import { BaseTableComponent } from '../base-table/base-table.component';
|
import { BaseTableComponent } from '../base-table/base-table.component';
|
||||||
import { ColorModeService } from '../../../services/color-mode.service';
|
import { ColorModeService } from '../../../services/color-mode.service';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { Module } from '../../../models/user-management.api.models';
|
import { Module } from '../../../services/api/api-models';
|
||||||
import { GuiGridModule } from '@generic-ui/ngx-grid';
|
import { GuiGridModule } from '@generic-ui/ngx-grid';
|
||||||
import { BaseTableComponent } from '../base-table/base-table.component';
|
import { BaseTableComponent } from '../base-table/base-table.component';
|
||||||
import { ModuleService } from '../../../services/api/module.service'
|
import { ModuleService } from '../../../services/api/module.service'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { UserRep } from '../../../models/user-management.api.models';
|
import { UserRep } from '../../../services/api/api-models';
|
||||||
import { UserRepService } from '../../../services/api/user-representation.service';
|
import { UserRepService } from '../../../services/api/user-representation.service';
|
||||||
import { BaseTableComponent } from '../base-table/base-table.component';
|
import { BaseTableComponent } from '../base-table/base-table.component';
|
||||||
import { GuiGridModule } from '@generic-ui/ngx-grid';
|
import { GuiGridModule } from '@generic-ui/ngx-grid';
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Component } from '@angular/core';
|
|||||||
import { UserService } from '../../../services/api/user.service';
|
import { UserService } from '../../../services/api/user.service';
|
||||||
import { ModuleOfUserService } from '../../../services/api/module-of-user.service';
|
import { ModuleOfUserService } from '../../../services/api/module-of-user.service';
|
||||||
import { GroupOfUserService } from '../../../services/api/group-of-user.service';
|
import { GroupOfUserService } from '../../../services/api/group-of-user.service';
|
||||||
import { User } from '../../../models/user-management.api.models';
|
import { User } from '../../../services/api/api-models';
|
||||||
import { GuiGridModule } from '@generic-ui/ngx-grid';
|
import { GuiGridModule } from '@generic-ui/ngx-grid';
|
||||||
import { BaseTableComponent } from '../base-table/base-table.component';
|
import { BaseTableComponent } from '../base-table/base-table.component';
|
||||||
import { ColorModeService } from '../../../services/button/color-mode.service'
|
import { ColorModeService } from '../../../services/button/color-mode.service'
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { catchError, finalize } from 'rxjs/operators';
|
|||||||
import { DirGroupTableComponent } from '../tables/dir-group-table/dir-group-table.component';
|
import { DirGroupTableComponent } from '../tables/dir-group-table/dir-group-table.component';
|
||||||
import { DirUserTableComponent } from '../tables/dir-user-table/dir-user-table.component';
|
import { DirUserTableComponent } from '../tables/dir-user-table/dir-user-table.component';
|
||||||
import { UserService } from '../../services/api/user.service';
|
import { UserService } from '../../services/api/user.service';
|
||||||
import { User } from '../../models/user-management.api.models'
|
import { User } from '../../services/api/api-models'
|
||||||
import { RefreshService } from '../../services/button/refresh.service';
|
import { RefreshService } from '../../services/button/refresh.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { MatTabsModule } from '@angular/material/tabs';
|
|||||||
import { GuiCellEdit, GuiSelectedRow } from '@generic-ui/ngx-grid';
|
import { GuiCellEdit, GuiSelectedRow } from '@generic-ui/ngx-grid';
|
||||||
import { GroupFormComponent } from '../../components/forms/group-form/group-form.component';
|
import { GroupFormComponent } from '../../components/forms/group-form/group-form.component';
|
||||||
import { BasePageComponent } from '../base-page/base-page.component';
|
import { BasePageComponent } from '../base-page/base-page.component';
|
||||||
import { Group } from '../../models/user-management.api.models';
|
import { Group } from '../../services/api/api-models';
|
||||||
import { firstValueFrom, forkJoin } from 'rxjs';
|
import { firstValueFrom, forkJoin } from 'rxjs';
|
||||||
import Swal from 'sweetalert2';
|
import Swal from 'sweetalert2';
|
||||||
import { env } from '../../../environments/environment';
|
import { env } from '../../../environments/environment';
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { GuiRowSelection, GuiRowSelectionMode, GuiRowSelectionType, GuiSelectedR
|
|||||||
import { UserTableComponent } from '../../components/tables/user-table/user-table.component';
|
import { UserTableComponent } from '../../components/tables/user-table/user-table.component';
|
||||||
import { ModuleTableComponent } from '../../components/tables/module-table/module-table.component';
|
import { ModuleTableComponent } from '../../components/tables/module-table/module-table.component';
|
||||||
import { GroupTableComponent } from '../../components/tables/group-table/group-table.component';
|
import { GroupTableComponent } from '../../components/tables/group-table/group-table.component';
|
||||||
import { User } from '../../models/user-management.api.models';
|
import { User } from '../../services/api/api-models';
|
||||||
import { MatTabsModule, MatTabGroup } from '@angular/material/tabs';
|
import { MatTabsModule, MatTabGroup } from '@angular/material/tabs';
|
||||||
import { BasePageComponent } from '../base-page/base-page.component';
|
import { BasePageComponent } from '../base-page/base-page.component';
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import Swal from 'sweetalert2';
|
|||||||
import { MatTabsModule, MatTabGroup } from '@angular/material/tabs';
|
import { MatTabsModule, MatTabGroup } from '@angular/material/tabs';
|
||||||
import { env } from '../../../environments/environment';
|
import { env } from '../../../environments/environment';
|
||||||
import { BasePageComponent } from '../base-page/base-page.component';
|
import { BasePageComponent } from '../base-page/base-page.component';
|
||||||
import { Group, User, UserRep } from '../../models/user-management.api.models';
|
import { Group, User, UserRep } from '../../services/api/api-models';
|
||||||
import { RepCreateFormComponent } from '../../components/forms/rep-create-form/rep-create-form.component';
|
import { RepCreateFormComponent } from '../../components/forms/rep-create-form/rep-create-form.component';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { BaseTableComponent } from '../../components/tables/base-table/base-table.component';
|
import { BaseTableComponent } from '../../components/tables/base-table/base-table.component';
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { GroupTableComponent } from '../../components/tables/group-table/group-t
|
|||||||
import { ModuleTableComponent } from '../../components/tables/module-table/module-table.component';
|
import { ModuleTableComponent } from '../../components/tables/module-table/module-table.component';
|
||||||
import { UserCreateFormComponent } from '../../components/forms/user-create-form/user-create-form.component';
|
import { UserCreateFormComponent } from '../../components/forms/user-create-form/user-create-form.component';
|
||||||
import { BasePageComponent } from '../base-page/base-page.component';
|
import { BasePageComponent } from '../base-page/base-page.component';
|
||||||
import { User } from '../../models/user-management.api.models';
|
import { User } from '../../services/api/api-models';
|
||||||
import { firstValueFrom, forkJoin } from 'rxjs';
|
import { firstValueFrom, forkJoin } from 'rxjs';
|
||||||
import Swal from 'sweetalert2';
|
import Swal from 'sweetalert2';
|
||||||
import { env } from '../../../environments/environment'
|
import { env } from '../../../environments/environment'
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ export interface User {
|
|||||||
language?: string;
|
language?: string;
|
||||||
comment?: string;
|
comment?: string;
|
||||||
deleted?: boolean;
|
deleted?: boolean;
|
||||||
|
deletedWhen?: Date;
|
||||||
|
deletedWho?: string;
|
||||||
dateFormat?: string;
|
dateFormat?: string;
|
||||||
addedWho?: string;
|
addedWho?: string;
|
||||||
addedWhen?: Date;
|
addedWhen?: Date;
|
||||||
@@ -70,7 +72,7 @@ export interface UserRep {
|
|||||||
repUser?: User
|
repUser?: User
|
||||||
user?: User,
|
user?: User,
|
||||||
repGroup?: Group,
|
repGroup?: Group,
|
||||||
group?: Group,
|
group?: Group,
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DirGroup {
|
export interface DirGroup {
|
||||||
@@ -17,21 +17,22 @@ export class AuthenticationService {
|
|||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private http: HttpClient,
|
private http: HttpClient,
|
||||||
urlService : UrlService)
|
urlService: UrlService) {
|
||||||
{
|
this.loginUrl = urlService.apiRoute.login;
|
||||||
this.loginUrl = urlService.apiRoute.login;
|
this.logoutUrl = urlService.apiRoute.logout;
|
||||||
this.logoutUrl = urlService.apiRoute.logout;
|
this.checkUrl = urlService.apiRoute.loginCheck;
|
||||||
this.checkUrl = urlService.apiRoute.loginCheck;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
async isAuthenticated(): Promise<boolean> {
|
async isAuthenticated(): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
const response = await firstValueFrom(this.http.get<boolean>(this.checkUrl, { withCredentials: true }));
|
const response = await firstValueFrom(this.http.get(this.checkUrl, { withCredentials: true, observe: 'response' }));
|
||||||
_isLogedIn = response;
|
_isLogedIn = response?.status === 200;
|
||||||
return response;
|
return _isLogedIn;
|
||||||
} catch (error) {
|
} catch (error: any) {
|
||||||
this.showErrorAlert();
|
if (error?.status !== 401)
|
||||||
return false;
|
this.showErrorAlert();
|
||||||
|
_isLogedIn = false
|
||||||
|
return _isLogedIn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,4 +82,4 @@ export class AuthenticationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let _isLogedIn: boolean = false;
|
let _isLogedIn: boolean = false;
|
||||||
export const IsLogedIn = () => _isLogedIn
|
export const IsLogedIn = () => _isLogedIn
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Injectable, Inject } from '@angular/core';
|
import { Injectable, Inject } from '@angular/core';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { DirGroup, } from '../../models/user-management.api.models';
|
import { DirGroup, } from './api-models';
|
||||||
import { ApiService } from './user-management.api.service';
|
import { ApiService } from './api-service';
|
||||||
import { Observable } from 'rxjs/internal/Observable';
|
import { Observable } from 'rxjs/internal/Observable';
|
||||||
import Swal from 'sweetalert2';
|
import Swal from 'sweetalert2';
|
||||||
import { UrlService } from './url.service';
|
import { UrlService } from './url.service';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Injectable, Inject } from '@angular/core';
|
import { Injectable, Inject } from '@angular/core';
|
||||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||||
import { DirUser } from '../../models/user-management.api.models';
|
import { DirUser } from './api-models';
|
||||||
import { ApiService } from './user-management.api.service';
|
import { ApiService } from './api-service';
|
||||||
import { Observable } from 'rxjs/internal/Observable';
|
import { Observable } from 'rxjs/internal/Observable';
|
||||||
import { UrlService } from './url.service';
|
import { UrlService } from './url.service';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { Inject, Injectable } from '@angular/core';
|
import { Inject, Injectable } from '@angular/core';
|
||||||
import { DirUser } from '../../models/user-management.api.models';
|
import { DirUser } from './api-models';
|
||||||
import { UrlService } from './url.service';
|
import { UrlService } from './url.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||||
import { GroupOfUser } from '../../models/user-management.api.models';
|
import { GroupOfUser } from './api-models';
|
||||||
import { ApiService } from './user-management.api.service';
|
import { ApiService } from './api-service';
|
||||||
import { Observable, firstValueFrom } from 'rxjs';
|
import { Observable, firstValueFrom } from 'rxjs';
|
||||||
import { UrlService } from './url.service';
|
import { UrlService } from './url.service';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Injectable, Inject } from '@angular/core';
|
import { Injectable, Inject } from '@angular/core';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { DirGroup, Group, } from '../../models/user-management.api.models';
|
import { DirGroup, Group, } from './api-models';
|
||||||
import { ApiService } from './user-management.api.service';
|
import { ApiService } from './api-service';
|
||||||
import { Observable } from 'rxjs/internal/Observable';
|
import { Observable } from 'rxjs/internal/Observable';
|
||||||
import { UrlService } from './url.service';
|
import { UrlService } from './url.service';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Injectable, Inject } from '@angular/core';
|
import { Injectable, Inject } from '@angular/core';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { ModuleOfUser } from '../../models/user-management.api.models';
|
import { ModuleOfUser } from './api-models';
|
||||||
import { ApiService } from './user-management.api.service';
|
import { ApiService } from './api-service';
|
||||||
import { Observable, firstValueFrom } from 'rxjs';
|
import { Observable, firstValueFrom } from 'rxjs';
|
||||||
import { UrlService } from './url.service';
|
import { UrlService } from './url.service';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Injectable, Inject } from '@angular/core';
|
import { Injectable, Inject } from '@angular/core';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { ApiService } from './user-management.api.service';
|
import { ApiService } from './api-service';
|
||||||
import { Module } from '../../models/user-management.api.models';
|
import { Module } from './api-models';
|
||||||
import { UrlService } from './url.service';
|
import { UrlService } from './url.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Inject, Injectable } from "@angular/core";
|
import { Inject, Injectable } from "@angular/core";
|
||||||
import { UserRep } from "../../models/user-management.api.models";
|
import { UserRep } from "./api-models";
|
||||||
import { ApiService } from "./user-management.api.service";
|
import { ApiService } from "./api-service";
|
||||||
import { HttpClient, HttpParams } from "@angular/common/http";
|
import { HttpClient, HttpParams } from "@angular/common/http";
|
||||||
import { Observable } from "rxjs";
|
import { Observable } from "rxjs";
|
||||||
import { UrlService } from "./url.service";
|
import { UrlService } from "./url.service";
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Injectable, Inject } from '@angular/core';
|
import { Injectable, Inject } from '@angular/core';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { DirUser, User } from '../../models/user-management.api.models';
|
import { DirUser, User } from './api-models';
|
||||||
import { ApiService } from './user-management.api.service';
|
import { ApiService } from './api-service';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { UrlService } from './url.service';
|
import { UrlService } from './url.service';
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using DigitalData.UserManager.Application.DTOs.Auth;
|
using DigitalData.UserManager.Application.DTOs.Auth;
|
||||||
using DigitalData.UserManager.Application.Contracts;
|
using DigitalData.UserManager.Application.Contracts;
|
||||||
using DigitalData.Core.DTO;
|
|
||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
using DigitalData.UserManager.Application;
|
using DigitalData.UserManager.Application;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.API.Controllers;
|
namespace DigitalData.UserManager.API.Controllers;
|
||||||
|
|
||||||
@@ -13,10 +13,13 @@ namespace DigitalData.UserManager.API.Controllers;
|
|||||||
[ApiController]
|
[ApiController]
|
||||||
public class AuthController : ControllerBase
|
public class AuthController : ControllerBase
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
private readonly ILogger<UserController> _logger;
|
private readonly ILogger<UserController> _logger;
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
private readonly IUserService _userService;
|
private readonly IUserService _userService;
|
||||||
private readonly IStringLocalizer<Resource> _localizer;
|
private readonly IStringLocalizer<Resource> _localizer;
|
||||||
|
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public AuthController(ILogger<UserController> logger, IUserService userService, IStringLocalizer<Resource> localizer)
|
public AuthController(ILogger<UserController> logger, IUserService userService, IStringLocalizer<Resource> localizer)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
@@ -34,6 +37,7 @@ public class AuthController : ControllerBase
|
|||||||
|
|
||||||
[Authorize]
|
[Authorize]
|
||||||
[HttpGet("user")]
|
[HttpGet("user")]
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public async Task<IActionResult> GetUserWithClaims()
|
public async Task<IActionResult> GetUserWithClaims()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using DigitalData.Core.API;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.API;
|
||||||
using DigitalData.UserManager.Application.Contracts;
|
using DigitalData.UserManager.Application.Contracts;
|
||||||
using DigitalData.UserManager.Application.DTOs.Base;
|
using DigitalData.UserManager.Application.DTOs.Base;
|
||||||
using DigitalData.UserManager.Application.DTOs.User;
|
using DigitalData.UserManager.Application.DTOs.User;
|
||||||
@@ -10,6 +10,7 @@ using System.Security.Claims;
|
|||||||
namespace DigitalData.UserManager.API.Controllers;
|
namespace DigitalData.UserManager.API.Controllers;
|
||||||
|
|
||||||
[Authorize]
|
[Authorize]
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class BaseAuthController<TCRUDService, TCreateDto, TReadDto, TUpdateDto, TBaseEntity> : CRUDControllerBaseWithErrorHandling<TCRUDService, TCreateDto, TReadDto, TUpdateDto, TBaseEntity, int>
|
public class BaseAuthController<TCRUDService, TCreateDto, TReadDto, TUpdateDto, TBaseEntity> : CRUDControllerBaseWithErrorHandling<TCRUDService, TCreateDto, TReadDto, TUpdateDto, TBaseEntity, int>
|
||||||
where TCRUDService : IBaseService<TCreateDto, TReadDto, TBaseEntity>
|
where TCRUDService : IBaseService<TCreateDto, TReadDto, TBaseEntity>
|
||||||
where TCreateDto : BaseCreateDto
|
where TCreateDto : BaseCreateDto
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.UserManager.Application.Contracts;
|
||||||
using DigitalData.UserManager.Application.Contracts;
|
|
||||||
using DigitalData.UserManager.Application.DTOs;
|
using DigitalData.UserManager.Application.DTOs;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Caching.Memory;
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
@@ -7,14 +6,16 @@ using System.Diagnostics.CodeAnalysis;
|
|||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using DigitalData.UserManager.Application;
|
using DigitalData.UserManager.Application;
|
||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
using DigitalData.Core.DTO;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using DigitalData.Core.Abstraction.Application;
|
||||||
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.API.Controllers;
|
namespace DigitalData.UserManager.API.Controllers;
|
||||||
|
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
[SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "<Pending>")]
|
[SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "<Pending>")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class DirectoryController : ControllerBase
|
public class DirectoryController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly IUserService _userService;
|
private readonly IUserService _userService;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using DigitalData.UserManager.Application.Contracts;
|
using DigitalData.UserManager.Application.Contracts;
|
||||||
using DigitalData.UserManager.Application.DTOs.Group;
|
using DigitalData.UserManager.Application.DTOs.Group;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
@@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
namespace DigitalData.UserManager.API.Controllers;
|
namespace DigitalData.UserManager.API.Controllers;
|
||||||
|
|
||||||
[Authorize]
|
[Authorize]
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class GroupController : BaseAuthController<IGroupService, GroupCreateDto, GroupReadDto, GroupUpdateDto, Group>
|
public class GroupController : BaseAuthController<IGroupService, GroupCreateDto, GroupReadDto, GroupUpdateDto, Group>
|
||||||
{
|
{
|
||||||
public GroupController(ILogger<GroupController> logger, IGroupService service, IUserService userService) : base(logger, service, userService)
|
public GroupController(ILogger<GroupController> logger, IGroupService service, IUserService userService) : base(logger, service, userService)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using DigitalData.UserManager.Application.Contracts;
|
using DigitalData.UserManager.Application.Contracts;
|
||||||
using DigitalData.UserManager.Application.DTOs.GroupOfUser;
|
using DigitalData.UserManager.Application.DTOs.GroupOfUser;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
@@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
namespace DigitalData.UserManager.API.Controllers;
|
namespace DigitalData.UserManager.API.Controllers;
|
||||||
|
|
||||||
[Authorize]
|
[Authorize]
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class GroupOfUserController : BaseAuthController<IGroupOfUserService, GroupOfUserCreateDto, GroupOfUserReadDto, GroupOfUserUpdateDto, GroupOfUser>
|
public class GroupOfUserController : BaseAuthController<IGroupOfUserService, GroupOfUserCreateDto, GroupOfUserReadDto, GroupOfUserUpdateDto, GroupOfUser>
|
||||||
{
|
{
|
||||||
public GroupOfUserController(ILogger<GroupOfUserController> logger, IGroupOfUserService service, IUserService userService) : base(logger, service, userService)
|
public GroupOfUserController(ILogger<GroupOfUserController> logger, IGroupOfUserService service, IUserService userService) : base(logger, service, userService)
|
||||||
|
|||||||
@@ -7,8 +7,10 @@ using Microsoft.AspNetCore.Authorization;
|
|||||||
namespace DigitalData.UserManager.API.Controllers;
|
namespace DigitalData.UserManager.API.Controllers;
|
||||||
|
|
||||||
[Authorize]
|
[Authorize]
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class ModuleController : ReadControllerBaseWithErrorHandling<IModuleService, ModuleDto, Module, int>
|
public class ModuleController : ReadControllerBaseWithErrorHandling<IModuleService, ModuleDto, Module, int>
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public ModuleController(ILogger<ModuleController> logger, IModuleService service) : base(logger, service)
|
public ModuleController(ILogger<ModuleController> logger, IModuleService service) : base(logger, service)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using DigitalData.Core.API;
|
using DigitalData.Core.API;
|
||||||
using DigitalData.Core.DTO;
|
|
||||||
using DigitalData.UserManager.Application.Contracts;
|
using DigitalData.UserManager.Application.Contracts;
|
||||||
using DigitalData.UserManager.Application.DTOs.ModuleOfUser;
|
using DigitalData.UserManager.Application.DTOs.ModuleOfUser;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
@@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
namespace DigitalData.UserManager.API.Controllers;
|
namespace DigitalData.UserManager.API.Controllers;
|
||||||
|
|
||||||
[Authorize]
|
[Authorize]
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class ModuleOfUserController : CRUDControllerBaseWithErrorHandling<IModuleOfUserService, ModuleOfUserCreateDto, ModuleOfUserReadDto, ModuleOfUserUpdateDto, ModuleOfUser, int>
|
public class ModuleOfUserController : CRUDControllerBaseWithErrorHandling<IModuleOfUserService, ModuleOfUserCreateDto, ModuleOfUserReadDto, ModuleOfUserUpdateDto, ModuleOfUser, int>
|
||||||
{
|
{
|
||||||
public ModuleOfUserController(ILogger<ModuleOfUserController> logger, IModuleOfUserService service) : base(logger, service)
|
public ModuleOfUserController(ILogger<ModuleOfUserController> logger, IModuleOfUserService service) : base(logger, service)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using DigitalData.UserManager.Application.Contracts;
|
using DigitalData.UserManager.Application.Contracts;
|
||||||
using DigitalData.UserManager.Application.DTOs.User;
|
using DigitalData.UserManager.Application.DTOs.User;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
@@ -8,6 +8,9 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
namespace DigitalData.UserManager.API.Controllers;
|
namespace DigitalData.UserManager.API.Controllers;
|
||||||
|
|
||||||
[Authorize]
|
[Authorize]
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[ApiController]
|
||||||
public class UserController : BaseAuthController<IUserService, UserCreateDto, UserReadDto, UserUpdateDto, User>
|
public class UserController : BaseAuthController<IUserService, UserCreateDto, UserReadDto, UserUpdateDto, User>
|
||||||
{
|
{
|
||||||
public UserController(ILogger<UserController> logger, IUserService service) : base(logger, service, service)
|
public UserController(ILogger<UserController> logger, IUserService service) : base(logger, service, service)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using DigitalData.UserManager.Application.Contracts;
|
using DigitalData.UserManager.Application.Contracts;
|
||||||
using DigitalData.UserManager.Application.DTOs.UserRep;
|
using DigitalData.UserManager.Application.DTOs.UserRep;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
@@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
namespace DigitalData.UserManager.API.Controllers;
|
namespace DigitalData.UserManager.API.Controllers;
|
||||||
|
|
||||||
[Authorize]
|
[Authorize]
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class UserRepController : BaseAuthController<IUserRepService, UserRepCreateDto, UserRepReadDto, UserRepUpdateDto, UserRep>
|
public class UserRepController : BaseAuthController<IUserRepService, UserRepCreateDto, UserRepReadDto, UserRepUpdateDto, UserRep>
|
||||||
{
|
{
|
||||||
public UserRepController(ILogger<UserRepController> logger, IUserRepService service, IUserService userService) : base(logger, service, userService)
|
public UserRepController(ILogger<UserRepController> logger, IUserRepService service, IUserService userService) : base(logger, service, userService)
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
|
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Version>6.0.1</Version>
|
<Version>6.1.2</Version>
|
||||||
<AssemblyVersion>6.0.1</AssemblyVersion>
|
<AssemblyVersion>6.1.2</AssemblyVersion>
|
||||||
<FileVersion>6.0.1</FileVersion>
|
<FileVersion>6.1.2</FileVersion>
|
||||||
<PackageIcon>icon.png</PackageIcon>
|
<PackageIcon>icon.png</PackageIcon>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
@@ -21,8 +21,9 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="DigitalData.Auth.Client" Version="1.3.5" />
|
<PackageReference Include="DigitalData.Auth.Client" Version="1.3.7" />
|
||||||
<PackageReference Include="DigitalData.Core.API" Version="2.1.1" />
|
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.0.0" />
|
||||||
|
<PackageReference Include="DigitalData.Core.API" Version="2.2.1" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.14" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.14" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.20" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.20" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.4" />
|
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.4" />
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using DigitalData.UserManager.Infrastructure.Repositories;
|
|
||||||
using DigitalData.UserManager.Application;
|
using DigitalData.UserManager.Application;
|
||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
|
||||||
using NLog.Web;
|
using NLog.Web;
|
||||||
using NLog;
|
using NLog;
|
||||||
using DigitalData.Core.API;
|
using DigitalData.Core.API;
|
||||||
@@ -31,8 +29,11 @@ try {
|
|||||||
|
|
||||||
builder.Services.AddEncryptor(builder.Configuration.GetSection("EncryptionParameters"));
|
builder.Services.AddEncryptor(builder.Configuration.GetSection("EncryptionParameters"));
|
||||||
|
|
||||||
builder.Logging.ClearProviders();
|
if (!builder.Environment.IsDevelopment())
|
||||||
builder.Host.UseNLog();
|
{
|
||||||
|
builder.Logging.ClearProviders();
|
||||||
|
builder.Host.UseNLog();
|
||||||
|
}
|
||||||
|
|
||||||
builder.Services.AddControllers(opt =>
|
builder.Services.AddControllers(opt =>
|
||||||
{
|
{
|
||||||
@@ -50,27 +51,12 @@ try {
|
|||||||
builder.Services.AddSwaggerGen();
|
builder.Services.AddSwaggerGen();
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.Services.AddControllers(opt =>
|
|
||||||
{
|
|
||||||
opt.Conventions.Add(new RemoveIfControllerConvention()
|
|
||||||
.AndIf(c => c.ControllerName == nameof(EncryptionController).Replace("Controller", ""))
|
|
||||||
.AndIf(c => !config.GetValue<bool>("UseEncryptor")));
|
|
||||||
});
|
|
||||||
|
|
||||||
builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
|
|
||||||
.AddCookie(options =>
|
|
||||||
{
|
|
||||||
options.Cookie.HttpOnly = true; // Makes the cookie inaccessible to client-side scripts for security
|
|
||||||
options.Cookie.SecurePolicy = CookieSecurePolicy.SameAsRequest; // Ensures cookies are sent over HTTPS only
|
|
||||||
options.Cookie.SameSite = SameSiteMode.Strict; // Protects against CSRF attacks by restricting how cookies are sent with requests from external sites
|
|
||||||
options.LoginPath = "/api/auth/login";
|
|
||||||
options.LogoutPath = "/api/auth/logout";
|
|
||||||
});
|
|
||||||
|
|
||||||
// Once the app is built, the password will be decrypted with Encryptor. lazy loading also acts as a call back method.
|
// Once the app is built, the password will be decrypted with Encryptor. lazy loading also acts as a call back method.
|
||||||
Lazy<string>? cnn_str = null;
|
Lazy<string>? cnn_str = null;
|
||||||
|
|
||||||
|
#pragma warning disable CS0618 // Type or member is obsolete
|
||||||
builder.Services.AddUserManager(options => options.UseSqlServer(cnn_str!.Value).EnableSensitiveDataLogging());
|
builder.Services.AddUserManager(options => options.UseSqlServer(cnn_str!.Value).EnableSensitiveDataLogging());
|
||||||
|
#pragma warning restore CS0618 // Type or member is obsolete
|
||||||
|
|
||||||
var allowedOrigins = builder.Configuration.GetSection("AllowedOrigins").Get<string[]>() ?? throw new InvalidOperationException("In appsettings there is no allowed origin.");
|
var allowedOrigins = builder.Configuration.GetSection("AllowedOrigins").Get<string[]>() ?? throw new InvalidOperationException("In appsettings there is no allowed origin.");
|
||||||
|
|
||||||
@@ -99,45 +85,44 @@ try {
|
|||||||
|
|
||||||
var authTokenKeys = config.GetSection(nameof(AuthTokenKeys)).Get<AuthTokenKeys>() ?? new();
|
var authTokenKeys = config.GetSection(nameof(AuthTokenKeys)).Get<AuthTokenKeys>() ?? new();
|
||||||
|
|
||||||
builder.Services
|
builder.Services.AddAuthentication(options =>
|
||||||
.AddAuthentication(options =>
|
{
|
||||||
{
|
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
|
||||||
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
|
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
|
||||||
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
|
})
|
||||||
})
|
.AddJwtBearer(opt =>
|
||||||
.AddJwtBearer(opt =>
|
|
||||||
{
|
|
||||||
opt.TokenValidationParameters = new TokenValidationParameters
|
|
||||||
{
|
{
|
||||||
ValidateIssuerSigningKey = true,
|
opt.TokenValidationParameters = new TokenValidationParameters
|
||||||
IssuerSigningKeyResolver = (token, securityToken, identifier, parameters) =>
|
|
||||||
{
|
{
|
||||||
var clientParams = lazyProvider.GetRequiredService<IOptions<ClientParams>>()?.Value;
|
ValidateIssuerSigningKey = true,
|
||||||
var publicKey = clientParams!.PublicKeys.Get(authTokenKeys.Issuer, authTokenKeys.Audience);
|
IssuerSigningKeyResolver = (token, securityToken, identifier, parameters) =>
|
||||||
return new List<SecurityKey>() { publicKey.SecurityKey };
|
|
||||||
},
|
|
||||||
ValidateIssuer = true,
|
|
||||||
ValidIssuer = authTokenKeys.Issuer,
|
|
||||||
ValidateAudience = true,
|
|
||||||
ValidAudience = authTokenKeys.Audience,
|
|
||||||
};
|
|
||||||
|
|
||||||
opt.Events = new JwtBearerEvents
|
|
||||||
{
|
|
||||||
OnMessageReceived = context =>
|
|
||||||
{
|
|
||||||
// if there is no token read related cookie or query string
|
|
||||||
if (context.Token is null) // if there is no token
|
|
||||||
{
|
{
|
||||||
if (context.Request.Cookies.TryGetValue(authTokenKeys.Cookie, out var cookieToken) && cookieToken is not null)
|
var clientParams = lazyProvider.GetRequiredService<IOptions<ClientParams>>()?.Value;
|
||||||
context.Token = cookieToken;
|
var publicKey = clientParams!.PublicKeys.Get(authTokenKeys.Issuer, authTokenKeys.Audience);
|
||||||
else if (context.Request.Query.TryGetValue(authTokenKeys.QueryString, out var queryStrToken))
|
return new List<SecurityKey>() { publicKey.SecurityKey };
|
||||||
context.Token = queryStrToken;
|
},
|
||||||
|
ValidateIssuer = true,
|
||||||
|
ValidIssuer = authTokenKeys.Issuer,
|
||||||
|
ValidateAudience = true,
|
||||||
|
ValidAudience = authTokenKeys.Audience,
|
||||||
|
};
|
||||||
|
|
||||||
|
opt.Events = new JwtBearerEvents
|
||||||
|
{
|
||||||
|
OnMessageReceived = context =>
|
||||||
|
{
|
||||||
|
// if there is no token read related cookie or query string
|
||||||
|
if (context.Token is null) // if there is no token
|
||||||
|
{
|
||||||
|
if (context.Request.Cookies.TryGetValue(authTokenKeys.Cookie, out var cookieToken) && cookieToken is not null)
|
||||||
|
context.Token = cookieToken;
|
||||||
|
else if (context.Request.Query.TryGetValue(authTokenKeys.QueryString, out var queryStrToken))
|
||||||
|
context.Token = queryStrToken;
|
||||||
|
}
|
||||||
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
return Task.CompletedTask;
|
};
|
||||||
}
|
});
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
builder.Services.AddSwaggerGen(setupAct =>
|
builder.Services.AddSwaggerGen(setupAct =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
|||||||
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||||
<ExcludeApp_Data>false</ExcludeApp_Data>
|
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||||
<ProjectGuid>07ccd651-647c-49f7-9715-30cebc13710d</ProjectGuid>
|
<ProjectGuid>07ccd651-647c-49f7-9715-30cebc13710d</ProjectGuid>
|
||||||
<DesktopBuildPackageLocation>P:\Install .Net\0 DD - Smart UP\DD-UserManager\Web\$(Version)\$(Version).zip</DesktopBuildPackageLocation>
|
<DesktopBuildPackageLocation>P:\Install .Net\0 DD - Smart UP\DD-UserManager\API\$(Version)\$(Version).zip</DesktopBuildPackageLocation>
|
||||||
<PackageAsSingleFile>true</PackageAsSingleFile>
|
<PackageAsSingleFile>true</PackageAsSingleFile>
|
||||||
<DeployIisAppPath>UserManager.API</DeployIisAppPath>
|
<DeployIisAppPath>UserManager.API</DeployIisAppPath>
|
||||||
<_TargetId>IISWebDeployPackage</_TargetId>
|
<_TargetId>IISWebDeployPackage</_TargetId>
|
||||||
|
|||||||
@@ -77,7 +77,7 @@
|
|||||||
"UseEncryptor": true,
|
"UseEncryptor": true,
|
||||||
"UseSwagger": true,
|
"UseSwagger": true,
|
||||||
"AuthClientParams": {
|
"AuthClientParams": {
|
||||||
"Url": "https://localhost:7192/auth-hub",
|
"Url": "https://localhost:9090/auth-hub",
|
||||||
"PublicKeys": [
|
"PublicKeys": [
|
||||||
{
|
{
|
||||||
"Issuer": "auth.digitaldata.works",
|
"Issuer": "auth.digitaldata.works",
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
using DigitalData.Core.Abstractions.Application;
|
|
||||||
using DigitalData.UserManager.Application.DTOs.User;
|
using DigitalData.UserManager.Application.DTOs.User;
|
||||||
using DigitalData.UserManager.Application.DTOs.Base;
|
using DigitalData.UserManager.Application.DTOs.Base;
|
||||||
|
using DigitalData.Core.Abstraction.Application;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Application.Contracts
|
namespace DigitalData.UserManager.Application.Contracts
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public interface IBaseService<TCreateDto, TReadDto, TBaseEntity> : ICRUDService<TCreateDto, TReadDto, TBaseEntity, int>
|
public interface IBaseService<TCreateDto, TReadDto, TBaseEntity> : ICRUDService<TCreateDto, TReadDto, TBaseEntity, int>
|
||||||
where TCreateDto : BaseCreateDto
|
where TCreateDto : BaseCreateDto
|
||||||
where TReadDto : class
|
where TReadDto : class
|
||||||
@@ -14,5 +15,5 @@ namespace DigitalData.UserManager.Application.Contracts
|
|||||||
public Func<Task<UserReadDto?>> UserFactoryAsync { set; }
|
public Func<Task<UserReadDto?>> UserFactoryAsync { set; }
|
||||||
|
|
||||||
public Task<UserReadDto?> GetUserAsync();
|
public Task<UserReadDto?> GetUserAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
using DigitalData.UserManager.Application.DTOs.GroupOfUser;
|
using DigitalData.UserManager.Application.DTOs.GroupOfUser;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Application.Contracts
|
namespace DigitalData.UserManager.Application.Contracts
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public interface IGroupOfUserService : IBaseService<GroupOfUserCreateDto, GroupOfUserReadDto, GroupOfUser>
|
public interface IGroupOfUserService : IBaseService<GroupOfUserCreateDto, GroupOfUserReadDto, GroupOfUser>
|
||||||
{
|
{
|
||||||
Task<Result> DeleteAsyncByGroupUserId(int groupId, int userId);
|
Task<Result> DeleteAsyncByGroupUserId(int groupId, int userId);
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
using DigitalData.UserManager.Application.DTOs.Group;
|
using DigitalData.UserManager.Application.DTOs.Group;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Application.Contracts
|
namespace DigitalData.UserManager.Application.Contracts
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public interface IGroupService : IBaseService<GroupCreateDto, GroupReadDto, Group>
|
public interface IGroupService : IBaseService<GroupCreateDto, GroupReadDto, Group>
|
||||||
{
|
{
|
||||||
Task<DataResult<int>> CreateAsync(DirectoryGroupDto dirGroup);
|
Task<DataResult<int>> CreateAsync(DirectoryGroupDto dirGroup);
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
using DigitalData.UserManager.Application.DTOs.ModuleOfUser;
|
using DigitalData.UserManager.Application.DTOs.ModuleOfUser;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Application.Contracts
|
namespace DigitalData.UserManager.Application.Contracts
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public interface IModuleOfUserService : ICRUDService<ModuleOfUserCreateDto, ModuleOfUserReadDto, ModuleOfUser, int>
|
public interface IModuleOfUserService : ICRUDService<ModuleOfUserCreateDto, ModuleOfUserReadDto, ModuleOfUser, int>
|
||||||
{
|
{
|
||||||
Task<Result> DeleteAsyncByModuleUserId(int moduleId, int userId);
|
Task<Result> DeleteAsyncByModuleUserId(int moduleId, int userId);
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
using DigitalData.Core.Abstractions.Application;
|
using DigitalData.Core.Abstraction.Application;
|
||||||
using DigitalData.UserManager.Application.DTOs.Module;
|
using DigitalData.UserManager.Application.DTOs.Module;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Application.Contracts
|
namespace DigitalData.UserManager.Application.Contracts
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public interface IModuleService : IBasicCRUDService<ModuleDto, Module, int>
|
public interface IModuleService : IBasicCRUDService<ModuleDto, Module, int>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
using DigitalData.UserManager.Application.DTOs.UserRep;
|
using DigitalData.UserManager.Application.DTOs.UserRep;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Application.Contracts
|
namespace DigitalData.UserManager.Application.Contracts
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public interface IUserRepService : IBaseService<UserRepCreateDto, UserRepReadDto, UserRep>
|
public interface IUserRepService : IBaseService<UserRepCreateDto, UserRepReadDto, UserRep>
|
||||||
{
|
{
|
||||||
Task<DataResult<IEnumerable<UserRepReadDto>>> ReadAllAsync(bool withUser = false, bool withRepGroup = false, bool withGroup = false, bool withRepUser = false, int? userId = null, int? groupId = null);
|
Task<DataResult<IEnumerable<UserRepReadDto>>> ReadAllAsync(bool withUser = false, bool withRepGroup = false, bool withGroup = false, bool withRepUser = false, int? userId = null, int? groupId = null);
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
using DigitalData.UserManager.Application.DTOs.User;
|
using DigitalData.UserManager.Application.DTOs.User;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Application.Contracts
|
namespace DigitalData.UserManager.Application.Contracts
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public interface IUserService : IBaseService<UserCreateDto, UserReadDto, User>
|
public interface IUserService : IBaseService<UserCreateDto, UserReadDto, User>
|
||||||
{
|
{
|
||||||
Task<DataResult<IEnumerable<UserReadDto>>> ReadByModuleIdAsync(int moduleId);
|
Task<DataResult<IEnumerable<UserReadDto>>> ReadByModuleIdAsync(int moduleId);
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Application.Contracts.Repositories;
|
namespace DigitalData.UserManager.Application.Contracts.Repositories;
|
||||||
|
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
public interface IClientUserRepository : ICRUDRepository<ClientUser, int>
|
public interface IClientUserRepository : ICRUDRepository<ClientUser, int>
|
||||||
{
|
{
|
||||||
Task<IEnumerable<ClientUser>> ReadAsync(bool readOnly = true, int? userId = null);
|
Task<IEnumerable<ClientUser>> ReadAsync(bool readOnly = true, int? userId = null);
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Application.Contracts.Repositories;
|
namespace DigitalData.UserManager.Application.Contracts.Repositories;
|
||||||
|
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
public interface IGroupOfUserRepository : ICRUDRepository<GroupOfUser, int>
|
public interface IGroupOfUserRepository : ICRUDRepository<GroupOfUser, int>
|
||||||
{
|
{
|
||||||
IQueryable<GroupOfUser> ReadByGroupId(int groupId);
|
IQueryable<GroupOfUser> ReadByGroupId(int groupId);
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Application.Contracts.Repositories;
|
namespace DigitalData.UserManager.Application.Contracts.Repositories;
|
||||||
|
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
public interface IGroupRepository : ICRUDRepository<Group, int>
|
public interface IGroupRepository : ICRUDRepository<Group, int>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Application.Contracts.Repositories;
|
namespace DigitalData.UserManager.Application.Contracts.Repositories;
|
||||||
|
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
public interface IModuleOfUserRepository : ICRUDRepository<ModuleOfUser, int>
|
public interface IModuleOfUserRepository : ICRUDRepository<ModuleOfUser, int>
|
||||||
{
|
{
|
||||||
IQueryable<ModuleOfUser> ReadByModuleId(int moduleId);
|
IQueryable<ModuleOfUser> ReadByModuleId(int moduleId);
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Application.Contracts.Repositories;
|
namespace DigitalData.UserManager.Application.Contracts.Repositories;
|
||||||
|
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
public interface IModuleRepository : ICRUDRepository<Module, int>
|
public interface IModuleRepository : ICRUDRepository<Module, int>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Application.Contracts.Repositories;
|
namespace DigitalData.UserManager.Application.Contracts.Repositories;
|
||||||
|
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
public interface IUserRepRepository : ICRUDRepository<UserRep, int>
|
public interface IUserRepRepository : ICRUDRepository<UserRep, int>
|
||||||
{
|
{
|
||||||
Task<IEnumerable<UserRep>> ReadAllAsync(
|
Task<IEnumerable<UserRep>> ReadAllAsync(
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Application.Contracts.Repositories;
|
namespace DigitalData.UserManager.Application.Contracts.Repositories;
|
||||||
|
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
public interface IUserRepository : ICRUDRepository<User, int>
|
public interface IUserRepository : ICRUDRepository<User, int>
|
||||||
{
|
{
|
||||||
Task<IEnumerable<User>> ReadByModuleIdAsync(int moduleId);
|
Task<IEnumerable<User>> ReadByModuleIdAsync(int moduleId);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ namespace DigitalData.UserManager.Application
|
|||||||
/// <typeparam name="TDbContext">The type of the DbContext to use for the repositories.</typeparam>
|
/// <typeparam name="TDbContext">The type of the DbContext to use for the repositories.</typeparam>
|
||||||
/// <param name="services">The IServiceCollection to which the services will be added.</param>
|
/// <param name="services">The IServiceCollection to which the services will be added.</param>
|
||||||
/// <returns>The updated IServiceCollection.</returns>
|
/// <returns>The updated IServiceCollection.</returns>
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public static IServiceCollection AddUserManagerApplication(this IServiceCollection services)
|
public static IServiceCollection AddUserManagerApplication(this IServiceCollection services)
|
||||||
=> services
|
=> services
|
||||||
.AddAutoMapper(typeof(UserMappingProfile).Assembly)
|
.AddAutoMapper(typeof(UserMappingProfile).Assembly)
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
using DigitalData.Core.DTO;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Application.DTOs.Base
|
namespace DigitalData.UserManager.Application.DTOs.Base
|
||||||
{
|
{
|
||||||
// TODO: use getter - setter methods for a simple inheritance.
|
// TODO: use getter - setter methods for a simple inheritance.
|
||||||
|
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
|
||||||
public record BaseReadDto(int Id, string? AddedWho, DateTime? AddedWhen, string? ChangedWho, DateTime? ChangedWhen) : BaseDTO<int>(Id);
|
public record BaseReadDto(int Id, string? AddedWho, DateTime? AddedWhen, string? ChangedWho, DateTime? ChangedWhen) : BaseDTO<int>(Id);
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
namespace DigitalData.UserManager.Application.DTOs.Base
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Application.DTOs.Base
|
|
||||||
{
|
{
|
||||||
public record BaseUpdateDto() : IUnique<int>
|
public record BaseUpdateDto
|
||||||
{
|
{
|
||||||
|
|
||||||
public string ChangedWho { get; set; } = "UNAUTHORIZED";
|
public string ChangedWho { get; set; } = "UNAUTHORIZED";
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace DigitalData.UserManager.Application.DTOs.Group
|
namespace DigitalData.UserManager.Application.DTOs.Group
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
|
||||||
public record GroupReadDto
|
public record GroupReadDto
|
||||||
(
|
(
|
||||||
int Id,
|
int Id,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using DigitalData.UserManager.Application.DTOs.User;
|
|||||||
|
|
||||||
namespace DigitalData.UserManager.Application.DTOs.GroupOfUser
|
namespace DigitalData.UserManager.Application.DTOs.GroupOfUser
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
|
||||||
public record GroupOfUserReadDto(
|
public record GroupOfUserReadDto(
|
||||||
int Id,
|
int Id,
|
||||||
int UserId,
|
int UserId,
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
namespace DigitalData.UserManager.Application.DTOs.Module
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Application.DTOs.Module
|
|
||||||
{
|
{
|
||||||
public record ModuleDto(
|
public record ModuleDto(
|
||||||
int Id,
|
int Id,
|
||||||
string? Name,
|
string? Name,
|
||||||
string? ShortName
|
string? ShortName
|
||||||
) : IUnique<int>;
|
);
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
namespace DigitalData.UserManager.Application.DTOs.ModuleOfUser
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Application.DTOs.ModuleOfUser
|
|
||||||
{
|
{
|
||||||
public record ModuleOfUserUpdateDto(
|
public record ModuleOfUserUpdateDto(
|
||||||
int Id,
|
int Id,
|
||||||
@@ -9,5 +7,5 @@ namespace DigitalData.UserManager.Application.DTOs.ModuleOfUser
|
|||||||
bool? IsAdmin,
|
bool? IsAdmin,
|
||||||
string? Comment,
|
string? Comment,
|
||||||
string? ChangedWho
|
string? ChangedWho
|
||||||
) : IUnique<int>;
|
);
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,7 @@ using DigitalData.UserManager.Application.DTOs.User;
|
|||||||
|
|
||||||
namespace DigitalData.UserManager.Application.DTOs.UserRep
|
namespace DigitalData.UserManager.Application.DTOs.UserRep
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
|
||||||
public record UserRepReadDto(
|
public record UserRepReadDto(
|
||||||
int Id,
|
int Id,
|
||||||
int? UserId,
|
int? UserId,
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<PackageId>UserManager.Application</PackageId>
|
<PackageId>UserManager.Application</PackageId>
|
||||||
<Version>3.1.3</Version>
|
|
||||||
<Authors>Digital Data GmbH</Authors>
|
<Authors>Digital Data GmbH</Authors>
|
||||||
<Company>Digital Data GmbH</Company>
|
<Company>Digital Data GmbH</Company>
|
||||||
<Product>UserManager.Application</Product>
|
<Product>UserManager.Application</Product>
|
||||||
@@ -14,8 +13,9 @@
|
|||||||
<PackageIcon>icon.png</PackageIcon>
|
<PackageIcon>icon.png</PackageIcon>
|
||||||
<RepositoryUrl>http://git.dd:3000/AppStd/WebUserManager.git</RepositoryUrl>
|
<RepositoryUrl>http://git.dd:3000/AppStd/WebUserManager.git</RepositoryUrl>
|
||||||
<PackageTags>digital data application user maanger</PackageTags>
|
<PackageTags>digital data application user maanger</PackageTags>
|
||||||
<AssemblyVersion>3.1.3</AssemblyVersion>
|
<Version>3.2.1</Version>
|
||||||
<FileVersion>3.1.3</FileVersion>
|
<AssemblyVersion>3.2.1</AssemblyVersion>
|
||||||
|
<FileVersion>3.2.1</FileVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -26,10 +26,9 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="DigitalData.Core.Abstractions" Version="3.4.1" />
|
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.0.0" />
|
||||||
<PackageReference Include="DigitalData.Core.Application" Version="3.2.1" />
|
<PackageReference Include="DigitalData.Core.Application" Version="3.3.4" />
|
||||||
<PackageReference Include="DigitalData.Core.DTO" Version="2.0.1" />
|
<PackageReference Include="DigitalData.EmailProfilerDispatcher.Abstraction" Version="3.1.1" />
|
||||||
<PackageReference Include="DigitalData.EmailProfilerDispatcher.Abstraction" Version="3.0.0" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ namespace DigitalData.UserManager.Application.MappingProfiles
|
|||||||
{
|
{
|
||||||
public class GroupMappingProfile : Profile
|
public class GroupMappingProfile : Profile
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
|
||||||
public GroupMappingProfile()
|
public GroupMappingProfile()
|
||||||
{
|
{
|
||||||
CreateMap<Group, GroupCreateDto>();
|
CreateMap<Group, GroupCreateDto>();
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ namespace DigitalData.UserManager.Application.MappingProfiles
|
|||||||
{
|
{
|
||||||
public class GroupOfUserMappingProfile : Profile
|
public class GroupOfUserMappingProfile : Profile
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
|
||||||
public GroupOfUserMappingProfile()
|
public GroupOfUserMappingProfile()
|
||||||
{
|
{
|
||||||
CreateMap<GroupOfUser, GroupOfUserCreateDto>();
|
CreateMap<GroupOfUser, GroupOfUserCreateDto>();
|
||||||
@@ -17,4 +18,4 @@ namespace DigitalData.UserManager.Application.MappingProfiles
|
|||||||
CreateMap<GroupOfUserUpdateDto, GroupOfUser>();
|
CreateMap<GroupOfUserUpdateDto, GroupOfUser>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,7 @@ namespace DigitalData.UserManager.Application.MappingProfiles
|
|||||||
{
|
{
|
||||||
public class UserRepMappingProfile : Profile
|
public class UserRepMappingProfile : Profile
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
|
||||||
public UserRepMappingProfile()
|
public UserRepMappingProfile()
|
||||||
{
|
{
|
||||||
CreateMap<UserRep, UserRepCreateDto>();
|
CreateMap<UserRep, UserRepCreateDto>();
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Abstractions.Infrastructure;
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
|
using DigitalData.Core.Abstraction.Application.Repository;
|
||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using DigitalData.Core.DTO;
|
|
||||||
using DigitalData.UserManager.Application.Contracts;
|
using DigitalData.UserManager.Application.Contracts;
|
||||||
using DigitalData.UserManager.Application.DTOs.Base;
|
using DigitalData.UserManager.Application.DTOs.Base;
|
||||||
using DigitalData.UserManager.Application.DTOs.User;
|
using DigitalData.UserManager.Application.DTOs.User;
|
||||||
@@ -9,6 +9,7 @@ using DigitalData.UserManager.Domain.Entities;
|
|||||||
|
|
||||||
namespace DigitalData.UserManager.Application.Services
|
namespace DigitalData.UserManager.Application.Services
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class BaseService<TCRUDRepository, TCreateDto, TReadDto, TBaseEntity> : CRUDService<TCRUDRepository, TCreateDto, TReadDto, TBaseEntity, int>, IBaseService<TCreateDto, TReadDto, TBaseEntity>
|
public class BaseService<TCRUDRepository, TCreateDto, TReadDto, TBaseEntity> : CRUDService<TCRUDRepository, TCreateDto, TReadDto, TBaseEntity, int>, IBaseService<TCreateDto, TReadDto, TBaseEntity>
|
||||||
where TCRUDRepository : ICRUDRepository<TBaseEntity, int>
|
where TCRUDRepository : ICRUDRepository<TBaseEntity, int>
|
||||||
where TCreateDto : BaseCreateDto
|
where TCreateDto : BaseCreateDto
|
||||||
@@ -25,7 +26,7 @@ namespace DigitalData.UserManager.Application.Services
|
|||||||
|
|
||||||
public async Task<UserReadDto?> GetUserAsync() => _lazyUserAsync is null ? null : await _lazyUserAsync.Value;
|
public async Task<UserReadDto?> GetUserAsync() => _lazyUserAsync is null ? null : await _lazyUserAsync.Value;
|
||||||
|
|
||||||
public override async Task<DataResult<int>> CreateAsync(TCreateDto createDto)
|
public override async Task<DataResult<TReadDto>> CreateAsync(TCreateDto createDto)
|
||||||
{
|
{
|
||||||
var user = await GetUserAsync();
|
var user = await GetUserAsync();
|
||||||
if(user is not null)
|
if(user is not null)
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.DTO;
|
|
||||||
using DigitalData.UserManager.Application.Contracts;
|
using DigitalData.UserManager.Application.Contracts;
|
||||||
using DigitalData.UserManager.Application.DTOs.GroupOfUser;
|
using DigitalData.UserManager.Application.DTOs.GroupOfUser;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
using DigitalData.UserManager.Application.Contracts.Repositories;
|
using DigitalData.UserManager.Application.Contracts.Repositories;
|
||||||
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Application.Services
|
namespace DigitalData.UserManager.Application.Services
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class GroupOfUserService : BaseService<IGroupOfUserRepository, GroupOfUserCreateDto, GroupOfUserReadDto, GroupOfUser>, IGroupOfUserService
|
public class GroupOfUserService : BaseService<IGroupOfUserRepository, GroupOfUserCreateDto, GroupOfUserReadDto, GroupOfUser>, IGroupOfUserService
|
||||||
{
|
{
|
||||||
public GroupOfUserService(IGroupOfUserRepository repository, IMapper mapper) : base(repository, mapper)
|
public GroupOfUserService(IGroupOfUserRepository repository, IMapper mapper) : base(repository, mapper)
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.DTO;
|
|
||||||
using DigitalData.UserManager.Application.Contracts;
|
using DigitalData.UserManager.Application.Contracts;
|
||||||
using DigitalData.UserManager.Application.DTOs.Group;
|
using DigitalData.UserManager.Application.DTOs.Group;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
using DigitalData.UserManager.Application.Contracts.Repositories;
|
using DigitalData.UserManager.Application.Contracts.Repositories;
|
||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Application.Services
|
namespace DigitalData.UserManager.Application.Services
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class GroupService : BaseService<IGroupRepository, GroupCreateDto, GroupReadDto, Group>, IGroupService
|
public class GroupService : BaseService<IGroupRepository, GroupCreateDto, GroupReadDto, Group>, IGroupService
|
||||||
{
|
{
|
||||||
private readonly IStringLocalizer<Resource>? _localizer;
|
private readonly IStringLocalizer<Resource>? _localizer;
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.Application;
|
using DigitalData.Core.Application;
|
||||||
using DigitalData.Core.DTO;
|
|
||||||
using DigitalData.UserManager.Application.Contracts;
|
using DigitalData.UserManager.Application.Contracts;
|
||||||
using DigitalData.UserManager.Application.DTOs.ModuleOfUser;
|
using DigitalData.UserManager.Application.DTOs.ModuleOfUser;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
using DigitalData.UserManager.Application.Contracts.Repositories;
|
using DigitalData.UserManager.Application.Contracts.Repositories;
|
||||||
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Application.Services
|
namespace DigitalData.UserManager.Application.Services
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class ModuleOfUserService : CRUDService<IModuleOfUserRepository, ModuleOfUserCreateDto, ModuleOfUserReadDto, ModuleOfUser, int>, IModuleOfUserService
|
public class ModuleOfUserService : CRUDService<IModuleOfUserRepository, ModuleOfUserCreateDto, ModuleOfUserReadDto, ModuleOfUser, int>, IModuleOfUserService
|
||||||
{
|
{
|
||||||
public ModuleOfUserService(IModuleOfUserRepository repository, IMapper mapper) : base(repository, mapper)
|
public ModuleOfUserService(IModuleOfUserRepository repository, IMapper mapper) : base(repository, mapper)
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using DigitalData.UserManager.Application.Contracts.Repositories;
|
|||||||
|
|
||||||
namespace DigitalData.UserManager.Application.Services
|
namespace DigitalData.UserManager.Application.Services
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class ModuleService : BasicCRUDService<IModuleRepository, ModuleDto, Module, int>, IModuleService
|
public class ModuleService : BasicCRUDService<IModuleRepository, ModuleDto, Module, int>, IModuleService
|
||||||
{
|
{
|
||||||
public ModuleService(IModuleRepository repository, IMapper mapper) : base(repository, mapper)
|
public ModuleService(IModuleRepository repository, IMapper mapper) : base(repository, mapper)
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.DTO;
|
|
||||||
using DigitalData.UserManager.Application.Contracts;
|
using DigitalData.UserManager.Application.Contracts;
|
||||||
using DigitalData.UserManager.Application.DTOs.UserRep;
|
using DigitalData.UserManager.Application.DTOs.UserRep;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
using DigitalData.UserManager.Application.Contracts.Repositories;
|
using DigitalData.UserManager.Application.Contracts.Repositories;
|
||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Application.Services
|
namespace DigitalData.UserManager.Application.Services
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class UserRepService : BaseService<IUserRepRepository, UserRepCreateDto, UserRepReadDto, UserRep>, IUserRepService
|
public class UserRepService : BaseService<IUserRepRepository, UserRepCreateDto, UserRepReadDto, UserRep>, IUserRepService
|
||||||
{
|
{
|
||||||
private readonly IStringLocalizer<Resource>? _localizer;
|
private readonly IStringLocalizer<Resource>? _localizer;
|
||||||
@@ -24,13 +25,13 @@ namespace DigitalData.UserManager.Application.Services
|
|||||||
return Result.Success(urReadDTOs);
|
return Result.Success(urReadDTOs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async Task<DataResult<int>> CreateAsync(UserRepCreateDto createDto)
|
public override async Task<DataResult<UserRepReadDto>> CreateAsync(UserRepCreateDto createDto)
|
||||||
// XOR control
|
// XOR control
|
||||||
=> (createDto.ValidFrom is null && createDto.ValidTo is not null) || (createDto.ValidFrom is not null && createDto.ValidTo is null)
|
=> (createDto.ValidFrom is null && createDto.ValidTo is not null) || (createDto.ValidFrom is not null && createDto.ValidTo is null)
|
||||||
? Result.Fail<int>().Notice(LogLevel.None, Flag.DataIntegrityIssue, _localizer?[Key.DateRangeNotXNOR].Value)
|
? Result.Fail<UserRepReadDto>().Notice(LogLevel.None, Flag.DataIntegrityIssue, _localizer?[Key.DateRangeNotXNOR].Value)
|
||||||
//date range control
|
//date range control
|
||||||
: (createDto.ValidFrom > createDto.ValidTo)
|
: (createDto.ValidFrom > createDto.ValidTo)
|
||||||
? Result.Fail<int>().Notice(LogLevel.None, Flag.DataIntegrityIssue, _localizer?[Key.InvalidDateRange].Value)
|
? Result.Fail<UserRepReadDto>().Notice(LogLevel.None, Flag.DataIntegrityIssue, _localizer?[Key.InvalidDateRange].Value)
|
||||||
: await base.CreateAsync(createDto);
|
: await base.CreateAsync(createDto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DigitalData.Core.DTO;
|
|
||||||
using DigitalData.UserManager.Application.Contracts;
|
using DigitalData.UserManager.Application.Contracts;
|
||||||
using DigitalData.UserManager.Application.DTOs.User;
|
using DigitalData.UserManager.Application.DTOs.User;
|
||||||
using DigitalData.UserManager.Domain.Entities;
|
using DigitalData.UserManager.Domain.Entities;
|
||||||
using DigitalData.UserManager.Application.Contracts.Repositories;
|
using DigitalData.UserManager.Application.Contracts.Repositories;
|
||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
|
using DigitalData.Core.Abstraction.Application.DTO;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Application.Services
|
namespace DigitalData.UserManager.Application.Services
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public class UserService : BaseService<IUserRepository, UserCreateDto, UserReadDto, User>, IUserService
|
public class UserService : BaseService<IUserRepository, UserCreateDto, UserReadDto, User>, IUserService
|
||||||
{
|
{
|
||||||
private readonly IStringLocalizer<Resource>? _localizer;
|
private readonly IStringLocalizer<Resource>? _localizer;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<PackageId>UserManager</PackageId>
|
<PackageId>UserManager</PackageId>
|
||||||
<Version>1.0.0</Version>
|
|
||||||
<Authors>Digital Data GmbH</Authors>
|
<Authors>Digital Data GmbH</Authors>
|
||||||
<Company>Digital Data GmbH</Company>
|
<Company>Digital Data GmbH</Company>
|
||||||
<Product>UserManager</Product>
|
<Product>UserManager</Product>
|
||||||
@@ -14,8 +13,9 @@
|
|||||||
<PackageIcon>icon.png</PackageIcon>
|
<PackageIcon>icon.png</PackageIcon>
|
||||||
<RepositoryUrl>http://git.dd:3000/AppStd/WebUserManager.git</RepositoryUrl>
|
<RepositoryUrl>http://git.dd:3000/AppStd/WebUserManager.git</RepositoryUrl>
|
||||||
<PackageTags>digital data user maanger</PackageTags>
|
<PackageTags>digital data user maanger</PackageTags>
|
||||||
<AssemblyVersion>1.0.0</AssemblyVersion>
|
<Version>1.1.2</Version>
|
||||||
<FileVersion>1.0.0</FileVersion>
|
<AssemblyVersion>1.1.2</AssemblyVersion>
|
||||||
|
<FileVersion>1.1.2</FileVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -25,6 +25,10 @@
|
|||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.0.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\DigitalData.UserManager.Application\DigitalData.UserManager.Application.csproj" />
|
<ProjectReference Include="..\DigitalData.UserManager.Application\DigitalData.UserManager.Application.csproj" />
|
||||||
<ProjectReference Include="..\DigitalData.UserManager.Domain\DigitalData.UserManager.Domain.csproj" />
|
<ProjectReference Include="..\DigitalData.UserManager.Domain\DigitalData.UserManager.Domain.csproj" />
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ namespace DigitalData.UserManager.DependencyInjection;
|
|||||||
|
|
||||||
public static class Extensions
|
public static class Extensions
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
public static IServiceCollection AddUserManager<TDbContext>(this IServiceCollection services)
|
public static IServiceCollection AddUserManager<TDbContext>(this IServiceCollection services)
|
||||||
where TDbContext : DbContext, IUserManagerDbContext
|
where TDbContext : DbContext, IUserManagerDbContext
|
||||||
{
|
{
|
||||||
@@ -16,10 +17,11 @@ public static class Extensions
|
|||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Obsolete("Use MediatR")]
|
||||||
public static IServiceCollection AddUserManager(this IServiceCollection services, Action<DbContextOptionsBuilder> optionsAction)
|
public static IServiceCollection AddUserManager(this IServiceCollection services, Action<DbContextOptionsBuilder> optionsAction)
|
||||||
{
|
{
|
||||||
services.AddUserManagerInfrastructure(optionsAction);
|
services.AddUserManagerInfrastructure(optionsAction);
|
||||||
services.AddUserManagerApplication();
|
services.AddUserManagerApplication();
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,8 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
|
<TargetFrameworks>net462;net7.0;net8.0;net9.0</TargetFrameworks>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
<PackageId>UserManager.Domain</PackageId>
|
<PackageId>UserManager.Domain</PackageId>
|
||||||
<Version>3.0.2</Version>
|
|
||||||
<Authors>Digital Data GmbH</Authors>
|
<Authors>Digital Data GmbH</Authors>
|
||||||
<Company>Digital Data GmbH</Company>
|
<Company>Digital Data GmbH</Company>
|
||||||
<Product>UserManager.Domain</Product>
|
<Product>UserManager.Domain</Product>
|
||||||
@@ -13,20 +10,46 @@
|
|||||||
<Copyright>Copyright 2024</Copyright>
|
<Copyright>Copyright 2024</Copyright>
|
||||||
<PackageIcon>icon.png</PackageIcon>
|
<PackageIcon>icon.png</PackageIcon>
|
||||||
<RepositoryUrl>http://git.dd:3000/AppStd/WebUserManager.git</RepositoryUrl>
|
<RepositoryUrl>http://git.dd:3000/AppStd/WebUserManager.git</RepositoryUrl>
|
||||||
<PackageTags>digital data domain user maanger</PackageTags>
|
<PackageTags>digital data domain user manager</PackageTags>
|
||||||
<AssemblyVersion>3.0.2</AssemblyVersion>
|
<Version>3.2.3</Version>
|
||||||
<FileVersion>3.0.2</FileVersion>
|
<AssemblyVersion>3.2.3</AssemblyVersion>
|
||||||
|
<FileVersion>3.2.3</FileVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(TargetFramework)' == 'net462'">
|
||||||
|
<Nullable>disable</Nullable>
|
||||||
|
<ImplicitUsings>disable</ImplicitUsings>
|
||||||
|
<LangVersion>7.3</LangVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(TargetFramework)' != 'net462'">
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<LangVersion>latest</LangVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
|
||||||
|
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" />
|
||||||
|
<PackageReference Include="System.Drawing.Common" Version="4.7.3" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
|
||||||
|
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
|
||||||
|
<PackageReference Include="System.Drawing.Common" Version="8.0.16" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
|
||||||
|
<PackageReference Include="System.Drawing.Common" Version="9.0.5" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="..\Assets\icon.png">
|
<None Include="..\Assets\icon.png">
|
||||||
<Pack>True</Pack>
|
<Pack>True</Pack>
|
||||||
<PackagePath>\</PackagePath>
|
<PackagePath>\</PackagePath>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="DigitalData.Core.Abstractions" Version="3.4.0" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using System.ComponentModel;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
#if NETFRAMEWORK
|
||||||
|
using System;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Domain.Entities
|
namespace DigitalData.UserManager.Domain.Entities
|
||||||
{
|
{
|
||||||
public class BaseEntity : IUnique<int>
|
public class BaseEntity
|
||||||
{
|
{
|
||||||
[Column("GUID")]
|
[Column("GUID")]
|
||||||
[Key]
|
[Key]
|
||||||
@@ -14,11 +16,19 @@ namespace DigitalData.UserManager.Domain.Entities
|
|||||||
|
|
||||||
[StringLength(50)]
|
[StringLength(50)]
|
||||||
[Column("ADDED_WHO")]
|
[Column("ADDED_WHO")]
|
||||||
public string? AddedWho { get; set; }
|
public string
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
AddedWho { get; set; }
|
||||||
|
|
||||||
[StringLength(50)]
|
[StringLength(50)]
|
||||||
[Column("CHANGED_WHO")]
|
[Column("CHANGED_WHO")]
|
||||||
public string? ChangedWho { get; set; }
|
public string
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
ChangedWho { get; set; }
|
||||||
|
|
||||||
//TODO: assign it to default value in create dto, not here!
|
//TODO: assign it to default value in create dto, not here!
|
||||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using System.ComponentModel;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
#if NETFRAMEWORK
|
||||||
|
using System;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Domain.Entities
|
namespace DigitalData.UserManager.Domain.Entities
|
||||||
{
|
{
|
||||||
[Table("TBDD_CLIENT_USER", Schema = "dbo")]
|
[Table("TBDD_CLIENT_USER", Schema = "dbo")]
|
||||||
public class ClientUser : IUnique<int>
|
public class ClientUser
|
||||||
{
|
{
|
||||||
[Column("GUID")]
|
[Column("GUID")]
|
||||||
[Key]
|
[Key]
|
||||||
@@ -15,18 +17,26 @@ namespace DigitalData.UserManager.Domain.Entities
|
|||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("USER_ID")]
|
[Column("USER_ID")]
|
||||||
public int UserId { get; init; }
|
public int UserId { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("CLIENT_ID")]
|
[Column("CLIENT_ID")]
|
||||||
public int ClientId { get; init; }
|
public int ClientId { get; set; }
|
||||||
|
|
||||||
[Column("COMMENT")]
|
[Column("COMMENT")]
|
||||||
public string? Comment { get; init; }
|
public string
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Comment { get; set; }
|
||||||
|
|
||||||
[StringLength(50)]
|
[StringLength(50)]
|
||||||
[Column("ADDED_WHO")]
|
[Column("ADDED_WHO")]
|
||||||
public string? AddedWho { get; set; }
|
public string
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
AddedWho { get; set; }
|
||||||
|
|
||||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||||
[DefaultValue("GETDATE()")]
|
[DefaultValue("GETDATE()")]
|
||||||
|
|||||||
@@ -8,7 +8,11 @@ namespace DigitalData.UserManager.Domain.Entities
|
|||||||
public class Group : BaseEntity
|
public class Group : BaseEntity
|
||||||
{
|
{
|
||||||
[StringLength(50)]
|
[StringLength(50)]
|
||||||
public string? Name { get; set; }
|
public string
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Name { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[DefaultValue(false)]
|
[DefaultValue(false)]
|
||||||
@@ -24,12 +28,16 @@ namespace DigitalData.UserManager.Domain.Entities
|
|||||||
public bool Active { get; set; }
|
public bool Active { get; set; }
|
||||||
|
|
||||||
[StringLength(200)]
|
[StringLength(200)]
|
||||||
public string? Comment { get; set; }
|
public string
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Comment { get; set; }
|
||||||
|
|
||||||
// TODO: this column should be assigned by triggers. despite this it is not null and this is problem for creation. talk with others
|
// TODO: this column should be assigned by triggers. despite this it is not null and this is problem for creation. talk with others
|
||||||
[Required]
|
[Required]
|
||||||
[Column("ECM_FK_ID")]
|
[Column("ECM_FK_ID")]
|
||||||
[DefaultValue(-1)]
|
[DefaultValue(-1)]
|
||||||
public int EcmFkId { get; init; } = -1;
|
public int EcmFkId { get; set; } = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -15,12 +15,24 @@ namespace DigitalData.UserManager.Domain.Entities
|
|||||||
public int GroupId { get; set; }
|
public int GroupId { get; set; }
|
||||||
|
|
||||||
[StringLength(200)]
|
[StringLength(200)]
|
||||||
public string? Comment { get; set; }
|
public string
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Comment { get; set; }
|
||||||
|
|
||||||
[ForeignKey("UserId")]
|
[ForeignKey("UserId")]
|
||||||
public virtual User? User { get; set; }
|
public virtual User
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
User { get; set; }
|
||||||
|
|
||||||
[ForeignKey("GroupId")]
|
[ForeignKey("GroupId")]
|
||||||
public virtual Group? Group { get; set; }
|
public virtual Group
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Group { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Domain.Entities
|
namespace DigitalData.UserManager.Domain.Entities
|
||||||
{
|
{
|
||||||
[Table("TBDD_MODULES", Schema = "dbo")]
|
[Table("TBDD_MODULES", Schema = "dbo")]
|
||||||
public class Module : IUnique<int>
|
public class Module
|
||||||
{
|
{
|
||||||
[Column("GUID")]
|
[Column("GUID")]
|
||||||
[Key]
|
[Key]
|
||||||
@@ -13,11 +12,19 @@ namespace DigitalData.UserManager.Domain.Entities
|
|||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
[StringLength(50)]
|
[StringLength(50)]
|
||||||
public string? Name { get; set; }
|
public string
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Name { get; set; }
|
||||||
|
|
||||||
[StringLength(20)]
|
[StringLength(20)]
|
||||||
[Column("SHORT_NAME")]
|
[Column("SHORT_NAME")]
|
||||||
public string? ShortName { get; set; }
|
public string
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
ShortName { get; set; }
|
||||||
|
|
||||||
#region IGNORED COLUMNS
|
#region IGNORED COLUMNS
|
||||||
//[Required]
|
//[Required]
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
using DigitalData.Core.Abstractions;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Domain.Entities
|
namespace DigitalData.UserManager.Domain.Entities
|
||||||
{
|
{
|
||||||
[Table("TBDD_USER_MODULES", Schema = "dbo")]
|
[Table("TBDD_USER_MODULES", Schema = "dbo")]
|
||||||
public class ModuleOfUser : IUnique<int>
|
public class ModuleOfUser
|
||||||
{
|
{
|
||||||
[Column("GUID")]
|
[Column("GUID")]
|
||||||
[Key]
|
[Key]
|
||||||
@@ -22,21 +21,41 @@ namespace DigitalData.UserManager.Domain.Entities
|
|||||||
|
|
||||||
[Column("COMMENT")]
|
[Column("COMMENT")]
|
||||||
[StringLength(200)]
|
[StringLength(200)]
|
||||||
public string? Comment { get; set; }
|
public string
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Comment { get; set; }
|
||||||
|
|
||||||
[Column("ADDED_WHO")]
|
[Column("ADDED_WHO")]
|
||||||
[StringLength(50)]
|
[StringLength(50)]
|
||||||
public string? AddedWho { get; set; } = "DEFAULT";
|
public string
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
AddedWho { get; set; } = "DEFAULT";
|
||||||
|
|
||||||
[Column("CHANGED_WHO")]
|
[Column("CHANGED_WHO")]
|
||||||
[StringLength(50)]
|
[StringLength(50)]
|
||||||
public string? ChangedWho { get; set; }
|
public string
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
ChangedWho { get; set; }
|
||||||
|
|
||||||
[ForeignKey("UserId")]
|
[ForeignKey("UserId")]
|
||||||
public virtual User? User { get; set; }
|
public virtual User
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
User { get; set; }
|
||||||
|
|
||||||
[ForeignKey("ModuleId")]
|
[ForeignKey("ModuleId")]
|
||||||
public virtual Module? Module { get; set; }
|
public virtual Module
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Module { get; set; }
|
||||||
|
|
||||||
#region IGNORED COLUMNS
|
#region IGNORED COLUMNS
|
||||||
//public bool IsAdmin { get; set; }
|
//public bool IsAdmin { get; set; }
|
||||||
@@ -54,5 +73,4 @@ namespace DigitalData.UserManager.Domain.Entities
|
|||||||
//public DateTime? ChangedWhen { get; set; }
|
//public DateTime? ChangedWhen { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,42 +1,74 @@
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
#if NETFRAMEWORK
|
||||||
|
using System;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Domain.Entities
|
namespace DigitalData.UserManager.Domain.Entities
|
||||||
{
|
{
|
||||||
[Table("TBDD_USER", Schema = "dbo")]
|
[Table("TBDD_USER", Schema = "dbo")]
|
||||||
public class User : BaseEntity
|
public partial class User : BaseEntity
|
||||||
{
|
{
|
||||||
[Column("PRENAME")]
|
[Column("PRENAME")]
|
||||||
[StringLength(50)]
|
[StringLength(50)]
|
||||||
public string? Prename { get; set; }
|
public string
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Prename { get; set; }
|
||||||
|
|
||||||
[Column("NAME")]
|
[Column("NAME")]
|
||||||
[StringLength(50)]
|
[StringLength(50)]
|
||||||
public string? Name { get; set; }
|
public string
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Name { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("USERNAME")]
|
[Column("USERNAME")]
|
||||||
[StringLength(50)]
|
[StringLength(50)]
|
||||||
public string Username { get; set; }
|
public
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
required
|
||||||
|
#endif
|
||||||
|
string Username { get; set; }
|
||||||
|
|
||||||
[Column("SHORTNAME")]
|
[Column("SHORTNAME")]
|
||||||
[StringLength(30)]
|
[StringLength(30)]
|
||||||
public string? Shortname { get; set; }
|
public string
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Shortname
|
||||||
|
{ get; set; }
|
||||||
|
|
||||||
[Column("EMAIL")]
|
[Column("EMAIL")]
|
||||||
[StringLength(100)]
|
[StringLength(100)]
|
||||||
public string? Email { get; set; }
|
public string
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Email { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("LANGUAGE")]
|
[Column("LANGUAGE")]
|
||||||
[StringLength(5)]
|
[StringLength(5)]
|
||||||
[DefaultValue("de-DE")]
|
[DefaultValue("de-DE")]
|
||||||
public string Language { get; set; }
|
public string
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Language { get; set; }
|
||||||
|
|
||||||
[Column("COMMENT")]
|
[Column("COMMENT")]
|
||||||
[StringLength(500)]
|
[StringLength(500)]
|
||||||
public string? Comment { get; set; }
|
public string
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Comment { get; set; }
|
||||||
|
|
||||||
[Column("DELETED")]
|
[Column("DELETED")]
|
||||||
public bool Deleted { get; set; }
|
public bool Deleted { get; set; }
|
||||||
@@ -45,33 +77,51 @@ namespace DigitalData.UserManager.Domain.Entities
|
|||||||
[Column("DATE_FORMAT")]
|
[Column("DATE_FORMAT")]
|
||||||
[StringLength(10)]
|
[StringLength(10)]
|
||||||
[DefaultValue("dd.MM.yyyy")]
|
[DefaultValue("dd.MM.yyyy")]
|
||||||
public string DateFormat { get; set; }
|
public
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
required
|
||||||
|
#endif
|
||||||
|
string DateFormat { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
[Column("ACTIVE")]
|
[Column("ACTIVE")]
|
||||||
public bool Active { get; set; }
|
public bool Active { get; set; }
|
||||||
|
|
||||||
#region IGNORED COLUMNS
|
[Required]
|
||||||
//[Required]
|
[Column("GENERAL_VIEWER")]
|
||||||
//[Column("GENERAL_VIEWER")]
|
[StringLength(30)]
|
||||||
//[StringLength(30)]
|
[DefaultValue("NONE")]
|
||||||
//[DefaultValue("NONE")]
|
public
|
||||||
//public string GeneralViewer { get; set; }
|
#if NET7_0_OR_GREATER
|
||||||
|
required
|
||||||
|
#endif
|
||||||
|
string GeneralViewer { get; set; }
|
||||||
|
|
||||||
//[Required]
|
[Required]
|
||||||
//[Column("WAN_ENVIRONMENT")]
|
[Column("WAN_ENVIRONMENT")]
|
||||||
//public bool WanEnvironment { get; set; }
|
public bool WanEnvironment { get; set; }
|
||||||
|
|
||||||
//[Required]
|
[Required]
|
||||||
//[Column("USERID_FK_INT_ECM")]
|
[Column("USERID_FK_INT_ECM")]
|
||||||
//public int UseridFkIntEcm { get; set; }
|
public int UserIdFkIntEcm { get; set; }
|
||||||
|
|
||||||
//[Column("DELETED_WHEN")]
|
[Column("DELETED_WHEN")]
|
||||||
//public DateTime? DeletedWhen { get; set; }
|
public DateTime
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
DeletedWhen { get; set; }
|
||||||
|
|
||||||
//[Column("DELETED_WHO")]
|
[Column("DELETED_WHO")]
|
||||||
//[StringLength(50)]
|
[StringLength(50)]
|
||||||
//public string? DeletedWho { get; set; }
|
public
|
||||||
#endregion
|
#if NET7_0_OR_GREATER
|
||||||
|
required
|
||||||
|
#endif
|
||||||
|
string
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
# endif
|
||||||
|
DeletedWho { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
#if NETFRAMEWORK
|
||||||
|
using System;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace DigitalData.UserManager.Domain.Entities
|
namespace DigitalData.UserManager.Domain.Entities
|
||||||
{
|
{
|
||||||
@@ -25,15 +27,31 @@ namespace DigitalData.UserManager.Domain.Entities
|
|||||||
public DateTime? ValidTo { get; set; }
|
public DateTime? ValidTo { get; set; }
|
||||||
|
|
||||||
[ForeignKey("UserId")]
|
[ForeignKey("UserId")]
|
||||||
public virtual User? User { get; set; }
|
public virtual User
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
User { get; set; }
|
||||||
|
|
||||||
[ForeignKey("RepGroupId")]
|
[ForeignKey("RepGroupId")]
|
||||||
public virtual Group? RepGroup { get; set; }
|
public virtual Group
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
RepGroup { get; set; }
|
||||||
|
|
||||||
[ForeignKey("GroupId")]
|
[ForeignKey("GroupId")]
|
||||||
public virtual Group? Group { get; set; }
|
public virtual Group
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
Group { get; set; }
|
||||||
|
|
||||||
[ForeignKey("RepUserId")]
|
[ForeignKey("RepUserId")]
|
||||||
public virtual User? RepUser { get; set; }
|
public virtual User
|
||||||
|
#if NET7_0_OR_GREATER
|
||||||
|
?
|
||||||
|
#endif
|
||||||
|
RepUser { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using DigitalData.UserManager.Application;
|
using DigitalData.UserManager.Application.Contracts.Repositories;
|
||||||
using DigitalData.UserManager.Application.Contracts.Repositories;
|
|
||||||
using DigitalData.UserManager.Infrastructure.Contracts;
|
using DigitalData.UserManager.Infrastructure.Contracts;
|
||||||
using DigitalData.UserManager.Infrastructure.Repositories;
|
using DigitalData.UserManager.Infrastructure.Repositories;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
@@ -16,6 +15,7 @@ public static class DependencyInjection
|
|||||||
/// <typeparam name="TDbContext">The type of the DbContext to use for the repositories.</typeparam>
|
/// <typeparam name="TDbContext">The type of the DbContext to use for the repositories.</typeparam>
|
||||||
/// <param name="services">The IServiceCollection to which the services will be added.</param>
|
/// <param name="services">The IServiceCollection to which the services will be added.</param>
|
||||||
/// <returns>The updated IServiceCollection.</returns>
|
/// <returns>The updated IServiceCollection.</returns>
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
public static IServiceCollection AddUserManagerInfrastructure<TDbContext>(this IServiceCollection services)
|
public static IServiceCollection AddUserManagerInfrastructure<TDbContext>(this IServiceCollection services)
|
||||||
where TDbContext : DbContext, IUserManagerDbContext
|
where TDbContext : DbContext, IUserManagerDbContext
|
||||||
{
|
{
|
||||||
@@ -36,7 +36,8 @@ public static class DependencyInjection
|
|||||||
/// <param name="services">The <see cref="IServiceCollection"/> to which the services will be added.</param>
|
/// <param name="services">The <see cref="IServiceCollection"/> to which the services will be added.</param>
|
||||||
/// <param name="optionsAction">An <see cref="Action{T}"/> to configure the <see cref="DbContextOptionsBuilder"/>.</param>
|
/// <param name="optionsAction">An <see cref="Action{T}"/> to configure the <see cref="DbContextOptionsBuilder"/>.</param>
|
||||||
/// <returns>The updated <see cref="IServiceCollection"/>.</returns>
|
/// <returns>The updated <see cref="IServiceCollection"/>.</returns>
|
||||||
|
[Obsolete("Use IRepository")]
|
||||||
public static IServiceCollection AddUserManagerInfrastructure(this IServiceCollection services, Action<DbContextOptionsBuilder> optionsAction) => services
|
public static IServiceCollection AddUserManagerInfrastructure(this IServiceCollection services, Action<DbContextOptionsBuilder> optionsAction) => services
|
||||||
.AddDbContext<UserManagerDbContext>(optionsAction)
|
.AddDbContext<UserManagerDbContext>(optionsAction)
|
||||||
.AddUserManagerInfrastructure<UserManagerDbContext>();
|
.AddUserManagerInfrastructure<UserManagerDbContext>();
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,6 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<PackageId>UserManager.Infrastructure</PackageId>
|
<PackageId>UserManager.Infrastructure</PackageId>
|
||||||
<Version>3.0.2</Version>
|
|
||||||
<Authors>Digital Data GmbH</Authors>
|
<Authors>Digital Data GmbH</Authors>
|
||||||
<Company>Digital Data GmbH</Company>
|
<Company>Digital Data GmbH</Company>
|
||||||
<Product>UserManager.Infrastructure</Product>
|
<Product>UserManager.Infrastructure</Product>
|
||||||
@@ -14,8 +13,9 @@
|
|||||||
<PackageIcon>icon.png</PackageIcon>
|
<PackageIcon>icon.png</PackageIcon>
|
||||||
<RepositoryUrl>http://git.dd:3000/AppStd/WebUserManager.git</RepositoryUrl>
|
<RepositoryUrl>http://git.dd:3000/AppStd/WebUserManager.git</RepositoryUrl>
|
||||||
<PackageTags>digital data infrastructure user maanger</PackageTags>
|
<PackageTags>digital data infrastructure user maanger</PackageTags>
|
||||||
<AssemblyVersion>3.0.2</AssemblyVersion>
|
<Version>3.1.1</Version>
|
||||||
<FileVersion>3.0.2</FileVersion>
|
<AssemblyVersion>3.1.1</AssemblyVersion>
|
||||||
|
<FileVersion>3.1.1</FileVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -26,7 +26,8 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="DigitalData.Core.Infrastructure" Version="2.0.1" />
|
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.0.0" />
|
||||||
|
<PackageReference Include="DigitalData.Core.Infrastructure" Version="2.1.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
|
||||||
@@ -40,7 +41,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.4" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.5" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.4" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.4" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using DigitalData.UserManager.Infrastructure.Contracts;
|
|||||||
|
|
||||||
namespace DigitalData.UserManager.Infrastructure.Repositories
|
namespace DigitalData.UserManager.Infrastructure.Repositories
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use Repository")]
|
||||||
public class ClientUserRepository<TDbContext> : CRUDRepository<ClientUser, int, TDbContext>, IClientUserRepository
|
public class ClientUserRepository<TDbContext> : CRUDRepository<ClientUser, int, TDbContext>, IClientUserRepository
|
||||||
where TDbContext : DbContext, IUserManagerDbContext
|
where TDbContext : DbContext, IUserManagerDbContext
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using DigitalData.UserManager.Application.Contracts.Repositories;
|
|||||||
|
|
||||||
namespace DigitalData.UserManager.Infrastructure.Repositories
|
namespace DigitalData.UserManager.Infrastructure.Repositories
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use Repository")]
|
||||||
public class GroupOfUserRepository<TDbContext> : CRUDRepository<GroupOfUser, int, TDbContext>, IGroupOfUserRepository
|
public class GroupOfUserRepository<TDbContext> : CRUDRepository<GroupOfUser, int, TDbContext>, IGroupOfUserRepository
|
||||||
where TDbContext : DbContext, IUserManagerDbContext
|
where TDbContext : DbContext, IUserManagerDbContext
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using Microsoft.EntityFrameworkCore;
|
|||||||
|
|
||||||
namespace DigitalData.UserManager.Infrastructure.Repositories
|
namespace DigitalData.UserManager.Infrastructure.Repositories
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use Repository")]
|
||||||
public class GroupRepository<TDbContext> : CRUDRepository<Group, int, TDbContext>, IGroupRepository
|
public class GroupRepository<TDbContext> : CRUDRepository<Group, int, TDbContext>, IGroupRepository
|
||||||
where TDbContext : DbContext, IUserManagerDbContext
|
where TDbContext : DbContext, IUserManagerDbContext
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using Microsoft.EntityFrameworkCore;
|
|||||||
|
|
||||||
namespace DigitalData.UserManager.Infrastructure.Repositories;
|
namespace DigitalData.UserManager.Infrastructure.Repositories;
|
||||||
|
|
||||||
|
[Obsolete("Use Repository")]
|
||||||
public class ModuleOfUserRepository<TDbContext> : CRUDRepository<ModuleOfUser, int, TDbContext>, IModuleOfUserRepository
|
public class ModuleOfUserRepository<TDbContext> : CRUDRepository<ModuleOfUser, int, TDbContext>, IModuleOfUserRepository
|
||||||
where TDbContext : DbContext, IUserManagerDbContext
|
where TDbContext : DbContext, IUserManagerDbContext
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using Microsoft.EntityFrameworkCore;
|
|||||||
|
|
||||||
namespace DigitalData.UserManager.Infrastructure.Repositories;
|
namespace DigitalData.UserManager.Infrastructure.Repositories;
|
||||||
|
|
||||||
|
[Obsolete("Use Repository")]
|
||||||
public class ModuleRepository<TDbContext> : CRUDRepository<Module, int, TDbContext>, IModuleRepository
|
public class ModuleRepository<TDbContext> : CRUDRepository<Module, int, TDbContext>, IModuleRepository
|
||||||
where TDbContext : DbContext, IUserManagerDbContext
|
where TDbContext : DbContext, IUserManagerDbContext
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using Microsoft.EntityFrameworkCore;
|
|||||||
|
|
||||||
namespace DigitalData.UserManager.Infrastructure.Repositories;
|
namespace DigitalData.UserManager.Infrastructure.Repositories;
|
||||||
|
|
||||||
|
[Obsolete("Use Repository")]
|
||||||
public class UserRepRepository<TDbContext> : CRUDRepository<UserRep, int, TDbContext>, IUserRepRepository
|
public class UserRepRepository<TDbContext> : CRUDRepository<UserRep, int, TDbContext>, IUserRepRepository
|
||||||
where TDbContext : DbContext, IUserManagerDbContext
|
where TDbContext : DbContext, IUserManagerDbContext
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using Microsoft.EntityFrameworkCore;
|
|||||||
|
|
||||||
namespace DigitalData.UserManager.Infrastructure.Repositories
|
namespace DigitalData.UserManager.Infrastructure.Repositories
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use Repository")]
|
||||||
public class UserRepository<TDbContext> : CRUDRepository<User, int, TDbContext>, IUserRepository
|
public class UserRepository<TDbContext> : CRUDRepository<User, int, TDbContext>, IUserRepository
|
||||||
where TDbContext : DbContext, IUserManagerDbContext
|
where TDbContext : DbContext, IUserManagerDbContext
|
||||||
{
|
{
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user