netcore-blueprint 1.0.24 → 1.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44,7 +44,7 @@ namespace Template.API.Controllers
44
44
  /// <param name="pagingParams"></param>
45
45
  /// <returns></returns>
46
46
  [HttpGet]
47
- [Authorize(Roles = "Admin")]
47
+ //[Authorize(Roles = "Admin")]
48
48
  [ProducesResponseType(typeof(PagerData<UserResponseDto>), StatusCodes.Status200OK)]
49
49
  public async Task<IActionResult> GetUsers([FromQuery] PagingParams pagingParams)
50
50
  {
@@ -69,6 +69,7 @@ namespace Template.API.Controllers
69
69
  /// <param name="userId"></param>
70
70
  /// <returns></returns>
71
71
  [HttpGet("{userId}")]
72
+ [Authorize(Roles = "Admin")]
72
73
  [ProducesResponseType(typeof(UserResponseDto), StatusCodes.Status200OK)]
73
74
  public async Task<IActionResult> GetUserById(int userId)
74
75
  {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "ConnectionStrings": {
3
- "MySql": "Server=localhost;port=3306;Database=test9;User=root",
3
+ "MySql": "Server=localhost;port=3306;Database=test10;User=root",
4
4
  "MongoDb": "mongodb://admin:password@localhost:27017"
5
5
  },
6
6
  "Database": {
@@ -1,7 +1,7 @@
1
1
  namespace Template.Core.Dtos
2
2
  {
3
3
  /// <summary>
4
- /// BaseDto
4
+ /// BaseRequestDto
5
5
  /// </summary>
6
6
  public class BaseRequestDto
7
7
  {
@@ -10,16 +10,16 @@
10
10
  /// </summary>
11
11
  public int? Id { get; set; }
12
12
  /// <summary>
13
- /// Active
13
+ /// Status
14
14
  /// </summary>
15
- public bool? Active { get; set; }
15
+ public bool? Status { get; set; }
16
16
  /// <summary>
17
- /// CreatedDate
17
+ /// Date
18
18
  /// </summary>
19
- public DateTime? CreatedDate { get; set; }
19
+ public DateTime? Date { get; set; }
20
20
  /// <summary>
21
- /// LastModifiedDate
21
+ /// Modified
22
22
  /// </summary>
23
- public DateTime? LastModifiedDate { get; set; }
23
+ public DateTime? Modified { get; set; }
24
24
  }
25
25
  }
@@ -1,12 +1,10 @@
1
- using Blueprint.Core.Enums;
2
-
3
- namespace Template.Core.Dtos.Requests
1
+ namespace Template.Core.Dtos.Requests
4
2
  {
5
3
  public class UserRequestDto: BaseRequestDto
6
4
  {
7
5
  public string? Name { get; set; }
8
6
  public string? Email { get; set; }
9
7
  public string? Picture { get; set; }
10
- public UserRole Role { get; set; }
8
+ public string? Role { get; set; }
11
9
  }
12
10
  }
@@ -1,10 +1,7 @@
1
- using MongoDB.Bson.Serialization.Attributes;
2
- using MongoDB.Bson;
3
-
4
- namespace Template.Core.Dtos
1
+ namespace Template.Core.Dtos
5
2
  {
6
3
  /// <summary>
7
- /// BaseDto
4
+ /// BaseResponseDto
8
5
  /// </summary>
9
6
  public class BaseDto
10
7
  {
@@ -13,16 +10,16 @@ namespace Template.Core.Dtos
13
10
  /// </summary>
14
11
  public int? Id { get; set; }
15
12
  /// <summary>
16
- /// Active
13
+ /// Status
17
14
  /// </summary>
18
- public bool? Active { get; set; }
15
+ public bool? Status { get; set; }
19
16
  /// <summary>
20
- /// CreatedDate
17
+ /// Date
21
18
  /// </summary>
22
- public DateTime? CreatedDate { get; set; }
19
+ public DateTime? Date { get; set; }
23
20
  /// <summary>
24
- /// LastModifiedDate
21
+ /// Modified
25
22
  /// </summary>
26
- public DateTime? LastModifiedDate { get; set; }
23
+ public DateTime? Modified { get; set; }
27
24
  }
28
25
  }
@@ -1,5 +1,4 @@
1
- 
2
- namespace Template.Core.Dtos.Responses
1
+ namespace Template.Core.Dtos.Responses
3
2
  {
4
3
  public class UserResponseDto : BaseRequestDto
5
4
  {
@@ -13,11 +13,11 @@ namespace Blueprint.Core.Entities
13
13
  [Key]
14
14
  [BsonElement("id")]
15
15
  public int Id { get; set; }
16
- [BsonElement("active")]
17
- public bool Active { get; set; } = true;
18
- [BsonElement("createdDate")]
19
- public DateTime CreatedDate { get; set; } = DateTime.Now;
20
- [BsonElement("lastModifiedDate")]
21
- public DateTime LastModifiedDate { get; set; } = DateTime.Now;
16
+ [BsonElement("status")]
17
+ public bool Status { get; set; } = true;
18
+ [BsonElement("date")]
19
+ public DateTime Date { get; set; } = DateTime.Now;
20
+ [BsonElement("modified")]
21
+ public DateTime Modified { get; set; } = DateTime.Now;
22
22
  }
23
23
  }
@@ -3,7 +3,9 @@
3
3
  public class Category: BaseEntity
4
4
  {
5
5
  public string? Name { get; set; }
6
- public string? Description { get; set; }
6
+ public string? CoverImage { get; set; }
7
+ public string? Title { get; set; }
8
+ public string? Content { get; set; }
7
9
  public virtual List<Product>? Products { get; set; }
8
10
  }
9
11
  }
@@ -1,12 +1,11 @@
1
- using System.ComponentModel.DataAnnotations.Schema;
2
-
3
- namespace Blueprint.Core.Entities
1
+ namespace Blueprint.Core.Entities
4
2
  {
5
3
  public class Product : BaseEntity
6
4
  {
7
5
  public string? Name { get; set; }
8
- public string? Url { get; set; }
9
- public string? Description { get; set; }
6
+ public string? CoverImage { get; set; }
7
+ public string? Title { get; set; }
8
+ public string? Content { get; set; }
10
9
  public virtual Category? Category { get; set; }
11
10
  public int? CategoryId { get; set; }
12
11
  }
@@ -22,4 +22,8 @@
22
22
  <ItemGroup>
23
23
  <ProjectReference Include="..\Blueprint.Core\Blueprint.Core.csproj" />
24
24
  </ItemGroup>
25
+
26
+ <ItemGroup>
27
+ <Folder Include="Migrations\" />
28
+ </ItemGroup>
25
29
  </Project>
@@ -19,27 +19,27 @@ namespace Blueprint.Infra.Database
19
19
  Id = 1,
20
20
  Name = "Test",
21
21
  Email = "",
22
- Active = true,
23
- CreatedDate = DateTime.Now,
24
- LastModifiedDate = DateTime.Now,
22
+ Status = true,
23
+ Date = DateTime.Now,
24
+ Modified = DateTime.Now,
25
25
  },
26
26
  new User()
27
27
  {
28
28
  Id = 2,
29
29
  Name = "Truong Dang",
30
30
  Email = "truongdxfx08031@funix.edu.vn",
31
- Active = true,
32
- CreatedDate = DateTime.Now,
33
- LastModifiedDate = DateTime.Now,
31
+ Status = true,
32
+ Date = DateTime.Now,
33
+ Modified = DateTime.Now,
34
34
  },
35
35
  new User()
36
36
  {
37
37
  Id = 3,
38
38
  Name = "Thai Son",
39
39
  Email = "truonghusk17aws1@gmail.com",
40
- Active = true,
41
- CreatedDate = DateTime.Now,
42
- LastModifiedDate = DateTime.Now,
40
+ Status = true,
41
+ Date = DateTime.Now,
42
+ Modified = DateTime.Now,
43
43
  }
44
44
  );
45
45
  modelBuilder?.Entity<Category>().HasData(
@@ -47,17 +47,17 @@ namespace Blueprint.Infra.Database
47
47
  {
48
48
  Id = 1,
49
49
  Name = "Item 1",
50
- Active = true,
51
- CreatedDate = DateTime.Now,
52
- LastModifiedDate = DateTime.Now,
50
+ Status = true,
51
+ Date = DateTime.Now,
52
+ Modified = DateTime.Now,
53
53
  },
54
54
  new Category()
55
55
  {
56
56
  Id = 2,
57
57
  Name = "Item 2",
58
- Active = true,
59
- CreatedDate = DateTime.Now,
60
- LastModifiedDate = DateTime.Now,
58
+ Status = true,
59
+ Date = DateTime.Now,
60
+ Modified = DateTime.Now,
61
61
  }
62
62
  );
63
63
  modelBuilder?.Entity<Product>().HasData
@@ -66,120 +66,120 @@ namespace Blueprint.Infra.Database
66
66
  {
67
67
  Id = 1,
68
68
  Name = "Item 1",
69
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Premtilmiue.png",
70
- Active = true,
71
- CreatedDate = DateTime.Now,
72
- LastModifiedDate = DateTime.Now,
69
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Premtilmiue.png",
70
+ Status = true,
71
+ Date = DateTime.Now,
72
+ Modified = DateTime.Now,
73
73
  CategoryId = 1,
74
74
  },
75
75
  new Product()
76
76
  {
77
77
  Id = 2,
78
78
  Name = "Item 2",
79
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Protile.png",
80
- Active = true,
81
- CreatedDate = DateTime.Now,
82
- LastModifiedDate = DateTime.Now,
79
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Protile.png",
80
+ Status = true,
81
+ Date = DateTime.Now,
82
+ Modified = DateTime.Now,
83
83
  CategoryId = 2,
84
84
  },
85
85
  new Product()
86
86
  {
87
87
  Id = 3,
88
88
  Name = "Item 3",
89
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Supertile.png",
90
- Active = true,
91
- CreatedDate = DateTime.Now,
92
- LastModifiedDate = DateTime.Now,
89
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Supertile.png",
90
+ Status = true,
91
+ Date = DateTime.Now,
92
+ Modified = DateTime.Now,
93
93
  CategoryId = 2,
94
94
  },
95
95
  new Product()
96
96
  {
97
97
  Id = 4,
98
98
  Name = "Item 4",
99
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-Sealant-HP.jpg",
100
- Active = true,
101
- CreatedDate = DateTime.Now,
102
- LastModifiedDate = DateTime.Now,
99
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-Sealant-HP.jpg",
100
+ Status = true,
101
+ Date = DateTime.Now,
102
+ Modified = DateTime.Now,
103
103
  CategoryId = 1,
104
104
  },
105
105
  new Product()
106
106
  {
107
107
  Id = 5,
108
108
  Name = "Item 5",
109
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-.jpg",
110
- Active = true,
111
- CreatedDate = DateTime.Now,
112
- LastModifiedDate = DateTime.Now,
109
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-.jpg",
110
+ Status = true,
111
+ Date = DateTime.Now,
112
+ Modified = DateTime.Now,
113
113
  CategoryId = 2,
114
114
  },
115
115
  new Product()
116
116
  {
117
117
  Id = 6,
118
118
  Name = "Item 6",
119
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-1.jpg",
120
- Active = true,
121
- CreatedDate = DateTime.Now,
122
- LastModifiedDate = DateTime.Now,
119
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-1.jpg",
120
+ Status = true,
121
+ Date = DateTime.Now,
122
+ Modified = DateTime.Now,
123
123
  CategoryId = 2,
124
124
  },
125
125
  new Product()
126
126
  {
127
127
  Id = 7,
128
128
  Name = "Item 7",
129
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-303.jpg",
130
- Active = true,
131
- CreatedDate = DateTime.Now,
132
- LastModifiedDate = DateTime.Now,
129
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-303.jpg",
130
+ Status = true,
131
+ Date = DateTime.Now,
132
+ Modified = DateTime.Now,
133
133
  CategoryId = 1,
134
134
  },
135
135
  new Product()
136
136
  {
137
137
  Id = 8,
138
138
  Name = "Item 8",
139
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Premtilmiue.png",
140
- Active = true,
141
- CreatedDate = DateTime.Now,
142
- LastModifiedDate = DateTime.Now,
139
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Premtilmiue.png",
140
+ Status = true,
141
+ Date = DateTime.Now,
142
+ Modified = DateTime.Now,
143
143
  CategoryId = 2,
144
144
  },
145
145
  new Product()
146
146
  {
147
147
  Id = 9,
148
148
  Name = "Item 9",
149
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Protile.png",
150
- Active = true,
151
- CreatedDate = DateTime.Now,
152
- LastModifiedDate = DateTime.Now,
149
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Protile.png",
150
+ Status = true,
151
+ Date = DateTime.Now,
152
+ Modified = DateTime.Now,
153
153
  CategoryId = 2,
154
154
  },
155
155
  new Product()
156
156
  {
157
157
  Id = 10,
158
158
  Name = "Item 10",
159
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Supertile.png",
160
- Active = true,
161
- CreatedDate = DateTime.Now,
162
- LastModifiedDate = DateTime.Now,
159
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Supertile.png",
160
+ Status = true,
161
+ Date = DateTime.Now,
162
+ Modified = DateTime.Now,
163
163
  CategoryId = 1,
164
164
  },
165
165
  new Product()
166
166
  {
167
167
  Id = 11,
168
168
  Name = "Item 11",
169
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-Sealant-HP.jpg",
170
- Active = true,
171
- CreatedDate = DateTime.Now,
172
- LastModifiedDate = DateTime.Now,
169
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-Sealant-HP.jpg",
170
+ Status = true,
171
+ Date = DateTime.Now,
172
+ Modified = DateTime.Now,
173
173
  CategoryId = 2,
174
174
  },
175
175
  new Product()
176
176
  {
177
177
  Id = 12,
178
178
  Name = "Item 12",
179
- Url = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-.jpg",
180
- Active = true,
181
- CreatedDate = DateTime.Now,
182
- LastModifiedDate = DateTime.Now,
179
+ CoverImage = "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-.jpg",
180
+ Status = true,
181
+ Date = DateTime.Now,
182
+ Modified = DateTime.Now,
183
183
  CategoryId = 2,
184
184
  }
185
185
  );